Packet

A unit of information to transfer through the Network Switch

IP Header

Pasted image 20240914203943.png

  1. Version (4 bits)
    • identifies which version the IP is 0100 for IPv4 and 0110 for IPv6
  2. Header Length (4 bits)
    • Length of the ip header, tell you how big it is
  3. Type of service/ Differentiate Service (TOS/ DS): QoS (Quality of service) — treating some packet more care than other packet
    1. Type of service (8 bits) has two component Pasted image 20240914205625.png
      1. precedence: set the priority for this packet
      2. TOS throughput, delay, reliability, monetary cost
    2. However now it's being used as differentiate service (DS)Pasted image 20240914205647.png
      • DSCP: This is where you specify the code to classify the service
      • ECN: Used by some router to signal support for explicit congestion notification
  4. Total Length (16-bit): the length of the entire packet (Header + Data)
    • Length of data = total_length - header_length
  5. Identifier (16 - bit), Flags, Flagment Offset: Use to fragment a packet as a packet needs to fragment into smaller packets if the original length exceed the MTU (Maximum Transmission unit)
  6. Flags: 3 bits field.
    • First bit is unused
    • DF (Don't Fragment) bit: router cannot fragment the packet. If the packet exceeds the MTU (Maximum Transmission unit) and this bit turned on, it will ==drop the packet==.
    • MF (More Fragment) bit: Set to 1 if the receiver should expect more fragment. In the last fragment sent, this will be set to 0
  7. Fragment Offset: 13 bits field specify the offset. Since fragment does not arrive in order, this offset is to sort the fragment.
  8. TTL (Time to live): 8 bit field which set when the packet first received. To prevent routing loop in the network
    • Originally it was specified by second but then it's hard to implement so it never generally supported.
    • Now this is more like expected hop count. The router simply decrement the TTL before passing to another router.
    • If this number reaches 0, router will discard this packet and send an error message to the source.
    • This process prevent lost packets from wandering in the network
    • This is the mechanism used in trace
  9. Protocol: 8 bit field that gives the protocol number. Pasted image 20240915122011.png
  10. Header Checksum: error detection for IP header. contains 16 bits. Receiver will calculate this checksum to see if there is error. If there is no error then the result of the checksum would be 1. This checksum will be recalculated at each router
  11. Source Address and Destination Address: store the originator of the packet and teh destination of the packet.
  12. Options (optional): normally used for testing. Variable length field. Use to store additional infromation.