cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1705
Views
0
Helpful
4
Replies

confusion between TCP segment and IP datagram

bhul0030
Level 1
Level 1

hi there ,

I am still learning the fundamentals of TCP/IP but I am confused a bit about the context about the 4 layers of TCP . So my understanding is that Transport layer does transport of application data and network (IP protocol) does delivery of datagram but i wanted to knew is that when a router received a packet and it decapsulates layer 3 (that contains tcp payload) does the router check layer 4 as well in case of congestion control and also acknowledging data packets .

Next thing i want to ask is when it is stated that ip datagram computed checksum is not correct or it is dropped does it means that router accepts upto layer 2 and then drops rest as the crc or checksum is incorrect and also can someone elaborate the difference between dropping layer 4 segment and layer 3 datagram .Isnt it the same thing as layer 4 payload is encapsulated in layer 3 if  layer 3 is dropped then layer 4 wont matter ?

4 Replies 4

Hello,

 

as I understand it, all checksum (CRC) and congestion control is done at layer 3, nothing at layer 4. On top of that, protocols such as PPP and Ethernet do an additional, more advanced and more reliable, CRC check at layer 2 as well (as the 'traditional' CRC check used by TCP is considered 'weak' by today's standards).

 

So, IF anything is dropped (due to congestion or CRC) it happens at layer 2 or 3, never at layer 4.

From my understanding and the tcp/ip fundamentals book that I am reading it states that congestion control and flow control is done by transport layer not ip layer . So that is why I am confused as to if Routers are L3 device then why routers are checking with the source and confirming to them about controlling flow rate of bits (congestion control).

You're confusing TCP flow control (which is between sending host and destination) and IP flow management which might optionally be done on router.  The latter "manages" flow rates by, usually and generally, dropping IP packets, by setting the ECN bit (not well supported, at least yet) or by sending an ICMP source quench message to sender, the latter often not supported, deprecated for almost two decades and might also be done by destination.

Joseph W. Doherty
Hall of Fame
Hall of Fame

". . . but i wanted to knew is that when a router received a packet and it decapsulates layer 3 (that contains tcp payload) does the router check layer 4 as well in case of congestion control and also acknowledging data packets ."

Is the router receiving the packet as the destination host or for forwarding?

If the former, it deals with the packet as any other IP and/or TCP host would, such as acknowledging TCP segments.

If the latter, for routing purposes, it only needs to consider L3, however some routers have enhancements that allow them deeper examination of the packet's contents for various purposes such as ACLs that might block UDP or TCP specific port numbers.

Anything "covered" by a CRC check, that "fails" would be considered "corrupted", and normally dropped.  BTW, there are methods to detect corruption and repair it (ECC, error correcting code, within a certain degree of corruption, which can be allowed for), but as they increase the amount of data being sent, they are often not used (like for your typical frame/packet/segment checks).

Likely your confusion of equating L3 and L4 is because one L4 segment is generally encoded in one L3 packet/datagram which is also encoded in one L2 frame.  This because, unless using ECC, corruption of a lower level will corrupt all higher levels too, and if they are larger in size, you generally lose them too.  For example, losing a single L2 ATM cell, of 53 bytes, will cause loss of a max sized Ethernet frame, 1500 bytes, which, in turn, could cause the loss of a max sized TCP segment, of 64 KB.

Review Cisco Networking for a $25 gift card