CS 352- Spring 2007 TA: Tuan Phan Email: tphan@cs.rutgers.edu 732-445-6450 (ext 9644) : Just leaving msg( prefer using Email) Th 8:10 – 9:00 PM @ ARC 107 Office Hour: Th 7:00 – 8:00 PM @ Hill 367 Recitation: Extra: Email to setup appointment on Monday afternoon. Instructor’s Web Site: http://remus.rutgers.edu/cs352/F07/ TA’s Web Site: http://paul.rutgers.edu/~tphan/cs352/ Slides for recitation, Useful Links 1 Introduction • Email – Email Header: [CS352]… • Grading – Midterms: 30 % (15% each) – Project: 35% (part 1: 10%, part 2: 10% & part 3: 15%) – Final: 35 % • Homework – We won’t grade , BUT, we highly suggest you doing them 2 Important Dates • • • • • • Midterm 1: Oct 9th Project 1: Oct 15th Project 2: Nov 5th Midterm2: Nov 13th Project 3: Nov 26th Final : Dec 11 3 What will be in recitations • • • • Summary of lectures Sample Questions Projects More technical stuff 4 Tools for CS352 • PuTTy : ssh client without GUI • XManager: ssh client with GUI • WinSCP: to upload files to CEREAL clusters • Ethereal: capturing packet program • IDE: Eclipse, emacs, vi … 5 CEREAL cluster • Link: http://cereal.rutgers.edu/ – Use Linux machines; DO NOT use Sun machines (including cereal.rutgers.edu) – Java programming: • http://java.sun.com/docs/books/tutorial/ • ILab: Hill 248 – Use Rutgers ID – Transfer students: use temporary ID – Problem: meet Robert Toth @ CoRE 232 6 Sample Question 1: OSI LAYERING • Fill in the boxes with the function (1-7) and protocol (A-G) belonging to them. Layer Typical Functions Example Protocol Application Presentation Session Transport Network DataLink Physical 7 Sample Question 1(cont.) • Functions: 1 Provides reliable end-to-end communication. 2 Represent bytes as different voltages. 3 Implement communication between two applications of the same type. 5 Groups several user-level connections into a single entity. 6 Provides reliable transfer of information between two adjacent nodes. 7 Decides the route a packet will take across the network. 4 Transform between big and little endian representations. • Protocols: A Telnet B Ethernet C User Datagram Protocol D Category-5 Twisted Pair E Internet Protocol F Point-to-Point Protocol G Tranmission Control Protocol 8 Internet Architecture FTP HTTP RTP TFTP UDP TCP IP Ethernet CAT-5 802.11 Single-Mode Fiber … PPP RS-232 9 Network programming in Java TCP/IP stack Host A Host B Application Protocol Application Layer Transport Protocols (UDP and TCP) Transport Layer IP IP Data Application Layer Transport Layer TCP/UDP header Data TCP/UDP header Data IP Network Layer Network Layer Network Layer Network Layer Host-toNet Layer Host-toNet Layer Host-toNet Layer Host-toNet Layer IP header 10 Sample Question2: ENCAPSULATION Fit the following headers in the correct order in the frame provided. UDP, Ethernet, DNS and IP. If the application wants to send a payload (data) of 400 bytes to the destination and the headers are of the sizes given below, what will be the size of the entire frame as presented to the IP layer at the destination? UDP: 50bytes, Ethernet:40bytes, DNS:20 byes, IP:30bytes 11 Why DNS? • On Internet, each machine has an unique IP address, e.g, 100.100.1.201. • The IP addresses are used to communicate between 2 machines. • Human is familiar with names: www.google.com, mail.yahoo.com . • Need a mechanism to convert from name to IP address: DNS(Domain Name Service) 12 Sample Question 8: DNS • Consider the internet in the figure below, in which zones are indicated with a dashed line. There is only one DNS server per zone and it happens to have the same name as the highest node in each zone: yale.edu, cs.yale.edu, rutgers.edu, cs.rutgers.edu and root-servers.net. • The only servers supporting recursive querying are cs.yale.edu and cs.rutgers.edu. For each of the queries below, list in order all the DNS servers contacted by the resolver (located in the OS of the machine running the query). Assume there is no caching performed at any level of the hierarchy. • 13 Sample Question 8: DNS(cont.) • A. (4 points) A machine called lab1.bio.yale.edu exists in the biology department at Yale, and a user on eden.rutgers.edu launches this query: "nslookup lab1.bio.yale.edu’’ . • B. (4 points) At the prompt of paul.cs.rutgers.edu somebody launches this query: "nslookup lab1.bio.yale.edu" . • C. (4 points) Later, lab1.bio.yale.edu is assigned a new IP (but keeps the same name) and is physically moved in the science building onto a local Ethernet with other machines such as electron.eng.yale.edu and theorem.eng.yale.edu. At the prompt of eden.rutgers.edu you launch this query: "nslookup lab1.bio.yale.edu". • D. (4 points) In the science building, on lab1.bio.yale.edu, somebody queries: "nslookup paul.cs.rutgers.edu". • E. (4 points) Follow the same scenario as in part (B), but this time indicate, in order, all the queries involved in the process. Use this notation to represent a query: rutgers.edu -> rootservers.net to indicate that rutgers.edu is generating/forwarding a query to rootservers.net. 14 Homework 1. Try to do all sample questions again. 2. Set-up account on CEREAL cluster. 3. Type the code in text book, p. 151 & p155 for the 3rd version) (p. 164 & 168 for the 4th version) 1. Compile and run them in CEREAL cluster 15 Build your own network • 3 CS students live together -> How about a small network connecting to Internet??? What equipments do they need to buy?? Is it very expensive ??? • System Admin of a small company want to build a network that connect 20 machines in the company. The office locates in 2 floors of a building. What equipments does he need to buy? • HUB, switch, router … how to distinguish them? • How to “touch” the network theories in class?? – TCP/IP, DNS, HTTP – Packet capturing !!! 16 ETHERNET • TOPOLOGY: Bus & Tree • BUS TOPOLOGY NIC Coaxial Cable T-Connector/Transceiver Receive Receive Transfer !! Send Terminator Host 17 ETHERNET – Tree Topology Backbone HUB Crossover cable CAT 5UTP cable forward straight through HUB SWITCH T send A cable B C X Y Z 18 Straight through cable & crossover cable Figure 3: Wiring for straight thru and crossover cables Fig1: Typical RJ45 Connector Figure 2: 8 wires in RJ45 that is labeled from 1 to 8 19 MAC address • Network Interface Card (NIC) – Each NIC has its own MAC address , it is stored on the chip!! • Length of MAC : 48 bites = 6 bytes • For examples: 00:C1:71:01:AB:F0 – Prefix: Company ID: 3Com, Netgear … – Postfix: Serial Number • Command to show MAC: ifconfig, ipconfig 20 Ethernet Frame Structure MAC Dest. address MAC Source address Type DATA …. CRC • Type(2 bytes) specifies the network layer protocol: IP or Novel IPX or ARP or RARP… • CRC: check sum • Broadcast: – MAC Broadcast Address = FF:FF:FF:FF:FF:FF • Host A sends a msg to host B: – MAC dest = MAC B, MAC src = MAC A 21 HUB vs. SWITCH Ethernet Frame MAC A -> MAC C SWITCH can learn the MACs of all nodes DATA HUB SWITCH forward send A send B C B can CAPTURE the packet from A to C !!!! A B C B CAN’T capture the packet from A to C !!!! 22 How to build your own network! • NICs • HUB or SWITCH !!! • 2 machines can be connected by using crossover cable!!! • Assign IP address Crossover cable – Static – Dynamic 23 DNS Protocol Example remus Scenario: remus tries to resolve an IP address for venus.cs.yale.edu using a recursive query 1 8 ns-lcsr 2 7 a.root-servers.net 3 6 yale.edu 4 5 cs.yale.edu DNS Protocol Another Example remus 1 Some servers do not support Recursive queries Scenario: remus tries to resolve an IP address for venus.cs.yale.edu using an iterative query 3 5 2 ns-lcsr a.root-servers.net 4 6 yale.edu 7 8 cs.yale.edu