Download presentation
Presentation is loading. Please wait.
Published byHilary Fleming Modified over 6 years ago
1
IP - Internet Protocol (Based on Kurose & Ross)
Performs network and internetworking functions Probably the most important protocol No Internet without IP Rich, complex and beautiful!
2
Datagram networks: the Internet model
Packets between same source-destination pair may take different paths application transport network data link physical 1. Send data 2. Receive data
3
Internet Network layer functions
Transport layer: TCP, UDP IP protocol addressing conventions datagram format packet handling conventions Routing protocols path selection RIP, OSPF, BGP Network layer forwarding table ICMP protocol error reporting router “signaling” Link layer physical layer
4
IP Features Connectionless (best effort) End to end delivery
Data Units are datagrams or packets Global Addressing Routing Fragmentation and Reassembly Route recording, time stamping options QoS options, but seldom used in v4
5
32 bit destination IP address
IP datagram format ver length 32 bits data (variable length, typically a TCP or UDP segment) 16-bit identifier Internet checksum time to live 32 bit source IP address IP protocol version number header length (bytes) max number remaining hops (decremented at each router) for fragmentation/ reassembly total datagram length (bytes) upper layer protocol to deliver payload to head. len type of service “type” of data flgs fragment offset upper layer 32 bit destination IP address Options (if any) E.g. timestamp, record route taken, specify list of routers to visit. how much overhead with TCP? 20 bytes of TCP 20 bytes of IP = 40 bytes + app layer overhead
6
Header Fields (1) Version Internet header length
Currently 4 IP v6 Internet header length In 4 byte words Including options if used Type of service – priority (3 bits), DTR (Delay, Throughput, Reliability) Total length Of datagram, in octets <= 65535
7
Header Fields (2) Identification (datagram) Flags
Sequence number Used with addresses and user protocol to identify datagram uniquely Flags M - More bit D - Don’t fragment Fragmentation offset – units of 8 octets Time to live TTL (<= 255) Protocol Next higher layer to receive data field at destination ICMP (1), TCP (6), UDP (17)
8
Protocol numbers http://www. iana
Protocol numbers c:/winnt/system32/drivers/etc 0 HOPOPT IPv6 Hop-by-Hop Option ICMP Internet Control Message IGMP Internet Group Management GGP Gateway-to-Gateway IP IP in IP (encapsulation) ST Stream TCP Transmission Control EGP Exterior Gateway Protocol] IGP any private interior gateway (used by Cisco for their IGRP) 17 UDP User Datagram
9
Header Fields (3) Header checksum Source address Destination address
Reverified and recomputed at each router 16 bit ones-complement sum of all 16 bit words in header Set to zero during calculation Source address Destination address Options Padding To fill to multiple of 4 bytes long
10
Options Specified as Type + length + value
Security – classification level Strict Source Routing Loose Source Routing Record Route Time Stamp
11
Data Field Carries user data from next layer up – TCP, UDP, ICMP etc.
Integer multiple of 8 bits long (octet) Max length of datagram (header plus data) 65,535 octets
12
Fragmentation & Re-assembly
Different packet sizes for different networks When to re-assemble At destination (IP approach) Results in packets getting smaller as data traverses internet Intermediate re-assembly (possible, but not used) Need large buffers at routers Buffers may fill with fragments All fragments must go through same router Inhibits dynamic routing
13
Fragmentation - fields
Uses fields in header D flag – don’t fragment Datagram Identifier (ID) Total length (data length + 20 bytes) Offset Position of fragment of user data in original datagram In multiples of 64 bits (8 octets) ‘M’ or More flag - last fragment?
15
Another example An IP packet with: total length 4820,
datagram ID = 571 (decimal), fragment offset 32 and M=0 has to be fragmented for an Ethernet network. Show how this could be done, giving the values of the relevant header fields in all the fragments.
16
Solution Frag ID M D Offset Comments 1 571 32 The original offset 2 217 185 (1480/8) + 32 3 402 Another 185 4 587 The original datagram is the last fragment of a larger packet, offset = 32. Ethernet payload = 1500 ( IP header)
17
Dealing with Failure Re-assembly may fail if some fragments get lost
Need to detect failure Re-assembly time out Assigned to first fragment to arrive If timeout expires before all fragments arrive, discard partial data
18
Node Addresses - MAC & IP
MAC addresses (6 bytes) Defined at layer 2 OSI AKA Physical addresses Fixed, burned-in to NIC Guaranteed globally-unique IP addresses (4 bytes, x 109 addresses) Defined at layer 3 Referred to as Logical addresses Configured by network manager Facilitates logical grouping The total number of possible combinations of 32 bits is billion, but not all addresses are actually usable.
19
IP addresses An IP address consists of two parts: The network address
The first part of the address Identifies the network to which a host belongs Used by routers in path determination The host address The last part of the address Used in the local network to identify a host Network portion Host portion 32-bit IP address A subnet mask is used to mark the length of the network part A ‘1’ indicates a network bit, a ‘0’ indicates a host bit If network portion is 24 bits and host portion is 8 bits subnet mask will be written in dotted decimal format as Mask: … …
20
IP Address Classes Class E: 1111xxxx: reserved for IAB R&D
network host 10 110 1110 multicast address A B C D class to to to to 32 bits Class E: 1111xxxx: reserved for IAB R&D Mask: 1’s for network bits, 0 for host bits e.g , , etc Three main classes of address are used, based on the organisation size: Class A Range – First octet 0xxxxxxx Number of hosts per network 224 = 16,777,216 Usable hosts per network = 16,777,214 Subnet mask Class B Range – First octet 10xxxxxx Number of hosts per network 216 = 65536 Usable hosts per network = 65534 Subnet mask Class C Range – First octet 110xxxxx Number of hosts per network 28 = 256 Usable hosts per network = 254 Subnet mask
21
Class A Start with binary 0 (first bit)
Addresses starting with reserved (127) reserved for loopback Range 1.x.x.x to 126.x.x.x All allocated 16,777 million hosts per network
22
Class B Start 10 (first 2 binary bits) Range 128.x.x.x to 191.x.x.x
Second octet also included in network address 214 = 16,384 class B networks All allocated 216 = host-ids per networks
23
Class C Start 110 (first 3 binary bits) Range 192.x.x.x to 223.x.x.x
Second and third octet also part of network address 221 = 2,097,152 addresses Nearly all allocated 256 host-ids per network
24
Special Addresses First octet >= 224 (E0 1110 0000) - multicast.
First octet >= 240 (F ): IAB use 127.X.X.X - local loop back address for debugging Host-id = 0 refers to network Net-id = 0 - 'this network‘ (class B address) : used by RARP, BOOTP DHCP – own address unknown : destination address for default route in routers. Broadcast addresses: host part is all 1’s Local broadcast Not forwarded by routers, to all hosts in sender’s broadcast domain Directed broadcast: <Network Address>.255: forwarded by routers to specified network; to all hosts in specified network
25
Private Addresses – – – Not routable on the public Internet. Can be reused on private (home, company, campus) networks. A home router may use these for PCs connected to its ports, with NAT
26
IP addressing: suffix notation
Address Class scheme wastes addresses CIDR: Classless InterDomain Routing Network portion of address of arbitrary length address format: a.b.c.d/x x is the number of bits in network portion of address Will be discussed later
27
Addresses & Interfaces
IP address: for each host, for each router interface interface: connection between host/router and physical link router’s typically have multiple interfaces host may have multiple interfaces = 223 1 1 1
28
What is an ‘IP Network’? From IP address perspective device interfaces with same network part of IP address can physically reach each other without intervening router LAN A network consisting of 3 IP networks (for IP addresses starting with 223, first 24 bits are network address)
29
How to find the networks?
Detach each interface from router, host create “islands of isolated networks
30
Address Allocation I How does host get IP address?
hard-coded by system admin in a file Windows: control-panel->network->configuration->tcp/ip->properties UNIX: /etc/rc.config DHCP: Dynamic Host Configuration Protocol: dynamically get address from as server “plug-and-play”
31
Address Allocation II Q: How does network get network address?
A: gets allocated portion of its provider ISP’s address space ISP's block /20 Organization /23 Organization /23 Organization /23 … … …. Organization /23
32
Address Allocation III
Q: How does an ISP get a block of addresses? A: IANA: Internet Assigned Numbers Authority Names and Numbers allocates addresses manages DNS assigns domain names, resolves disputes
33
Getting a datagram from source to destination (1)
forwarding table in A Dest. Net. next router Nhops IP datagram: misc fields source IP addr dest data A B E datagram remains unchanged, as it travels source to destination addr fields of interest here
34
Getting a datagram from source to destination (2)
forwarding table in A misc fields Dest. Net. next router Nhops data Starting at A, send IP datagram addressed to B: look up net. address of B in forwarding table find B is on same net. as A link layer will send datagram directly to B inside link-layer frame B and A are directly connected A B E
35
Getting a datagram from source to destination (3)
forwarding table in A misc fields Dest. Net. next router Nhops data Starting at A, dest. E: look up network address of E in forwarding table E on different network A, E not directly attached routing table: next hop router to E is link layer sends datagram to router inside link-layer frame datagram arrives at continued….. A B E
36
Getting a datagram from source to destination (4)
forwarding table in router Dest. Net router Nhops interface misc fields data Arriving at , destined for look up network address of E in router’s forwarding table E on same network as router’s interface router, E directly attached link layer sends datagram to inside link-layer frame via interface datagram arrives at A B E
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.