280 likes | 430 Views
Network Layer Functions. Key Layer in Internet Architecture End-to-end Packets Adapt to lower layers. 3. 2. 2. 1. 1. Network Layer. Design Goals ‘Independent’ of layer 1 & 2 implementations Hide layer 1 & 2 details from upper layers Architecture Connection oriented Connectionless
E N D
Network Layer Functions • Key Layer in Internet Architecture • End-to-end Packets • Adapt to lower layers 3 2 2 1 1
Network Layer • Design Goals • ‘Independent’ of layer 1 & 2 implementations • Hide layer 1 & 2 details from upper layers • Architecture • Connection oriented • Connectionless • (where should reliability be done?) • Services • Routing (Path selection) • Adaptation to different lower layers
Routing Algorithms • Goals • Optimality • Fairness • Stablility • Robustness • Correctness • Simplicity • Adaptive vs Static • Congestion Control
Adaptive Routing • Centralized • Isolated • Distributed
Distributed Routing • Metric - Vector Algorithms • sometimes called shortest path • Bellman-Ford most famous • Knowledge of immediate neighbors • Result is “first step” in path to ultimate destination • Link State Algorithms • OSPF {Open Shortest Path First} • Knowledge of network layer map (connectivity)
Congestion Control RESEARCH ISSUE! • Resource Reservation • Packet Discarding • Flow Control
Routing Information Protocol (RIP) • Known as a routing table update protocol • Developed by Xerox and gained widespread acceptance by the proliferation of TCP/IP’s implementation of it in UNIX. • Other protocols (AppleTalk, NetWare) adopted RIP as their standard routing update protocol. • Known as a distance vector protocol. • Vector is an adjacent router and the distance is how far away (hops) the network is. • One hop is considered one router traversed. • Devised for relatively stable, small-to-medium size networks (less than 16 routers in diameter) .
Network 4 Internal routing table Hops Network 3 1 Router C 4 1 2 2 1 3 Network 3 Router B Hops Transmitted routing table Network 2 1 3 1 1 2 Network 2 Transmitted routing table Hops Network 1 1 Router A 2 1 3 2 Network 1 Calculating the Cost
IP Routing • Making Decisions • Gathering Information • ICMP
Routing Table Network Mask Router Hops Age Port ID 3 255 C 1 30 1 4 255 C 1 30 2 2 255 B 2 15 2 1 255 B 3 45 2
Example: TCP/IP • Not the only way to do things ... • But well tested in the field • Brief History • TCP/IP vs ISO protocols
References TCP/IP • Overall -- Douglas Comer • Internetworking with TCP/IP, Vol I, 3d ed. • Internetworking with TCP/IP, Vol II • Internetworking with TCP/IP, Vol III (Sockets) • Internetworking with TCP/IP, Vol III (TLI) • Unix Programming -- W. Richard Stevens • Unix Network Programming • Advanced Unix Network Programming • Stevens & Wright • TCP/IP Illustrated Vol I • TCP/IP Illustrated Vol II • TCP/IP Illustrated Vol III
TCP/IP Stack OSI FTP 5 -7 TELNET DNS TCP 4 UDP IP 3 ICMP ARP 2 DIX Ethernet or ... 1
Notes on TCP/IP Suite • TCP/IP preceded the OSI Reference Model • Layers 1 & 2 are not part of the standard • Functions above the Transport Layer are consolidated
Brief Definitions • ARP -- Address Resolution Protocol • IP -- Internet Protocol • ICMP -- Internet Control Message Protocol • UDP -- User Datagram Protocol • TCP -- Transmission Control Protocol • DNS -- Domain Name System • FTP -- File Transfer Protocol • TELNET -- remote terminal
Other TCP/IP Protocols • Routing Protocols -- RIP, OSPF, EGP, GGP • BOOTP - Bootstrap Protocol • RARP - Reverse ARP • TFTP - Trivial FTP • HTTP - Hyper Text Transfer Protocol • SMTP - Simple Mail Transfer Protocol • SNMP - Simple Network Management Protocol
Layer Protocols DNS Query DNS Reply SYN SYN/ACK Caller Callee ACK {TCP Establishment} ARP Request ARP Reply
IP Functionality • Presents single, virtual network to user • Connectionless Delivery • Packet Routing • Interface to Lower Layers
IP Addresses • “Dotted Decimal” 32 bit (4 byte) address, written by taking each byte as an unsigned number • Address Classes [first octet] • A - <net> < > <host> < > 1-126 • B - <net> < > <host> < > 128-191 • C -< > <net> < > <host> 192-223 • D - special subset of C 224-239 multicast • E - reserved 240-254 • Netmask • a 32 bit value which, when ANDed with an address, selects only the network part
Netmask Usage “Do a bitwise AND then compare for equality of results” <src addr> & netmask =?= <dst addr> & netmask if comparison is equal, then both src & dst are on same (sub)net. Same netmask
S= 128.194.100.10 M= 255.255.255.0 result 128.194.100.0 D= 128.194.200.10 M= 255.255.255.0 result 128.194.200.0 Not Equal S= 128.194.12.10 M= 255.255.255.0 result 128.194.12.0 D= 128.194.12.110 M= 255.255.255.0 result 128.194.12.0 ? S= 67.194.18.10 M= 255.255.240.0 result 67.194.16.0 D= 67.194.10.10 M= 255.255.240.0 result 67.194. 0.0 Netmask Examples ?
Special Address Conventions • This host • Host on this net • Limited broadcast • Directed broadcast • Loopback all 0’s all 0’s host all 1’s net all 1’s 127 anything (usually 1)
0 4 8 16 19 24 31 VERS HLEN SERVICE TYPE TOTAL LENGTH IDENTIFICATION FLAGS FRAGMENT OFFSET TIME TO LIVE PROTOCOL HEADER CHECKSUM SOURCE IP ADDRESS DESTINATION IP ADDRESS IP OPTIONS (IF ANY) PADDING DATA ... IP Header
IP Packet Handling (rcv) Sockets Transport Layer (TCP or UDP) Other IP Link {DIX Type or 802.3 DSAP} Physical receiving
IP Packet Handling (xmit) Local or Non-Local ? sending Search Routing Table ARP Found! Missing! Send locally... ICMP Error
Bridges or Routers Address & Netmask 1: 131.122.24.12 255.255.255.0 2: 131.122.31.253 255.255.255.0 3: 131.121.18.12 255.255.240.0 4: 131.121.24.18 255.255.240.0 5: 131.121.31.254 255.255.240.0 1 3 A B C 2 5 D 4
ICMP • ping • ECHO Request/Reply • traceroute traceroute to falcon.ece.utexas.edu (128.83.196.10), 30 hops max, 40 byte packets 1 exit_133 (128.194.133.254) 2 ms 2 ms 2 ms 2 exit_128 (128.194.128.254) 2 ms 3 ms 2 ms 3 FDDI-T3.TAMU.EDU (128.194.1.13) 3 ms 3 ms 3 ms 4 FDDI-WAN.TAMU.EDU (165.91.128.17) 5 ms 4 ms 6 ms 5 sprint-gw-h1-0.the.net (129.117.16.161) 20 ms 5 ms 5 ms 6 ut8-h1-0.the.net (129.117.16.241) 8 ms 9 ms 21 ms 7 129.117.20.12 (129.117.20.12) 7 ms 11 ms 7 ms 8 ens.gw.utexas.edu (128.83.7.132) 16 ms 23 ms 21 ms 9 ece-e0.gw.utexas.edu (128.83.249.251) 12 ms 9 ms 9 ms 10 * * *