CS 145A Implementation Issues Netlab.caltech.edu/course.

Slides:



Advertisements
Similar presentations
CS 145A Case Study: Simplified BGP Finite State Machine Netlab.caltech.edu/course.
Advertisements

Internet Control Protocols Savera Tanwir. Internet Control Protocols ICMP ARP RARP DHCP.
Communication Protocols II Ninth Meeting. TCP/IP family.
CS3505 The Internet and Info Hiway transport layer protocols : TCP/UDP.
Socket Programming.
1 Java Networking – Part I CS , Spring 2008/9.
Chapter 5 – Big Picture Dr. V.T. Raja Oregon State University.
Leon-Garcia & Widjaja: Communication Networks Copyright ©2000 The McGraw Hill Companies The user clicks on a link to indicate which document is to be retrieved.
1 Review of Important Networking Concepts Introductory material. This module uses the example from the previous module to review important networking concepts:
COS 338 Day DAY 16 Agenda Capstone Proposals Overdue 3 accepted, 3 in mediation Capstone progress reports still overdue I forgot to mark in calendar.
Defining Network Protocols Application Protocols –Application Layer –Presentation Layer –Session Layer Transport Protocols –Transport Layer Network Protocols.
1 CS4550 Computer Networks II Socket Interface Ref: Feit Chap 21 Tanenbaum Chap 6.
TCP/IP Tools Lesson 5. Objectives Skills/ConceptsObjective Domain Description Objective Domain Number Using basic TCP/IP commands Understanding TCP/IP3.6.
Chapter Overview TCP/IP Protocols IP Addressing.
1 Review of Important Networking Concepts Introductory material. This slide uses the example from the previous module to review important networking concepts:
CS 356 Systems Security Spring Dr. Indrajit Ray
1 TCP/IP architecture A set of protocols allowing communication across diverse networks Out of ARPANET Emphasize on robustness regarding to failure Emphasize.
Lecture 8 Modeling & Simulation of Communication Networks.
IST 228\Ch3\IP Addressing1 TCP/IP and DoD Model (TCP/IP Model)
Hands-On Microsoft Windows Server 2003 Networking Chapter Three TCP/IP Architecture.
Chapter 17 Networking Dave Bremer Otago Polytechnic, N.Z. ©2008, Prentice Hall Operating Systems: Internals and Design Principles, 6/E William Stallings.
70-291: MCSE Guide to Managing a Microsoft Windows Server 2003 Network Chapter 3: TCP/IP Architecture.
Socket Lab Info. Computer Network. Requirement Use TCP socket to implement a pair of programs, containing a server and a client. The server program shall.
1 ELEN602 Lecture 2 Review of Last Lecture Layering.
PA3: Router Junxian (Jim) Huang EECS 489 W11 /
Network Communications Technology Chapter 19 Internet Architecture and TCP/IP.
Examining TCP/IP.
Computer Networks (CS 132/EECS148) General Networking Example Karim El Defrawy Donald Bren School of Information and Computer Science University of California.
CS/EE 145A Reliable Transmission over Unreliable Channel Netlab.caltech.edu/course.
The complete picture Linux Network Management. End to End Connection Being able to describe the end to end connection sequence is a useful thing Very.
Link Layer 5-1 Link layer, LAN s: outline 5.1 introduction, services 5.2 error detection, correction 5.3 multiple access protocols 5.4 LANs  addressing,
Chapter 9 & 10 TCP/IP. TCP/IP Model Application Transport Internet Internet Access.
1 John Magee 11 July 2013 CS 101 Lecture 11: How do you “visit” a web page, revisted Slides adapted from Kurose and Ross, Computer Networking 5/e Source.
1 CSC111H Client-Server: An Introduction Dennis Burford
ICOM 6115©Manuel Rodriguez-Martinez ICOM 6115 – Computer Networks and the WWW Manuel Rodriguez-Martinez, Ph.D. Lecture 26.
1 TCP/IP Internetting ä Subnet layer ä Links stations on same subnet ä Often IEEE LAN standards ä PPP for telephone connections ä TCP/IP specifies.
1 Introductory material. This module illustrates the interactions of the protocols of the TCP/IP protocol suite with the help of an example. The example.
Computer Networks Chapter 2: Applications and Layered Architectures.
1 Networking Chapter Distributed Capabilities Communications architectures –Software that supports a group of networked computers Network operating.
5: Link Layer Part Link Layer r 5.1 Introduction and services r 5.2 Error detection and correction r 5.3Multiple access protocols r 5.4 Link-Layer.
1 TCP/IP, Addressing and Services S. Hussain Ali M.S. (Computer Engineering) Department of Computer Engineering King Fahd University of Petroleum and Minerals.
TCP/IP Honolulu Community College Cisco Academy Training Center Semester 2 Version 2.1.
Link Layer5-1 Synthesis: a day in the life of a web request  journey down protocol stack complete!  application, transport, network, link  putting-it-all-together:
4061 Session 25 (4/17). Today Briefly: Select and Poll Layered Protocols and the Internets Intro to Network Programming.
Chapter 23: ARP, ICMP, DHCP CS332, IS333 Spring 2014.
CSE 6590 Department of Computer Science & Engineering York University 111/9/ :26 AM.
1 Chapter 8 – TCP/IP Fundamentals TCP/IP Protocols IP Addressing.
70-291: MCSE Guide to Managing a Microsoft Windows Server 2003 Network, Enhanced Chapter 3: TCP/IP Architecture.
Client/Server Socket Programming Project
Socket Programming.
1 Bus topology network. 2 Data is sent to all computers, but only the destination computer accepts 02608c
CS 101 – Nov. 23 Communication, continued LANs –Bus (ethernet) communication –Token ring communication How the Internet works: TCP/IP.
Advanced UNIX programming Fall 2002, lecture 16 Instructor: Ashok Srinivasan Acknowledgements: The syllabus and power point presentations are modified.
Computer Communication: An example What happens when I click on
Transmission Control Protocol (TCP) Internet Protocol (IP)
CS 145A Protocols Netlab.caltech.edu/course. Misc. Extension Extension Textbooks Textbooks.
Network Basics CS490 - Security in Computing Copyright © 2005 by Scott Orr and the Trustees of Indiana University.
A Local Area Network Chat Client ITTC LAN CHAT John Vincent Cecogo Jerikho Daguno Ardee Santos Elaine Mendoza Anjomar Pat Del Mindo Philip John Sales Philip.
- 1 - DPNM Review of Important Networking Concepts J. Won-Ki Hong Dept. of Computer Science and Engineering POSTECH Tel:
The OSI Model. Understanding the OSI Model In early 1980s, manufacturers began to standardize networking so that networks from different manufacturers.
TCP/IP PROTOCOL UNIT 6. Overview of TCP/IP Application FTP, Telnet, SMTP, HTTP.. Presentation Session TransportHost-to-HostTCP, UDP NetworkInternetIP,
Client-server communication Prof. Wenwen Li School of Geographical Sciences and Urban Planning 5644 Coor Hall
IST 201 Chapter 11 Lecture 2. Ports Used by TCP & UDP Keep track of different types of transmissions crossing the network simultaneously. Combination.
SOCKET PROGRAMMING Presented By : Divya Sharma.
A quick intro to networking
Lecture 6: TCP/IP Networking By: Adal Alashban
Network Architecture Introductory material
Internet Control Message Protocol (ICMP)
Review of Important Networking Concepts
1 TRANSMISSION CONTROL PROTOCOL / INTERNET PROTOCOL (TCP/IP) K. PALANIVEL Systems Analyst, Computer Centre Pondicherry University, Puducherry –
Presentation transcript:

CS 145A Implementation Issues Netlab.caltech.edu/course

Topics of this thread How does the TCP/IP work? (roughly) How does the TCP/IP work? (roughly) (Very) Simple & basic tools on network engineering (Very) Simple & basic tools on network engineering Design and implementation of protocols Design and implementation of protocols

Mail lists CS145class.cs.caltech.edu CS145class.cs.caltech.edu CS145ta.cs.caltech.edu CS145ta.cs.caltech.edu

Today The topology of Internet The topology of Internet Naming Naming Packet transmission Packet transmission Stream Connection Stream Connection

What does the Internet look like? Example: (/sbin/traceroute) Example: (/sbin/traceroute) C:\>tracert cwis.usc.edu Tracing route to cwis.usc.edu [ ] 1 <1 ms Jorgensen-RSM-44.caltech.edu [ ] 2 <1 ms Booth-border.ilan.caltech.edu [ ] 3 <1 ms CalREN-Caltech.caltech.edu [ ] 4 <1 ms JPL--CIT.POS.calren2.net [ ] 5 1 ms UCLA--JPL.POS.calren2.net [ ] 6 1 ms ISI--UCLA.POS.calren2.net [ ] 7 2 ms USC--ISI.POS.calren2.net [ ] 8 3 ms rtr43-c2-gw.usc.edu [ ] 9 2 ms rtr-gw-1.usc.edu [ ] 10 2 ms cwis.usc.edu [ ]

Topology of the Network

Global Network (From Quest)

Get your “ IDs ” on-line Example: (/sbin/ifconfig) Example: (/sbin/ifconfig) C:\>ipconfig – all Physical Address : A4-79-F0-32 IP Address : Subnet Mask :

Use of the IDs Application TCP/UDP IP MAC Physic

The Journey of a packet (1) Application : Send [MSG] to “ : 5001 ” UDP IP MAC Physic

The Journey of a packet (1) Application : Send [MSG] to “ : 5001 ” UDP UDP header + [MSG] Send to IP MAC Physic

The Journey of a packet (1) Application : Send [MSG] to “ : 5001 ” UDP UDP header + [MSG] Send to IP IP header + UDP header + [MSG] Send to (from routing table) Send to 00:90:6D:E7:D4:00 (from ARP) MAC Physic

The Journey of a packet (1) Application : Send [MSG] to “ : 5001 ” UDP UDP header + [MSG] Send to IP IP header + UDP header + [MSG] Send to (from routing table) Send to 00:90:6D:E7:D4:00 (from ARP) MAC MAC header + IP + UDP + [MSG] Physic

The Journey of a packet (1) Application : Send [MSG] to “ : 5001 ” UDP UDP header + [MSG] Send to IP IP header + UDP header + [MSG] Send to (from routing table) Send to 00:90:6D:E7:D4:00 (from ARP) MAC MAC header + IP + UDP + [MSG] Physic Send to the Ethernet

The Journey of a packet (1) >

The Journey of a packet (2) IP MAC Physic Get a packet From Ethernet It ’ s for 00:90:6D:E7:D4:00. That ’ s me. I should accept it.

The Journey of a packet (2) IP MAC “ OK, I am 00:90:6D:E7:D4:00 ” Pass the packet to IP Physic Get a packet from ethernet for : 00:90:6D:E7:D4:00

The Journey of a packet (2) IP [IP] Header: From to “ ” “ Should go to next router: ” MAC “ OK, I am 00:90:6D:E7:D4:00 ” Pass the packet to IP Physic Get a packet from ethernet for: 00:90:6D:E7:D4:00

The Journey of a packet (2) IP [IP] Header: From to “ ” “ Should go to next router: ” Send to zz:zz:zz:zz:zz:zz (from ARP) MAC Physic

The Journey of a packet (2) IP [IP] Header: From to “ ” “ Should go to next router: ” Send to zz:zz:zz:zz:zz:zz (from ARP) MAC MAC header + IP + UDP + [MSG] Physic

The Journey of a packet (2) IP [IP] Header: From to “ ” “ Should go to next router: ” Send to zz:zz:zz:zz:zz:zz (from ARP) MAC MAC header + IP + UDP + [MSG] Physic Send to zz:zz:zz:zz:zz:zz

The Journey of a packet (2) >

The Journey of a packet (n) >

The Journey of a packet (n) Application “ I want to receive something on port 5001 ” UDP Listening to the port 5001 IP MAC Physic

The Journey of a packet (n) Application UDP Listening to the Port 5001 IP MAC Physic Get a packet from ethernet for yy:yy:yy:yy:yy:yy

The Journey of a packet (n) Application UDP Listening to the Port 5001 IP MAC “ Yes, I am yy:yy:yy:yy:yy:yy ” Pass the packet to IP Physic Get a packet From ethernet for yy:yy:yy:yy:yy:yy

The Journey of a packet (n) Application UDP Listening to port 5001 IP From to :5001 “ Yes, I am ” “ Is there any program listening to this port? ” “ Yes. One UDP is waiting. Pass it to UDP ” MAC “ Yes, I am yy:yy:yy:yy:yy:yy ” Pass the packet to IP Physic Get a packet From ethernet for yy:yy:yy:yy:yy:yy

The Journey of a packet (n) Application Receive message from UDP Pass to Application IP From to “ Yes, I am ” “ Is there any program waiting for it? ” “ Yes. One application is waiting. Pass it to UDP ” MAC “ Yes, I am yy:yy:yy:yy:yy:yy ” Pass the packet to IP Physic Get a packet From Ethernet For yy:yy:yy:yy:yy:yy

Overview

Necessary Information (1) Where shall I pass the packet, for a given destination IP address? – Routing Table Where shall I pass the packet, for a given destination IP address? – Routing Table Exmaple: Exmaple: route DestinationGatewayGen-maskFlagsInterface * UEth * Ulo default UFEth0

Necessary Information (2) Where shall I pass the packet, for a given destination IP address? -- Arp Where shall I pass the packet, for a given destination IP address? -- Arp Exmaple: Exmaple: arp -a at 00:06:5B:DE:C5:72 on eth at 00:60:B0:7C:E8:02 on eth at 00:A0:C9:5A:26:6D on eth at 00:E0:81:02:7F:7B on eth at 00:00:0C:07:AC:01 on eth at 00:90:6D:E7:D4:00 on eth at 00:20:78:1B:13:2C on eth at 00:A0:C9:06:2F:2A on eth0

More Information (Bonus) Get your phone book (Domain Name Service). Get your phone book (Domain Name Service). Example: Example: ping login.cs.caltech.edu PING orchestra.cs.caltech.edu ( ) from : 56(84) bytes of data. freebsd- login.cs.caltech.edu ( ) API: API:gethostbyname()

How does DNS work?

Connection

Streamless Connection ApplicationSocket_send/receiveDNS UDP UDP send/receive IP Routing (IP / ARP) MAC Ethernet or other LAN Physic Electronic/Optical signals

Stream Connection ApplicationSocket_send/receiveDNS TCP How to establish/maintain a connection? IP Routing (IP / ARP) MAC Ethernet/Token Ring or other direct links Physic Electronic/Optical signals

Stream Connection An Example: At: Call: DMV An Example: At: Call: DMV Prerequisite: Prerequisite: You know the number of DMV ( ) You know the number of DMV ( ) The service is now open at DMV. The service is now open at DMV. There is a link between the two phones. There is a link between the two phones.

Stream Connection Steps at your site: Establish the phone Establish the phone Dial the number Dial the number Select the service Select the service Talk Talk Hang up Hang up Steps at DMV: Establish the phone Establish the service on phone Accept your request Talk Hang Up An Example: At: Call: DMV An Example: At: Call: DMV

Stream Connection Steps at DMV: Establish the phone Establish the phone Establish the service on phone Establish the service on phone Accept your request Accept your request Talk to you Talk to you Hang Up Hang Up Steps at your site: Establish the phone Establish the phone Dial the number Dial the number Select the service Select the service Talk to the representative Talk to the representative Hang up Hang up

Stream Connection Steps at client’s site: Establish the socket Establish the socket Dial the number Dial the number Select the service Select the service Talk to the representative Talk to the representative Hang up Hang up Steps at server’s site: Establish the socket Establish the service Accept your request Talk to you Hang Up Steps at DMV: Establish the phone Establish the phone Establish the service on phone Establish the service on phone Accept your request Accept your request Talk to you Talk to you Hang Up Hang Up Steps at your site: Establish the phone Establish the phone Dial the number Dial the number Select the service Select the service Talk to the representative Talk to the representative Hang up Hang up

Stream Connection Steps at client’s site: Establish the socket Establish the socket Dial the number Dial the number Select the service Select the service Talk to the representative Talk to the representative Hang up Hang up Steps at server’s site: Establish the socket Bind socket to port & Listen Accept your request Talk to you Hang Up Steps at client’s site: Establish the socket Establish the socket Dial the number Dial the number Select the service Select the service Talk to the representative Talk to the representative Hang up Hang up Steps at server’s site: Establish the socket Establish the socket Establish the service on phone Establish the service on phone Accept your request Accept your request Talk to you Talk to you Hang Up Hang Up

Stream Connection Steps at client’s site: Establish the socket Establish the socket connect the address ( IP connect the address ( IP + port ) + port ) Talk to the representative Talk to the representative Hang up Hang up Steps at server’s site: Establish the socket Bind socket to a port & Listen Accept your request Talk to you Hang Up Steps at client’s site: Establish the socket Establish the socket Dial the number Dial the number Select the service Select the service Talk to the representative Talk to the representative Hang up Hang up Steps at server’s site: Establish the socket Establish the socket Bind socket to a port & Listen Bind socket to a port & Listen Accept your request Accept your request Talk to you Talk to you Hang Up Hang Up

Stream Connection Steps at client’s site: Establish the socket Establish the socket connect the address ( IP connect the address ( IP + port ) + port ) Talk Talk Hang up Hang up Steps at server’s site: Establish the socket Bind socket to a port & Listen Accept the request from client Talk to you Hang Up Steps at client’s site: Establish the socket Establish the socket connect the address ( IP connect the address ( IP + port ) + port ) Talk to the representative Talk to the representative Hang up Hang up Steps at server’s site: Establish the socket Establish the socket Bind socket to a port & Listen Bind socket to a port & Listen Accept your request Accept your request Talk to you Talk to you Hang Up Hang Up

Stream Connection Steps at client’s site: Establish the socket Establish the socket connect the address ( IP connect the address ( IP + port ) + port ) Send/Receive Data Send/Receive Data Hang up Hang up Steps at server’s site: Establish the socket Bind socket to a port & Listen Accept the request from client Send/Receive Data Hang Up Steps at client’s site: Establish the socket Establish the socket connect the address ( IP connect the address ( IP + port ) + port ) Talk Talk Hang up Hang up Steps at server’s site: Establish the socket Establish the socket Bind socket to a port & Listen Bind socket to a port & Listen Accept the request from client Accept the request from client Talk to you Talk to you Hang Up Hang Up

Stream Connection Steps at client’s site: Establish the socket Establish the socket connect the address ( IP connect the address ( IP + port ) + port ) Send/Receive Data Send/Receive Data Hang up Hang up Steps at server’s site: Establish the socket Bind socket to a port & Listen Accept the request from client Send/Receive Data Hang Up Steps at client’s site: Establish the socket Establish the socket connect the address ( IP connect the address ( IP + port ) + port ) Send/Receive Data Send/Receive Data Hang up Hang up Steps at server’s site: Establish the socket Establish the socket Bind socket to a port & Listen Bind socket to a port & Listen Accept the request from client Accept the request from client Send/Receive Data Send/Receive Data Hang Up Hang Up

Insight (from LinuxForum)

CS 145A Lab 1 Connection Netlab.caltech.edu/course

How to establish a connection? UDP UDP Steps at client’s site: Establish the socket Establish the socket Send Data to the address ( IP Send Data to the address ( IP + port ) + port ) Close the socket Close the socket Steps at server’s site: Establish the socket Establish the socket Bind socket to a port Bind socket to a port Receive Data Receive Data Close the socket Close the socket

How to establish a connection? TCP TCP Steps at client’s site: Establish the socket Establish the socket connect the address ( IP connect the address ( IP + port ) + port ) Send/Receive Data Send/Receive Data Close the socket Close the socket Steps at server’s site: Establish the socket Establish the socket Bind socket to a port & Listen Bind socket to a port & Listen Accept the request from client and create a new socket for communication Accept the request from client and create a new socket for communication Send/Receive Data on the new socket Send/Receive Data on the new socket Close the socket Close the socket

Tasks for Lab 1 Be familiar with the basic commands that we talked about in class (see those examples in the lecture). Be familiar with the basic commands that we talked about in class (see those examples in the lecture). Write a program ( “ server ” ) that can act as a Server Write a program ( “ server ” ) that can act as a Server Write a program ( “ udp client ” ) that can send UDP packets Write a program ( “ udp client ” ) that can send UDP packets Write a program ( “ tcp client ” ) that can send TCP packets Write a program ( “ tcp client ” ) that can send TCP packets

Server accept TCP connections in one port accept TCP connections in one port The server should “ talk ” with the clients. That is, the server return the same contents as the client sends to it. If the client does not send anything in 10 seconds, the server should actively disconnect the connection. The server should “ talk ” with the clients. That is, the server return the same contents as the client sends to it. If the client does not send anything in 10 seconds, the server should actively disconnect the connection. The server is able to “ talk ” with 5 different clients at the same time. The server should not keep more than 5 clients at the same time. The server is able to “ talk ” with 5 different clients at the same time. The server should not keep more than 5 clients at the same time.

Server accept UDP packets in one port (may be different from the TCP) accept UDP packets in one port (may be different from the TCP) The server should talk to the clients. The server should talk to the clients. The input format: Server Server (port 1 is for TCP, port2 is for UDP)

Tcp client send a message to the server, wait for several seconds, then disconnect. send a message to the server, wait for several seconds, then disconnect. Input format: tcpclient tcpclient is a number indicating the seconds the client should wait before disconnection. is a number indicating the seconds the client should wait before disconnection.

Udp client send a message to the server send a message to the server Input format: udpclient udpclient

Tips For the unknown commands, use “ man ” / “ info ” /Richard Stevens ’ book For the unknown commands, use “ man ” / “ info ” /Richard Stevens ’ book Testing: you can use “ telnet ” to test the server, use the server to test the clients. Testing: you can use “ telnet ” to test the server, use the server to test the clients. How to implement the “ disconnection after 10-sec? ” How to implement the “ disconnection after 10-sec? ” 1. Child-process 2. “ select ” 3. …

Submission (due Oct 18 th ) Task 1: route.txt arp.txt ifconfig.txt traceroute.txt Task 2: server.c; server.txt Task 3: udpclient.c; udpclient.txt Task 4: tcpclient.c; tcpclient.txt Mailto: (Do NOT send to ) Documents:  How to use the program: compile, run …  Your design, your testing, the problems you met  Any other comments

Grading Correctness (70%) Correctness (70%) Documentation and comments (20%) Documentation and comments (20%) Program style (10%) Program style (10%) TA Hours Tue: 20:00 ~22:00 JRG 154 / 170 Tue: 20:00 ~22:00 JRG 154 / 170 Thu: 20:00 ~22:00 JRG 154 / 170 Thu: 20:00 ~22:00 JRG 154 / 170