Recitation 6 Midterm 1’s solution Project 2 IP Forwarding CIDR.

Slides:



Advertisements
Similar presentations
Everything.
Advertisements

Discussion Monday ( ). ver length 32 bits data (variable length, typically a TCP or UDP segment) 16-bit identifier header checksum time to live.
Chapter 9a Intro to Routing & Switching.  Upon completion of this chapter, you should be able to:  Explain why routing is necessary for hosts on different.
21.1 Chapter 21 Network Layer: Address Mapping, Error Reporting, and Multicasting Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction.
Communication Networks ( ) / Spring 2011 The Blavatnik School of Computer Science, Tel-Aviv University Allon Wagner.
ARP: Address Resolution Protocol
Review of Important Networking Concepts
Chapter 5 – Big Picture Dr. V.T. Raja Oregon State University.
11- IP Network Layer4-1. Network Layer4-2 The Internet Network layer forwarding table Host, router network layer functions: Routing protocols path selection.
1 Review of Important Networking Concepts Introductory material. This module uses the example from the previous module to review important networking concepts:
IP Routing: an Introduction. Quiz
TCP/IP Protocol Suite 1 Chapter 6 Upon completion you will be able to: Delivery, Forwarding, and Routing of IP Packets Understand the different types of.
Network Layer4-1 Network layer r transport segment from sending to receiving host r on sending side encapsulates segments into datagrams r on rcving side,
Network Layer4-1 Network layer r transport segment from sending to receiving host r on sending side encapsulates segments into datagrams r on rcving side,
TCP/IP Protocol Suite 1 Chapter 6 Upon completion you will be able to: Delivery, Forwarding, and Routing of IP Packets Understand the different types of.
Everything. MACIP End-host IP: MAC: 11:11:11:11:11 gateway IP: MAC: 22:22:22:22:22 Google server IP: MACIP MACInterfaceMACInterface.
Support Protocols and Technologies. Topics Filling in the gaps we need to make for IP forwarding work in practice – Getting IP addresses (DHCP) – Mapping.
TCP/IP Protocol Suite 1 Chapter 6 Upon completion you will be able to: Delivery, Forwarding, and Routing of IP Packets Understand the different types of.
Layering and the TCP/IP protocol Suite  The TCP/IP Protocol only contains 5 Layers in its networking Model  The Layers Are 1.Physical -> 1 in OSI 2.Network.
1 Linux Networking Lal Paul IP Addressing & Routing By Lal Paul Systems Administrator CIRM, CUSAT IP Addressing & Routing By Lal Paul Systems Administrator.
1 Internet Addresses (You should read Chapter 4 in Forouzan) IP Address is 32 Bits Long Conceptually the address is the pair ( NETID, HOSTID ) Addresses.
2010 Pago Pago, American Samoa IP Basics Unix/IP Preparation Course June 29, 2010 Pago Pago, American Samoa.
Network Redundancy Multiple paths may exist between systems. Redundancy is not a requirement of a packet switching network. Redundancy was part of the.
DHCP: Dynamic Host Configuration Protocol
ARP Scenarios CIS 81 and CST 311 Rick Graziani Fall 2005.
PA3: Router Junxian (Jim) Huang EECS 489 W11 /
Cisco 1 - Networking Basics Perrine. J Page 19/17/2015 Chapter 9 What transport layer protocol does TFTP use? 1.TCP 2.IP 3.UDP 4.CFTP.
1 Internet Protocol. 2 Connectionless Network Layers Destination, source, hop count Maybe other stuff –fragmentation –options (e.g., source routing) –error.
1 IP: putting it all together Part 1 G53ACC Chris Greenhalgh.
Copyright © Lopamudra Roychoudhuri
CMPT 471 Networking II Address Resolution IPv4 ARP RARP 1© Janice Regan, 2012.
CDPA 網管訓練 駭客任務 2 Ethernet Switching ARP, IP, LAN, Subnet IP Header, Routing ICMP
Sublayers Under the Network Layer: BOOTP & DHCP
Delivery, Forwarding, and Routing of IP Packets
TCOM 515 IP Routing. Syllabus Objectives IP header IP addresses, classes and subnetting Routing tables Routing decisions Directly connected routes Static.
2010 paro, bhutan IP Basics IP/ISP Services Workshop July, 2010 Paro, Bhutan.
Data Networks ISOTDAQ 2012
BAI513 - PROTOCOLS ARP BAIST – Network Management.
Basic Routing Principles V1.2. Objectives Understand the function of router Know the basic conception in routing Know the working principle of router.
1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Dynamic Host Configuration Protocol (DHCP)
2011 Dar es Salaam, Tanzania IP Basics Unix/IP Preparation Course May 29, 2011 Dar es Salaam, Tanzania.
Linux Operations and Administration Chapter Eight Network Communications.
workshop eugene, oregon IP Basics Unix/IP Preparation Course July 19, 2009 Eugene, Oregon, USA
Ethernet switch Hosts Can talk using Ethernet addresses only.
Address Resolution Protocol (ARP). Internet and Data Link Layer Addresses Each host and router on a subnet needs a data link layer address to specify.
Review of IPv4 Routing Veena S, MCA Dept, PESIT Mar 09-10, 2013.
J. Liebeher (modified by M. Veeraraghavan) 1 Introduction Complexity of networking: An example Layered communications The TCP/IP protocol suite.
BAI513 - PROTOCOLS DHCP BAIST – Network Management.
End-host IP: MAC: 11:11:11:11:11 gateway IP: MAC: 22:22:22:22:22 Google server IP: interne t interface DNS server IP:
IP Internet Protocol. IP TCP UDP ICMPIGMP ARP PPP Ethernet.
1 K. Salah Module 5.1: Internet Protocol TCP/IP Suite IP Addressing ARP RARP DHCP.
Cisco Routers Routers collectively provide the main feature of the network layer—the capability to forward packets end-to-end through a network. routers.
Behrouz A. Forouzan TCP/IP Protocol Suite, 3rd Ed.
Address Resolution Protocol (ARP)
MAC Addresses and ARP 32-bit IP address:
Remind: CEREAL account!!!
Chapter 6 – Routing.
ARP: Address Resolution Protocol
Introduction to Networking
5 Network Layer Part II Computer Networks Tutun Juhana
Net 323: NETWORK Protocols
IP Forwarding Relates to Lab 3.
CS 457 – Lecture 10 Internetworking and IP
Chapter 6 Delivery & Forwarding of IP Packets
Internetworking Outline Best Effort Service Model
Wide Area Networks and Internet CT1403
Delivery, Forwarding, and Routing of IP Packets
IP Forwarding Relates to Lab 3.
Figure 6.11 Configuration for Example 4
Figure 6.6 Default routing
Presentation transcript:

Recitation 6 Midterm 1’s solution Project 2 IP Forwarding CIDR

Project 2 Environment Expand your project 1 1 tracker, 2 seeds and 2 leeches Expand your project 1 Download from multiple peers. Be able to upload. Be able to accept incoming connections. Connect to 2 leeches and upload your available pieces to leeches.

Protocol State machine: am_choking: this client is choking the peer am_interested: this client is interested in the peer peer_choking: peer is choking this client peer_interested: peer is interested in this client bitfield: <len=0001+X><id=5><bitfield> SEND+RECV keep-alive: <length prefix> is 0 choke: <len=0001><id=0> unchoke: <len=0001><id=1> interested: <len=0001><id=2> not interested: <len=0001><id=3> have: <len=0005><id=4><piece index> request: <len=0013><id=6><index><begin><length> SEND+RECV piece: <len=0009+X><id=7><index><begin><block> SEND+RECV

Notes After handshake, seeds should send the bitfield with “all of bit 1s”. Leeches may not send “bitfields” or bitfield with “all of bit 0s” After downloading & verifying a piece, your program should advertise the piece by sending a “have” to peers. Don’t send a “have” to peers having it already.

Sample Question: Subnetting Consider a conventional class B network. A network administrator decides to give all subnets in the class B network a sub-net mask of 255.255.248.0. (5 points) How many sub-nets can the administrator use if all sub-nets use this mask? (5 points) How many hosts are possible on each sub-net? (5 points) The administrator just heard that she only needs 16 sub-nets for the class B address. What sub-net mask maximizes the number of hosts on each sub-net?

ARP (from IP add. to MAC add.) Application doesn’t know MAC address !!! Application works with IP address: ssh 128.6.171.162 (ssh cereal.rutgers.edu) ping 192.168.1.1 Recall: Ethernet Frame Structure “A” knows IP X of “C”, how can A send an ethernet frame to C? How does A know MAC of C?? MAC Dest. address MAC Source address Type DATA …. CRC Send broadcast MAC A -> FF: …FF, Type=ARP Who has IP X ???? HUB NIC -> EISA, ISA, PCI card Maybe separate into several slide !!! MAC C -> MAC A, type=ARP Hey guy, I have IP X !!! MAC A-> MAC C, type=IP IP packet A B C D

Multi-Hop Forwarding Example X sends an IP packet to Y?? 3. R2b->Y 1.X-> R1a 2. R1b->R2a a b a b R1 R2 N1 N2 N3 x Y 1. X sends to its gateway (IP of R1a) MAC X -> MAC R1a IP X -> IP Y DATA 2. R1 forwards the packet to R2 MAC R1b -> MAC R2a IP X -> IP Y DATA 3. R2 forwards the packet to Y MAC R2b -> MAC Y IP X -> IP Y DATA

Multi-Hop Forwarding Example Dest Next hop N1 N2 N3 N4 R1 Deliver directly (ARP) R3 Routing table @ R2 Actual routing table contains IP addresses, Flags indicating type of entries, net mask etc.

IP forwarding ROUTING TABLE AT A ROUTER: Destination Gateway Genmask Flags Metric Ref Use Iface 128.6.5.0 A 255.255.255.128 U 0 0 0 eth0 128.6.5.128 B 255.255.255.128 U 0 0 0 eth1 127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo 0.0.0.0 128.6.5.1 0.0.0.0 UG 0 0 0 eth0 (default) 128.6.5.1 0.0.0.0 UG 0 0 0 eth0 Question1: Packet with dest IP = 128.6.5.200, what is the next-hop (gateway)? For each entry: if ( <dest IP> AND <netmask> == <destination field>) { choose the next hop = the corresponding gateway; break; } Question2: How many networks does the router connect to?

Network programming in Java TCP/IP stack Application Layer Transport Network Host-to- Net Layer Host A Host B Application Protocol Application Layer Data Transport Protocols (UDP and TCP) Transport Layer TCP/UDP header Data IP IP IP Network Layer Network Layer Network Layer IP header TCP/UDP header Data Host-to- Net Layer Host-to- Net Layer Host-to- Net Layer

Sample Question: IP Forwarding The following table is a routing table using CIDR. Address bytes are in hexadecimal. The notation “/12” defines the length of the mask in bits. For example, for C4.50.0.0/12, the mask is 12 bits, or FF.F0.0.0 in hexadecimal notation. For each of the following destination IP addresses (in hexadecimal), state what the next hop will be by using the routing table above (2 points each): C4.4B.31.2E : C4.5E.05.09 : C4.4D.31.2E : C4.5E.03.87 : C4.5E.7E.12 : C4.5E.D1.02 : Dest. Next Hop C4.5E.2.0/23 A C4.5E.4.0/22 B C4.5E.C0.0/19 C C4.5E.40.0/18 D C4.4C.0.0/14 E C0.0.0.0/2 F 80.0.0.0/1 G default H

Reducing Routing Table Size Without CIDR: service provider 200.71.0.0 200.71.1.0 200.71.2.0 ….. 200.71.255.0 Routing table With CIDR: 200.71.0.0 200.71.1.0 200.71.2.0 ….. 200.71.255.0 service provider Routing table 200.71.0.0/16

Sample Question: CIDR The company X has 4 offices, each office has one subnet. All subnets connect to a router (Router 1 in the figure). This router connects to the ISP router. The subnets are described in the figure.

Sample Question: CIDR (cont.) A. Fill out the routing table for the router 1: Destination Netmask Nexthop Interface Eth1 Eth2 Eth3 Eth4 192.168.1.0 255.255.255.0 192.168.1.2 Eth0 0.0.0.0 192.168.1.3

Sample Question: CIDR (cont.) B. Assume that the ISP router forwards to the router 1 an IP packet that has the destination address 139.200.1.135. Which subnet will the packet be forwarded to? Based on the routing table in (1), what is the interface that the router 1 will forward the packet through? C. Assume that the ISP router implement CIDR. What is the routing entry for all subnets of the company X in the routing table of the ISP router? Destination Netmask Nexthop Interface Eth1