Download presentation
Presentation is loading. Please wait.
Published byDeborah Bryan Modified over 9 years ago
1
Network Layer and Routing
2
NL responsibility Main responsibilities –Host to Host delivery. –Finding path to destination. Services provided to TL, receive from DL –Connectionless and connection oriented services –Identifying source and destination uniquely and thereby use NL address. Fragments TL data if necessary. Uses packet switching (store and forward) with datagram approach. –In the router NL finds the appropriate interface from which it will reach the destination. –At the destination matches the address and check corrupt packets, and assembly fragmented units and then sent to TL
3
Switching How is a packet sent from one node to another node. –Circuit switching –Packet switching VC approach – call set up before message transfer Datagram approach – independent packet, does not need call setup phase.
4
Transport Layer:TCP, UDP Link Layer Routing Protocols: path selection RIP, OSPF, BGP Routing Table IP Protocols: addressing conventions Datagram format Packet handling conventions ICMP protocol: error reporting Router “signaling” Internet Protocol Network layer of datagram-oriented network such as internet has three major components: –Network protocol, e.g IP –Path determination –Error reporting
5
Internet structure At the NL internet can be viewed as a collection of subnets or Autonomous systems (AS) that are interconnected.
6
Internet working TL takes data streams and breaks them up into datagrams. Datagrams cab be up to 64Kbytes each, but usually not more than 1500 bytes. If necessary the fragments them and sent to internet. When all pieces finally reaches the destination they are reassembled by NL to original datagram. It is then handed over to TL which inserts it into receiving process.
7
IPv4 addressing IPv4 is 32 bits long Usually written in dotted decimal notation, eg. 193.32.216.9 In the globak internet each interface must have a unique IP address. Network address and host address. Subnet mask Meaning of 223.1.1.0/24
8
IPv4 header header has 20bytes fixed part and a variable length optional part. Version keeps track of which version of the protocol the datagram belongs to IHL – header length in 32 bit words. minimum IHL = 5 words = 20 bytes. maximum is 15 words. types of service – 6 bit field. voice, text etc. different classes of service. total length – 65,535 bytes including both data and header. Version IHL Type of Service Total length Identification Fragment offset DFDF MF TTL protocolHeader checksum Source Add Destination Add options ( 0 or more words) 4 bits 16 bits 2 6 bits4 bits
9
Identification – identifies the fragment which datagram it belongs to. An unused bit fields. DF stands for Don’t Fragment. MF stands for More Fragment – all fragments except the last one has this bit set. Fragment offset – where in the current datagram this fragment belongs. there is a maximum 213 fragments per datagram. TTL – counter to limit packet lifetimes in seconds. max. value 255. it must be decremented on each hop, and supposed to be decremented when queued for long time in a router. when it hits 0 the packet is discarded and a warning message is sent back to source. Protocol – TCP or UDP etc. checksum – for header only. source and destination address – IP addresses. Options – security, strict source routing, loose source routing, record routes, timestamp etc.
10
Classful addressing networkHost network Host network Host Mutlicast address 1111For future use 1.0.0.0 – 127.255.255.255 128.0.0.0 – 191.255.255.255 192.0.0.0 – 223.255.255.255 224.0.0.0 – 239.255.255.255 240.0.0.0 – 255.255.255.255 192.68.1.20/255.255.255.0 or 192.168.1.20/24 network number or address – 192.68.1.0 host number of address – 20 Broadcast address = 198.68.1.255 0 10 110 1110 A B C D E
11
Special IP 0.0.0.0 – this host; used when the machine is booting. IP address with 0 as the network number refer to the current network. IP with all 1s allows broadcasting on local network, typically a LAN. IP address with all 1s in host field allows broadcasting on the remote network that matches the network number. 127.x.x.x - loopback
13
Transporting a datagram Addressing and routing Key fields of IP datagram Misc fields Source IP address Desti.IP address Data Dest. Net Next router Nhop s 223.1.1.0/24-1 223.1.2.0/24 223.1.1. 4 2 223.1.3.0/24 223.1.1. 4 2 Routing table in A A 223.1.1.1 223.1.1.2 223.1.1.3 223.1.1.4 223.1.2.9 223.1.3.27 223.1.2.1 223.1.2.2 B E Hub
14
Dest. NetNext routerNhopsinterface 223.1.1.0/24-1223.1.1.4 223.1.2.0/24-1223.1.2.9 223.1.3.0/241223.1.3.27 Routing table in router How is this table created in the router?
15
Internet corporation for Assigned Names and Numbers (ICANN) – manages IP numbers and DNS root servers ICANN appointed some regional authority called Internet registry who are now responsible for IP address assignment for a particular region –North america: American registry for internet –Reseaux IP Europeans –Asia pacific Network Information center (APNIC)
16
A campus network main rout er routers hosts APE CSE
17
Subnets Splitting a network into several subnetworks. –Reduced network traffic Routers create broadcast domains. The smaller broadcast domains you create, the less network traffic on that network segment. –Optimized network performance This is a result of reduced network traffic –Simplified management It’s easier to identify and isolate network problems in a group of smaller connected networks than within one gigantic network. –Facilitated spanning of large geographical distances
18
Subnetting example 10networksubnethost 16 bit Let a class B network 130.50.0.0/16 1 0 0 0 0 0 1 0.0 0 1 1 0 0 1 0.0 0 0 0 0 0 0 0.0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 Number of subnets = 2 6 = 64, new subnet mask = 255.255.252.0 = 22 bits First subnet address – 130.50.0.0/22 2ndnd subnet address – 130.50.4.0/22 3 rd subnet address – 130.50.8.0/22 Last subnet address – 130.50.252.0/22
19
CIDR Problem with classfull addressing: Practice of organizing the address space in classes wastes millions of them. For most organization Class A with 16 million addresses is too big, and a Class C with 256 addresses is too small. However, an organization with 2000 hosts will also waste many IPs if it has a class B network. Routing table explosion problem: more bits for net address makes larger routing table. Classless InterDomain Routing Variable size block without regard to classes. If we need 2000 addresses we will be assigned 2048 address. The address is written as a.b.c.d/subnet mask in bits. 172.16.4.5/20 Needs longest prefix match.
20
CIDR example We are to asked to create an ip block of 2048 addresses starting with 194.24.0.0. 2048 = 11 bits host So 21 bits network. 11000010.00011000. 00000000. 00000000 00000000.00000000. 00000111. 11111111 =>194.24.0.0/21 => Complement of the subnet mask OR 11000010.00011000. 00000111.11111111 => 194.24.7.255 /21 Next block of 2048 start from 194.24.8.0/21 to 194.24.15.255/21 Next block of 2048 start from 194.24.16.0/21 to 194.24.23.255/21 However, if you have to allocate a block of 4096 ips to an university, then what would be the range of ips and subnet mask?
21
Internet control protocols To send some control message, in addition to data, network layer has control protocols like ICMP, ARP, RARP, BOOTP and DHCP.
22
ICMP When an unexpected event occurs in the network, router informs it by ICMP. Some important events and corresponding ICMP messages are listed below: Message typeEvent description Destination unreachable Packet could not be delivered. DF bit set, small packet network on the way. Time exceededTTL field hit 0 Parameter problemInvalid header field Source quench Choke packet. Receiver slow down the sending rate. Redirect Teach a router about geography. Packet seems to be routed wrong. EchoAsk if the machine is alive Echo replyYes, I am alive Timestamp requestSame as echo but with timestamp Timestamp replySame as echo reply, with timestamp
23
ARP Address Resolution Protocol – used to get the physical address of a host. – Ethernet physical address is called MAC address: 48 bits long. e.g. 00.1c.3d.6f.23.a8 How does the IP addresses get mapped onto physical address? – Source machines IP software sends a broadcast message asking “who has IP 192.31.65.5? Tell 192.31.65.7” this is called ARP broadcast. – Only machine with ip 192.31.65.5 reply with its MAC address (say, E2) to machine with IP 192.31.65.7 ARP table – cache the address, age after a while
24
Explanation How does host 1 send a packet to host 4? ARP proxy Default router
25
RARP, BOOTP,DHCP Reverse Address Resolution Protocol. – Used to get ip by a newly-booted machine. – No more usage. Given an IP address what is the physical address? Broadcast message. RARP broadcast is not routed. BOOTP – Used to boot a diskless machine over the network. – BOOTP messages are forwarded by the router. – Manual entry of any new machine added in the network.
26
DHCP Dynamic Host Configuration Protocol. Special server DHCP server is responsible for offering IP against a MAC request over the network. Allows both manual and automatic assignment. DHCP relay agent is needed on each LAN. DHCP DISCOVER (broadcast). Relay agent relays the discover message as unicast to dhcp server possibly on a distant network. DHCPOFFER from the servers. DHCPREQUEST to the selected server. DHCPACK from the selected server. Leasing time.
27
Mobile IP Problems: when a machine with an IP goes from one network to another network, packets destined to it still goes to its old network, and is lost. 1.assigning a new ip to a new host is not practical because this would involve a huge information changes in existing databases in the networks. 2.routers with complete IP addresses for routing, instead of just the network; however, this strategy would require each router to have millions of table entries! impractical.
28
IETF working group considers the following goals to be achieved in any solution for the mobile net user: 1.each mobile host must be able to use its home ip address anywhere. 2.software changes to the fixed hosts were not permitted. 3.changes to the router software and tables were not permitted. 4.most packets for mobile hosts should not make detours on the way. 5.no overhead should be incurred when a mobile host in at home.
29
every site that wants to allow its user to roam has to create a home agent. every site that wants to allow visitors has to create a foreign agent. when a mobile host shows up at a foreign site, it contacts the foreign agent there and registers. the foreign agent then contacts the user’s home agent and gives it a care of address, normally the foreign agent’s won IP address. when a packet arrives at the user’s home LAN, it comes in at some router attached to the lan. the router then tries to locate the host in the usual way, by broadcasting an ARP packet asking, ethernet address of the host. the home agent responds to this query by giving his its own ethernet address. the router then sends the packet for the mobile host to the home agent. It, in turn, tunnels then to the care- of-address by encapsulating then in the payload field of an iP packet addressed to the foreign agent.
30
the foreign agent then decapsulates and delivers them to the data link address of the mobile host. In addition the home agent gives the care of address to the sender, so future packets can be tunneled directly to the foreign agent.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.