Chapter 18. Introduction to Network Layer 18.1 Network Layer Services 18.2 Packet Switching 18.3 Network Layer Performance 18.4 IPv4 Addresses 18.5 Forwarding of IP Packets Computer Networks 18-1
Communication at Network Layer Computer Networks 18-2
Network Layer Services Packetizing Encapsulating and decapsulating the payload Routing and Forwarding Routing is applying strategies and running some protocols to create the decision-making tables for each router Forwarding as the action applied by each router when a packet arrives at one of its interfaces Computer Networks 18-3
Network Layer: Other Services Error control Error detection and correction Flow control Regulating the amount of data a can send without overwhelming the receiver No flow control in the network layer of Internet Congestion control Quality of Service Security Computer Networks 18-4
Wide Area Network and Switching Methods Computer Networks 18-5
Circuit Switching Create a real circuit (dedicated line) between source and destination Physical layer technology Computer Networks 18-6
Packet Switching: Datagram Approach Connectionless Service Mostly used in the network layer Routing (selecting the best route for a packet) is performed at each router Computer Networks 18-7
Packet Switching: Datagram Approach Forwarding process in a router when used in connectionless network Computer Networks 18-8
Packet Switching: Virtual Circuit Approach Connection-Oriented Service: Packets are switched along a pre-determined path from source to destination Flow Label (or Virtual Circuit Identifier): To define the virtual path the packet should follow Virtual-circuit packet-switched network Computer Networks 18-9
Three Phases in Virtual Circuit Network Setup, data transfer, teardown Computer Networks 18-10
Forwarding Process in a Router Computer Networks 18-11
Setup Phase: Request Packet Sending request packet in a virtual-circuit network Computer Networks 18-12
Setup Phase : Acknowledgement Packet Sending acknowledgements in a virtual-circuit network Computer Networks 18-13
Data Transfer Phase Flow of one packet in an established virtual circuit Computer Networks 18-14
Network Layer Performance Measured in terms of Delay, Throughput, Packer loss, Congestion control Delay Transmission delay (Delay tr ) = (packet length)/(transmission rate) Propagation delay (Delay pg ) = (Distance)/(Propagation speed) Processing delay (Delay pr ): Time required to process a packet in a router or a destination host Queuing delay (Delay qu ): Time a packet waits in input and output queues in a router When we have n routers, Total delay = (n+1) (Delay tr + Delay pg + Delay pr ) + (n) (Delay qu ) Computer Networks 18-15
Network Layer Performance: Throughput Throughput at any point in a network is defined as the number of bits passing through the point in a second, which is actually the transmission rate of data at that point Throughput = minimum {TR 1, TR 2, TR n } Computer Networks 18-16
Network Layer Performance: Throughput Access network and backbone in Internet Effect of throughput in second links Computer Networks 18-17
Network Layer Performance Packet Loss Severely affect the performance Limited size of input buffer in a router: drop and resent Congestion control Congestion at the network layer is not explicitly addressed in the Internet model Congestion at the network layer is related to two issues, throughput and delay Computer Networks 18-18
Congestion Control Open-Loop Congestion Control Retransmission policy, Window policy Acknowledgement policy, Discarding policy Admission policy Closed-Loop Congestion Control Backpressure, Choke packet Implicit signaling/explicit signaling Computer Networks 18-19
IPv4 Addresses The identifier used in the IP layer of the TCP/IP protocol suite to identify the connection of each device to the Internet is called the Internet address or IP address An IPv4 address is a 32-bit address that uniquely and universally defines the connection of a host or a router to the Internet The IP address is the address of the connection, not the host or the router Address Space: 2 32 or 4,294,967,296 (more than four billion) Computer Networks 18-20
Hierarchy in Addressing Divided into two pars: prefix and suffix A prefix can be fixed or variable length Fixed-length network prefix classful addressing Variable-length network prefix classless addressing Computer Networks 18-21
Classful Addressing Five classes with fixed-length prefix: A, B, C, D, and E Address depletion: many addresses are remaining unused in classful addressing To alleviate address depletion: Subnetting and supernetting Computer Networks 18-22
Classless Addressing With the growth of the Internet, a larger address space was needed Long-term solution: IPv6 Short-term solution: classless addressing with IPv4 Variable-length blocks in classless addressing Prefix length: Slash notation CIDR (Classless Interdomain Routing) strategy Computer Networks 18-23
Classless Addressing Information extraction in classless addressing Computer Networks 18-24
Example 18.1 & 18.2 Example 18.1 Example 18.2: Another way Address Mask Address: 167.199.170.82, Mask: 255.255.255.224 64 95 Computer Networks 18-25
Example 18.3 Address 230.8.24.56 (11100110.00001000.00011000.00111000) Computer Networks 18-26
Network Address Important in routing a packet to the destination network Computer Networks 18-27
Subnetting Designing subnets The number of addresses in each subnet should be a power of 2 Prefix length for each subnetwork : n sub = 32 - log 2 N sub, where N sub = Assigned number of address to each subnetwork The starting address in each subnetwork should be divisible by the number of addresses in that subnetwork Example 18.5 An organization is granted a block of addresses with the beginning address 14.24.74.0/24. The organization needs to have 3 subblocks of addresses to use in its three subnets: one subblock of 10 addresses, one subblock of 60 addresses, and one subblock of 120 addresses. Design the subblocks. Computer Networks 18-28
Example 18.5 There are 2 32 24 = 256 addresses in this block. The first address is 14.24.74.0/24; the last address is 14.24.74.255/24. To satisfy the third requirement, we assign addresses to subblocks, starting with the largest and ending with the smallest one. a. The number of addresses in the largest subblock, which requires 120 addresses, is not a power of 2. We allocate 128 addresses. The subnet mask for this subnet can be found as n 1 = 32 log 2 128 = 25. The first address in this block is 14.24.74.0/25; the last address is 14.24.74.127/25. b. The number of addresses in the second largest subblock, which requires 60 addresses, is not a power of 2 either. We allocate 64 addresses. The subnet mask for this subnet can be found as n 2 = 32 log 2 64 = 26. The first address in this block is 14.24.74.128/26; the last address is 14.24.74.191/26. c. The number of addresses in the largest subblock, which requires 10 addresses, is not a power of 2. We allocate 16 addresses. The subnet mask for this subnet can be found as n 3 = 32 log 2 16 = 28. The first address in this block is 14.24.74.192/28; the last address is 14.24.74.207/28. Computer Networks 18-29
Example 18.5 Computer Networks 18-30
Address Aggregation One of the advantages of the CIDR strategy Address summarization or routing summarization Computer Networks 18-31
Special Address This-host address: 0.0.0.0/32 Limited-broadcast address: 255.255.255.255/32 Loopback address: 127.0.0.0/8 Private address: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 169.254.0.0/16 Multicast address: 224.0.0.0/4 Computer Networks 18-32
DHCP Dynamic Host Configuration Protocol Address assignment can be done automatically using DHCP Application-layer protocol, using the client-server paradigm Computer Networks 18-33
DHCP Operation Computer Networks 18-34
FSM for DHCP Client Computer Networks 18-35
Network Address Translation (NAT) Mapping between the private and universal addresses To use a set of private addresses for internal communication and a set of global Internet addresses (at least one) for communication with the rest of the world. Computer Networks 18-36
Address Translation Computer Networks 18-37
Translation Table Using one IP address Computer Networks 18-38
Translation Table Using a pool of IP addresses Using both IP addresses and port addresses Computer Networks 18-39
Forwarding of IP Packets Forwarding means to place the packet in its route to its destination When a host has a packet to send or when a router has received a packet to be forwarded, it looks at the forwarding table to find the next hop to deliver the packet Based on destination address Computer Networks 18-40
Example 18.7 Forwarding table for R1 : in case of 180.70.65.140? Computer Networks 18-41
Address Aggregation Computer Networks 18-42
Longest Mask Matching 140.24.7.200 is arrived at R2 If 140.24.7.0/24 is located the first line of the forwarding table, what happen? Computer Networks 18-43
Hierarchical Routing Computer Networks 18-44
Forwarding Based on Label In a connection-oriented network (virtual-circuit approach), a switch forwards a packet based on the label attached to the packet Routing is normally based on searching the contents of a table; switching can be done by accessing a table using an index Forwarding based on destination address Computer Networks 18-45
Forwarding Based on Label A simple example of using a label to access a switching table Computer Networks 18-46
Multi-Protocol Label Switching (MPLS) When behaving like a router, MPLS can forward the packet based on the destination address When behaving like a switch, it can forward a packet based on the label MPLS header made of s stack of labels Computer Networks 18-47