IP HEADER FIELDS Vers Version #f of IP (current version is 4) HL Header Length in 32-bit words · Service: Mostly Ignored Total length Length of IP datagram Unique datagram ID Flags NoFrag, More Fragoffset: Fragment offset in units of 8 Octets TTL: Time to Live in"seconds"or Hops Protocol: Higher Layer Protocol ID HDR Cksum: 16 bit 1s complement checksum(on header only!) Sa DA: Network Addresses Options: Record Route, Source Route, Time Stamp
IP HEADER FIELDS • Vers: Version # of IP (current version is 4) • HL: Header Length in 32-bit words • Service: Mostly Ignored • Total length Length of IP datagram • ID Unique datagram ID • Flags: NoFrag, More • FragOffset: Fragment offset in units of 8 Octets • TTL: Time to Live in "seconds” or Hops • Protocol: Higher Layer Protocol ID # • HDR Cksum: 16 bit 1's complement checksum (on header only!) • SA & DA: Network Addresses • Options: Record Route,Source Route,TimeStamp Eytan Modiano Slide 16
FRAGMENTATION X25 ethernet ntu=1500 MTU= 512 ethernet mtU=1500 a gateway fragments a datagram if length is too great for next network (fragmentation required because of unknown paths) Each fragment needs a unique identifier for datagram plus identifier for position within datagram In IP, the datagram ID is a 16 bit field counting datagram from given host
FRAGMENTATION ethernet mtu=1500 X.25 G MTU = 512 G ethernet mtu=1500 • A gateway fragments a datagram if length is too great for next network (fragmentation required because of unknown paths). • Each fragment needs a unique identifier for datagram plus identifier for position within datagram • In IP, the datagram ID is a 16 bit field counting datagram from given host Eytan Modiano Slide 17
POSITION OF FRAGMENT Fragment offset field gives starting position of fragment within datagram in 8 byte increments(13 bit field) Length field in header gives the total length in bytes(16 bit field) Maximum size of iP packet 64K bytes a flag bit denotes last fragment in datagram IP reassembles fragments at destination and throws them away if one or more is too late in arriving y"°
POSITION OF FRAGMENT • Fragment offset field gives starting position of fragment within datagram in 8 byte increments (13 bit field) • Length field in header gives the total length in bytes (16 bit field) – Maximum size of IP packet 64K bytes • A flag bit denotes last fragment in datagram • IP reassembles fragments at destination and throws them away if one or more is too late in arriving Eytan Modiano Slide 18
IP Routing Routing table at each node contains for each destination the next hop router to which the packet should be sent Not all destination addresses are in the routing table Look for net id of the destination "prefix match" Use default router Routers do not compute the complete route to the destination but only the next hop router IP uses distributed routing algorithms: RIP, OSPF In a LAN, the"host computer sends the packet to the default router which provides a gateway to the outside world
IP Routing • Routing table at each node contains for each destination the next hop router to which the packet should be sent – Not all destination addresses are in the routing table Look for net ID of the destination “Prefix match” Use default router • Routers do not compute the complete route to the destination but only the next hop router • IP uses distributed routing algorithms: RIP, OSPF • In a LAN, the “host” computer sends the packet to the default router which provides a gateway to the outside world Eytan Modiano Slide 19
Subnet addressing Subnet addressing allows us to divide the host iD space intl p Class a and b addresses allocate too many hosts to a given n smaller“ sub networks” simplify routing within an organization Smaller routing tables Potentially allows the allocation of the same class b address to more than one organization 32 bit Subnet Mask is used to divide the host id field into subnets “1” denotes a network address field “0” denotes a host| D field 16 bit net id 16 bit host iD Class B Address 140.252 Subnet ID Host ID Mask 11111111111111111111111100000000
Subnet addressing • Class A and B addresses allocate too many hosts to a given net • Subnet addressing allows us to divide the host ID space into smaller “sub networks” – Simplify routing within an organization – Smaller routing tables – Potentially allows the allocation of the same class B address to more than one organization • 32 bit Subnet “Mask” is used to divide the host ID field into subnets – “1” denotes a network address field – “0” denotes a host ID field 16 bit net ID 16 bit host ID Class B Address 140.252 Subnet ID Host ID Mask 111111 111 1111111 11111111 00000000 Eytan Modiano Slide 20