Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 COMP 431 Internet Services & Protocols The IP Internet Protocol Jasleen Kaur April 21, 2016.

Similar presentations


Presentation on theme: "1 COMP 431 Internet Services & Protocols The IP Internet Protocol Jasleen Kaur April 21, 2016."— Presentation transcript:

1 1 COMP 431 Internet Services & Protocols The IP Internet Protocol Jasleen Kaur April 21, 2016

2 2 The Network Layer: Routing & Addressing Outline u Network layer services u Routing algorithms »Least cost path computation algorithms u Hierarchical routing »Connecting networks of networks u IP Internet Protocol »Addressing »IPv6 u Routing on the Internet »Intra-domain routing »Inter-domain routing u Router architecture application transport network link physical network application transport network link physical network link physical network link physical network link physical network link physical network link physical network

3 3 Routing protocols path selection RIP, OSPF, BGP The Internet Network layer Host and router network layer functions routing table IP protocol addressing conventions IP datagram format packet handling conventions ICMP protocol error reporting router “signaling” Transport layer: TCP, UDP Link layer Physical layer Network layer

4 4 The Internet Network layer IP datagram format ver length 32 bits data (variable length, typically a TCP segment or UDP datagram) 16-bit identifier Internet checksum time to live 32 bit source IP address head. len type of service flgs fragment offset upper layer 32 bit destination IP address Options (if any) u IP datagrams »The protocol data units at the IP network layer) u (Not to be confused with UDP datagrams) »The protocol data units at the UDP transport layer are also called datagrams

5 5 IP Addressing Introduction u IP address: 32-bit identifier for host or router interface u Interface: connection between host or router and a physical link »Routers typically have multiple interfaces »Host may have multiple interfaces (typically not) »IP addresses are associated with an interface, not the host or router 223.1.1.1 223.1.1.2 223.1.1.3 223.1.1.4 223.1.2.9 223.1.2.2 223.1.2.1 223.1.3.2 223.1.3.1 223.1.3.27 223.1.3.2 = 11011111 00000001 00000011 00000010 223 12 3

6 6 IP Addressing Host address v. Network addresses u IP address: »Network part (high order bits) »Host part (low order bits) u What’s a network? »The set of devices that can communicate with each other without an intervening router  The devices attached to the same physical network »From an IP address perspective its:  The set of device interfaces with IP addresses having a common network part 223.1.1.1 223.1.1.2 223.1.1.3 223.1.1.4 223.1.2.9 223.1.2.2 223.1.2.1 223.1.3.2 223.1.3.1 223.1.3.27 Ethernet

7 7 IP Addressing Host address v. Network addresses u A network is the set of hosts reachable without having to traverse a router »Detach each interface from router or host »Create “islands” of isolated networks 223.1.1.1 223.1.1.3 223.1.1.4 223.1.2.2 223.1.2.1 223.1.2.6 223.1.3.2 223.1.3.1 223.1.3.27 223.1.1.2 223.1.7.0 223.1.7.1 223.1.8.0223.1.8.1 223.1.9.1 223.1.9.2 Note: single point-to-point link is an (IP) network

8 8 IP Addressing Class-based addressing u Class A addresses »128 networks »65,536 to 2 24 hosts u Class B addresses »16,384 networks »256 to 65,536 hosts u Class C addresses »2 21 networks »less than 256 hosts u Class D addresses »28-bit multicast addresses »No origin or network information is encoded 1 0 1 2 3 4 8 16 24 31 110 multicast address 0 0 1 2 3 4 8 16 24 31 net id 1 0 1 2 3 4 8 16 24 31 0 net id 1 0 1 2 3 4 8 16 24 31 10 net id (IP addresses 224.0.0.0 through 239.255.255.255) host id (IP addresses 1.0.0.0 through 127.255.255.255) (IP addresses 128.0.0.0 through 191.255.255.255) (IP addresses 192.0.0.0 through 223.255.255.255)

9 9 IP Addressing Classless Inter Domain Routing (CIDR) u Class-based addressing »Inefficient use of address space, address space exhaustion »e.g., class B network allocated enough addresses for 64K hosts, even if only 300 hosts in that network u Classless addressing »Network portion of address has an arbitrary length »Address format: a.b.c.d/x, where x is the number of bits in network portion of address; called the network mask  Used only in routing tables, not IP datagram source/destination 11001000 00010111 00010000 00000000 200.23.16.0 / 23 Network part Host part

10 10 IP addresses How are IP addresses assigned? u The network address is assigned by the ISP »Hosts portion only; all hosts share the same network portion u Host address »Static assignment:  Configuration parameter (manually) set during system installation 223.1.1.1 223.1.1.3 223.1.1.4 »Dynamic assignment at boot/wake-up time  DHCP: Dynamic Host Configuration Protocol:  Host broadcasts a “DHCP discover” message  DHCP server responds with a “DHCP offer” message  Host requests IP address: “DHCP request” message  DHCP server sends address: “DHCP ack” message 223.1.1.2 DCHP Server

11 11 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 0001011 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 IP addresses How are network addresses assigned? u ISPs obtain a block of addresses from ICANN ( Internet Corporation for Assigned Names and Numbers) »ICANN allocates IP address blocks, manages DNS, (used to assign domain names), resolves disputes u ISPs subdivide their block among their customers

12 12 223.1.1.1 223.1.1.2 223.1.1.3 223.1.1.4 223.1.2.9 223.1.2.2 223.1.2.1 223.1.3.2 223.1.3.1 223.1.3.27 A B E Routing IP Datagrams Example IP Datagram misc fields source IP addr dest IP addr data u All routing is based on the IP destination address field in the IP header u IP destination address (and data fields) never change! »Delivery to intermediate hops involves link-layer addresses Dest. Net. next router Nhops 223.1.1/24 - 1 *(default) 223.1.1.4 2 Routing table in A

13 13 223.1.1.1 223.1.1.2 223.1.1.3 223.1.1.4 223.1.2.9 223.1.2.2 223.1.2.1 223.1.3.2 223.1.3.1 223.1.3.27 A B E Routing IP Datagrams Routing to a local destination misc fields 223.1.1.1223.1.1.3 data u An application on A generates an IP datagram addressed to B »The IP layer on A looks up the network address of B... »And determines that B is on same network as A (223.1.1) u A’s link layer sends the IP datagram directly to B inside link-layer frame »B and A are assumed to be connected to the same physical network Dest. Net. next router Nhops 223.1.1/24 - 1 *(default) 223.1.1.4 2 Routing table in A

14 14 223.1.1.1 223.1.1.2 223.1.1.3 223.1.1.4 223.1.2.9 223.1.2.2 223.1.2.1 223.1.3.2 223.1.3.1 223.1.3.27 A B E Routing IP Datagrams Routing to a remote destination u Host A generates an IP datagram addressed to E »The IP layer on A looks up up network address of E (223.1.2) »A determines that E is NOT on same network as A »A’s routing table shows router 223.1.1.4 as the default for all networks u A’s link layer sends IP datagram to router inside link-layer frame misc fields 223.1.1.1223.1.2.2 data Dest. Net. next router Nhops 223.1.1/24 - 1 *(default) 223.1.1.4 2 Routing table in A

15 15 223.1.1.1 223.1.1.2 223.1.1.3 223.1.1.4 223.1.2.9 223.1.2.2 223.1.2.1 223.1.3.2 223.1.3.1 223.1.3.27 A B E Routing IP Datagrams Routing to a remote destination Routing table in router network router Nhops interface 223.1.1/24 - 1 223.1.1.4 223.1.2/24 - 1 223.1.2.9 223.1.3/24 - 1 223.1.3.27 Dest. next u A’s datagram addressed to E arrives at the router »The router looks up network address of E (223.1.2) »E has the same network address as router’s interface 223.1.2.9 »Router is directly attached to the same network (223.1.2) as E u Router’s link layer sends the datagram to 223.1.2.2 inside a link-layer frame via interface 223.1.2.9 »Datagram arrives at 223.1.2.2 misc fields 223.1.1.1223.1.2.2 data

16 16 Routing IP Datagrams NetMasks $ ifconfig eth0 Link encap:Ethernet HWaddr 00:06:5B:F3:34:7F inet addr:152.2.128.80 Bcast:152.2.255.255 Mask:255.255.0.0 inet6 addr: fe80::206:5bff:fef3:347f/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:59314376 errors:0 dropped:0 overruns:0 frame:0 TX packets:7659872 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:401871884 (383.2 MiB) TX bytes:2309337676 (2.1 GiB) Interrupt:193

17 17 Hierarchical addressing Route aggregation “Send me anything with addresses beginning 200.23.16.0/20” 200.23.16.0/23 200.23.18.0/23 200.23.30.0/23 FlyByNightISP Organization 0 Organization 7 Internet Core Organization 1 ISPsRUs “Send me anything with addresses beginning 199.31.0.0/16” 200.23.20.0/23 Organization 2...... G G G G u Hierarchical addressing allows efficient specification of routing information by gateway routers 4 billion possible Internet addresses!

18 18 Hierarchical addressing Specific routes 200.23.16.0/23200.23.18.0/23200.23.30.0/23 FlyByNightISP Organization 0 Organization 7 Organization 1 ISPsRUs “Send me anything with addresses beginning 199.31.0.0/16 or 200.23.18.0/23” 200.23.20.0/23 Organization 2...... G G G G “Send me anything with addresses beginning 200.23.16.0/20” u Q: If Organization 1 moves to ISPsRUs how will Internet core routers choose a route to Organization 1? »A: Use “longest prefix match” on network part of IP destination address Internet Core

19 19 Longest Prefix Matching Prefix To Match Port/Interface 11001000 00010111 00010 0 11001000 00010111 00011000 1 11001000 00010111 00011 2 otherwise 3 Destination Address: 11001000 00010111 00011000 10101010 Examples (given destination IP address, forward to which interface?) Destination Address: 11001000 00010111 00010110 10100001 ?? Destination Address: 11001000 00010111 00011001 10101010 ?? Destination Address Range Port/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

20 20 Datagram Routing and Transmission IP datagram encapsulation (Ethernet) u Sending interface adapter encapsulates IP datagram (or other network layer protocol packet) in an Ethernet frame IP header data TCP header user data IP Datagram TCP Segment Link layer addresses (not same as IP addresses) CRC Preamble Destination Address Source Address CRCData 8 bytes6 bytes 46 to 1500 bytes4 bytes 2 bytes Type

21 21 ver length 32 bits Data (variable length, typically a TCP segment or UDP datagram) Internet checksum time to live 32 bit source IP address head. len type of service protocol type 32 bit destination IP address Options (if any) Datagram Routing and Transmission IP datagram format IP protocol version Header length (bytes) Maximum number of remaining hops (decremented at each router) For fragmentation/ reassembly Total IP datagram length (bytes) Transport layer protocol to receive payload (UDP, TCP) Network layer service requested E.g.: Timestamp, record route taken, specify routing path, etc. 16-bit identifier flgs fragment offset

22 22 IP Datagrams Fragmentation & Reassembly u Network links have a maximum frame size »Called the maximum transmission unit (MTU) »Different link types, different MTUs u Large IP datagrams must be “fragmented” to link MTU sizes »One IP datagram becomes several IP datagrams as it transits networks »“Fragments” reassembled only at the final destination u All fragments carry the same IP identification number »All fragments (except the last) have the fragment bit set Reassembly... Fragmentation

23 23 IP Fragmentation and Reassembly Ethernet MTU example ID = x offset = 0 fragment = 0 length = 4000 ID =x offset =0 fragment =1 length =1500 ID =x offset =1480 fragment =1 length =1500 ID =x offset =2960 fragment =0 length =1040 One large IP datagram becomes several smaller IP datagrams Each IP datagram encapsulated in one Ethernet frame u Consider a 3,980 byte message sent in an FDDI frame u The message generates 3 fragments when it transits an Ethernet »How much application data is in each fragment? IP datagram (20 byte IP header + 3,980 byte TCP segment) encapsulated in one FDDI frame


Download ppt "1 COMP 431 Internet Services & Protocols The IP Internet Protocol Jasleen Kaur April 21, 2016."

Similar presentations


Ads by Google