1 / 39

CS252: Systems Programming

CS252: Systems Programming. Ninghui Li Based on Slides by Prof. Gustavo Rodriguez-Rivera Topic 15: Internet Overview. History of the Internet. 1962 Galactic Network idea ( J.C.R. Licklider of MIT)

trudy
Télécharger la présentation

CS252: Systems Programming

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. CS252: Systems Programming Ninghui Li Based on Slides by Prof. Gustavo Rodriguez-Rivera Topic 15: Internet Overview

  2. History of the Internet • 1962 Galactic Network idea (J.C.R. Licklider of MIT) • Envisions a globally interconnected set of computers through which everyone could quickly access data and programs from any site • 1961-1965 Packet switching (Leonard Kleinrock at MIT • 1967 Lawrence G. Roberts publishes plan for ARPANET • 1968 Frank Heart led team at BBN to build packet switches called Interface Message Processors (IMP's)

  3. History of the Internet • 1969 ARPANET started with 2 nodes, goes to 4 nodes • 1972 email introduced • 1973- Vinton G. Cerf and Robert E. Kahn developed TCP/IP to support connecting different networks: 4 ground rules • Each distinct network stands on its own • Communications on best effort basis • Blackboxes (gateways/routers) connect networks • No global control at operation level

  4. History of the Internet • First computer virus: creeper (which year?) • World Wide Web (Tim Berners-Lee) (Which year?) • Some people attribute the increase in productivity in the last 15 years to the existence of the Internet. People produce more in less time. • A fun history of programming languages • http://james-iry.blogspot.com/2009/05/brief-incomplete-and-mostly-wrong.html

  5. Internet Architecture • The Internet is a collection of • Networks • Routers interconnecting networks • Hosts connected to networks. H H H H Network R Network R Network H H H Network H H H H

  6. Internet Architecture The networks may be implemented using different kinds of hardware: Ethernet, Token Ring, FDDI, etc. The goal of the Internet is to hide all this heterogeneity to the user and user programs. The internet is a virtual network with its own addressing and name scheme.

  7. Open Systems Interconnection (OSI) model of Networking International Standards Organization (ISO) standard Physical layer Data link layer Network layer Transport layer Session layer Presentation layer Application layer

  8. Internet Layering It reflects the layering used by the TCP/IP protocols Closer to reality than ISO/OSI- Layering - Individual Application Programs (HTTP) Application Transport - Program to Program (TCP and UDP) Internet - Packet Forwarding. Machine to Machine. (IP) - Local Area Network (Ethernet, RS232, etc) Network Interface - Basic Network Hardware Physical

  9. Network Protocols Stack Application protocol Application Application TCP protocol Transport Transport Network IP Network IP protocol IP protocol Link Network Access Link Data Link Data Link

  10. Types of Addresses in Internet • Media Access Control (MAC) addresses in the network access layer • Associated w/ network interface card (NIC) • 48 bits or 64 bits • IP addresses for the network layer • 32 bits for IPv4, and 128 bits for IPv6 • E.g., 128.3.23.3 • IP addresses + ports for the transport layer • E.g., 128.3.23.3:80 • Domain names for the application/human layer • E.g., www.purdue.edu

  11. Topic 18: Network Security Routing and Translation of Addresses • Translation between IP addresses and MAC addresses • Address Resolution Protocol (ARP) for IPv4 • Neighbor Discovery Protocol (NDP) for IPv6 • Routing with IP addresses • TCP, UDP, IP for routing packets, connections • Border Gateway Protocol for routing table updates • Translation between IP addresses and domain names • Domain Name System (DNS)

  12. IP Addressing It is an abstraction to hide the network internals. It is independent from hardware addressing. IP addresses are used for all communications. IPv4 addresses use 32 bits.

  13. IP Addressing • Important: • An IP Address does not specify a specific computer. Instead, each IP address identifies a connection between a computer and a network. • An IP address identifies a network interface. • A computer with multiple network connections (like a router) must be assigned one IP address for each connection.

  14. IP Addressing • The 32 bits are divided into two parts: • The prefix identifies a network (variable length) • The suffix identifies the host in that network. Network Number Host Number N2 H3 N1 H5 H N2 H2 N1 H1 H R N2 N1 N1 H2 H H N2 H1 N1 H3 H H N1 H4

  15. IP Addressing A global authority assigns a unique prefix for the network. A local administrator assigns a unique prefix to the hosts. The number of bits assigned to the prefix and suffix is variable depending on the size of the number of hosts in each network.

  16. Routing • The routing table tells which is the next router for delivering to any destination network. • The source of the table information can be: • Manual: • Suitable for small networks where routes never change • Automatic • Software creates/updates the routing table using information from neighboring routers. • It is needed for lager nets • It changes routes if failure.

  17. IP packetfrom A to M A: Routing Table Target Net Net/Subnet Mask Next Hop 40.0.0.0 255.0.0 Directly 128.10.3.0 255.255.255.0 40.0.0.11(R1) 128.10.5.0 255.255.255.0 40.0.0.11(R1) 128.10.4.0 255.255.255.0 40.0.0.11(R1) 216.109.112.0 255.255.255.0 40.0.0.11(R1) Default: 255.255.255.255 40.0.0.1(R3) 216.109.112.45 216.109.112.48 F E 128.10.3.9 I 128.10.5.9 216.109.112.0 40.0.0.7 216.109.112.1 H K A IP IP 128.10.3.1 128.10.5.2 R1 R2 128.10.5.0 40.0.0.0 128.10.3.0 B L 40.0.0.11 128.10.3.2 C 128.10.4.2 D 128.10.4.0 J 40.0.0.5 R3 G M 40.0.0.1 128.10.4.7 128.10.4.10 Internet 128.10.3.5 Packet addresses: Esrc=Ea, Edst=ER1, IPsrc=A, IPdst=M

  18. IP packetfrom A to M R1: Routing Table Target Net Net/Subnet Mask Next Hop 40.0.0.0 255.0.0 Directly 128.10.3.0 255.255.255.0 Directly 128.10.5.0 255.255.255.0 128.10.3.2(R2) 128.10.4.0 255.255.255.0 128.10.3.2(R2) 216.109.112.0 255.255.255.0 Directly Default: 255.255.255.255 40.0.0.1(R3) 216.109.112.45 216.109.112.48 F E 128.10.3.9 I 128.10.5.9 216.109.112.0 40.0.0.7 216.109.112.1 H K A 128.10.3.1 128.10.5.2 IP R1 R2 128.10.5.0 40.0.0.0 128.10.3.0 B L 40.0.0.11 128.10.3.2 C 128.10.4.2 D 128.10.4.0 J 40.0.0.5 R3 G M 40.0.0.1 128.10.4.7 128.10.4.10 Internet 128.10.3.5 IP: Esrc=ER1, Edst=ER2, IPsrc=A, IPdst=M

  19. IP packetfrom A to M R2: Routing Table Target Net Net/Subnet Mask Next Hop 40.0.0.0 255.0.0 128.10.3.1(R1) 128.10.3.0 255.255.255.0 Directly 128.10.5.0 255.255.255.0 Directly 128.10.4.0 255.255.255.0 Directly 216.109.112.0 255.255.255.0 128.10.3.1(R1) Default: 255.255.255.255 128.10.3.1(R1) 216.109.112.45 216.109.112.48 F E 128.10.3.9 I 128.10.5.9 216.109.112.0 40.0.0.7 216.109.112.1 H K A 128.10.3.1 128.10.5.2 R1 R2 128.10.5.0 40.0.0.0 128.10.3.0 B L 40.0.0.11 IP 128.10.3.2 C 128.10.4.2 D 128.10.4.0 J 40.0.0.5 R3 G M 40.0.0.1 128.10.4.7 128.10.4.10 Internet 128.10.3.5 IP: Esrc=ER2, Edst=EM, IPsrc=A, IPdst=M

  20. Addresses in IP packet The IP source and destination addresses of the packet remain the same during the transit of the packet. The hardware source and destination address will be different every time the packet is forwarded. The source host or some of the routers may need to send ARP requests if the hardware destination address is not in the ARP cache.

  21. Address Resolution Protocol (ARP) • Primarily used to translate IP addresses to Ethernet MAC addresses • The device drive for Ethernet NIC needs to do this to send a packet • Also used for IP over other LAN technologies, e.g. IEEE 802.11 • Each host maintains a table of IP to MAC addresses • Message types: • ARP request, ARP reply, ARP announcement

  22. http://www.windowsecurity.com

  23. DNS: Domain Name Server Humans prefer to use computer names instead of IP addresses. Example: www.yahoo.com instead of 204.71.200.68 Before DNS the mappings name to IP address where stored in a file /etc/hosts The Net administrators used to exchange updates in the /etc/hosts file. This solution was not scalable..

  24. DNS: Domain Name Server • DNS is a distributed database that translates host names to IP addresses. • Information is stored in a distributed way • Highly dynamic • Decentralized authority

  25. Topic 19: DNS Security Domain Name System • Hierarchical Name Space root edu com uk net org ca purdue indiana umich illinois wisc cs ece www

  26. Topic 19: DNS Security DNS Resolver: Recursive Resolver • Recursive resolver • Normally thought of as a “DNS server” • Accept queries from users, understand the zone hierarchy, interact with the authority servers • Cache answers From wikipedia

  27. DHCP – Dynamic Host Configuration Protocol • Allows connecting computers to the Internet without the need of an administration. • Before DHCP, an administrator had to manually configure the following parameters to add a computer to the Internet: • The local IP address – Current address • The subnet mask – Determines which hosts are in same LAN • The default router – Deliver packets to hosts outside the LAN • The default DNS server – convert names to IP addresses. • In UNIX the command used to set these parameters is ifconfig. In Windows is ipconfig or the Control Panel.

  28. Transport Protocols • Two transport protocols available in the TCP/IP family • UDP – User Datagram Protocol • TCP – Transmission Control Protocol

  29. UDP- User Datagram Protocol • Unreliable Transfer. • Packets may be dropped, received more than once, delivered out of order • Applications will need to implement their own reliability if necessary. • Minimal overhead in both computation and communication. • It is best for LAN applications. Why? • Connectionless – No initial connection necessary. No state in both ends • Useful for video conferencing, online gaming, etc.

  30. UDP- User Datagram Protocol • Message Oriented • Each message is encapsulated in an IP datagram. • Size of message is restricted by the size of the MTU of the directly connected network. (Maximum Transfer Unit =1500bytes for Ethernet networks) • The UDP header has ports that identify • Source application (Source Port) • Destination application (Destination Port)

  31. TCP – Transmission Control Protocol • It is the major transport protocol used in the Internet • It is: • Reliable – It uses acknowledgement and retransmission to accomplish reliability • Connection-Oriented - An initial connection is required. Both end points keep state about the connection. • Full-Duplex – Communication can happen in both ways simultaneously. • Stream Interface – Transfer of bytes look like writing/reading to a file.

  32. TCP Reliability • How does TCP achieves reliability? • It uses Acknowledgments and Retransmissions • Acknowledgement- • The receiver sends an acknowledgement when the data arrives. • Retransmission • The sender starts a timer whenever the message is transmitted • If the timer expires before the acknowledgement arrives, the sender retransmits the message.

  33. TCP Reliability Normal Exchange Host 1 Host 2 1.Send packet 2.Timer Starts 3.Receive pkt 1 4.Send ack 1 5.Receive ack1 6.Timer Cancel 7.Send pkt 2 9.Receive pkt 2 8.Timer Starts 10.Send ack 2 11.Receive ack2 12.Timer Cancel 13.Send pkt 3

  34. TCP Reliability Packet Lost Host 1 Host 2 3.Packet Lost 1.Send pkt 1 2.Timer Starts 4.Timer Expires 5.Send pkt1 6.Timer Starts 7.Receive pkt 1 8.Send ack 1 9.Receive ack1 10. Timer Cancel 11.Send pkt 2 12.Timer Starts 13.Receive pkt 2

  35. TCP Reliability Ack Lost Host 1 Host 2 1.Send pkt 1 2.Timer Starts 3.Receive pkt 1 4.Send ack 1 5.Ack Lost 6.Timer Expires 7.Send pkt1 8.Timer Starts 9.Receive pkt 1 10.Send ack1 11.Receive ack1 12. Timer Cancel 13.Send pkt 2 14.Timer Starts 15.Receive pkt 2

  36. TCP Summary of Features • 1. Adaptive Retransmission • The retransmission timer is set to RTT+4*RTTVAR where RTT is estimated. This allows TCP work in slow and fast networks. • 2. Cumulative Acknowledgments • An acknowledgment is for all the bytes received so far without holes and not for every packet received. • 3. Fast Retransmission • It is a heuristic where a duplicated acknowledgment for the same sequence is signal of a packet lost. The data is retransmitted before the timer expires.

  37. TCP Summary of Features • 4. Flow Control • It slows down the sender if the receiver is running out of buffer space. The window (receiver’s buffer size) is sent in every acknowledgment. • 5. Congestion Control • For TCP a lost packet is signal of congestion. • Instead of aggressively retransmit, it will slow down the retransmission. It will use first “Slow Start” and then a “Congestion Avoidance” where the window of retransmitted data is reduced in size.

  38. TCP Summary of Features • 6. Reliable Connection and Shutdown • TCP uses a Three way Handshake to close connections. • Three packets are enough to make sure that lost packets or host crashes will not interfere future connections.

  39. When to Use UDP or TCP • If you need reliable communication in your application use TCP. • Only use UDP in the following cases: • Broadcasting: that is the computer needs to reach all or part of the computers in the local network. • Example: Find out of the existence of a server (Example DHCP, or finding a printer). • Multicasting data to several machines simultaneously. • Real Time Data: Applications where packets arriving on time with minimum delay is more important than reliability where retransmission can add to the delay. • Example: Voice over IP, teleconferencing.

More Related