Options

Clarification please

surfthegeckosurfthegecko Member Posts: 149
Hi,

Just after a bit of clarification on a couple of topics. I will write my thoughts on it and if people could correct them where applicable it would be appreciated.

1. How data is packaged during Encapsulation:

Data is passed from Layer 7 down to the Transport Layer where it is broken into segments and a protocol is selected and the header applied, normally either TCP or UDP.

This then gets passed to the Network Layer where its put into packets and an IP Source Address & Destination Address are applied

Then its passed to the Data Layer where the packet is placed within a frame, where the MAC Source Address & Destination Address are applied.

This then gets transmitted to physical layer and to its intended destination.


2. Same as above but using different terminology:

Is a PDU passed to the Transport layer, where a protocol is selected (TCP or UDP), and then uses IP to route (in a connectionless state) the data.

3. Can somebody confirm if IP is similar to UDP in the way it works as opposed to TCP?

Thanks
Nick

Comments

  • Options
    aordalaordal Member Posts: 372
    Let me preface that this is my understanding after reading 3 books and 2 1/2 months of study so I'm not a cisco guru.

    1. Pretty much except during encapsulation in a frame theres both a header and a trailer.

    2. PDU is a generic term for Protocol Data Unit. So if it a Layer 7 PDU then yes. If its a L3 PDU then its only referring to packets.

    3. TCP/UDP go through the same "encapsulation" process as far as being converted to the data stream. Their main difference is TCP sets up a virtual circuit and provides retransmission of packets etc.. im not going to explain it all. But yeah, same general "encapsulation" process.
  • Options
    SlowhandSlowhand Mod Posts: 5,161 Mod
    1.) Take a look at the image below. Think of data passing down the left side, from the application layer all the way down to the physical layer, across the wire, then up the right side when the same data is received by the destination computer.

    osilayer_encap.gif



    2.) The diagram above should confirm what you've said about the encapsulation process, just look at the middle-portion between the stacks. Hopefully, the picture should give you a clear(er) understanding of what happens during encapsulation.



    3.) TCP and UDP are alike in function, but IP includes a separate header that includes things like destination IP address and source IP, as opposed to UDP and TCP which talk only in ports. A datagram will include either a TCP or a UDP header, but not both, then receive an IP header. TCPIPguide.com has a great explanation of how the encapsulation process works.

    UDP is connectionless and unreliable, which means that it does not confirm delivery of data, it just sends packets.
    UDP_header.gif

    TCP is connection-oriented, and has several fields which help ensure delivery of data, such as the windowing, acknowledgment number, and sequence number fields.
    TCP-header.GIF

    Once data has been segmented, (see the chart above,) it is put into IP packets; assuming we're moving down the stack from layer 7 to layer 1. The following is an IP packet that includes everything from above it its data field, including either a TCP or UDP header.
    IP-Header.gif

    Free Microsoft Training: Microsoft Learn
    Free PowerShell Resources: Top PowerShell Blogs
    Free DevOps/Azure Resources: Visual Studio Dev Essentials

    Let it never be said that I didn't do the very least I could do.
  • Options
    surfthegeckosurfthegecko Member Posts: 149
    So are IP, UDP & TCP 3 very seperate protocols.
    Is it just that TCP/UDP are Transport Layer 4 and both are then bound to the IP at Network Layer 3?

    Do all Transport layer protocols get bound to IP at layer 3?

    Also would this diagram be true:
    Layer 4 - Transport
    UDP/TCP Header + Data = Segment

    Layer 3 - Network
    IP Header + UDP/TCP Header + Data = Packet

    Layer 2 - Data
    Frame Header + IP Header + UDP/TCP Header + Data + Frame Trailer = Frame

    Thanks for your help so far its starting to make more sense. I will give that TCPIPGuide a read as well.
  • Options
    amp2030amp2030 Member Posts: 253
    If by 'bound to the ip' you mean the transport layer segment is encapsulated into an IP packet, then yes.

    The protocols are indeed very different, and they serve different functions. IP deals with routing, making sure the data can reach the destination. TCP deals with error correction, making sure data can be put back together once it gets there (and checking that it got there). UDP is simpler, it just makes sure the data gets to the right application (by using ports).

    That diagram is correct.
  • Options
    SlowhandSlowhand Mod Posts: 5,161 Mod
    The best way to think about it is in terms of envelopes. At layer 4, the data is segmented, then that whole segment gets tucked into the data field of an IP packet in layer 3. Moving down the stack, that IP packet gets put into the data field of a frame in layer 2, and then converted to ones and zeros at layer 1. Think of it kind of like an envelope inside another envelope, with all the necessary address information from each layer written on the outside of each. When the data reaches its destination, each layer rips open the corresponding envelope and kicks the data it finds up to the next level, until it finally reaches the application layer.

    Free Microsoft Training: Microsoft Learn
    Free PowerShell Resources: Top PowerShell Blogs
    Free DevOps/Azure Resources: Visual Studio Dev Essentials

    Let it never be said that I didn't do the very least I could do.
  • Options
    surfthegeckosurfthegecko Member Posts: 149
    Thanks for clarifying that....im almost certain it makes sense now.

    Im sure there will be more questions to follow.
  • Options
    surfthegeckosurfthegecko Member Posts: 149
    Thanks slow hand, I think that analogy is a good one.

    I liked the use of the words "then that whole segment gets tucked into the data field of an IP packet in layer 3" sort of helped clarify where the segment gets tucked, as I had never really thought about this bit before.
Sign In or Register to comment.