1 / 196

Reference Notes on TCP/IP

Reference Notes on TCP/IP. Internetworking. Interconnection of 2 or more networks forming an internetwork, or internet. LANs, MANs, and WANs. Different networks man different protocols. TCP/IP, IBM’s SNA, DEC’s DECnet, ATM, Novell and AppleTalk (for LANs).

lamare
Download Presentation

Reference Notes on TCP/IP

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Reference Notes on TCP/IP

  2. Internetworking • Interconnection of 2 or more networks forming an internetwork, or internet. • LANs, MANs, and WANs. • Different networks man different protocols. • TCP/IP, IBM’s SNA, DEC’s DECnet, ATM, Novell and AppleTalk (for LANs). • Also, satellite and cellular networks.

  3. Example Internet LAN-WAN- LAN 802.5 LAN R 802.3 LAN 802.3 LAN 802.4 LAN X.25 WAN B R R LAN- WAN LAN-LAN R Gateway: device connecting 2 or more different networks. SNA WAN

  4. Gateways • Repeaters: operate at physical layer (bits); amplify/regenerate signal. • Bridges: store-and-forward frames; data link layer devices. • Routers: operate at network layer. • Transport gateways: connect networks at the transport layer. • Application gateways: connect 2 parts of an application at application layer.

  5. How do networks differ? • Service offered: connection-oriented versus connection-less. • Protocols: IP, IPX, AppleTalk, DECnet. • Addressing: flat (802) versus hierarchical (IP). • Maximum packet size. • Quality of service. • Error control: reliable, ordered, unordered delivery. • Flow control: sliding window versus rate-based. • Congestion control: leaky bucket, choke packets. • Security: privacy rules, encryption. • Parameters: different timeouts.

  6. Types of Internetworks • Connection-oriented concatenation of VC subnets. • VC between source and router closest to destination network. • Router builds V to gateway to other subnet. • Gateway keeps state about that VC. • Builds VC to router in the next subnet, etc. • Every packet traverses same path. • Ordered delivery. • Routers convert between packet formats.

  7. Connection-oriented concatenation • VC between source and router closest to destination network. • Router builds VC to gateway to other subnet. Gateway keeps state about VC. • Gateway builds VC to router in the next subnet, etc. • Every packet traverses same path. • Ordered delivery. • Routers convert between packet formats.

  8. Connectionless Internetworking • Datagram model. • Different packets may take different routes. • Separate routing decision for each packet. • No ordered delivery guarantees.

  9. Datagram versus VC Internets • VC: • Plus’s: resources reserved in advance, ordered delivery, short headers. • Minus’s: vulnerability to failures, less adaptive, hard if involving datagram subnet. • Datagram: • Plus’s: more robust and adaptive, can be used over datagram subnets (many LANs, mobile networks). • Minus’s: Longer headers, unordered delivery.

  10. Tunneling • Interconnecting through a “foreign” subnet. Tunnel Ethernet 2 Ethernet 1 G G WAN IP IP IP Ethernet frame Ethernet frame IP packet inside payload field of WAN packet.

  11. Internetwork Routing 1 • 2-level hierarchy: • Routing within each network: interior gateway protocol. • Routing between networks: exterior gateway protocol. • Within each network, different routing algorithms can be used. • Each network is autonomously managed and independent of others: autonomous system (AS).

  12. Internetwork Routing 2 • Typically, packet starts in its LAN. Gateway receives it (broadcast on LAN to “unknown” destination). • Gateway sends packet to gateway on the destination network using its routing table. If it can use the packet’s native protocol, sends packet directly. Otherwise, tunnels it.

  13. Fragmentation 1 • Network-specific maximum packet size. • Width of TDM slot. • OS buffer limitations. • Protocol (number of bits in packet length field). • Maximum payloads range from 48 bytes (ATM cells) to 64Kbytes (IP packets).

  14. Fragmentation 2 • What happens when large packet wants to travel through network with smaller maximum packet size? Fragmentation. • Gateways break packets into fragments; each sent as separate packet. • Gateway on the other side have to reassemble fragments into original packet. • 2 kinds of fragmentation: transparent and non-transparent.

  15. Transparent Fragmentation • Small-packet network transparent to other subsequent networks. • Fragments of a packet addressed to the same exit gateway, where packet is reassembled. • OK for concatenated VC internetworking. • Subsequent networks are not aware fragmentation occurred. • ATM networks (through special hardware) provide transparent fragmentation: segmentation.

  16. Problems with Transparent Fragmentation • Exit gateway must know when it received all the pieces. • Fragment counter or “end of packet” bit. • Some performance penalty but requiring all fragments to go through same gateway. • May have to repeatedly fragment and reassemble through series of small-packet networks.

  17. Non-Transparent Fragmentation • Only reassemble at destination host. • Each fragment becomes a separate packet. • Thus routed independently. • Problems: • Hosts must reassemble. • Every fragment must carry header until it reaches destination host.

  18. Keeping Track of Fragments 1 • Fragments must be numbered so that original data stream can be reconstructed. • Tree-structured numbering scheme: • Packet 0 generates fragments 0.0, 0.1, 0.2, … • If these fragments need to be fragmented later on, then 0.0.0, 0.0.1, …, 0.1.0, 0.1.1, … • But, too much overhead in terms of number of fields needed. • Also, if fragments are lost, retransmissions can take alternate routes and get fragmented differently.

  19. Keeping Track of Fragments 2 • Another way is to define elementary fragment size that can pass through every network. • When packet fragmented, all pieces equal to elementary fragment size, except last one (may be smaller). • Packet may contain several fragments.

  20. Keeping Track of Fragments 3 • Header contains packet number, number of first fragment in the packet, and last-fragment bit. 1 byte Last-fragment bit 27 0 1 A B C D E F G H I J (a) Original packet with 10 data bytes. Number of first fragment Packet number 27 0 0 A B C D E F G H 27 8 1 I J (b) Fragments after passing through network with maximum packet size = 8 bytes.

  21. The Internet Network Layer • The Internet as a collection on networks or autonomous systems (ASs). • Hierarchical structure. Transcontinental US backbone Transcontinental links links European backbone Regional network National network

  22. IP (Internet Protocol) • Glues Internet together. • Common network-layer protocol spoken by all Internet participating networks. • Best effort datagram service: • No reliability guarantees. • No ordering guarantees.

  23. IP • Transport layer breaks data streams into datagrams; fragments transmitted over Internet, possibly being fragmented. • When all packet fragments arrive at destination, reassembled by network layer and delivered to transport layer at destination host.

  24. IP Versions • IPv4: IP version 4. • Current, predominant version. • 32-bit long addresses. • IPv6: IP version 6 (aka, IPng). • Evolution of IPv4. • Longer addresses (16-byte long).

  25. IP Datagram Format • IP datagram consists of header and data (or payload). • Header: • 20-byte fixed (mandatory) part. • Variable length optional part.

  26. IP Header 32 bits Header length Type of service Version Total length U D M Identification Fragment offset TTL Protocol Header checksum Source address Destination address Options

  27. IP Header Fields 1 • Version: which IP version datagram uses. • Header length: how long (in 32-bit words) is header; minimum=5; maximum=15 (options=40 bytes). • Type of service: precedence (priority), 3 flags (delay, throughput, reliability). In practice, routers ignore type of service. • Total length: length of total datagram, i.e., header + data (max = 64Kbytes).

  28. IP Header Fields 2 • Identification: which datagram fragment belongs to. • U: unused bit. • D: don’t fragment. • M: more fragments. • Fragment offset: position of fragment in datagram. • TTL: datagram lifetime.

  29. IP Header Fields 3 • Protocol: number of the transport protocol that generated the datagram. • Header checksum: verifies header integrity; computed at each hop. • Source and destination address: IP addresses of source and destination. • Options: way of extending the protocol.

  30. Addressing • Required for packet delivery. • Each network may use different addressing scheme. • Addresses must be unique. • Flat addresses: physical addresses (e.g., Ethernet address). • Hierarchical addresses: use hierarchy scheme like postal addresses (e.g., IP).

  31. Address Types • Unicast: uniquely distinguishes a single node. • Multicast: shared by a group of nodes. • Broadcast: shared by all nodes.

  32. IP Addresses • Every host and router on the Internet must have an IP address. • 2-level hierarchy: • Network number. • Host number. • Notations: • Binary: 10000000 00000110 11110000 00000011 • Dotted decimal: 128.6.240.3

  33. IP Address Formats 1 • 4 different classes: Network Host 0XXXXXXX Class A: 128 nets. 16M hosts/net. Class B: 16K nets. 64K hosts/net. Class C: 2M nets. 256 hosts/net. Class D: Multicast. 10XXXXXX XXXXXXXX 110XXXXX XXXXXXXX XXXXXXXX 1110XXXX XXXXXXXX XXXXXXXX XXXXXXXX

  34. IP Address Formats 2 • Class A: 1~127. • Class B: 128~191. • Class C: 192~223. • Class D: 224~239.

  35. Multi-addresses • A router usually has more than one IP address. • Multi-homed host: host with multiple network interfaces each of which has different IP address. 236.240.128.0 129.98.0.0 236.240.128.3 129.98.95.1 80.0.0.0 80.0.0.8

  36. Management and Scalability 1 • Network numbers assigned by single authority: NIC (network information center). • All hosts in a network must have same network number. • What if networks grow?

  37. Management and Scalability 2 • Example: company starts with 1 class C LAN, thus can connect up to 256 hosts. • It might grow to more than 256 hosts. • It might get more LANs. • For every new LAN, need new network number from NIC. • Moving machines between LANs needs address change.

  38. Subnetting 1 • Split address space into several “internal” subnets. • Still act like single network to outside world. • Example: Class B address. Class B: 16K nets. 64K hosts/net 10XXXXXX XXXXXXXX HHHHHHHH HHHHHHHH 10XXXXXX XXXXXXXX SSSSSSHH HHHHHHHH Class B with subnetting: 62 LANs, 1022 hosts each. 1st. subnet: 130.50.4.1 2nd. subnet: 130.50.8.1

  39. Subnetting 2 • Routing: hierarchical. • (network, -) entries: distant networks hosts. • (this network, host) entries: local hosts. • Routers only need to keep track of other networks and local hosts. • With subnetting: • (network, -) entries: distant networks hosts. • (this network, subnet, -). • (this network, this subnet, host). • Adds extra hierarchical level => smaller RTs.

  40. Subnet Mask • Used to compute the subnet number; i.e., gets rid of the host number. • Facilitates routing table look-up. • IP address AND subnet mask = subnet # • Example: 10XXXXXX XXXXXXXX SSSSSSHH HHHHHHHH 11111111 11111111 11111100 00000000 Ex: 130.50.15.6 AND subnet mask = 130.50.12.0, which is subnet 3.

  41. Internet Control Protocols • IP carries data. • There are other network layer protocols that carry control information. • Example: ICMP, ARP, RARP, BOOTP.

  42. ICMP • Internet Control Message Protocol. • Report specific events. • Generated by routers. • Encapsulated in IP packets.

  43. ICMP Messages Destination unreachable Packet couldn’t be delivered Time exceeded TTL field hit 0 Parameter problem Invalid header field Source quench Choke packets Redirect Route problem Echo request Check if destination is up Echo reply Destination responds Timestamp request Same as echo request + TS Timestamp reply Same as echo reply + TS

  44. Mapping IP to DLL Address • Internet applications refer to hosts by their IP addresses; once packet gets to destination LAN, node needs to figure out the destination DLL address. • One solution is to have configuration file. • Hard to maintain/update. • Address Resolution Protocol (ARP): • Run by every node to map IP to DLL address (RFC 826).

  45. ARP • Advantage: • Easy to administer, less human intervention. • Example: 2 hosts on the same Ethernet want to communicate. • Host 1 must figure out host 2’s Ethernet address. • Host 1 broadcasts ARP packet on Ethernet asking for the Ethernet address of host 2. • Host 2 receives the ARP request, and replies with its Ethernet address.

  46. ARP Optimizations • Caching of ARP replies. • Entries may have large TTLs. • When sending ARP request, piggyback its own IP-DLL address mapping. • Every machine broadcasts its mapping at boot time. • No response is expected. • Other machines cache that information.

  47. Proxy ARP • What if host 1 wants to send data to host 3 on a different LAN? • Router connecting the 2 LANs can be configured to respond to ARP requests for the networks it interconnects: proxy arp. • Another solution is for host 1 to recognize host 3 is on remote network and use default LAN address that handles all remote traffic; that could be the router’s Ethernet address.

  48. RARP • Reverse Address Resolution Protocol. • Given LAN address, what’s the IP address? • Usually for booting diskless workstation. • Gets the OS image from remote file server. • Same image for all machines. • Machine broadcasts its LAN address. • Remote RARP server responds with machine’s IP address.

  49. BOOTP • RARP broadcasts are not forwarded by routers. • Need RARP server on every network. • BOOTP uses UDP messages that are forwarded by routers. • Also provides additional information such as IP address of file server holding OS image, subnet mask, etc.

  50. Internet Routing • IGPs and EGPs • IGPs: routing within ASs. • EGPs: routing between ASs.

More Related