Modern Computer Networks 3.1 General Issues
Total Page:16
File Type:pdf, Size:1020Kb
Content 3.1 General Issues Modern Computer Networks 3.2 Data-Plane Protocols: IPv4 An Open Source Approach 3.3 Data-Plane Protocols: IPv6 34C3.4 Con tro l-Plane Prot ocol s: Add ress Management Chap ter 3It3: Interne t PtProtoco lLl Layer 3.5 Control-Plane Protocols: Error Reporting 3. 6 Control-Plane Protocols: Routing 3.7 Control-Plane Protocols: Multicast Copyright reserved 2001 (Lin & Hwang) 2 DHCP server 3.1 General Issues host NAT Server Router TCP/UDP Routing IP address Protocols Subnet ICMP Routing Default Service router Table Addressing IP ARP IP NAT IP Forwarding Routing Data Link Data Link Data Link Security Copyright reserved 2001 (Lin & Hwang) 4 Service Internetwork An example of an internetwork Provides a host-to-host transmission service Ethernet Fast Ethernet Connects several LANs into an internetwork a network of networks H1 H2 R1 R2 “Internet” GigabitEthernet the global internetwork to which most of networks R3 are connectdted H3 Wireless LAN Copyright reserved 2001 (Lin & Hwang) 5 Copyright reserved 2001 (Lin & Hwang) 6 Internet Service Model Address Connectionless A globally unique address for host Best effort delivery identification packets may be lost Data link layer: a flat address packets are delivered out of order dlitduplicate cop ies o f a pac ktket are dliddelivered Network layer: a hierarchical address packets can be delayed for a long time Next-hop forwarding based on destination address Copyright reserved 2001 (Lin & Hwang) 7 Copyright reserved 2001 (Lin & Hwang) 8 Deliver a packet Forwarding at Data Plane How to deliver a packet? Steps Routing Extract destination address Find a path from source to destination Look up destination address in routing table Done by routing protocols Obtain the outppgut interface from routing table Forwarding Forward the packet Forward packets at a router Look up the next-hop from the routing table and then forward Copyright reserved 2001 (Lin & Hwang) 9 Copyright reserved 2001 (Lin & Hwang) 10 Look uppg the routing table Routing at Control Plane Issues Task of routing Speed and memory requirement Select a path from the source to the destination Good data structure Goal of routing fast look uppp and table update Efficient (low delay , high throughput , … ) low memory requirement Scalable Classical approaches Sta ble Trie Robust Hash Fast lookup table Fair Hardware implementation Copyright reserved 2001 (Lin & Hwang) 11 Copyright reserved 2001 (Lin & Hwang) 12 IP routing Multicast Hop-by-hop routing DfiitiDefinition o f a mu lticas t Option: source routing Communication between a group of hosts Packets are sent to all group members Shortest path routing Issues Available information Group membership Global information vs. local information receivers of a multicast session Information exchange Multicast tree construction Multiple point-to-point connections or a multicast tree Floodingg( (broadcast) vs. neig hbors only A multicast tree connects the source node to all destination nodes Copyright reserved 2001 (Lin & Hwang) 13 Copyright reserved 2001 (Lin & Hwang) 14 Security of IP Aspects on the network security User-Plane Protocols and Access Control Control who has the rights to access MhiMechanisms Data Security Encrypt messages transmitted Intrusion Detection 3. 2 Internet Protocol Detect illegal break in 3.3 Internet Protocol Version 6 Copyright reserved 2001 (Lin & Hwang) 15 Copyright reserved 2001 (Lin & Hwang) 16 IP Address 3.2 Internet Protocol A globally unique 32-bit address to identify a network interface A hierarchical address consists of network id and host id Addressing A router usually has more than one Subnetting interface and one address Forwarding A host may have more than one address Packet format Fragmentation and re-assembly Copyright reserved 2001 (Lin & Hwang) 17 Copyright reserved 2001 (Lin & Hwang) 18 IP Address Notation Class-ful IP Address 140.123.1.1 = 10001100 01111011 00000001 00000001 bits 0 1 2 3 4 8 16 24 31 1.0.0.0 to 140 123 1 1 Class A 0 Network Host 127.255.255.25 IP address notation 128.0.0.0 to Class B 1 0 Network Host 191.255.255.25 order transmitted in networks order stored in memory 192.0.0.0 to Class C 1 1 0 Network Host 223.255.255.25 Big Endian Big Endian 224.0.0.0 to 10001100 01111011 00000001 00000001 Class D 1 1 1 0 Multicast address 10001100 01111011 00000001 00000001 239.255.255.25 240.0.0.0 to Class E 1 1 1 1 Reserved 255. 255.255 .25 Little Endian 00000001 00000001 10001100 01111011 Copyright reserved 2001 (Lin & Hwang) 19 Copyright reserved 2001 (Lin & Hwang) 20 Reserved IP Addresses IP Subnet Host id = 0 Network address uniquely identifies a denotes the network itself physical network Host id = F…F A physical network consists of several LANs broadcast address of the network Subnet mask is used to identify a subnet Hosts in the same IP subnet talk directly without intervening router For example cs.ccu.edu.tw: 140.123.101.0 subnet mask: 255.255.255.0 or 140.123.101.0/24 Copyright reserved 2001 (Lin & Hwang) 21 Copyright reserved 2001 (Lin & Hwang) 22 IP Subnet Classless IP Address H2 Subnet: H1 140.123.1.2 140.123.1.0 140.123.1.1 Classful addressing: 140.123.1.250 Inefficient use of address space R1 A class B address is too large 140.123.250.1 A class C address is too small 140.123.250.2 140.123.250.3 Subnet: Scalability: too many class C routing entries R2 140.123.250.0 R3 CIDR: Classless InterDomain Routing 140.123.2.250 140.123.3.250 network portion of address of arbitrary length 140.123.2.1 140.123.2.2 140.123.3.1 H3 H4 H5 address format: a. b. c. d/x Subnet: 140.123.2.0 Subnet: 140.123.3.0 Copyright reserved 2001 (Lin & Hwang) 23 Copyright reserved 2001 (Lin & Hwang) 24 Authority IP Forwarding ICANN: Internet Corporation for Assigned Aspects of forw arding Packets from upper layer protocols Names and Numbers Packets fro m a net wo rk inte rface allocates addresses Routing table manages DNS Forwarding is based on routing table Routing entry: (Destination/SubnetMask, NextHop) assigns domain names, resolves disputes Default router: (0.0.0.0/0, default router) Copyright reserved 2001 (Lin & Hwang) 25 Copyright reserved 2001 (Lin & Hwang) 26 Packet Forwardingg( (at Host) Packet Forwardingg( (at Router) D = NetworkAddress of the destination If (NetworkAddress of the destination == My subnet address) then Look up the routing table Transmit the ppyacket directly to the destination IfthepacketistobedelieredtotheIf the packet is to be delivered to the u pperlaerpper layer Else Deliver the packet to an upper layer protocol Look up the routing table Else if the packet is to be delivered to a directly connected subnet Deliver the packet to the default router Deliver the packet directly to the destination End if Else Deliver the packet to a next hop router Check if destination is in my sbunet: End if If ((HostIP ^ DestinationIP) & SubnetMask)==0) Copyright reserved 2001 (Lin & Hwang) 27 Copyright reserved 2001 (Lin & Hwang) 28 Table Look Up Opppen Source Implementation: Packet Comes From Upper Layer Longest prefix match Search cache first; if not found, search the Organization A: 194.24.0.0/21 routing table (FIB). Organization B: 194.24.7.0/24 ip_route_output() 194.24.7.10 matches 194.24.0.0/21 (21 bits) as well as 194.24.7.0/24 (24bits) Longest prefix: 194. 24. 7. 0/24 is the right routing ip_route_ out put _ke y() entry yes no return fd?found? itttl()ip_route_output_slow() Copyright reserved 2001 (Lin & Hwang) 29 Copyright reserved 2001 (Lin & Hwang) 30 Opppen Source Implementation: Opppen Source Implementation: Routing Cache Routing Table (FIB) fib_table fn_hash fn_zone rt_hash_table chain u.rt_next fn_zones[0] fz_next fib_node fib_node rtable rtable fn_ zones[[]1] fz_ hash[[]..] fn_next fn_next fn_zones[2] chain tb_data fn_info fn_info chain fn_zone fz_next fib_nh fz_hash[..] fib_nh nh_dev fn_zone fib_ info fn_zones[32] fz_next nh_gw fn_zone_list fz_hash[..] Copyright reserved 2001 (Lin & Hwang) 31 Copyright reserved 2001 (Lin & Hwang) 32 IP Packet Format IP Packet Format (()cont.) 0 4 8 16 24 31 HdHeader Type of Version Packet Length (bytes) Length Service Version Number Identifier Flags 13-bit Fragmentation Offset Current version 4 Upper Layer Header Checksum Time-to-Live Protocol Version for next generation IP is 6 Source IP Address Header Length Destination IP Address In units of 4-byte words Options TfSi(TOS)Type of Service (TOS) Data Desired service of the packet Copyright reserved 2001 (Lin & Hwang) 33 Copyright reserved 2001 (Lin & Hwang) 34 IP TOS IP Packet Format (()cont.) New: Used as DS codepoint. Packet Length Precedence Type of Service R Total number of byy(tes (header + data) Precedence defined TOS defined in RFC 1349: Maximum is 65,535 bytes In RFC 791: 1000: minimize delay 111: network control 0100: maximize throughput Identifier 110: Internetwork control 0010: maximize reliability 101: CRITIC/ECP 0001: minimize cost Uniquely identify an IP packet 100: Flash override 0000: normal service 011: Flash 1111: maximize security Flags 010: Intermediate R 001: Priority : Reserved Low-order two bits: for fragmentation control 000: Routine First bit: do not fragment Not implemented!! Partially implemented!! Last bit: more Copyright reserved 2001 (Lin & Hwang) 35 Copyright reserved 2001 (Lin & Hwang) 36 IP Packet Format (()cont.) IP Packet Format (()cont.) Fragmentation Offset HdChkHeader Checksum Position of the fragment, measured in unit of 8 16-bit 1’s complement checksum bytes. Source Address (32 bits) Time-to-live (TTL) Destination Address (()32 bits) Used as hop limit Options Each router decrease TTL by one loose source routing, strict source routing, record route, record timestamp If TTL reaches zero, sent an ICMP message Data ULPUpper Layer Protoco l Payload from upper layers IP:0, ICMP:1, TCP:6, UDP:17 Copyright reserved 2001 (Lin & Hwang) 37 Copyright reserved 2001 (Lin & Hwang) 38 Opppen Source Implementation: IP Fraggymentation & Reassembly Checksum ip_fast_csum() function Limitation from data link layers (src/include/asm_i386/checksum.h).