2

According to me when PSH flag is set , it indicates that data will have to be sent immediately to the wire and on receiving side the data has to be pushed to the application immediately .

When URG flag is set it indicates that urgent data has to be sent immediately to wire from sender side and on receiving end the urgent data has to be sent immediately to application.

Urgent pointer in TCP segment is used to indicate that amount of urgent data present in TCP segemnt . So, for example, if the segment contained 400 bytes of urgent data followed by 200 bytes of regular data, the URG bit would be set and the Urgent Pointer field would have a value of 400.

The problem here is that , Is urgent data is same as push data . If , yes then why two different URG and PSH flag are used in TCP segment . Please help me to clear my doubts in simple language .

I am new to networking field and preparing for CCNA exam. Thanks in advance :-)

2

Jeremy Stretch has a good article on this.

This is where the PSH flag comes in. The socket that TCP makes available at the session level can be written to by the application with the option of "pushing" data out immediately, rather than waiting for additional data to enter the buffer. When this happens, the PSH flag in the outgoing TCP packet is set to 1 (on). Upon receiving a packet with the PSH flag set, the other side of the connection knows to immediately forward the segment up to the application. To summarize, TCP's push capability accomplishes two things:

• The sending application informs TCP that data should be sent immediately.

• The PSH flag in the TCP header informs the receiving host that the data should be pushed up to the receiving application immediately.

The URG flag is used to inform a receiving station that certain data within a segment is urgent and should be prioritized. If the URG flag is set, the receiving station evaluates the urgent pointer, a 16-bit field in the TCP header. This pointer indicates how much of the data in the segment, counting from the first byte, is urgent.

  • So I should take it that when PSH flag is set from sender side then receiver receives PUSH data and is not expecting any more PUSH data from sender (but there can be more Push data coming receiver doesn't know that) but when URG flag is set then receiver receives the urgent data and process it and is expecting more urgent data from sender until the data with sequence number comes to receiver which is written in urgent pointer . – user10433098 Apr 21 at 11:30
0

Suppose the receiving buffer has already some data to be processed by the application. A segment with the PSH flag set to 1 is sent now. The sending buffer will not wait to be filled, instead, it will immediately push the data into the wire. Now, this data will queue up behind the already non-processed data in the receiving buffer. After the previous data is processed then only the data with PSH=1 can be forwarded to the application.

When URG is set, the data can be immediately forwarded to the application ignoring the already existent data in the receiving buffer. In other words, URG=1 violates the FIFO structure.

The major difference between PSH=1 and URG=1 is that the former follows the ordering of the data in the receiving buffer whereas the latter doesn't and that's why the name is URG i.e. to send urgent data.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.