cs144 Midterm Review Fall 2010
Administrivia Lab 3 in flight. Due: Thursday, Oct 28 Midterm is this Thursday, Oct 21 (during class) Remember Grading Policy: - Exam grade = max (final, (final + midterm)/2) - Final grade will be computed as: max(2 exam + lab, exam + 2 lab) 3
Computer Networks Interconnected computers that move information The Internet: - the network of networks - (try) to deliver information from one host to another - Best Effort - The End to End Principle
Protocol Layering 7 6 5 4 3 2 1 Application Presentation Session Transport Network Link Physical
Example Encapsulation Sending Receiving Application data Transport header IP header Link layer header
Addressing Each node typically has unique address - (or at least is made to think it does when there is shortage) Each layer can have its own addressing - Link layer: e.g., 48-bit Ethernet address (interface) - Network layer: 32-bit IP address (node) - Transport layer: 16-bit UDP/TCP port (service)
Physical Layer (Layer 1) Specifies the physical medium (e.g. Cat5, WiFi) Specifies the signal (physics to data (chips)) Specifies the bits (chips to bits) Pre L Data
Link Layer (Layer 2) Single-hop addressing (e.g. Ethernet address) Media Access Control - Link-layer congestion control - Collision detection/collision avoidance Single-hop acknowledgements Preamble 7 x 10101010 Physical Link Layer 3 Link SFD 10101011 Src Dest Type/ Len Payload 6 bytes 6 bytes 2 bytes 46-1500 bytes CRC 4 bytes Gap 96 ns, 960 ns, 9600 ns
Network Layer (Layer 3) Narrow waist of IP Glue lower-level networks unreliable, best-effort Packet forwarding Routing protocols FTP HTTP NV TFTP TCP UDP IP NET 1 NET 2 NET n
IPv4 packet format
Network Layer: IP Addressing Globally unique (or made to seem that way) Originally had Class prefixes Now, CIDR blocks (ip addr + prefix length) IPv4, IPv6 ICMP: Internet Control Message Protocol ARP: Address Resolution Protocol
Network Layer: IP Forwarding Passing packets from input to output ports Pick output port based on destination addr - Find out-port or out-port, MAC addr pair - Longest Prefix Matching Switches (shared bus, crossbar, Banyan)
Network Layer: IP Routing Process of populating forwarding table Routers exchange messages about network Find a route for every destination Intra-domain vs Inter-domain routing - Intra-: routers within an Autonomous System (AS) - Inter-: decentralized, the entire internet. Two kinds of Routing Protocols: - Link State: global view of network (OSPF) - Distance Vector: only local state (RIP)
Transport Layer (Layer 4) Provide multiplexing at the host Error detection UDP and TCP new narrow waist
Transport Layer: UDP user datagram protocol Unreliable and unordered Checksum on whole packet (+ pseudo header) No flow control, No Reliability
Transport Layer: TCP tansmission control protocol Full duplex, connection-oriented byte stream Provides: - Reliability - In Order - Flow control - Congestion control
Application Layer (Layer 7) Sockets (just like files) HTTP, FTP, BitTorrent, Skype, etc.
Practice Problems Practice Midterm (posted on website) Book (questions at the end of each chapter) Some next up!
Question 1 Suppose Host A sends two TCP segments back to back to Host B over a TCP connection. The first segment has sequence number 90; the second has sequence number 110. How much data is in the first segment? Suppose that the first segment is lost but the second segment arrives at B. What will the ACK number be in the acknowledgment that Host B sends to Host A?
Answer 1 How much data is in the first segment? 20 bytes. Bytes 90-109 are in the first segment. What will the ACK number be in the acknowledgment that Host B sends to Host A? 90. TCP might buffer the second packet, but the ACK is still requesting the first segment. (In order requirement)
Question 2 A 10-port hub is connected to 10 hosts using gigabit links. What is the maximum aggregate transfer rate of data flowing through this network?
Answer 2 A 10-port hub is connected to 10 hosts using gigabit links. What is the maximum aggregate transfer rate of data flowing through this network? All ports are part of the same collision domain only one device can send at a time. Therefore, peak bandwidth is one gigabit
Question 3: Routing with CIDR IP Address Netmask Next hop Interface 0.0.0.0 0.0.0.0 5.10.1.1 eth0 12.1.0.0 255.255.0.0 12.1.0.1 eth1 12.1.1.0 255.255.255.0 12.1.1.1 eth2 12.1.1.200 255.255.255.255 12.1.1.200 eth3 What is the longest prefix matching for: 12.1.1.200 12.1.0.20 128.12.92.53
Answer 3: Routing with CIDR IP Address Netmask Next hop Interface 0.0.0.0 0.0.0.0 5.10.1.1 eth0 12.1.0.0 255.255.0.0 12.1.0.1 eth1 12.1.1.0 255.255.255.0 12.1.1.1 eth2 12.1.1.200 255.255.255.255 12.1.1.200 eth3 What is the longest prefix matching for: 12.1.1.200 12.1.1.200/32 12.1.0.20 12.1.1.0/24 128.12.92.53 0.0.0.0/0
Question 4: Fragmentation When an IP packet needs to traverse a link with a lower MTU, it can be fragmented. Does fragmenting increase or reduce the likelihood of dropping the packet? Consider sending a 2100 byte datagram over a link with MTU of 700 bytes. How many fragments are generated? What fields are changed in the IP frame?
Answer 4: Fragmentation Does fragmenting increase or reduce the likelihood of dropping the packet? Increases it. Each fragment can be dropped independently of the others, yet the packet needs all fragments to be reconstructed. How many fragments are generated? 700 MTU = 680b of data + 20b IP header. = 3.08, so at least 4 fragments. 2100 680 What fields are changed in the IP frame? Total Length, More flag, Fragment Offset, Checksum Identifier field is not changed, but used to reconstruct packet.
Question 5: Distance Vector