1 / 141

MITM753: Advanced Computer Networks

MITM753: Advanced Computer Networks. Chapter 4 Network Layer. Introduction. Network layer implements the host-to-host communication service. It makes sure packets travel correctly from sending host to receiving host. Network layer is implemented in every host and router in the network.

bennettn
Download Presentation

MITM753: Advanced Computer Networks

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. MITM753: Advanced Computer Networks Chapter 4 Network Layer

  2. Introduction • Network layer implements the host-to-host communication service. • It makes sure packets travel correctly from sending host to receiving host. • Network layer is implemented in every host and router in the network. • The network-layer information is initially generated by the sending host and put in the network-layer header. • This header is read and acted upon by every single router in the path as well as by the receiving host.

  3. Introduction

  4. Network-layer Functions • Forwarding: • Move packets from an input link to an appropriate output link. • Also referred to as “switching”. • Routing: • Determine the route / path to be taken from sender to receiver. • The path is calculated by using routing algorithms. • The exchange of information between routers to perform routing is done using routing protocols. • Paths obtained from routing algorithm is put inside the forwarding table.

  5. Network-layer Functions • Connection setup: • Routers along the path perform handshake with each other before the actual data transfer. • Required to set up the necessary variables and resources. • Done by networks that use the virtual circuit architecture such as ATM, frame relay and X.25. • Not done by datagram networks such as the Internet.

  6. Network Service Models • Depending on the network technology used, the network layer may provide none, one or more of these services: • Guaranteed delivery • Guaranteed delivery with bounded delay • In-order packet delivery • Guaranteed minimal bandwidth • Guaranteed maximum jitter • Etc... etc… etc…

  7. Network Service Models • The Internet’s network layer provides a single service called the best-effort service. • Best-effort service is just another name for “no service”. • Timing between packets is not guaranteed. • Packets are not guaranteed to be received in order. • Packets are not even guaranteed to be received. • Other network architectures may implement better service models.

  8. Network Service Models

  9. Virtual Circuit and Datagram Networks • Similar to transport layer, network layer can also offer either connection-oriented or connectionless service. • Connection-oriented – virtual circuit networks. • Connectionless – datagram networks. • A network technology either use a virtual circuit or datagram approach, but not both. • Virtual circuit networks: ATM, frame relay, X.25. • Datagram networks: Internet.

  10. Virtual Circuit Networks • Connection must be setup before data transfer and terminated at the end. • During connection setup: • The path to be taken is determined. • An entry is added to the forwarding table of each router in the path together with the corresponding VC numbers. • Link and router resources (bandwidth, buffers) may also be allocated to the connection. • Unlike in transport layer, the connection involves all the routers between the two end systems.

  11. application transport network data link physical application transport network data link physical 6. Receive data 5. Data flow begins 4. Call connected 3. Accept call 1. Initiate call 2. incoming call Virtual Circuit Networks Routers maintain connection state information!

  12. Virtual Circuit Networks • A packet travelling in a VC network carries a VC number. • This number will change depending on which link the packet is travelling on. • The VC number is given by a router based on its forwarding table. • The messages used to setup and terminate a VC connection are known as signaling messages. • The protocol used to exchange these messages are called signaling protocols.

  13. VC number 22 32 12 3 1 2 Forwarding table in northwest router: interface number Incoming interface Incoming VC # Outgoing interface Outgoing VC # 1 12 3 22 2 63 1 18 3 7 2 17 1 97 3 87 … … … … Virtual Circuit Networks

  14. Datagram Networks • No connection is established before data transfer. • The packet carries the destination host address. • The routers will make forwarding destination based on this address. • Each router has a forwarding table which specifies which address should be forwarded to which interface. • This table is updated from time to time using a routing algorithm. • It is possible for packets from the same source-destination pair to follow different paths.

  15. Datagram Networks

  16. Inside a Router • Here we will briefly describe the network layer’s forwarding function. • In general, a router has four components: • Input ports • Switching fabric • Output ports • Routing processor • The input and output ports are contained in a line card slotted into the router. • The switching fabric and router processor are contained within the router itself.

  17. Inside a Router

  18. Input Ports • Perform functions related to physical and data link layers. • Line termination • Processing of link-layer header • Perform lookup and forwarding function. • Determine the output port. • Done by table lookup on the forwarding table. • It is important that the table lookup to be done at the line speed (or faster).

  19. Input Ports • Example on table lookup speed requirement: • Incoming link data rate = 2.5Gbps • Each packet size = 256 bytes • Lookup speed required = 1 million lookups per second • Once the output port has been determined, it can be queued to enter the switching fabric. • Switching fabric may currently being used by other input ports. • Need to queue and wait for its turn.

  20. Input Ports

  21. Switching Fabric • Packets are forwarded from an input port to an output port through the switching fabric. • Switching can be accomplished in many ways: • Switching via memory • Switching via a bus • Switching via an interconnection network • These are general techniques. Implementation details for each may vary.

  22. Switching Fabric

  23. Output Ports • Takes packets from output port’s memory and transmit them to outgoing link. • Perform the necessary data-link layer processing and line termination. • Queuing is needed when the switch fabric delivers packets at a rate faster than the output link rate.

  24. Where does Queuing Occur? • Queuing can occur both at the input and output ports. • If the queue grows too large, the buffer may run out of space and packet loss will occur. • Queuing at input ports can occur if the switching fabric speed is not fast enough to process incoming packets from all input ports. • To ensure no queuing at the input ports, the switching fabrics must be at least n times faster than the input line speed (n = number of input ports).

  25. Where does Queuing Occur? • Queuing at output ports can occur if: • Packets arriving at input ports all go to the same output port. • Output link speed is not fast enough transmit the packets. • What can we do if there is queue at the input ports? • Drop-tail: drop incoming packets if buffer is full. • Perform active queue management (AQM) algorithms: selectively drop packets.

  26. Where does Queuing Occur? • What can we do if there is queue at the output ports? • Use a packet scheduler to choose one of the queued packets for transmission. • First-come-first serve (FCFS) scheduling. • Weighted fair queuing (WFQ) scheduling: share the link fairly among the different end-to-end connections.

  27. The Internet’s Network Layer • The Internet’s network layer has three major components: • IP protocol • Addressing conventions • Datagram formats • Packet handling and conventions • Routing protocol • Path selection • RIP, OSPF, BGP • ICMP protocol • Error reporting • Router signaling

  28. IPv4 Datagram Format

  29. IPv4 Datagram Format • Version number: • A 4-bit value specifying the IP protocol version. • Allows routers to interpret the datagram correctly (different version has different datagram format). • For IPv4, this field should contain number 4. • Header length: • The size of the header in bytes. • Important because the size of the header my vary due to the Options field. • Used to determine where the data begins.

  30. IPv4 Datagram Format • Type of service (TOS): • Used to mark different types of IP datagrams (e.g. real-time vs. non-real-time datagrams). • Allows routers to provide different level of service to different types of datagram. • Only useful if the router supports this feature. • Datagram length: • Total length of the IP datagram (header plus data) in bytes. • The 16 bits value allows for a maximum size of 65,535 bytes. • In practice, the size is rarely larger than 1,500 bytes.

  31. IPv4 Datagram Format • Identifiers, flags, fragmentation offset: • Used for IP fragmentation (will be discussed shortly). • Time-to-live (TTL): • Contains a number which is decremented by one each time the datagram is processed by a router. • When the number reaches 0, the datagram is dropped. • Ensure a datagram does not circulate forever the in network.

  32. IPv4 Datagram Format • Protocol: • Indicates the specific transport-layer protocol to which the data portion should be passed. • Example: • TCP – 6 • UDP – 17 • Used in a similar way to a port number. • Only used by the receiving host.

  33. IPv4 Datagram Format • Header checksum: • Computed by treating each 2 bytes in the header as a number and summing them using 1s complement arithmetic. • A router use the checksum value to check for bit errors for each datagram. • A corrupted datagram is discarded by the router. • The checksum value needs to be recomputed each time because some of the values in the header (e.g. TTL or Options) may change.

  34. IPv4 Datagram Format • Source and destination IP addresses: • Specify of the sending and receiving hosts. • The receiver’s IP address is commonly obtained through a DNS lookup. • Options: • Allows an IP header to be extended. • Rarely used. • Data: • Contains transport-layer segment or any other type of upper-layer data such as ICMP message.

  35. IP Datagram Fragmentation • Along the path to the receiver, an IP datagram may travel through a number of different link-layer technologies. • Different link-layer protocol have different restriction on the maximum packet size: • This maximum size is called the maximum transfer unit (MTU). • Example: Ethernet frame has a maximum size of 1500 bytes.

  36. IP Datagram Fragmentation • If an IP datagram needs to be forwarded to an interface that has a smaller MTU, the IP datagram needs to be fragmented. • The fragments will now travel as independent, smaller datagrams until they arrive at the destination. • The task of reassembling the datagram is done at the destination host. • The datagram needs to be reassembled before it can be forwarded to the transport layer.

  37. IP Datagram Fragmentation • There are three fields in the IP header that are used to support fragmentation: • Identification: • Whenever an IP datagram is created, the sending host will assign the datagram an identification number. • This number is incremented for every datagram created. • Flag: • Value 1 means there are more fragments after this one. • Value 0 means this is the last fragment for this datagram. • Offset: • Specifies where the segment fits within the original IP datagram.

  38. IP Datagram Fragmentation

  39. IP Datagram Fragmentation

  40. IP Datagram Fragmentation • If one of the fragmented datagram is lost, the whole incomplete datagram is discarded. • Fragmentation puts a burden on Internet routers and also the destination host. • Therefore, it is desirable to keep fragmentation to a minimum. • This can be done by limiting the TCP or UDP segment size to be relatively small such that fragmentation is unlikely. • A good MSS would be 536 bytes.

  41. 223.129.5.17 = 11011111 10000001 00000101 00010001 223 129 5 17 IPv4 Addressing • An IP address (IPv4) is a 32-bit number. • Written in dotted-decimal-notation. • Each byte of the address is written in its decimal form and is separated by a dot. • There is a total of 232 possible IP addresses (about 4 billion).

  42. IPv4 Addressing • An IP address is given to an interface. • Connection between host/router and physical link. • A host normally only have one interface. • Routers normally have multiple interfaces. • A network interconnecting a router interface and several host interfaces forms a subnet. • IP address must be globally unique. • No two interfaces should have the same IP address.

  43. IPv4 Addressing

  44. IPv4 Addressing • IP addresses cannot be assigned randomly. • An IP address must be assigned depending on the network on which the host is attached. • The IP address has two parts. • The network part – high order bits (the left part). • The host part – low order bits (the right part). • Which part of an address belongs to the network and which part belongs to the host depends on the subnet mask.

  45. IPv4 Addressing • A subnet is a segment of the network that has its own address (network address). • Example: 223.1.1.0/24 • The /24 notation is known as a subnet mask. • A subnet mask can also be written in dotted-decimal notation. • /24 = 255.255.255.0 • A subnet can also consists of a connection between two router interfaces.

  46. IPv4 Addressing

  47. IPv4 Addressing

  48. IPv4 Addressing • In the early days of the Internet, IP addresses are divided into several classes (Class A, Class B, Class C, etc). • With classful addressing, the network portion of an address must be either 8, 16 or 24 bits long. • Nowadays, the address is assigned using a strategy known as Classless Interdomain Routing (CIDR). • The IP address can have the format a.b.c.d/x, where x indicates the length of the network portion. • As opposed to classful addressing, the value of x in classless addressing is not restricted to 8, 16 or 24. • This makes more efficient use of IP address space.

  49. IP Address: How to get one? • The answer to the question “how to get an IP address” depends on who you are. • If you are configuring a host (computer): • Manual configuration by system admin. • Windows: Control panel  network configuration TCP/IP  properties. • Linux (Debian): /etc/network/interfaces • DHCP (Dynamic Host Configuration Protocol). • Dynamically get address from server (plug-and-play).

  50. IP Address: How to get one? • If you are a network administrator for an organization: • Contact an ISP (Jaring, TM, Time.com, etc). • You will be allocated a portion of the ISP’s address space. ISP's block 11001000 00010111 00010000 00000000 200.23.16.0/20 Organization 0 11001000 00010111 00010000 00000000 200.23.16.0/23 Organization 1 11001000 00010111 00010010 00000000 200.23.18.0/23 Organization 2 11001000 00010111 00010100 00000000 200.23.20.0/23 ... ….. …. …. Organization 7 11001000 00010111 00011110 00000000 200.23.30.0/23

More Related