1 / 33

Computer Networks

Computer Networks. Text has no relevant information. What do we know about Networking?. So far we have looked at the BSD socket API discussed the basic actions that applications have to perform to communicate been aware of threads and how to use them

Download Presentation

Computer Networks

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. Computer Networks Text has no relevant information

  2. What do we know about Networking? • So far we have • looked at the BSD socket API • discussed the basic actions that applications have to perform to communicate • been aware of threads and how to use them • seen how to use semaphores to deal with problems that require the application to process more than one thing at a time

  3. Is this enough? • With respect to network programming: • Do we care how long it might take for data to arrive? • Do we care about the data arrival rate? • Are there problems unique to a network that we should care about? • How can computers be connected?

  4. Communication paths • When data is exchanged between computers it may traverse many different network types amd travel at different speeds • 100 Mb/s - local Ethernet • 1 Gb/s - local backbone (fiber) • 155 Mbs/s - OC3 leased line • 11 Mb/s - 802.11b to the laptop

  5. What’s a Network? • A network is a Collection of interconnected computers. • Depending on the number of computers and the distance between them we can form: • Local Area Networks (LAN) • cover small local area, like a home, office, or campus • are fast • can be wireless • Metropolitan Area Networks (MAN) • usually spanning a campus or a city • typically use wireless structure or optical fiber connections to link their sites. • Wide Area Networks (WAN) • cover a wide area, involve a large number of computers • usually connect LAN’s and MAN’s • Internet is a WAN

  6. Local Area Networks or • Bus: Computers are connected to a central cable (bus). Also called Ethernet. • Ring:Computers are connected into a loop. • Star:Computers are connected to a hub or a switch • most popular nowadays • Network Hub: • has ports where computers are attached • repeats the signal received at one port out each of the other ports • Network Switch: • Like a hub, but it only sends the signal to one other port

  7. Metropolitan Area Networks[Tan02]

  8. Wide Area Networks [Tan02] • Notes in the subnet are usually routers. • A router acts as a junction between two or more networks to transfer data among them. Backbone

  9. Architecture of the Internet [Tan02] • Network Access Point: huge interconnection points • Points Of Presence: connects clients to an ISP • To connect a computer to Internet, you connect it to an ISP computer via a modem.

  10. Satellite Links

  11. Distinguishing Network Characteristics • Latency - how long it takes data to get from one location to the next • Bandwidth – the amount of data that can be moved in a given unit of time • Jitter – the variability in latency • Error rate – how frequently data becomes corrupted during transmission

  12. Data transmission • Signal transmission over cables, fiber optics, or other media generates errors; Sender may have to re-send a message many times • For efficiency, messages are divided into fix-size packets before they sent • Two ways to send the packets: • Using Connectionless Service (or Datagram) • Using Connection-Oriented Service (or virtual circuit )

  13. Connection Based Service(TCP/IP) • Sending and receiving hosts establish a connection • Sender • Splits sequence of outgoing bytes into packets • Remembers sent packets in case they are lost and need to be resent • Receiver • Receives packets • Reassembles packets into a sequence of bytes • If packets don’t arrive in a given time requests the sender to retransmit them • Produces a reliable streamed delivery of data • The most common protocol supported by most OS’s is TCP/IP • TCP – Transmission Control Protocol • IP – Internet Protocol

  14. Datagram (UDP) • Not streamed – data arrives in the “chunks” that the sender sent, called datagrams • Datagrams have a maximum size • Datagrams are individually addressed • Datagrams may be lost • Datagrams may arrive out of order • No connection setup • No connection state • The most common protocol supported by most OS’s is • UDP – User Datagram Protocol

  15. Protocol • A formally agreed upon convention for performing or engaging in some sort of activity • A data communication protocol is an example of a protocol to exchange data between machines • A connection protocol describes how two machines establish a connection. (Usually a subset of a data comm. protocol)

  16. Introducing Protocol Layers • Similar idea to virtual machine • Add layers to perform various functions • Lowest layer deals with hardware • Next layer deals with moving data to the destination machine • Next layer handles correcting errors and lost data (if appropriate) and getting data to application • Last layer is the application

  17. Layering Yet Again! Application programs Operating system Hardware General Layering Structure Application Application Transport Unix I/O Network File System Link Disk Drive File System Layering Network Layering

  18. Application telnet, FTP, ssh, SMTP Transport TCP, UDP Network IP Link Ethernet, FDDI, token ring Protocol Layers Application Transport Network Link

  19. Layers of Functionality • Link – moves the data between directly connected nodes on the path to the destination • Network – used to route the data between the source/destination end points • Transport – application to application delivery • Application to application level interchanges

  20. Encapsulation • To achieve the desired functionality each layer adds “headers” to the data it receives • Headers are meant for the corresponding layer at the destination • Headers are removed at the destination layer

  21. Protocol headers Application A. Data Application data A. Data Transport TCP Header A. Data TCP Header A. Data Network IP Header TCP Header A. Data Link Ethernet Header IP Header TCP Header A. Data

  22. Protocol headers: Going Down Application A. Data Transport TCP Header A. Data Network IP Header TCP Header A. Data Link Ethernet Header IP Header TCP Header A. Data

  23. Protocol headers: Coming up Application Transport Network Link Ethernet Header IP Header TCP Header A. Data

  24. Source Port Destination Port Sequence Number Control Fields (Includes transport protocol type) Source. Ethernet Addr Type/Size Destination IP Address Options Dest Ethernet Addr Source IP Address ACK Number Additional Fields Header Contents TCP IP Ethernet

  25. Application Application Transport Transport Network Network Network Link Link Link Link Routing example Source Destination Application data TCP Header IP Header Ethernet Header 802.11G Header

  26. Routing

  27. AP1 AP2 AP3 Application Protocol 1 Application Protocol 2 Application Protocol 3 Protocol Processing TCP UDP IP Ethernet Wireless

  28. Send pkt0 pkt0 recv pkt0 Send ACK0 ACK0 recv ACK0 Send pkt1 pkt1 recv pkt1 Send ACK1 ACK1 recv ACK1 Send pkt2 pkt2 recv pkt2 Send ACK2 ACK2 recv ACK2 TCP Acknowledgement Normal Operation, no loss

  29. Send pkt0 pkt0 recv pkt0 Send ACK0 ACK0 recv ACK0 Send pkt1 pkt1 X Timeout loss Send pkt1 pkt1 recv pkt1 Send ACK1 ACK1 recv ACK0 pkt2 TCP Acknowledgement Lost Packet

  30. What if something isn’t ready? Application Application Not Ready Write() OS OS Commands to hardware Hardware Hardware

  31. Buffers • Kernel memory devoted to storing: • Data destined for hardware (comes from a process via a system call) • Data arriving for a process (comes from the hardware, notifies the kernel via an interrupt) • Deals with problems of • Process sending data faster then hardware can consume • Data arrives faster then process consumes • Permits concurrency

  32. Device ready Device ready Device ready Device ready send send send send Transmission Buffers Packets to Send Free list

  33. What if there are no buffers? • Block local sending process until there is space • Receiving data from network • Before enabling hardware to receive make sure there is space -- OR -- • Wait for data to arrive from network • If no space, immediately discard data and start receiving again

More Related