CPS110: Networks Landon Cox March 20, 2008. Network hardware reality  Lots of different network interface cards (NICs)  3Com/Intel, Ethernet/802.11x.

Slides:



Advertisements
Similar presentations
Lecture 2 Protocol Layers CPE 401 / 601 Computer Network Systems slides are modified from Dave Hollinger.
Advertisements

Internet -- network of networks –network delivers packets (& locates nodes) –router (gateway) moves packets between networks –IP interoperability on top.
Networking Theory (Part 1). Introduction Overview of the basic concepts of networking Also discusses essential topics of networking theory.
CS335 Networking & Network Administration Tuesday, May 11, 2010.
Networks 1 CS502 Spring 2006 Network Input & Output CS-502 Operating Systems Spring 2006.
CS-3013 & CS-502, Summer 2006 Network Input & Output1 CS-3013 & CS-502, Summer 2006.
OSI Model 7 Layers 7. Application Layer 6. Presentation Layer
Prepared By E.Musa Alyaman1 Networking Theory Chapter 1.
Defining Network Protocols Application Protocols –Application Layer –Presentation Layer –Session Layer Transport Protocols –Transport Layer Network Protocols.
1 TCP/IP architecture A set of protocols allowing communication across diverse networks Out of ARPANET Emphasize on robustness regarding to failure Emphasize.
What Can IP Do? Deliver datagrams to hosts – The IP address in a datagram header identify a host IP treats a computer as an endpoint of communication Best.
TCP/IP Protocol Suite - examples
TCP/IP protocols Communication over Internet is mostly TCP/IP (Transmission Control Protocol over Internet Protocol) TCP/IP "stack" is software which allows.
G64INC Introduction to Network Communications Ho Sooi Hock Internet Protocol.
The Network Layer. Network Projects Must utilize sockets programming –Client and Server –Any platform Please submit one page proposal Can work individually.
Lecture 2 TCP/IP Protocol Suite Reference: TCP/IP Protocol Suite, 4 th Edition (chapter 2) 1.
Operating Systems Lesson 10. Networking Communications protocol is the set of standard rules for ◦ Data representation ◦ Signaling ◦ Authentication ◦
TCP/IP Essentials A Lab-Based Approach Shivendra Panwar, Shiwen Mao Jeong-dong Ryoo, and Yihan Li Chapter 5 UDP and Its Applications.
Introduction to Networks CS587x Lecture 1 Department of Computer Science Iowa State University.
Digital Multimedia, 2nd edition Nigel Chapman & Jenny Chapman Chapter 17 This presentation © 2004, MacAvon Media Productions Multimedia and Networks.
TCP/IP TCP/IP LAYERED PROTOCOL TCP/IP'S APPLICATION LAYER TRANSPORT LAYER NETWORK LAYER NETWORK ACCESS LAYER (DATA LINK LAYER)
1 The Internet and Networked Multimedia. 2 Layering  Internet protocols are designed to work in layers, with each layer building on the facilities provided.
ECE 526 – Network Processing Systems Design Networking: protocols and packet format Chapter 3: D. E. Comer Fall 2008.
CS1Q Computer Systems Lecture 17 Simon Gay. Lecture 17CS1Q Computer Systems - Simon Gay2 The Layered Model of Networks It is useful to think of networks.
Chapter 4: Interprocess Communication‏ Pages
Network Protocols A network protocol defines the structure of messages sent over the network We will only talk about the Internet Network protocols need.
Information Flow Across the Internet. What is the Internet? A large group of computers that link together to form the Worldwide Area Network (WAN)
Internetworking Internet: A network among networks, or a network of networks Allows accommodation of multiple network technologies Universal Service Routers.
Internetworking Internet: A network among networks, or a network of networks Allows accommodation of multiple network technologies Universal Service Routers.
TCP/IP Honolulu Community College Cisco Academy Training Center Semester 2 Version 2.1.
ICOM 6115©Manuel Rodriguez-Martinez ICOM 6115 – Computer Networks and the WWW Manuel Rodriguez-Martinez, Ph.D. Lecture 21.
1 CS 4396 Computer Networks Lab TCP/IP Networking An Example.
IP1 The Underlying Technologies. What is inside the Internet? Or What are the key underlying technologies that make it work so successfully? –Packet Switching.
CSE 6590 Department of Computer Science & Engineering York University 111/9/ :26 AM.
Networking Fundamentals. Basics Network – collection of nodes and links that cooperate for communication Nodes – computer systems –Internal (routers,
Multimedia and Networks. Protocols (rules) Rules governing the exchange of data over networks Conceptually organized into stacked layers – Application-oriented.
Lecture 4 Overview. Ethernet Data Link Layer protocol Ethernet (IEEE 802.3) is widely used Supported by a variety of physical layer implementations Multi-access.
1 OSI and TCP/IP Models. 2 TCP/IP Encapsulation (Packet) (Frame)
Networking Material taken mainly from HowStuffWorks.com.
Digital Multimedia, 2nd edition Nigel Chapman & Jenny Chapman Chapter 17 This presentation © 2004, MacAvon Media Productions Multimedia and Networks.
Individual Project 1 Sarah Pritchard. Fran, a customer of your company, would like to visit your company’s website from her home computer… How does your.
1 Bus topology network. 2 Data is sent to all computers, but only the destination computer accepts 02608c
1. Layered Architecture of Communication Networks: TCP/IP Model
Intro to Distributed Systems and Networks Hank Levy.
Transmission Control Protocol (TCP) Internet Protocol (IP)
CPS110: More Networks Landon Cox March 25, Virtual/physical interfaces Hardware OS Applications.
Internet Flow By: Terry Hernandez. Getting from the customers computer onto the internet Internet Browser
TCP/IP1 Address Resolution Protocol Internet uses IP address to recognize a computer. But IP address needs to be translated to physical address (NIC).
The OSI Model. Understanding the OSI Model In early 1980s, manufacturers began to standardize networking so that networks from different manufacturers.
COMPUTER NETWORKS Hwajung Lee. Image Source:
Ch. 23, 25 Q and A (NAT and UDP) Victor Norman IS333 Spring 2015.
CPS110: Networks Landon Cox March 25, Network hardware reality  Lots of different network interface cards (NICs)  3Com/Intel, Ethernet/802.11x.
UDP: User Datagram Protocol. What Can IP Do? Deliver datagrams to hosts – The IP address in a datagram header identify a host – treats a computer as an.
Functions of Presentation Layer
Introduction to TCP/IP networking
Scaling the Network: The Internet Protocol
Layered Architectures
TCP/IP Transmission Control Protocol / Internet Protocol
CS 457 – Lecture 10 Internetworking and IP
Topic 5: Communication and the Internet
I. Basic Network Concepts
Multimedia and Networks
TCP/IP Protocol Suite: Review
TCP/IP Protocol Suite: Review
1 TRANSMISSION CONTROL PROTOCOL / INTERNET PROTOCOL (TCP/IP) K. PALANIVEL Systems Analyst, Computer Centre Pondicherry University, Puducherry –
Networking Introduction CSE 333 Summer 2018
Scaling the Network: The Internet Protocol
Ch 17 - Binding Protocol Addresses
OSI Reference Model Unit II
OSI Model 7 Layers 7. Application Layer 6. Presentation Layer
Presentation transcript:

CPS110: Networks Landon Cox March 20, 2008

Network hardware reality  Lots of different network interface cards (NICs)  3Com/Intel, Ethernet/802.11x  Each NIC has a fixed hardware address  MAC address: 01:10:C6:CE:8E:42  Send packet to LAN by specifying MAC address  Max packet size is 1500 bytes  Packets can be reordered, corrupted, dropped  Anyone can sniff packets from the network

Virtual/physical interfaces Hardware OS Applications

Distributed computing  Try to make multiple computers look like one  We won’t really cover  Take CPS 214  Distributed shared memory  Distributed file systems  Parallelizing compilers  Process migration

Protocol layers NFS (files) NFS (files) HTTP (web) HTTP (web) SMTP ( ) SMTP ( ) SSH (login) SSH (login) RPC TCP UDP IP Ethernet ATM PPP Applications Abstraction Hardware

OSI model  Open Systems Interconnections Applications Layer 7 Presentation Layer 6 Session Layer 5 Transport Layer 4 Network Layer 3 DataLink Layer 2 Physical Layer 1 Applications Presentation Session Transport Network DataLink Physical

Network layers (the stack)  Build higher-level services on simpler ones  IP over Ethernet  TCP over IP  HTTP over TCP  Why build in layers?  Could have 0 layers (build directly on top of HW)  What would happen?  Have to build from scratch each time HW changes  E.g. one firefox for wired NIC, one for wireless NIC

Network layers (the stack)  Build higher-level services on simpler ones  IP over Ethernet  TCP over IP  HTTP over TCP  Why build in layers?  Could have 1 layer (OS provides single layer)  What would happen?  Better to let applications choose functionality they need  Unneeded features usually cost something (performance)  E.g. would you ever not need reliable communication?

Virtual/physical interfaces Hardware OS Applications

Routing  HW lets us send to neighbor on same LAN  Single-hop route  Want to send to computer on another LAN  Multi-hop route  IP (Internet Protocol) handles this

Local-area network  Typically, switched Ethernet  Messages delivered using  Ethernet MAC address  E.g. 00:0D:56:1E:AD:BB  Unique to physical card (like a serial number)  Switch knows all connected computers’ MAC addresses Ethernet switch

Routing  Can’t put all computers on one switch!  Think of the wiring logistics  Want to connect two LANs together  Use a machine that straddles two networks  Called a router or gateway or bridge  LANs and routers form the Internet

Internet graph A A C C B B D D E E F F G G Each letter is a router, possibly with a LAN connected to it.

Internet graph Each node is an Autonomous System (AS). Can think of as an ISP.

Internet graph A A C C B B D D E E F F G G How does D know how to get to router G? Should it send messages to E, C, or F?

Internet routing is imprecise  Internet has no centralized state  Makes it (supposedly) more fault-tolerant  Routing is hard when a network is  Large (a lot to track)  Dynamic (connections change quickly)  Incentives to lie (make money by accepting traffic)  The Internet exhibits all three  Basic idea  Routers propagate info about the graph to each other  BGP (Border Gateway Protocol)

Traceroute example   Unix traceroute utility

Virtual/physical interfaces Hardware OS Applications

Naming other computers  Low-level interface  Provide the destination MAC address  00:13:20:2E:1B:ED  Middle-level interface  Provide the destination IP address   High-level interface  Provide the destination hostname  crocus.cs.duke.edu

Translating hostname to IP addr  Hostname  IP address  Performed by Domain Name Service (DNS)  Used to be a central server  /etc/hosts at SRI  What’s wrong with this approach?  Doesn’t scale to the global Internet

DNS  Centralized naming doesn’t scale  Server has to learn about all changes  Server has to answer all lookups  Instead, split up data  Use a hierarchical database  Hierarchy allows local management of changes  Hierarchy spreads lookup work across many computers

Example:  nslookup in interactive mode

Translating IP to MAC addrs  IP address  MAC address  Performed by ARP protocol  Only done after you get to the right LAN  How does a router know the MAC address of ?  ARP (Address Resolution Protocol)  If it doesn’t know the mapping, broadcast through switch  “Whoever has this IP address, please tell me your MAC address”  Cache the mapping  “/sbin/arp”  Why is broadcasting over a LAN ok?  Number of computers connected to a switch is relatively small

Virtual/physical interfaces Hardware OS Applications

Message sizes  Hardware interface  Max Ethernet message size is 1500 bytes  Application interface  IP maximum packet size is 64 kbytes  What if the route narrows?  Start at Ethernet max of 1500 bytes  Could traverse ATM w/ max of 53 bytes

Message sizes  IP layer fragments larger MTU to smaller MTU Computer 1Computer 2Router IP Ethernet IP Ethernet ATM IP ATM

Virtual/physical interfaces Hardware OS Applications

Processes vs machines  IP is machine-to-machine  E.g. crocus.cs.duke.edu   Process abstraction  Each app thinks it has its own machine  Give each process multiple virtual NICs

Processes vs machines  Hardware interface  One network endpoint per machine  Application interface  Multiple network endpoints per machine  Sockets  Software endpoints for communication  Like virtual network cards

Sockets  Another example of virtualized hardware  Thread  virtual processor  Address space  virtual memory  Endpoint/socket  virtual NIC  NIC and socket both have unique identifiers  NIC: MAC address  Socket: ‹hostname, port number›  bind () assigns a port number to a host’s socket

Sockets  OS allows apps to program sockets  E.g. BSD sockets  WinSock has pretty much same interface  Processes name each other via sockets  Each message includes a destination ‹host, port›  Tells routers which computer gets message  Tells dst computer which process gets message

Sockets  OS can multiplex multiple connections over one NIC  Kinds of sockets: UDP (datagrams), TCP (ordered, reliable)

Course administration  Exam regrades back on Tuesday  Project 2 also due on Tuesday  Four groups have submitted  Any questions?

Virtual/physical interfaces Hardware OS Applications

Ordered messages  Networks can re-order IP messages  E.g. Send: A, B. Arrive: B, A  How should we fix this?  Assign sequence numbers (0, 1, 2, 3, 4, …)

Ordered messages  Do what for a message that arrives out of order?  (0, 1, 3, 2, 4) a.Save #3 and deliver after #2 is delivered  (this is what TCP does) b.Drop #3, deliver #2, deliver #4 c.Deliver #3, drop #2, deliver #4 b. and c. are ordered, but not reliable (messages are dropped). Relies on the reliability layer to handle lost messages.

Ordered messages  For a notion of order, first need “connections”  Why?  Must know which messages are related to each other  Idea in TCP  Open a connection  Send a sequence of messages  Close the connection  Opening a connection ties two sockets together  Connection is socket-to-socket unique: only these sockets can use it  Sequence numbers are connection specific

Virtual/physical interfaces Hardware OS Applications

Reliable messages  Usually paired with ordering  TCP provides both ordering and reliability  Hardware interface  Network drops messages  Network duplicates messages  Network corrupts messages  Application interface  Every message is delivered exactly once

Detecting and fixing drops  How to fix a dropped message?  Have sender re-send it  How does sender know it’s been dropped?  Have receiver tell the sender  Receiver may not know it’s been sent  Like asking in the car,  “If we left you at the theater, speak up.”

Detecting and fixing drops  Have receiver acknowledge each message  Called an “ACK”  If sender doesn’t get an ACK  Assume message has been dropped  Resend original message  Is this ok for the sender to assume?  No. ACKs can be dropped too (or delayed)

Detecting and fixing drops  Possible outcomes  Message is delayed or dropped  ACK is delayed or dropped  Strategy  Deal with all as though message was dropped  Worst case if message wasn’t dropped after all?  Need to deal with duplicate messages  How to detect and fix duplicate messages?  Easy. Just use the sequence number and drop duplicate.

What about corruption?  Messages can also be corrupted  Bits get flipped, etc  Especially true over wireless networks  How to deal with this?  Add a checksum (a little redundancy)  Checksum usually = sum of all bits  Drop corrupted messages

What about corruption?  Dropping corrupted messages is elegant  Transforms problem into a dropped message  We already know how to deal with drops  Common technique  Solve one problem by transforming it into another 1.Corruption  drops 2.Drops  duplicates 3.Drop any duplicate messages (very simple)

Virtual/physical interfaces Hardware OS Applications

Byte streams  Hardware interface  Send information in discrete messages  Application interface  Send data in a continuous stream  Like reading/writing from/to a file

Byte streams  Many apps think about info in distinct messages  What if you want to send more data than fits?  UDP max message size is 64 KB  What if data never ends?  Streamed media  TCP provides “byte streams” instead of messages

Byte streams  Sender writes messages of arbitrary size  TCP breaks up the stream into fragments  Reassembles the fragments at destination  Receiver sees a byte stream  Fragments are not visible to either process  Programming the receiver  Must loop until certain number of bytes arrive  Otherwise, might get first fragment and return

Byte streams  UDP makes boundaries visible  TCP makes boundaries invisible  (loop until you get everything you need)  How to know # of bytes to receive? 1.Size is contained in header 2.Read until you see a pattern (sentinel) 3.Sender closes connection

Sentinels  Idea: m essage is done when special pattern arrives  Example: C strings  How do we know the end of a C string?  When you reach the null-termination character (‘\0’)  Ok, now say we are sending an arbitrary file  Can we use ‘\0’ as a sentinel?  No. The data payload may contain ‘\0’ chars  What can we do then?