User Tools

Site Tools


doc:networking:datagram.structures

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
doc:networking:datagram.structures [2012/11/23 00:36]
uvray313
doc:networking:datagram.structures [2012/11/30 16:13] (current)
uvray313
Line 1: Line 1:
 +====== Datagram Structures ======
 +Please read [[wp>​Datagram]] and [[wp>OSI model]].
  
 +
 +===== OSI Layer 2  =====
 +[[wp>​OSI_model#​Layer_2:​_data_link_layer|OSI Layer 2]] datagrams are called **frames**.
 +
 +==== Ethernet ====
 +  * [[wp>​Ethernet|IEEE 802.3]]
 +  * [[wp>​IEEE 802.1Q|IEEE 802.1q: VLANs]]
 +
 +
 +
 +==== Wireless LAN ====
 +  *[[wp>​Wireless_lan|Wireless LAN]]. ​
 +
 +==== ATM cell ====
 +Layer 2  datagrams of the ATM protocol are called **cells**.
 +  * [[wp>​Asynchronous_Transfer_Mode#​Structure_of_an_ATM_cell| ATM cell structure]]
 +
 +
 +==== PPP ====
 +The [[wp>​Point-to-point protocol|PPP (Point-to-point protocol)]] is a somewhat of a partial Layer 2 protocol. It is always used in conjunction with a second Layer 2 protocol, working as a carrier.
 +
 +^ PPP Header or Field or Tag  ^^^
 +^ Field ^ Version ^ Type ^ Code ^ Session-ID ^ Length ^ PPP protocol ^  **Payload** ​ ^
 +^ Bit   ​| ​ 4      |  4   ​| ​ 8   ​| ​  ​16 ​      ​| ​ 16    |  16          |  x  |
 +
 +Such PPP frames are encapsulated into the carrier frame: common are Ethernet and ATM. So we talk about 
 +
 +  * **PPPoE Frame**: TODO (or simply combine the already given information)
 +  * **PPPoA Cell**: TODO (or simply combine the already given information)
 +
 +But since ATM protocol is ever present, you only seldom have pure PPPoE over the whole distance from your Modem to the DSLAM. You have ATM as well as Ethernet. And this gives you two possibilities to combine the two protocols. You can either encapsulate or bridge:
 +  * Encapsulating:​ **PPPoEoA Frame**: [[wp>​Point-to-Point_Protocol_over_Ethernet#​How_PPPoE_fits_in_the_DSL_Internet_access_architecture]]
 +  * Briding: **PPPoE-2-PPPoA** this means that the Modem, strips the PPPoE header of every frame and replaces it with a PPPoA header.
 +
 +  * Pure PPPoE: it is being claimed that many VDSL2 connections relinquish the ATM protocols, and use pure PPPoE.
 +
 +
 +===== OSI Layer 3 =====
 +Datagrams at [[wp>​OSI_model#​Layer_3:​_network_layer|OSI Layer 2]] are called **packets**.
 +
 +
 +==== IP ====
 +  * [[wp>​IPv4#​Packet_structure|IPv4 Packet]]
 +  * [[wp>​IPv6 packet|IPv6 Packet]]
 +
 +==== ICMP====
 +  * [[wp>​Internet Control Message Protocol|ICMPv4 Packet]]
 +  * [[wp>​ICMPv6|ICMPv6 Packet]]
 +
 +
 +===== OSI Layer 4  =====
 +Some [[wp>​OSI_model#​Layer_4:​_transport_layer|OSI Layer 4]] datagrams are referred to as **packets**. TCP datagrams are called **segments**. ​ By definition UDP datagrams remain **datagrams** because they are [[wp>​Stateless_protocol|stateless]] but are often referred to as **packets**.
 +
 +==== TCP  ====
 +  * [[wp>​Transmission_Control_Protocol|TCP]]
 +
 +==== UDP  ====
 +  * [[wp>​User_Datagram_Protocol|UDP]]
 +
 +===== Datagram Structure =====
 +
 +^ Protocol ^ Header Size in Bytes ^ Total Size in Bytes ^
 +| [[wp>​Ethernet frame#​Structure|Ethernet frame]] ​ |  38–42 ​  | Size: 84–1542Bytes,​ [[wp>​Jumbo frame]] up to 9042  |
 +| [[wp>​IEEE 802.11#​Frames|Wireless LAN]]                                  |  ??      |  23??  |
 +| [[wp>​IPv4#​Packet_structure|IPv4 Packet]] ​ |  20–60 ​  ​| ​ Size: 20– (20-byte header + 0 bytes data) 65.535 ​ |
 +| [[wp>​IPv6 packet|IPv6 Packet]] ​           |  40 fixed, Optional Extension Header possible ​ |  up to 65.535 ​ |
 +| [[wp>​Transmission_Control_Protocol#​TCP_segment_structure|TCP Segment]] ​ |  20–60 ​ |  up to 65.535 ​ |
 +| [[wp>​User_Datagram_Protocol#​Packet_structure|UDP Packet]] ​ |  4–8 with IPv4 and 6–8 with IPv6  |  up to 65.535 ​ |
 +
 +====  Example ​ ====
 +TCP segment in IPv4 packet in Ethernet frame
 +^  Ethernet ​ ^  Octets ​ |
 +|  Preamble ​ |  7  |
 +|  Start of frame delimiter ​ |  1  |
 +|  MAC destination ​ |  6  |
 +|  MAC source ​ |  6  |
 +|  802.1Q tag (opt.) ​ |  4  |
 +|  Ethertype or length ​ |  2  ^  IPv4  ^  Bits  |
 +|  Payload ​ |  46 -1500  |  Version ​ |  4  |
 +|  |  |  Header Length ​ |  4  |
 +|  |  |  Differentiated Services Code Point   ​| ​ 6  |
 +|  |  |  Explicit Congestion Notification ​ |  2  |
 +|  |  |  Total Length ​ |  16  |
 +|  |  |  Identification ​ |  16  |
 +|  |  |  Flags  |  3  |
 +|  |  |  Fragment Offset ​ |  13  |
 +|  |  |  Time to Live  |  8  |
 +|  |  |  Protocol ​ |  8  |
 +|  |  |  Header Checksum ​ |  16  |
 +|  |  |  Source IP Address ​ |  32  |
 +|  |  |  Destination IP Address ​ |  32  |
 +|  |  |  Options ( if Header Length > 5 )  |  ?  |
 +|  |  |  Payload ​ |  1440-1480 Bytes  ^  TCP  ^  Bits  |
 +|  |  |    |    |  Source Port  |  16  |
 +|  |  |    |    |  Destination Port  |  16  |
 +|  |  |    |    |  Sequence number ​ |  32  |
 +|  |  |    |    |  Acknowledgment number ​ |  32  | 
 +|  |  |    |    |  Data offset |  4   |
 +|  |  |    |    |  Reserved ​ |  4  |
 +|  |  |    |    |  Flag  |  8  | 
 +|  |  |    |    |  Window Size |  16  |
 +|  |  |    |    |  Checksum ​  | 16  |
 +|  |  |    |    |  Urgent pointer ​ |  16  ||
 +|  |  |    |    |  Options (if Data Offset > 5)  |  varies ​ |
 +|  |  |    |    |  padding ​ | 8  |
 +|  |  |    |    |  Payload ​ |  Payload ​ |
 +|  CRC  |  4  |
 +|  Interframe gap  |  12  |
doc/networking/datagram.structures.txt · Last modified: 2012/11/30 16:13 by uvray313