Overview
This lecture covers the structure and fields of an IP datagram, explaining their functions and how network data is encapsulated in layers.
IP Datagram Structure
- An IP datagram consists of two main sections: the header and the payload.
- The header contains more data than an Ethernet frame header and has several specific fields.
Key Header Fields
- The version field (4 bits) specifies the IP version (IPv4 or IPv6).
- The header length field (4 bits) indicates the total header size, usually 20 bytes for IPv4.
- The service type field (8 bits) can specify Quality of Service (QoS) for prioritized routing.
- The total length field (16 bits) shows the full size of the IP datagram; max size is 65,535 bytes.
- The identification field (16 bits) groups related datagrams for reassembly if fragmentation occurs.
- The flag field indicates whether fragmentation is allowed or has occurred.
- The fragmentation offset field helps reassemble fragmented datagrams in the correct order.
- The time to live (TTL) field (8 bits) decreases by 1 at each router to prevent infinite looping.
- The protocol field (8 bits) specifies the transport layer protocol (e.g., TCP or UDP).
- The header checksum field provides error checking for the header and is recalculated at each router.
- The source and destination IP address fields (each 32 bits) contain sender and receiver IP addresses.
- The IP options field is optional and can add special characteristics, mostly for testing.
- The padding field ensures the header reaches the required length with extra zeros if needed.
Encapsulation & Networking Layers
- An IP datagram is encapsulated as the payload within an Ethernet frame.
- The IP datagram payload contains the entire TCP or UDP packet.
- Networking layers depend on each other, with each layer providing the foundation for the next.
Key Terms & Definitions
- IP Datagram — a packet at the network layer under the IP protocol.
- Header — structured fields containing essential routing and delivery information.
- Payload — the data section, often a TCP or UDP packet.
- Fragmentation — splitting a datagram into smaller parts to traverse networks with smaller maximum sizes.
- Encapsulation — enclosing data from one layer into a packet of the lower layer.
- TTL (Time to Live) — limits a datagram's lifetime to prevent endless looping in the network.
Action Items / Next Steps
- Review the structure and functions of each IP datagram header field.
- Prepare for questions about encapsulation and the relationship between different networking layers.