Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS4470 Computer Networking Protocols

Similar presentations


Presentation on theme: "CS4470 Computer Networking Protocols"— Presentation transcript:

1 CS4470 Computer Networking Protocols
7/6/2018 CS Computer Networking Protocols 8. Network layer 2 Huiping Guo Department of Computer Science California State University, Los Angeles

2 Outline What’s insider a router IPv4 datagrams
Datagram transmission Paradigm Fragmentation and reassembly 8. Network layer CS470

3 Router architecture overview
two key router functions: run routing algorithms/protocol (RIP, OSPF, BGP) forwarding datagrams from incoming to outgoing link forwarding tables computed, pushed to input ports routing processor routing, management control plane (software) forwarding data plane (hardware) high-seed switching fabric router input ports router output ports 8. Network layer CS470

4 Router architecture overview
Router control plane Runs the routing protocols Responds to the attached links that go up or down Performs management functions Implemented in software Execute on routing processor Router forwarding plane Consists of input ports, output ports and switching fabric Implements forwarding function Implemented in hardware 8. Network layer CS470

5 Input port functions decentralized switching: physical layer:
lookup, forwarding queueing line termination link layer protocol (receive) switch fabric physical layer: bit-level reception data link layer: e.g., Ethernet decentralized switching: given datagram dest., lookup output port using forwarding table in input port memory (“match plus action”) goal: complete input port processing at ‘line speed’ queuing: if datagrams arrive faster than forwarding rate into switch fabric 8. Network layer CS470

6 Switching fabrics transfer packet from input buffer to appropriate output buffer switching rate: rate at which packets can be transfer from inputs to outputs often measured as multiple of input/output line rate N inputs: switching rate N times line rate desirable three types of switching fabrics memory memory bus crossbar 8. Network layer CS470

7 Switching via memory first generation routers:
traditional computers with switching under direct control of CPU packet copied to system’s memory speed limited by memory bandwidth Memory bandwidth B, forwarding throughput <=B/2 2 packets cannot be forwarded at the same time input port (e.g., Ethernet) memory output system bus 8. Network layer CS470

8 Switching via a bus datagram from input port memory
to output port memory via a shared bus without intervention of the routing processor bus contention: switching speed limited by bus bandwidth 32 Gbps bus, Cisco 5600: sufficient speed for access and enterprise routers bus 8. Network layer CS470

9 Switching via interconnection network
overcome bus bandwidth limitations A crossbar switch an interconnection network consisting of 2N buses that connect N input ports to N output ports Can forward multiple packets in parallel Cisco 12000: switches 60 Gbps through the interconnection network crossbar 8. Network layer CS470

10 Output ports datagram buffer queueing switch fabric link layer protocol (send) line termination buffering required when datagrams arrive from fabric faster than the transmission rate scheduling discipline chooses among queued datagrams for transmission Datagram (packets) can be lost due to congestion, lack of buffers Priority scheduling – who gets best performance, network neutrality 8. Network layer CS470

11 Why does queuing occurs?
Packet queues my form at both the input ports and output ports The location and extent of queuing depend on Traffic load Speed of the switching fabric Line speed Main reasons of packet loss As the queues grow large, the router’s memory can eventually be exhausted. Packet loss will occur when no memory is available to store the arriving packets 8. Network layer CS470

12 Output port queueing at t, 3 packets from input to output one packet time later switch fabric buffering when arrival rate via switch exceeds output line speed queueing (delay) and loss due to output port buffer overflow! 8. Network layer CS470

13 Input port queuing fabric slower than input ports combined -> queueing may occur at input queues queueing delay and loss due to input buffer overflow! Head-of-the-Line (HOL) blocking: queued datagram at front of queue prevents others in queue from moving forward one packet time later: green packet experiences HOL blocking switch fabric switch fabric output port contention: only one red datagram can be transferred. lower red packet is blocked 8. Network layer CS470

14 The Internet Network layer
Host, router network layer functions: Transport layer: TCP, UDP IP protocol addressing conventions datagram format datagram handling conventions Routing protocols path selection RIP, OSPF, BGP Network layer forwarding table ICMP protocol error reporting router “signaling” Link layer physical layer 8. Network layer CS470

15 IP datagrams Motivation: universal service
Because it can connect heterogeneous networks, a router cannot transmit a copy of a frame that arrives on one network across another. To accommodate heterogeneity, an internet must define a hardware-independent datagram format. 8. Network layer CS470

16 IP datagrams Created and understood only by software
Contains sender and destination addresses Size depends on data being carried Called IP datagram header Data datagram 8. Network layer CS470

17 IPv4 datagram format Version HLen TOS Length ID Flags Offset TTL Protocol Checksum SourceAddr DestinationAddr Options (variable) Pad (variable) 4 8 16 19 31 Data Every datagram contains enough information for the network to forward it from source to destination. Question: Why is Version on the top of the datagram? Aligned on 32-bit boundaries. 8. Network layer CS470

18 IPv4 datagram format (cont.)
Version HLen TOS Length ID Flags Offset TTL Protocol Checksum SourceAddr DestinationAddr Options (variable) Pad (variable) 4 8 16 19 31 Data HLen: length of header(the number of 32-bit words). TOS: type of service. Length: total length of datagram(in bytes) (header+data). Questions: Why HLen? What is the minimum, maximum length of a datagram? Will the underlying physical network support it? Aligned on 32-bit boundaries. 8. Network layer CS470

19 Type of Service D T R C Precedence TOS Not used in IPv4
7/6/2018 Type of Service D: Minimize delay R: Maximize reliability T: Maximize throughput C: Minimize cost D T R C Precedence TOS Not used in IPv4 TOS bits Description Protocol 0000 Normal ICMP 0001 Minimize cost NNTP 0010 Maximize reliability SNMP 0100 Maximize throughput FTP (data) 1000 Minimize delay FTP(control) DNS NNTP: network lay3 protocol 8. Network layer CS470

20 IPv4 datagram format (cont.)
7/6/2018 IPv4 datagram format (cont.) Version HLen TOS Length ID Flags Offset TTL Protocol Checksum SourceAddr DestinationAddr Options (variable) Pad (variable) 4 8 16 19 31 Data TTL: time to live (hop counts) ensure data don’t circulate for ever Usually set to 32 or 64 Protocol: identity of upper-level protocol to which IP passes this datagram. 6:TCP 17: UDP Checksum: applies to header Questions: 1. Will different routers see the same checksum in the same datagram? Aligned on 32-bit boundaries. 8. Network layer CS470

21 IPv4 datagram format (cont.)
Version HLen TOS Length ID Flags Offset TTL Protocol Checksum SourceAddr DestinationAddr Options (variable) Pad (variable) 4 8 16 19 31 Data SourceAddr DestinationAddr: used for data delivery. Options: header length determines if any are set. Aligned on 32-bit boundaries. 8. Network layer CS470

22 Internet Transmission Paradigm (General Case)
Source host Forms datagram Includes destination address Sends to nearest router Intermediate routers Forward datagram to next router Final router Delivers to destination host 8. Network layer CS470

23 Datagram Transmission
Datagram sent across conventional network From source host and router Between intermediate routers From final router to destination host Encapsulation needed Network hardware does not recognize Datagram format IP addresses 8. Network layer CS470

24 Illustration Of IP Encapsulation
Entire datagram treated like data Frame type identifies contents as IP datagram Frame destination address gives next hop 8. Network layer CS470

25 Frame And Datagram Destination Addresses
Frame address Hardware (MAC) address Next hop Datagram address IP address Ultimate destination 8. Network layer CS470

26 Frames and Datagrams Datagram survives entire trip across Internet
Frame only survives one hop A datagram is encapsulated in a frame for transmission across a physical network. The destination address in the frame is the address of the next hop to which the datagram should be sent the address is obtained by translating the IP address of the next hop to an equivalent hardware address. 8. Network layer CS470

27 Illustration Of Frame Headers Used For Datagram Transmission
Each hop extracts datagram and discards frame 8. Network layer CS470

28 Exercise In LAN1, LAN2 and LAN3, A sends a datagram to F, what’s the datagram’s source IP address, destination’s IP address, corresponding frame’s source MAC address and destination’s MAC address? 1 2 3 8. Network layer CS470

29 Maximum Frame Size Each network technology imposes maximum frame data size Called Maximum Transmission Unit (MTU) The maximum amount of data that a link layer frame can carry MTUs differ Internet Can contain heterogeneous technologies Must accommodate multiple MTUs 8. Network layer CS470

30 Illustration Of How Two MTUs Cause A Problem For IP
Host 1 Creates datagram for Host 2 Create a frame of 1500 bytes Transmits the frame across network 1 Router R Receives frame over network 1 Must send frame over network 2 Employs fragmentation 8. Network layer CS470

31 Fragmentation and Reassembly
Ethernet: max. frame length = 1500 bytes. FDDI: max. frame length = 4500 bytes. MTU Question: How does the underlying network technology affect IP? How does one choose the maximum datagram size for IP? Design options: (1) Choose IP datagram max. length to be compatible with MTU. (2) Fragment IP datagram into multiple datagrams 8. Network layer CS470

32 Fragmentation and Reassembly
large IP datagram divided (“fragmented”) within net one datagram becomes several datagrams “reassembled” only at final destination IP header bits used to identify, order related fragments fragmentation: in: one large datagram out: 3 smaller datagrams 8. Network layer CS470

33 Fragmentation and Reassembly
When to re-assemble At destination only Results in datagrams getting smaller as data traverses internet Why not re-assemble at intermediate routers? Need large buffers at routers Buffers may fill with fragments All fragments must go through same router Routers have enough work to do already 8. Network layer CS470

34 IP Fragmentation IP re-assembles at destination only
Uses fields in header Data Unit Identifier (ID) When a datagram is created, the sender stamps the datagram with an ID as well as source and destination address The sender increments the ID of each datagram it sends Offset Position of fragment of user data in original datagram In multiples of 64 bits (8 bytes) flag Indicates that this is not the last fragment 0 if a fragment is the last one 8. Network layer CS470

35 Fragmentation and Reassembly
1. Each fragment is itself a self-contained IP datagram that is transmitted over a sequence of physical networks, independent of other fragments. 2. Each IP datagram is reencapsulated for each physical network over which it travels. 8. Network layer CS470

36 Fragmentation and Reassembly
Ident = x Start of header Rest of header 1400 data bytes Offset = 0 (b) 512 data bytes 1 Offset = 64 376 data bytes Offset = 128 Some nitty-gritty details If a fragment is lost, the receiver still tries to assemble the datagram… When this fails, it has to clean up the memory that was used in the attempt. If hosts can do “path MTU discovery”, then IP fragmentation can be avoided altogether. 8. Network layer CS470

37 Fragmenting Fragments
A fragment may encounter a subsequent network with even smaller MTU Router fragments the fragment to fit Resulting (sub)fragments look just like original fragments (except for size) No need to reassemble hierarchically; (sub)fragments include position in original datagram 8. Network layer CS470

38 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 Loss of any fragments means loss of entire datagram! 8. Network layer CS470

39 Fragmentation & Reassembly
ID =77 offset =0 flag length =4000 fragflag =1 =1500 =185 =370 =1040 One large datagram becomes several smaller datagrams Example A datagram of 4000 byte (header+data) Assume ID=77 MTU = 1500 bytes 1480 bytes in data field offset = 1480/8 8. Network layer CS470


Download ppt "CS4470 Computer Networking Protocols"

Similar presentations


Ads by Google