320 likes | 421 Views
Announcements: Chapter 4. CS 372 – introduction to computer networks* Friday July 16, 2010. * Based in part on slides by Bechir Hamdaoui and Paul D. Paulson. Acknowledgement: slides drawn heavily from Kurose & Ross. Chapter 4: Network Layer. Chapter goals:
E N D
Announcements: Chapter 4 CS 372 – introduction to computer networks*Friday July 16, 2010 * Based in part on slides by Bechir Hamdaoui and Paul D. Paulson. Chapter 4, slide: Acknowledgement: slides drawn heavily from Kurose & Ross
Chapter 4: Network Layer Chapter goals: • understand principles behind network layer services: • network layer service models • forwarding versus routing • subnetting and IP addressing • routing algorithms (path selection) • advanced topics: IPv6 Chapter 4, slide:
Introduction IP: Internet Protocol IPv4 addressing NAT IPv6 Routing algorithms Link state Distance Vector Routing in the Internet RIP OSPF BGP Chapter 4: Network Layer Chapter 4, slide:
network layer protocols run at end systems & routers Sender side: get segments from transport layer encapsulates segments into IP datagrams router examines header fields in all IP datagrams Receiver side: delivers segments to transport layer network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical application transport network data link physical application transport network data link physical Network layer Chapter 4, slide:
Interplay between routing and forwarding • routing algorithm: constructs routing tables • forwarding table: a lookup table for figuring out output port for each input pkt routing algorithm local forwarding table header value output link • forwarding process: move pkts from input to output 0100 0101 0111 1001 3 2 2 1 value in arriving packet’s header 1 0111 2 3 Destination • routing process: find route taken by packets from source to dest. Chapter 4, slide:
Two Key Network-Layer Functions Important !! • forwarding: move packets from router’s input to appropriate router output • routing: determine route taken by packets from source to dest. • routing algorithms • analogy: • routing: process of planning trip from source to dest • forwarding: process of getting through single interchange Chapter 4, slide:
Example services for individual datagrams: Reliability Guaranteed delivery End-to-end delay guaranteed delivery within 40 msec delay Example services for a flow of datagrams: In-order in-order datagram delivery Throughput guaranteed minimum bandwidth to flow Jitter delay restrictions on changes in inter-packet spacing Network service model Q: What services are needed/offered to transportdatagrams from sender to receiver? Chapter 4, slide:
Network layer: connection and connection-less services • Network-layer versus transport-layer services • datagram network provides network-layer connectionless service • Virtual Circuit (VC) network provides network-layer connection service Chapter 4, slide:
call setup/teardown for each call before data can flow VC identifier in each packet (not destination address) Maintain state for each VC in every router on the source-dest. path Allocate resources for each VC: bandwidth, buffers in links, routers involved in the VC “source-to-dest path behaves much like telephone circuit” performance-wise network actions along source-to-dest path Virtual circuits Chapter 4, slide:
VC implementation a VC consists of: • path from source to destination • VC numbers, one number for each link along path • entries in forwarding tables in routers along path • packet belonging to VC carries VC number (rather than dest. address) • VC number can be changed on each link. • New VC number comes from forwarding table Chapter 4, slide:
VC number 22 32 12 3 1 2 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 … … … … Forwarding table Forwarding table in northwest router: Routers maintain connection state information! Chapter 4, slide:
used to setup, maintain teardown VC used in ATM, frame-relay, X.25 not used in today’s Internet application transport network data link physical application transport network data link physical Virtual circuits: signaling protocols 6. Receive data 5. Data flow begins 4. Call connected 3. Accept call 1. Initiate call 2. incoming call Chapter 4, slide:
no call setup at network layer no state about end-to-end connections is kept in routers no network-level concept of “connection” packets forwarded using dest. host address packets (same source-dest pair) may take different paths application transport network data link physical application transport network data link physical Datagram networks 1. Send data 2. Receive data Chapter 4, slide:
Forwarding table 4 billion possible entries Destination Address RangeLink Interface 11001000 00010111 00010000 00000000 through 0 11001000 00010111 00010111 11111111 11001000 00010111 00011000 00000000 through 1 11001000 00010111 00011000 11111111 11001000 00010111 00011001 00000000 through 2 11001000 00010111 00011111 11111111 otherwise 3 Chapter 4, slide:
Longest prefix matching Prefix MatchLink Interface 11001000 00010111 00010 0 11001000 00010111 00011000 1 11001000 00010111 00011 2 otherwise 3 Examples Which interface? DA: 11001000 00010111 00010110 10100001 Which interface? DA: 11001000 00010111 00011000 10101010 Chapter 4, slide:
Internet (datagram) data exchange among computers “elastic” service, no strict timing req. “smart” end systems (computers) can adapt, perform control, error recovery simple inside network, complexity at “edge” many link types different characteristics uniform service difficult ATM (VC) evolved from telephony voice conversation: strict timing, reliability requirements need for guaranteed service “dumb” end systems telephones complexity inside network Datagram or VC network: why? Chapter 4, slide:
Router Architecture:a little about hardware Two key router functions: • runrouting algorithms/protocol (OSPF, BGP) • forwardingdatagrams from incoming to outgoing link Chapter 4, slide: 17
Input Port Functions Decentralized switching: • Lookup: given datagram dest., lookup output port using forwarding table in input port memory • forward: forward to appropriate output port • queuing: if datagrams arrive faster than forwarding rate into switch fabric Physical layer: bit-level reception Data link layer: e.g., Ethernet see chapter 5 Chapter 4, slide:
Three types of switching fabrics Chapter 4, slide:
Output Port Functions • Buffering required when datagrams arrive from fabric faster than the transmission rate • Scheduling discipline chooses among queued datagrams for transmission Chapter 4, slide:
Input Port Queuing • Fabric slower than input ports combined -> queueing may occur at input queues • Head-of-the-Line (HOL) blocking: queued datagram at front of queue prevents others in queue from moving forward • queueing delay and loss due to input buffer overflow! Chapter 4, slide:
Output port queueing • buffering when arrival rate via switch exceeds output line speed • queueing (delay) and loss due to output port buffer overflow! Chapter 4, slide:
Introduction IP: Internet Protocol IPv4 addressing NAT IPv6 Routing algorithms Link state Distance Vector Routing in the Internet RIP OSPF BGP Chapter 4: Network Layer Chapter 4, slide:
Host, router network layer functions: ICMP protocol • error reporting • router “signaling” IP protocol • addressing conventions • datagram format • packet handling conventions Routing protocols • path selection • RIP, OSPF, BGP forwarding table The Internet Network layer Transport layer: TCP, UDP Network layer Link layer physical layer Chapter 4, slide:
The Internet Protocol (IP) • TCP accepts data, destination (source port, destination address/port) • Encapsulates data segments, ports, other info • Gives TCP packet, destination address to IP • UDP is similar • IP accepts TCP / UDP packets, destination address • Encapsulates packets, source address, destination address, other info • Provides “best-effort”, host-to-host delivery • The IP unit is called a datagram Chapter 4, slide:
IP protocol version number 32 bits total datagram length (bytes) header length (4-byte units) type of service head. len ver length for fragmentation/ reassembly fragment offset “type” of data flgs 16-bit identifier max number remaining hops (decremented at each router) upper layer time to live header checksum 32 bit source IP address 32 bit destination IP address upper layer protocol to deliver payload to E.g. timestamp, record route taken, specify list of routers to visit. Options (if any) data (variable length, typically a TCP or UDP segment) IP datagram format How much overhead with TCP? At least: 20 bytes of TCP 20 bytes of IP = 40 bytes for every packet Chapter 4, slide:
IP datagram header • VERS - version of IP (currently 4) • H. LEN - header length (number of 4-byte units) • SERVICE TYPE - sender's preference for low latency, high reliability (rarely used) • TOTAL LENGTH - total octets in datagram • IDENT, FLAGS, FRAGMENT OFFSET - used with fragmentation (later) • TTL - time to live; decremented in each router; datagram discarded when TTL = 0 • TYPE - type of protocol carried in datagram; e.g., TCP, UDP • HEADER CHECKSUM - 1s complement of sum • SOURCE IP ADDRESS - IP address of original source • DEST IP ADDRESS - IP address of ultimate destination Chapter 4, slide:
IP datagram options • Added to IP header: • Record route (e.g., traceroute) • Source route (e.g., for connection-oriented services) • Timestamp • Header with no options has H. LEN field value 5; TCP/UDP header begins immediately after DESTINATION IP ADDRESS • Options added in multiples of 32 bits between DESTINATION IP ADDRESS and DATA. Padding added if necessary • Header with 1 to 32 bits of options has H. LEN field value 6 Chapter 4, slide:
IP Datagram • Datagrams can have different sizes • Header area usually fixed (20 octets*) but can have options • Total length can be between 0 and 65,535 • Usually, data area is much larger than header, but not even close to maximum size • Try to balance efficiency and reliability • TCP/UDP header is part of datagram “data” • *octet: usually same as byte • called "octet" in internet protocols for historical reasons Chapter 4, slide:
network links have MTU (max.transfer size) - largest possible link-level frame. different link types, different MTUs 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 IP Fragmentation & Reassembly fragmentation: in: one large datagram out: 3 smaller datagrams reassembly Chapter 4, slide:
length =4000 ID =x fragflag =0 offset =0 One large datagram becomes several smaller datagrams IP Fragmentation & Reassembly (ctd) • Example • 4000 byte datagram • = 20 (header) + 3980 (data) • MTU = 1500 bytes Chapter 4, slide:
length =1040 length =4000 length =1500 length =1500 ID =x ID =x ID =x ID =x fragflag =1 fragflag =1 fragflag =0 fragflag =0 offset =370 offset =185 offset =0 offset =0 One large datagram becomes several smaller datagrams IP Fragmentation & Reassembly (ctd) • Example • 4000 byte datagram • = 20 (header) + 3980 (data) • MTU = 1500 bytes 1480 bytes in data field offset = 1480/8 1040= 20 (header) + 1020 (data) 1020 (data) =3980 – 1480 -1480 Chapter 4, slide: