1 CS 352- Spring 2007 TA: Tuan Phan Email: [email protected]@cs.rutgers.edu 732-445-6450...

25
1 CS 352- Spring 2007 TA: Tuan Phan Email: [email protected] 732-445-6450 (ext 9644) : Just leaving msg( prefer using Email) Recitation: Th 8:10 – 9:00 PM @ ARC 107 Office Hour: Th 7:00 – 8:00 PM @ Hill 367 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

Transcript of 1 CS 352- Spring 2007 TA: Tuan Phan Email: [email protected]@cs.rutgers.edu 732-445-6450...

Page 1: 1 CS 352- Spring 2007 TA: Tuan Phan Email: tphan@cs.rutgers.edutphan@cs.rutgers.edu 732-445-6450 (ext 9644) : Just leaving msg( prefer using Email) Recitation:

1

CS 352- Spring 2007

TA: Tuan PhanEmail: [email protected]

732-445-6450 (ext 9644) : Just leaving msg( prefer using Email)

Recitation: Th 8:10 – 9:00 PM @ ARC 107Office Hour: Th 7:00 – 8:00 PM @ Hill 367

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

Page 2: 1 CS 352- Spring 2007 TA: Tuan Phan Email: tphan@cs.rutgers.edutphan@cs.rutgers.edu 732-445-6450 (ext 9644) : Just leaving msg( prefer using Email) Recitation:

2

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

Page 3: 1 CS 352- Spring 2007 TA: Tuan Phan Email: tphan@cs.rutgers.edutphan@cs.rutgers.edu 732-445-6450 (ext 9644) : Just leaving msg( prefer using Email) Recitation:

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

Page 4: 1 CS 352- Spring 2007 TA: Tuan Phan Email: tphan@cs.rutgers.edutphan@cs.rutgers.edu 732-445-6450 (ext 9644) : Just leaving msg( prefer using Email) Recitation:

4

What will be in recitations

• Summary of lectures

• Sample Questions

• Projects

• More technical stuff

Page 5: 1 CS 352- Spring 2007 TA: Tuan Phan Email: tphan@cs.rutgers.edutphan@cs.rutgers.edu 732-445-6450 (ext 9644) : Just leaving msg( prefer using Email) Recitation:

5

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 …

Page 6: 1 CS 352- Spring 2007 TA: Tuan Phan Email: tphan@cs.rutgers.edutphan@cs.rutgers.edu 732-445-6450 (ext 9644) : Just leaving msg( prefer using Email) Recitation:

6

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

Page 7: 1 CS 352- Spring 2007 TA: Tuan Phan Email: tphan@cs.rutgers.edutphan@cs.rutgers.edu 732-445-6450 (ext 9644) : Just leaving msg( prefer using Email) Recitation:

7

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

Page 8: 1 CS 352- Spring 2007 TA: Tuan Phan Email: tphan@cs.rutgers.edutphan@cs.rutgers.edu 732-445-6450 (ext 9644) : Just leaving msg( prefer using Email) Recitation:

8

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 TelnetB EthernetC User Datagram ProtocolD Category-5 Twisted PairE Internet ProtocolF Point-to-Point ProtocolG Tranmission Control Protocol

Page 9: 1 CS 352- Spring 2007 TA: Tuan Phan Email: tphan@cs.rutgers.edutphan@cs.rutgers.edu 732-445-6450 (ext 9644) : Just leaving msg( prefer using Email) Recitation:

9

Internet Architecture

FTP HTTP RTP TFTP

TCP UDP

IP

Ethernet 802.11 PPP

CAT-5 Single-ModeFiber

RS-232

Page 10: 1 CS 352- Spring 2007 TA: Tuan Phan Email: tphan@cs.rutgers.edutphan@cs.rutgers.edu 732-445-6450 (ext 9644) : Just leaving msg( prefer using Email) Recitation:

10

Network programming in JavaTCP/IP stack

Application Protocol

Transport Protocols (UDP and TCP)

ApplicationLayer

TransportLayer

NetworkLayer

Host-to-Net Layer

Host A Host B

ApplicationLayer

TransportLayer

NetworkLayer

Host-to-Net Layer

NetworkLayer

Host-to-Net Layer

NetworkLayer

Host-to-Net Layer

IPIP IP

Data

Data

TCP/UDP header

Data

TCP/UDP header

IP header

Page 11: 1 CS 352- Spring 2007 TA: Tuan Phan Email: tphan@cs.rutgers.edutphan@cs.rutgers.edu 732-445-6450 (ext 9644) : Just leaving msg( prefer using Email) Recitation:

11

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

Page 12: 1 CS 352- Spring 2007 TA: Tuan Phan Email: tphan@cs.rutgers.edutphan@cs.rutgers.edu 732-445-6450 (ext 9644) : Just leaving msg( prefer using Email) Recitation:

12

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)

Page 13: 1 CS 352- Spring 2007 TA: Tuan Phan Email: tphan@cs.rutgers.edutphan@cs.rutgers.edu 732-445-6450 (ext 9644) : Just leaving msg( prefer using Email) Recitation:

13

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.

Page 14: 1 CS 352- Spring 2007 TA: Tuan Phan Email: tphan@cs.rutgers.edutphan@cs.rutgers.edu 732-445-6450 (ext 9644) : Just leaving msg( prefer using Email) Recitation:

14

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.

Page 15: 1 CS 352- Spring 2007 TA: Tuan Phan Email: tphan@cs.rutgers.edutphan@cs.rutgers.edu 732-445-6450 (ext 9644) : Just leaving msg( prefer using Email) Recitation:

15

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

Page 16: 1 CS 352- Spring 2007 TA: Tuan Phan Email: tphan@cs.rutgers.edutphan@cs.rutgers.edu 732-445-6450 (ext 9644) : Just leaving msg( prefer using Email) Recitation:

16

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 !!!

Page 17: 1 CS 352- Spring 2007 TA: Tuan Phan Email: tphan@cs.rutgers.edutphan@cs.rutgers.edu 732-445-6450 (ext 9644) : Just leaving msg( prefer using Email) Recitation:

17

ETHERNET

• TOPOLOGY: Bus & Tree

• BUS TOPOLOGY

Host

T-Connector/TransceiverCoaxial Cable

Terminator

NIC

Send

Transfer !!

Receive

Receive

Page 18: 1 CS 352- Spring 2007 TA: Tuan Phan Email: tphan@cs.rutgers.edutphan@cs.rutgers.edu 732-445-6450 (ext 9644) : Just leaving msg( prefer using Email) Recitation:

18

ETHERNET – Tree Topology

HUB

Backbone HUB

SWITCH

BA C X Y Z

Tsend

forward

Crossover cable CAT 5-

UTP cable

straight through

cable

Page 19: 1 CS 352- Spring 2007 TA: Tuan Phan Email: tphan@cs.rutgers.edutphan@cs.rutgers.edu 732-445-6450 (ext 9644) : Just leaving msg( prefer using Email) Recitation:

19

Straight through cable & crossover cable

Fig1: Typical RJ45 Connector

Figure 2: 8 wires in RJ45 that is labeled from 1 to 8

Figure 3: Wiring for straight thru and crossover cables

Page 20: 1 CS 352- Spring 2007 TA: Tuan Phan Email: tphan@cs.rutgers.edutphan@cs.rutgers.edu 732-445-6450 (ext 9644) : Just leaving msg( prefer using Email) Recitation:

20

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

Page 21: 1 CS 352- Spring 2007 TA: Tuan Phan Email: tphan@cs.rutgers.edutphan@cs.rutgers.edu 732-445-6450 (ext 9644) : Just leaving msg( prefer using Email) Recitation:

21

Ethernet Frame Structure

• 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

MAC Dest. address

MAC Source address

Type DATA …. CRC

Page 22: 1 CS 352- Spring 2007 TA: Tuan Phan Email: tphan@cs.rutgers.edutphan@cs.rutgers.edu 732-445-6450 (ext 9644) : Just leaving msg( prefer using Email) Recitation:

22

HUB vs. SWITCH

HUB

MAC A -> MAC C

SWITCH

BA C A B C

send

DATA

Ethernet Frame

forward

B can CAPTURE the packet from A to C !!!!

send

SWITCH can learn the MACs of all nodes

B CAN’T capture the packet from A to C !!!!

Page 23: 1 CS 352- Spring 2007 TA: Tuan Phan Email: tphan@cs.rutgers.edutphan@cs.rutgers.edu 732-445-6450 (ext 9644) : Just leaving msg( prefer using Email) Recitation:

23

How to build your own network!

• NICs

• HUB or SWITCH !!!

• 2 machines can be connected by using crossover cable!!!

• Assign IP address– Static– Dynamic

Crossover cable

Page 24: 1 CS 352- Spring 2007 TA: Tuan Phan Email: tphan@cs.rutgers.edutphan@cs.rutgers.edu 732-445-6450 (ext 9644) : Just leaving msg( prefer using Email) Recitation:

DNS ProtocolExample

remus

ns-lcsr

a.root-servers.net

yale.edu

cs.yale.edu

1

2

3

4

8

7

6

5

Scenario:

remus tries toresolve an IP address forvenus.cs.yale.eduusing a recursive query

Page 25: 1 CS 352- Spring 2007 TA: Tuan Phan Email: tphan@cs.rutgers.edutphan@cs.rutgers.edu 732-445-6450 (ext 9644) : Just leaving msg( prefer using Email) Recitation:

DNS ProtocolAnother Example

remus

ns-lcsr

a.root-servers.net

yale.edu

cs.yale.edu

1 2

Scenario:

remus tries toresolve an IP address forvenus.cs.yale.eduusing an iterative query

3 4

5 6

7 8

Some servers do not supportRecursive queries