430 likes | 515 Views
Reading. Make sure you read all of chapter 2 & 3. Internet Architecture. How are networks interconnected to form an internetwork? We’ve seen how hosts on a single network interconnect Physically 2 networks attached by a computer that attaches to both of them
E N D
Reading Make sure you read all of chapter 2 & 3 CS 428 Computer Networking
Internet Architecture How are networks interconnected to form an internetwork? We’ve seen how hosts on a single network interconnect Physically 2 networks attached by a computer that attaches to both of them Doesn’t guarantee that the computer will cooperate with other hosts Need computers willing to shuffle packets from one network to another They are internet gateways (internet routers) CS 428 Computer Networking
IP Routers See figure 3.1 on page 56 (draw) Need to know about topology of internet beyond connected networks See figure 3.2 on page 57 R 1 must transfer from network 1 to network 2 all packets destined for both network 2 and 3 CS 428 Computer Networking
IP Routers In a TCP/IP internet, computers called routers or gateways provide all interconnections among physical networks. Routers are usually small computers with limited memory and disk storage Trick: Routers use the destination network, not the destination host when routing a packet CS 428 Computer Networking
IP Routers Amount of information needed to keep is proportional to the number of networks in the internet not the number of computers User’s view of internet is single virtual network to which all machines connect See figure 3.3 on page 59 Advantage of network level interconnection (over app level) is that application level programs need not be concerned with network details CS 428 Computer Networking
All Networks are Equal Any communication system capable of transferring packets counts as a single network Ethernet LAN WAN - ANSNET backbone Point to Point link How do IP addresses work CS 428 Computer Networking
Internet Addresses TCP/IP internet, a virtual network built by interconnecting physical networks with routers Now we discuss addressing Hides physical network details CS 428 Computer Networking
Universal Comm. Service Any to any host Needs globally accepted method of computer id Names - What an object is Addresses - Where it is Route - How to get there IP addresses - 32 bit integers Chosen to make routing efficient Encodes id of network to which the host attaches as well as host id itself CS 428 Computer Networking
IP Addresses Unique 32 bit address used for ALL communication with that host Simplest view Each host has unique 32 bit addr Bits of all hosts on a common network share same prefix Each addr. is a pair (netid, hostid) netid = network id hostid = host id CS 428 Computer Networking
IP Address Classes - 2 bits can distinguish between 3 common classes Class A (000) 0 netid hostid Class B (128) 1 0 netid hostid Class C (192) 1 1 0 netid hostid Class D (224) 1 1 1 0 multicast address Class E (240) 1 1 1 1 0 reserved for future use CS 428 Computer Networking
Address Classes Class A - Handful of networks that each have more than 216 (65,536) hosts 7 bits to netid, 24 bits to hostid Class B - Intermediate size networks - between 28 and 216 hosts 14 bits to netid, 16 bits to hostid Class C - Less than 28 hosts 21 bits to the netid, 8 to hostid CS 428 Computer Networking
IP Addresses Dealt with as 32 bit addresses Assume following IP Addr. 137.141.152.35 (Decimal) 89.8D.98.23 (Hexadecimal) 1000 1001.1000 1101.1001 1000.0010 0011 (Binary) 0 1 2 3 4 . . . 8 . . . 16 . . . 24 . . . 31 Class B (128) 1 0 netid hostid ‘898D’x ‘9823’x 2445 38947 decimal 1 0 0 0 1 0 0 1 -1 0 0 0 1 1 0 1 - 1 0 0 1 1 0 0 0 - 0 01 0 0 0 1 1 CS 428 Computer Networking
Multi-Homed Hosts A router connects 2 or more physical networks How is one IP address assigned to the router??? IP Addr. encode a network and a host A router is a multi-homed host CS 428 Computer Networking
Network Connections Routers have 2 or more IP Addresses One for each network on which it resides IP addresses do not specify and individual computer, but a connection to a network A router connecting n networks has n distinct IP addresses, one for each network connection CS 428 Computer Networking
Network Addresses By convention, hostid 0 is never assigned to an individual host IP addr. with hostid = 0 refers to the network itself 137.141.0.0 (hostid = 0.0 right??) This allows IP addresses to refer to networks as well as hosts All bits of hostid = 0 ? Refers to a network CS 428 Computer Networking
Broadcast Address Any hostid consisting of strictly 1’s is reserved for broadcast Broadcast not supported on all networks Early release of Berkeley Unix used all 0’s, still around Sometime option of specifying 0’s - not recommended Directed broadcast still correctly identifies the network but broadcasts to all hosts on a given network CS 428 Computer Networking
Limited Broadcast 32 bits of 1’s Broadcast only to local network Host may use this prior to knowing its IP addr. at start up Field of 1’s = ‘All’ Field of 0’s = ‘This’ IP addr. with hostid = 0 refers to ‘this’ host Network id = 0 refers to ‘this’ network CS 428 Computer Networking
This Receive a packet with netid of dest. addr = 0 and hostid matches its address Interpret to mean ‘this’ network Addressing scheme actually slightly more intricate Subnetting CS 428 Computer Networking
Internet Addresses Disadvantages Address refers to network connections Host moves to a different network, it must change its IP addr. If IP addr referred to host itself the could move without changing IP addr. CS 428 Computer Networking
Traveling PC Example Disconnect your computer from your local network. Take it with you on a trip Reconnect to an internet at destination PC cannot ‘own’ an IP address because the IP addr. is associated with the physical network not the host Do 137.141.152.35 example in Lons le Saunier CS 428 Computer Networking
Another Disadvantage Any class C network that grows beyond 255 hosts must change its class to Class B Big pain to change One less Class B network address available 0 1 2 3 4 . . . 8 . . . 16 . . . 24 . . . 31 1 1 0 netid hostid Class C (192) CS 428 Computer Networking
Largest Flaw Not entirely apparent until we do routing Routing is based on internet addresses (IP addr) with netid portion used to make routing decisions Multi-homed host Because routing uses the netid portion of IP addr. the path taken to a multi-homed host will depend entirely upon which IP addr. was supplied CS 428 Computer Networking
Multiple Routes Multiple names for same host yield packets for same host behaving differently It may be impossible to reach a dest. even though you know a valid IP addr. Network 1 I1 I2 I3 R A B I4 I5 Network 2 I = IP Addr. R = Router B known by two IP addresses CS 428 Computer Networking
Dotted Decimals IP Addresses written as 4 decimal integers separated by decimal points 10000000 00001010 00000010 00011110 is 128 . 10 . 2 . 30 Unix netstat command - displays current routing telnet, ftp - application programs all use dotted decimal notation Class Lowest Addr. Highest Addr. A 0.1.0.0 126.0.0.0 B 128.0.0.0 191.255.0.0 C 192.0.1.0 223.255.255.0 D 224.0.0.0 239.255.255.255 E 240.0.0.0 247.255.255.255 CS 428 Computer Networking
Loopback Address Not all possible addresses are assigned to classes 127.0.0.0 not used - Class A Used for loopback - usual addr used is 127.0.0.1 Intended for TCP/IP testing and IPC on local machine CS 428 Computer Networking
Special Addresses All 0’s This host All 0’s Host Host on this net All 1’s Limited Broadcast (local net) Net All 1’s Directed Broadcast for specific network 127 Anything,often 1 Loopback Limited and Direct Broadcast addresses are never valid source addresses. Length of netid portion of directed broadcast depends on network class. All 0’s only allowed at system start up. CS 428 Computer Networking
Internet Addressing Authority Internet Assigned Number Authority (IANA) Ultimate control over numbers assigned and sets policy An organization can obtain network addresses from the Internet Network Information Center (INTERNIC) Only needed to assign network portion of IP Address. Why ??? CS 428 Computer Networking
More IP Addr Stuff Only necessary to assign IP Addresses to networks which will participate in the Internet 9.0.0.0 = IBM; 12.0.0.0 = AT&T; 10.0.0.0 = ARPANET See figure 4.5 on page 73 3 networks, what are their classes? How do you know? CS 428 Computer Networking
IP Address Assignment See figure 4.6 on page 73 Host computers now attached and IP addresses assigned 4 hosts Arthur, Merlin, Guenevere, Lancelot 2 routers Taliesyn, Glatisant Multi-homed host Note network IP addresses, remember classes CS 428 Computer Networking
Network Byte Order 32 bit binary integer; What does it look like in memory ??? Let’s take the hexadecimal number ‘6789ABCD’x Which one does it look like ? a) 6789ABCD b) ABCD6789 c) CDAB8967 d) 8967CDAB e) None of the above CS 428 Computer Networking
Network Byte Order Let’s take the hexadecimal number ‘6789ABCD’x Which one does it look like ? a) 6789ABCD (Big Endian) b) ABCD6789 (Little Endian) c) CDAB8967 (LE&ByteSwap) d) 8967CDAB (Just odd) e) None of the above Little Endian stores LOB portion of the integer at the lowest address Big Endian stores HOB portion of the integer at the lowest address CS 428 Computer Networking
Network Byte Order With TCP/IP, Network Standard Byte Order is defined to be Big Endian Most Significant Byte is sent first and down the line If the architecture of the machine does not match this pattern then it is the responsibility of the TCP/IP developers for that machine to convert data on the way in and out CS 428 Computer Networking
Internet Routing Read Chapters 7 & 8 Routing - Process of choosing a path over which to send packets Router - A computer making such a choice Goal: “… provide a virtual network that encompasses multiple physical networks and offers a connectionless datagram delivery service.” - Comer CS 428 Computer Networking
Routers An internet composed of multiple physical networks interconnected by computers called routers Router - direct connections to 2 or more physical networks Host computer - a single, direct connection CS 428 Computer Networking
Routers Multi-homed hosts - direct connections to 2 or more physical networks Both hosts and routers route IP datagrams Hosts?? Two or more routers on network? Which to send to? Host must make decision Any computer with multiple network connections can act as a router CS 428 Computer Networking
Delivery Direct - Local Sender encapsulates datagram in a physical frame Binds dest IP addr to a physical hardware addr Sends frame to destination Known local because netid matches host’s netid Indirect - Between physical networks CS 428 Computer Networking
Indirect Delivery Sender must identify a router to send datagram to Router then forwards it toward its destination When frame reaches the router Software extract the encapsulated datagram IP software selects next router along the path Datagram again placed in a frame Sent over physical network to next router CS 428 Computer Networking
Table Driven Routing IP Routing Table on each machine netstat -nr Want to contain most minimal information at all times Next hop routing done by using the routing tables (N, R) pairs N = netid part of IP addr R = Next router along path to N CS 428 Computer Networking
Next Hop Routing Important - all routers identified in machine M’s routing table are physically located on the same network as M When a datagram ready to leave M IP software locates dest IP addr extracts the network portion to make routing decision M will select a router which M can directly reach Hosts have minimal information, rely on routers CS 428 Computer Networking
Routing Example 10.0.0.0 10.0.0.5 Q 20.0.0.5 20.0.0.0 IP Addr Gateway 20.0.0.6 20.0.0.0 Direct Delivery 30.0.0.0 Direct Delivery 10.0.0.0 20.0.0.5 40.0.0.0 30.0.0.7 R 30.0.0.6 30.0.0.0 30.0.0.7 S 40.0.0.7 40.0.0.0 CS 428 Computer Networking
Consequences All traffic destined for given network use same path Even when multiple paths exist, won’t be used Only final router can determine if dest. host exists or is operational Need way for routers to return delivery problem errors Datagrams travelling from A to B may follow a different path from B to A CS 428 Computer Networking
Default Routes Especially useful when local network has small set of hosts and 1 connection to internet 2 tests One for local network Default that points to default router CS 428 Computer Networking
Routing Algorithm RouteDatagram (Datagram, RoutingTable) Extract destination IP addr, D, from the datagram and compute the network prefix, N; IfN matches any directly connected network address, deliver datagram to destination D over that network (This involves resolving D to a physical address, encapsulating the datagram, and sending the frame) else if the table contains a host-specific route for D send the datagram to next hop specified in the table else if the table contains a route for network N, send datagram to next hop specified in the table else if the table contains a default route, send datagram to the default router specified in the table else declare a routing error CS 428 Computer Networking