Docsity

Computer networking a topdown approach, Summaries of Computer Systems Networking and Telecommunications

Partial preview of the text

Download Computer networking a topdown approach and more Summaries Computer Systems Networking and Telecommunications in PDF only on Docsity!

Ja 2017

Sixth Edition

James F. Kurose & Keith W. Ross

Computer Networking

A Top-Down Approach

jsdf

Joost Holwerda SUMMARY – EDUCATION ONLY

  • Chapter 1 Computer Networks and the Internet Table of Contents
    • 1.1 What Is the Internet?.........................................................................................................................
    • 1.2 The Network Edge
    • 1.3 The Network Core
    • 1.4 Delay, Loss, and Throughput in Packet-Switched Networks
    • 1.5 Protocol Layers and Their Service Models
    • 1.6 Networks Under Attack
    • 1.7 History of Computer Networking and the Internet
  • Chapter 2 Application Layer
    • 2.2 The Web and HTTP
    • 2.3 File Transfer: FTP
    • 2.4 Electronic Mail in the Internet
    • 2.5 DNS—The Internet’s Directory Service
    • 2.6 Peer-to-Peer Applications
    • 2.7 Socket Programming: Creating Network Applications
    • 2.8 Summary
  • Chapter 3 Transport Layer
    • 3.2 Multiplexing and Demultiplexing
    • 3.3 Connectionless Transport: UDP
    • 3.4 Principles of Reliable Data Transfer
    • 3.5 Connection-Oriented Transport: TCP
  • FINISH THIS SECTION
    • 3.6 Principles of Congestion Control
    • 3.7 TCP Congestion Control
    • 3.8 Summary
  • Chapter 4 The Network Layer
    • 4.1 Introduction
    • 4.2 Virtual Circuit and Datagram Networks
    • 4.3 What’s Inside a Router?
    • 4.4 The Internet Protocol (IP): Forwarding and Addressing in the Internet
    • 4.5 Routing Algorithms............................................................................................................................
    • 4.6 Routing in the Internet
    • 4.8 Summary

1.3.2 Circuit Switching 27 There are two ways to moving data through a network. Circuit switching and packet switching. Circuit switching is the reserved network. The way of connecting is already laid out (calling to a restaurant so you can just sit and order). Packet switching vs circuit switching Packet switching more fair due to the sharing of transmission capacity and it’s simpler, more efficient and less costly to implement than circuit switching (more on that page 56-

  1. read it! Circuit switching is for bulk data not efficient (an average of 10 times slower!) 1.3.3 A Network of Networks 32 In the network of networks you can say the ISP is the customer and the global ISP is the provider. This is called: Network Structure 2 (Two tier). Each regional ISP connects to a tier 1 – ISP. This is the global ISP. No group officially sanctions tier 1 status. But even in some regions there is a higher ISP. Tier 3 network = ISP each city > ISP each provincial

ISP nationwide (3 ISP’s). 1.4 Delay, Loss, and Throughput in Packet-Switched Networks 35 1.4.1 Overview of Delay in Packet-Switched Networks 35 Types of delay: Process: Time required to examine the packets header and determine where to direct the packet. Queuing: As the packet waits to be transmitted onto the link. Transmission: L/R L=bits R=bits/sec. 10Mb link so R=10Mpbs. The amount of time required to push all the bits into the link. Propagation: A bit time required to from the beginning of the link to router B. The propagation speed depends on the physical medium of the link. The propagation delay is the distance between two routers divided by the propagation speed. 1.4.2 Queuing Delay and Packet Loss 39 The traffic intensity plays an important role in estimating the extent of queuing delay. Design your system so that the traffic intensity is no greater than 1. A router will drop a packet when the queue is full, thus greater than 1. The packet will be lost. 1.4.3 End-to-End Delay 42 End-to-end delay. Let’s suppose there are n-1 routers. Process delay at each router is Dproc. The propagation is Dprop. Dtrans = L/R. L=packet size. R=bits/sec. Dend-to- end=N(Dproc + Dprop + Dtrans). http://www.traceroute.org 1.4.4 Throughput in Computer Networks 44 Consider a large file from host A to host B. The instantaneous throughput is the rate at which host B receives the file (just like the download speed in Bittorent). The average throughput is the total bits send/total seconds = F/T bits/sec Rs= throughput for a file from server to router. Rc= throughput of the link between router to client. If Rs<Rc then the bit rate arrives at the client at the rate of Rs. If Rc<Rs then the router is slower in sending bits to the client, then the server to the router. The waiting queue at the router is growing. This is called bottleneck link.

1.5 Protocol Layers and Their Service Models 47 1.5.1 Layered Architecture 47 The network hardware and software organize protocols (the layers). Each protocol belongs to one of the layers. We are interested in the services that a layer offers to the layer above. Taken together, the various layer is called: protocol stack. The internet protocol stack contains: physical, link, network, transport and application layer. We take a top-down approach. Starting at the application layer. Application layer: Where network application and their application-layer protocols reside. (HTTP, SMTP, DNS) Transport layer: Transport application-layer messages between applications end points. Two transport protocols: TCP and UDP. Transport layer packet we call: segment Network layer: Responsible for moving network-layer packets (datagrams) from one host to another. Also called: the IP protocol. Link layer: The network layer relies on the link layer at each node, the network layer passes the datagram down to the link lay.er Link layer packets are called in this boos as: frames. Physical layer: Move entire frames from one network element to the next. Move individual bits within the frame from one node to the next node. 1.5.2 Encapsulation 53 Encapsulation: Figure 1. A host sends an application-layer message to another host. Then the transport makes it to a transport-layer segment. The transport passes the segment to the network layer creating a network-layer datagram. This is passed to the link-layer adding his own information and making is a link-layer frame.

Chapter 2 Application Layer 83 2.1 Principles of Network Applications 84 2.1.1 Network Application Architectures 86 The application architecture is designed by the application developer and dictates how the application is structured over the various end systems. We have a client-server architecture there is always a server. The clients make requests to the server. Example: nu.nl. Bigger application uses a datacenter to handle all the requests (google, amazon, eBay). In a P- 2 - P architecture there is minimal (or no) reliance on dedicated servers in datacenters. The data is exchanged between hosts and are called: peers (Bittorrent) 2.1.2 Processes Communicating 88 Processes on two different end-systems communicate with each other by exchanging messages. For each pair of processes, we label one of the two processes as: client and the other as: server. In p2p file sharing you can be both. Even then (in p2p) we can call one the client and the other the server. The one initiates the connection is called the client. A process sends messages into a socket. A socket interface is called: API (Application Programming Interface). In the internet, the host is identified by its IP- address. To send a message to another host you also need to know its port number. So the combination of the ip address and port number let you send messages to the right host. 2.1.3 Transport Services Available to Applications 91 We need a protocol that provide guaranteed data delivery service or reliable data transfer. One important that a transport layer protocol can provide is reliable data transfer. When a transport layer protocol doesn’t provide reliable data transfer, this must be accepted for loss-tolerant application. Application that have throughput requirements are said to be bandwidth-sensitive applications. The transport protocol can provide an application with one or more security services. Example: a transport protocol can encrypt all data transmitted by the sending process. (chapter 8) 2.1.4 Transport Services Provided by the Internet 93 Type transport services are TCP & UDP. TCP: Connection Oriented Services. The client and server exchange transport layer control information with each other before the application layer messages begin to flow AKA handshaking procedure. TCP is a reliable data transfer service. UDP: Lightweight transport protocol. This is an unreliable data transfer service. UDP provides NO guarantee that the message will even reach the receiving process. 2.1.5 Application-Layer Protocols 96 An application-layer protocol defines how an application processes running on different end systems, pass messages to each other. The protocol defines:

  • Types of messages exchanged. Request and response messages.
  • Syntax of the various messages types, such as the field in the messages and how the field are delineated.
  • Rules for determining when and how a process sends messages and responds to messages. 2.1.6 Network Applications Covered in This Book 97 Network applications. This chapter we are going to discuss five important applications:
  • Web
  • File transfer
  • Electronic mail
  • Directory service
  • P2P applications

2.2 The Web and HTTP 98 2.2.1 Overview of HTTP 98 The HTTP is the heart of the internet. Before explaining http in details, we review some Web terminology. A web page consists of objects. An object is simply a file – such as a HTML file image, java applet, video clip, etc. Most web pages consist of a base HTML file. Web browsers implement the client side of HTTP. Web servers, which implements the server side of HTTP. HTTP uses TCP as its underlying transport protocol. Client starts with the connection. Because a HTTP server maintains no information about the clients, HTTP is said to be a stateless protocol. 2.2.2 Non-Persistent and Persistent Connections 100 Non-persistent connections. Transferring a web page from server to client. The server sends the page and closes each connection after it has send the page. Round trip time is the time a packet goes from client to server and back to the client. This includes propagation delays and gueing delays. Each object in the page needs a NEW connection. Persistent connection. This is without the closing of the TCP connection (its keeping the connection open). 2.2.3 HTTP Message Format 103 HTTP messages. There a two types:

  • Request messages
  • Response messages Request: First line is called request line. The subsequent are called: header lines. 2.2.4 User-Server Interaction: Cookies 108 When connecting to a web server its creating a cookie number for you. Its saving the cookie id in a back-end database and shares it with other websites. So another website (who you may never visited) already knows who you are.

2.4 Electronic Mail in the Internet 118 User agents and Mail servers. User agents are the clients. Even a protocol is made for emailing called: SMTP (simple mail transfer protocol). Each user agent has its mailbox. If Alice cannot deliver mail to bobs server, its holding the mail for every 30 minutes to re-sent the email. No success? The server removes the message and notifies Alice. 2.4.1 SMTP 121 You sent an email > email traffels to your email server > to his/her email server > to his/her email box. 2.4.2 Comparison with HTTP 124 1 st: HTTP uses a pull protocol. Uses a pull protocol. User stores his site on a server and clients pull the sites of the servers. SMTP protocol uses push protocol. The sending server pushes the mail to another server. 2 nd: SMTP is restricted to the 7-bit ascii. HTTP does not impose this restriction. 3th: Important difference. Text and images. HTTP encapsulated each object in a HTTP response message. 2.4.3 Mail Message Format 125 ‘From: ‘ and ‘To: ‘ are required. 2.4.4 Mail Access Protocols 125 POP3 – Post Office Protocol Version 3 IMAP – Internet mail access protocol Pop3: An extremely simple mail access protocol. Opens a connection on port 110. Three phases: authorization, transaction and update.

  • Authorization: The user agent sends a username and password.
  • Transaction: User retrieves messages.
  • Update: After the client issued the quit command, ending the pop3 connection. IMAP: You download the messages to your own local machine. You can store messages in folders. With IMAP the messages are linked to the folders. Web based email examples are: Outlook.com, Gmail.com, Yahoo! Mail. 2.5 DNS—The Internet’s Directory Service 130 Hostname: google.com, nu.nl. These we can transfer to ip-addresses to make it easier for the routers. Ip-addresses contains 4 times 0-255. More on that later. But you already know ;) 2.5.1 Services Provided by DNS 131 Host aliasing: A host with complicated hostname can have more than one alias names. Mail server aliasing: The mx record shows the right email provider for the right way for the email. Load distribution: Busy sites like: cnn.com can have lots of traffic with multiple servers. This make sure the traffic is distributed between the different servers.

2.5.2 Overview of How DNS Works 133 We cannot have a centralized design because we create a single point of failure. To much traffic to handle. A distributed Database Root DNS server > .com, .org, .edu DNS servers > yahoo.com, amazon.com, pbs.org, umass.edu 2.5.3 DNS Records and Messages 139 Resource Records (RRs). Each DNS reply message carries one or more resource records. The RR is a tuple carrier the following field:

  • name
  • value
  • type
    • type=A, standard hostname-to-ip address mapping.
    • type=NS, route query’s further along in the query chain
  • ttl 2.6 Peer-to-Peer Applications 144 Bittorrent is the perfect example. 2.6.1 P2P File Distribution 145

Chapter 3 Transport Layer 185 3.1 Introduction and Transport-Layer Services 186 The transport layer provides for logical communication between application processes. The transport layer converts application layer messages into transport layer packets, known as: segments. There are two protocols for transport layer: TCP and UDP. 3.1.1 Relationship Between Transport and Network Layers 186 Consider two houses. Each with 12 children and both are family. Each kid writes to each cousin in the other house every day (note: 144 letters/day). In each house the oldest is responsible for collecting all the letters and distributing all the receiving letters. The oldest send it through the postal service to the other house. The postal service is the network layer and the job of the oldest kid is the transport layer. 3.1.2 Overview of the Transport Layer in the Internet 189 There are two protocols for the transport layer: UDP and TCP. UDP (User Datagram Protocol): unreliable, connectionless TCP (Transmission Control Protocol): reliable, connection oriented. We call the transport layer packets segments. First let's discuss some network layer terms. IP is the name of the network layer. The IP service model is best effort delivery service. It does not guarantee delivered segments. IP is said to be an unreliable service. Extendedly host-to-host to process-to-process delivery is called transport-layer multiplexing and demultiplexing. More next section. TCP provides reliable data transfer. TCP also provides congestion control. This prevent TCP connection from swamping the links and routers. More in 3.4-3. 3.2 Multiplexing and Demultiplexing 191 The job of delivering the data in a transport layer segment to the correct socket is called demultiplexing. From sockets to segments with the right header info, and passing the segments to the network layer is called multiplexing. 3.3 Connectionless Transport: UDP 198 Because UDP has no handshake is said to be connectionless. DNS is an example. UDP has no congestion control.

  • finer control over what data is sent, and when
  • no connection establishment. UDP just blast away it’s segments without any formality’s. So it’s way faster. No connection state. With TCP you need a connection between host and server. So there is always a limit with N number of connections. With UDP you do not have a connection.
  • small header. UDP has 8 bytes of header each segment and TCP 20 bytes. 3.3.1 UDP Segment Structure 202

3.3.2 UDP Checksum 202 When you take 3 16 bits’ words and sum the first two, then you sum the third word with the previous sum. Convert the last sum with 1s compliment. This becomes the checksum. So you send the 4 16bit words. If no errors are introduced into the packet, then clearly the sum at the receiver will be all 1’s. 3.4 Principles of Reliable Data Transfer 204 This section is only the case of unidirectional data transfer that is transfer from the sending to the receiving side. The case of bidirectional data transfer is conception’s no more difficult but considerably more tedious to explain. 3.4.1 Building a Reliable Data Transfer Protocol 206

  • Data over Perfectly Reliable Channel. Rdt1. The finite-state machine (FSM)
  • With bit errors is rdt2. This uses positive ACK’s and negative ACK’s (neg ack = ‘please repeat’) In a network, reliable data transfer based on such retransmission is AKA ARQ (Automatic Repeat Request) protocols.
  • Error detection. A mechanism that a user can detect when bits errors have occurred.
  • Retransmission. A packet can be retransmitted by the sender. Protocols as rdt2.0 are stop-and-wait protocols. The receiver only knows a single state. So a nak (neg ack) or ack can also be corrupted. So a lot of time goes to waiting with rtd2.0. Consider three possibilities with corrupted ack’s / nak’s.
  • we don’t know the response. So we also don’t know to resent the message.
  • 3d checksum so the receiver can repair the fallen bits himself so he does not have to retransmit.
  • resent the ack or nak. This introduces duplicates packets. The sender does not know which ack is late or a priori. So we put a sequence number. So the sender knows which ACK is for what message.

3.4.4 Selective Repeat (SR) 223 With GBN a single time out can cause all the packets to be resent. This can cost performance and ‘fill the pipeline’. Also a single packet error can cause GBN to retransmit a large number of packets. As the name suggest, selective-repeat avoid unnecessary retransmission by having the sender retransmit only those packets that is suspect were received in error at the receiver. The SR receiver will acknowledge a correctly received packet whether or not it is in order. Out-of-order packets are buffered until any missing packets are received.

3.5 Connection-Oriented Transport: TCP 230 3.5.1 The TCP Connection 231 Connection oriented. Before processes can exchange data the two need to setup the connection. ‘handshake’. A TCP connection provides a full-duplex; this is in a TCP connection data can simultaneously flow from a to b and b to a (Point-to-Point). The three-way handshake:

  • first sends special segment
  • server responses with second special segment
  • finally client responses with third special segment First two carry no payload, while the third may carry payload. The amount of data that can be grabbed and placed in a segment is limited by the maximum segment size (MSS). You can determine the MSS by first determine the length of the la FINISH THIS SECTION 3.5.2 TCP Segment Structure 233 Sequence & ACK numbers: The sequence number for a segment is therefore the first byte of a segment. Piggybacked: The ack for client-to-server data is carried in a segment carrying server-to-client data; this ack is said to be piggybacked ion the server- to-client segment. 3.5.3 Round-Trip Time Estimation and Timeout 238 Estimating RTT = (1-α)EstRTT+αSampleRTT. α is recommended to 0,125 (1/8). You also have to estimate how much SampleRTT deviates from EstRTT. DevRTT=(1-ß)DevRTT+ß|SampleRTT-EstRTT| The recommended ß=0, Now we have EstRTT&DevRTT. We can start calculating the Timeout interval = EstRTT+4*DevRTT Initial time out of 1 is recommended. At time of a timeout the interval is doubled. 3.5.4 Reliable Data Transfer 242 Always remember that IP does not guarantee delivery of the datagrams. So TCP creates a reliable data transfer service. Duplicate ACK: is an ACK that reacknowledges a segment for which the sender has already received an earlier acknowledgment. In case of three dub ACK’s TCP sender performs a fast retransmit. A mod to TCP is selective acknowledgment, it allows a TCP receiver to ack out-of-order segments. Rather than just cumulatively acking the last correct received in-order- segment. 3.5.5 Flow Control 250 TCP provides a flow-control service to eliminate the possibility of the sender overflowing the receivers buffer. This form of sender control is referred to as congestion control. TCP provides flow control by having the sender maintain the receive windows. The receiver sends back how much space there is in the buffer so the sender can adapt to it.

3.7.1 Fairness 279 Consider K TCP connection, each with different end-to-end path. All passing through a bottleneck link with transmission rate R bps. Eventually the total bandwidth used will be greater than R, thus packet loss will occur. When you repeat this, the broad bandth will be divided between the connections. 3.8 Summary 283 Still reading this silly summary? Thank you very much  UDP, simple, no-frills, only multiplexing, demultiplexing. TCP on the other hand, many ways of guaranteed delivery of segments. So much. Often the transport layer constrained by the service model of the underlying network layer protocol IP.

Chapter 4 The Network Layer 305 4.1 Introduction 306 The network layer takes segments from the transport layer, encapsulates each segment to a datagram and sends it to its nearby router. The primary role of a router is to forward datagrams from incoming link to outgoing link. 4.1.1 Forwarding and Routing 308 The role of the network layer is to move packets from a sending host to a receiving host. Two functions:

  • forwarding; The router needs to determine where to send the datagram to (the right output link) (4.3)
  • routing; The network layer needs to determine the path taken by packets as they flow from sender to receiver. Also called: routing algorithms. Every router has its forwarding table. The router forward a packet by examining the value to index into the routers forwarding table. The term packet switch will be coming back later. Some packet switchers are called; link-layer switches (chap5). The other packets switchers are called routers. Connection Setup. The network layer has a third important function: connection setup (more 4.2) 4.1.2 Network Service Models 310 The network service model defines the characteristics of end-to-end ransport of packets between sending and receiving end systems Some services that the network layer can provide are:
  • guaranteed delivery
  • guaranteed delivery with bounded delay. This is not only guaranteed delivery but even within a time frame (example;100ms) The following services could also be provided to a flow of packets.
  • In order packet delivery.
  • Guaranteed minimal bandwidth. Emulating the behavior of a transmission link of a specified bit rate. If the sending host is sending below the rate, no packets are lost, and every packet arrives with the same delay. All of them!
  • Guaranteed maximum jitter. Thus amount of time between the transmission of two successive packets at the sender is qual to the amount of time between their receipt at the destination.
  • Security services. Using a key only know for the sender and receiver you can encrypt all your traffic. The network layer decrypts the payloads. The network layer provides a single service, known as; best-efford service. Two of the more important ATM service model are:
  • CBR(Constant bit rate)
  • ABR(Available bit rate) 4.2 Virtual Circuit and Datagram Networks 313 There are some crucial difference between connection and connectionless services from the network and transport layer; The network layer provides a host-to-host connectionless service or host-to-host connection service. Not both! Computers network that provides only a connection service at the network layer are called virtual-circuit (VC) network. Computer network that provide only a connectionless service at the network layer are called datagram network.