CS 352 Internet Technology Dept. of Computer Science Rutgers University Administrative Instructor : Richard Martin TA: TBA Textbook James F. Kurose and Keith W. Ross, Computer Networking, 3rd edition. Class webpage http://remus.rutgers.edu/cs352/S06/ Announcements Lecture notes Projects Homeworks Old exams CS352 Fall, 2005 2 Course Goals Understand the basic principles of computer networks Understand the Internet and its protocols Understand the key design principles used to build the Internet Experience building network systems CS352 Fall, 2005 3 Course goals (cont.) Course is not about specific skills E.g. configure a router from company X vs. learn principles of how all routers work Success means you are confident to tackle a range of network programming, design and maintenance. CS352 Fall, 2005 4 Course Approach Lectures: theory behind how networks operate Tested in exams See last semesters’ classes for sample problems Programming assignments: CS352 Real world experience with networks Program design Communicating your design Fall, 2005 5 Course Work 2 Mid-terms (15% each) Final (35%) No electronic devices or notes allowed. No cheat sheets allowed You must send the instructor email at least 2 weeks before the final if you need to take the makeup! Project (35%) CS352 Part 1 (10%) Part 2 (10%) Part 3 (15%) Fall, 2005 6 Programming assignments Single long project Broken into three parts Can work in a group of 2 Both program and write-up required Background needed to get started: Java (112+ level) CS352 Comfortable using data structures(stacks, trees, vector) Unix (login, handin, permissions, javac) Fall, 2005 7 Programming Assignment 2 Code reviews Make improvements for next level of the assignment. 10-15 minute oral question and answer period. TA and instructor will critically review your assignment. “lost art” of program design. Grade depends on level of improvement in code quality as well as functionality. No late handin CS352 Failure to meet the deadline will result in a zero for all team members. No exceptions! Fall, 2005 8 Academic integrity No cheating on projects and exams Run code similarity detectors on the projects & code review Scrutinize exams for copying Department academic integrity policy CS352 http://www.cs.rutgers.edu/policies/academicintegri ty/ Acknowledge your awareness of this policy by the end of September to continue to access department computing facilities Fall, 2005 9 Facilities “Cereal” machines and lab ~20 UltraSparc machines ~30+ Linux machines Cardkey Access: student ID card Romulus and remus for general use CS352 Create your accounts now! http://remus.rutgers.edu/newaccount.html Fall, 2005 10 CS352 Fundamentals Why Study Networks? Integral part of society Pervasive Work, entertainment, community Home, car, office, school, mall … Huge impact on people and society CS352 Fall, 2005 12 Impact of the Net on People Anytime access to remote information Person-to-person and group communication email, blogs, chat Form and strengthen communities CS352 HW assignments from my server chat rooms, MUDs, newsgroups Fall, 2005 13 Impact of the Net on Society Huge impact! Continuation of technologies that reduce problems of time & space Good, bad and ugly mirror of society Changes still on the horizon CS352 (e.g. railroads,phone,autos,TV) Commerce, services, entertainment, socializing Fall, 2005 14 Concepts for this week What is the Internet? Network delay analysis Core and Edge of the Internet Circuit, message and packet switching Single link Multi-link Layering and encapsulation CS352 Fall, 2005 15 What is the Internet? What is Internet Technology? What is an internet? What is the Internet? A global internet based on the IP protocol To what does “Internet technology” refer? CS352 Network of networks Architecture Services Fall, 2005 Protocols 17 Architecture-wise Company A Internet Service Provider 1 ISP 2 Company B Core Networks (ISP tiers) Network Host: Machine : Collection running of interconnected user application machines Media: Channel: Router: Physical decide Logical process where line of to used communication send (copper data next wire, fiber optics, satellite • Tier 1:link) Biggest ISPs Edge Networks: Companies, organizations with a “default route” •Tier 2 and 3: Regional CS352 Fall, 2005 18 and Service-wise (applications) Electronic mail Remote terminal File transfer Newsgroups File sharing Resource distribution World Wide Web Video conferencing Games CS352 Fall, 2005 19 Protocols Protocol Architecture Service Rules of communication FTP HTTP RTP TFTP UDP TCP IP Ethernet CAT-5 CS352 Fall, 2005 802.11 Single-Mode Fiber … PPP RS-232 20 Core Network Switching Schemes How much “state” about the connection between two hosts does each node/router along a path through the network maintain? CS352 Fall, 2005 21 Switching Schemes (1) (2) (3) CS352 Circuit Switching Message Switching (Store-and-Forward) Packet Switching (Store-and-Forward) Fall, 2005 22 Circuit Switching Provides service by setting up the total path of connected lines hop-by-hop from the origin to the destination Example: Telephone network CS352 Fall, 2005 23 Circuit Switching (cont’d) 1. Control message sets up a path from origin to destination 2. Return signal informs source that data transmission may proceed 3. Data transmission begins 4. Entire path remains allocated to the transmission (whether used or not) 5. When transmission is complete, source releases the circuit CS352 Fall, 2005 24 Circuit Switching (cont’d) Call request signal Time Propagation Delay Transmission Delay Call accept signal Data Transmission Time CS352 Fall, 2005 Data A B C D Routers/Switches 25 Message Switching Each message is addressed to a destination When the entire message is received at a router, the next step in its journey is selected; if this selected channel is busy, the message waits in a queue until the channel becomes free Thus, the message “hops” from node to node through a network while allocating only one channel at a time Analogy: Postal service CS352 Fall, 2005 26 Message Switching (cont’d) Header Time Msg Transmission Delay Msg Queueing Delay Msg CS352 Fall, 2005 A B C D Routers/switches 27 Packet Switching Messages are split into smaller pieces called packets These packets are numbered and addressed and sent through the network one at a time Allows Pipelining CS352 Overlap sending and receiving of packets on multiple links Fall, 2005 28 Packet Switching (cont’d) Pkt 1 Time Header Pkt 2 Pkt 1 Pkt 3 Transmission Delay Pkt 2 Pkt 1 Pkt 3 Pkt 2 Pkt 3 Pipelining CS352 Fall, 2005 A B C D 29 Comparisons (1) Header Overhead Circuit < Message < Packet (2) Transmission Delay Short Bursty Messages: Packet < Message < Circuit Long Continuous Messages: Circuit < Message < Packet CS352 Fall, 2005 30 Network delay analysis Why Study Network Performance Networks cost $ OC-3 line ~= $10,000/month Cable modem: $40/month Are you getting your $/worth? Why is the network “slow”? Approach: Build abstract models of network performance Observe where real networks deviate from model Simple Models: Tells us average/best/worse cases->useful, practical Complex Models: Hard to understand -> useless CS352 Fall, 2005 32 Units Bits are the units used to describe an amount of data in a network = 1 x 103 bits = 1,000 bits = 1 x 106 bits = 1,000,000 bits = 1 x 109 bits = 1,000,000,000 bits Seconds are the units used to measure time 1 kilobit (Kbit) 1 megabit (Mbit) 1 gigabit (Gbit) 1 millisecond (msec) 1 microsecond (msec) 1 nanosecond (nsec) = 1 x 10-3 seconds = 0.001 seconds = 1 x 10-6 seconds = 0.000001 seconds = 1 x 10-9 seconds = 0.000000001 seconds Bits per second are the units used to measure channel capacity/bandwidth and throughput CS352 bit per second (bps) kilobits per second (Kbps) megabits per second (Mbps) Fall, 2005 33 Types of Delay Processing Queuing Time waiting in queue to be processed Transmission Time to execute protocol code Time to “get bits on wires” Propagation CS352 Time for bits to “move across wires” Fall, 2005 34 Transmission vs. Prop. delay A single transmission link as a water pipe 1. 2. The thicker the pipe, the more water it can carry from one end to the other in each unit time Water is carried from one end of the pipe to the other at constant speed, no matter how thick the pipe is Water = Data bits Thickness of the pipe = Channel capacity Speed of water through the pipe = Propagation speed CS352 Fall, 2005 35 Transmission vs. Prop. Delay (cont) pipe 1. 2. CS352 Fall, 2005 Propagation delay is how long takes to cross the pipe, irrespective of volume Transmission (bandwidth delay) is related to how much water can be pushed in through the opening per unit time 36 Transmission Time How long does it take A to transmit an entire packet onto the link? Relevant information: packet length = 1500 bytes channel capacity = 100 Mbps Another way to ask this question: If the link can transmit 10 million bits in a second, how many seconds does it take to transmit 1500 bytes (8x1500 bits)? 100 Mbits 1 sec CS352 Fall, 2005 = 1500 x 8 bits t Solving for t… t = 0.00012 sec (or 120 msec) 37 Propagation Delay How long does it take a single bit to travel on the link from A to B? Relevant information: link distance = 500 m prop. delay factor = 5 msec/km Another way to ask this question: If it takes a signal 5 msec to travel 1 kilometer, then how long does it take a signal to travel 500 meters? 5 msec 1000 m CS352 Fall, 2005 = t 500 m Solving for t… t = 2.5 msec 38 Processing Delay Stylized format required to send data Analogy: adding and removing envelopes to letters Host Host Application Layer Application Layer Transport Layer Transport Layer Router Network Layer Network Layer Network Layer Host-toNet Layer Host-toNet Layer Host-toNet Layer CS352 Fall, 2005 How long does it take to execute all these layers? Why is this time important? 39 Example A B 500 m Protocol Processing Time = 40 msec packet length = 1500 bytes channel capacity = 100 Mbps propagation delay factor = 5 msec/km 1. 2. 3. CS352 How long to format the data? How long does it take a single bit to travel on the link from A to B? How long does it take A to transmit an entire packet onto the link? Fall, 2005 40 Timeline Method Host A 40 1st bit Host B Protocol Delay 2.5 Propagation delay 120 Transmission time Time last bit 40 CS352 Protocol Delay Total time: 40+120+2.5+40 = 202.5 msec Fall, 2005 41 Queuing Delay Router Network Layer Host-toNet Layer Packets waiting processing at input ports 2 0 3 1 0 0 Router 0 0 1 2 2 3 Packets waiting transmission at output ports Packets arriving faster than processing or transmission delay CS352 Fall, 2005 => queuing (I.e. waiting in line) 42 Analytic Comparison of multilink network Given choice of 2 switching schemes, how would you compare their performance? What would you need to know? What are the independent variables? What is the dependent variable? Could you come up with a closed form expression based on your choices? CS352 Fall, 2005 43 Example: Circuit Switching vs. Packet Switching Goal: Determine which is faster Formal definition: Least time to move a fixed amount of data Approach: CS352 Compute time where circuit switching and packet switching are equal based on all possible factors A factor moving in one direction or the other will tip the balance in favor of one or the other We’ll ignore wire-line propagation delay in this example Fall, 2005 44 Factors: Number of bytes in the message: N Time to set up circuit: c Per-link bandwidth: B Size of the packet: p Size of the header: h Number of switches: s CS352 Fall, 2005 45 Circuit Switching Time Time to send N bytes using circuit switching = Set-up cost + bandwidth delay N C B CS352 Fall, 2005 46 Pipelining “Parallelogram” for packet switching Host A Switch 1 Switch 2 Host B Packet 1 Packet 2 Time Propagation Delay Packet 3 Packet 4 Bandwidth Delay CS352 Fall, 2005 47 Note on Pipelining The above analysis is very general: Packets in a computer network Instructions in a processor Instructions are the unit of work. Jobs through a batch Q in an operating system. Messages/packets are the unit of work. Processes are the unit of work. Pipelining speeds up work over time. CS352 How? Fall, 2005 48 Packet Switching Time Delay = Transmission + “Propagation” delays “Propagation” delay: Time for a single packet to cross - not really prop. delay in the traditional sense + Transmission delay (also bandwidth delay): Time to push all the packets into the network ( p h) N ( p h) ( S 1) * ( 1) * B B P CS352 Fall, 2005 49 Packet Switching Time Transmission delay “Propagation” delay Number of packets Number of links/hops ( p h) N ( p h) ( S 1) * ( 1) * B B P Time for each packet to go through each link CS352 Fall, 2005 50 Equilibrium Point N p h N S C B P B Assuming all other factors equal, solve for C Q: Can you add link propagation delay to this example? CS352 Fall, 2005 51 Homework Questions If we use message switching, how does the time increase as we scale s? How does packet switching reduce the impact of increasing s? Show, using an equation, how reducing the packet size and packet switching reduces the impact of increasing s. Where does the approach of reducing packet size fail to give any benefit? CS352 Fall, 2005 52 Layering and Encapsulation Why Layering? Network communication is very complex Separation of concerns CS352 Different vendors and organizations responsible for different layers Testing and maintenance is simplified Easy to replace a single layer with a different version Fall, 2005 54 Protocol Hierarchy Use layers to hide complexity Each layer implements a service Protocols Layer N uses service provided by layer N-1 layer N-1 provides a service to layer N Each layer communicates with its peer by a set of rules Interface CS352 A layers interface specifies the operations Fall, 2005 55 Protocol Hierarchy (cont’d) Host A Layer 7 Layer 6 Layer 5 Layer 4 Layer 3 Layer 2 Layer 1 CS352 Fall, 2005 Host B Layer 7 Protocol Layer 6 Protocol Layer 5 Protocol Layer 4 Protocol Layer 3 Protocol Layer 2 Protocol Layer 1 Protocol Physical Medium Layer 7 Layer 6 Layer 5 Layer 4 Layer 3 Layer 2 Layer 1 56 Different Layering Architectures ISO OSI 7-Layer Architecture TCP/IP 4-Layer Architecture + application layer = 5 layers in Kurose Novell NetWare IPX/SPX 4-Layer Architecture CS352 Fall, 2005 57 Standards Making Organizations ISO = International Standards Organization ITU = International Telecommunication Union (formerly CCITT) ANSI = American National Standards Institute IEEE = Institute of Electrical and Electronic Engineers IETF = Internet Engineering Task Force ATM Forum = ATM standards-making body ...and many more CS352 Fall, 2005 58 Why So Many Standards Organizations? Multiple technologies Different areas of emphasis and history Telecommunications/telephones Local area networking/computers IETF, IEEE System area networks/storage CS352 ITU,ISO,ATM ANSI Fall, 2005 59 ISO OSI Layering Architecture Host A Host B Application Layer Application Protocol Presentation Layer Presentation Protocol Session Layer Session Protocol Transport Layer Transport Protocol Application Layer Presentation Layer Session Layer Transport Layer Network Layer Network Layer Network Layer Network Layer Data Link Layer Data Link Layer Data Link Layer Data Link Layer Physical CS352 Fall, 2005 Layer Physical Layer Physical Layer Physical Layer Router Router 60 ISO’s Design Principles A layer should be created where a different level of abstraction is needed Each layer should perform a well-defined function The layer boundaries should be chosen to minimize information flow across the interfaces The number of layers should be large enough that distinct functions need not be thrown together in the same layer out of necessity, and small enough that the architecture does not become unwieldy CS352 Fall, 2005 61 Layer 1: Physical Layer Functions: Transmission of a raw bit stream Forms the physical interface between devices Issues: Which modulation technique (bits to pulse)? How long will a bit last? Bit-serial or parallel transmission? Half- or Full-duplex transmission? How many pins does the network connector have? How is a connection set up or torn down? Fall, 2005 CS352 62 Layer 2: Data Link Layer Functions: Provides reliable transfer of information between two adjacent nodes Creates frames from bits and vice versa Provides frame-level error control Provides flow control In summary, the data link layer provides the network layer with what appears to be an error-free link for packets CS352 Fall, 2005 63 Layer 3: Network Layer Functions: Responsible for routing decisions CS352 Dynamic routing Fixed routing Performs congestion control Fall, 2005 64 Layer 4: Transport Layer Functions: Hide the details of the network from the session layer CS352 Example: If we want replace a point-to-point link with a satellite link, this change should not affect the behavior of the upper layers Provides reliable end-to-end communication Fall, 2005 65 Transport Layer (cont’d) Host A first end-to-end layer Host B Application Layer Application Protocol Presentation Layer Presentation Protocol Session Layer Session Protocol Transport Layer Transport Protocol Application Layer Presentation Layer Session Layer Transport Layer Network Layer Network Layer Network Layer Network Layer Data Link Layer Data Link Layer Data Link Layer Data Link Layer Physical CS352 Fall, 2005 Layer Physical Layer Physical Layer Physical Layer Router Router 66 Transport Layer (cont’d) Functions (cont’d): CS352 Perform end-to-end flow control Perform packet retransmission when packets are lost by the network Fall, 2005 67 Layer 5: Session Layer May perform synchronization between several communicating applications or logical transmissions Groups several user-level connections into a single “session” Examples: CS352 Banking session Network meetings Fall, 2005 68 Layer 6: Presentation Layer Performs specific functions that are requested regularly by applications Examples: CS352 encryption ASCII to Unicode, Unicode to ASCII LSB-first representations to MSB-first representations Fall, 2005 69 Layer 7: Application Layer Application layer protocols are applicationdependent Implements communication between two applications of the same type Examples: CS352 FTP HTTP SMTP (email) Fall, 2005 70 Encapsulation Treat the neighboring layer’s information as a “black box”, can’t look inside or break message Sending: add information needed by the current layer “around” the higher layers’ data headers in front trailers in back Receiving: Strip off headers and trailers before handing up the stack CS352 Fall, 2005 71 Encapsulation Data CS352 Application Layer AH Presentation Layer PH Session Layer SH Transport Layer TH Fall, 2005 Network Layer NH Data Link Layer DH Physical Layer PH Data Data Headers Trailer Data Data Data Data Data DT 72 Internet “Hourglass” Architecture Defined by Internet Engineering Task Force (IETF) “Hourglass” Design FTP HTTP RTP TFTP UDP TCP IP Ethernet CAT-5 CS352 Fall, 2005 802.11 Single-Mode Fiber … PPP RS-232 73 Internet Design Principles Scale Incremental deployment Different technologies, autonomous organizations End-to-end argument CS352 New protocols need to be deployed gradually Heterogeneity Protocols should work in networks of all sizes and distances Some functions can only be correctly implemented at the end hosts; the network should not provided these. Fall, 2005 74 TCP/IP Layering Architecture Application A simplified model The network layer Transport Internet/Network Host-to-Net CS352 Fall, 2005 Hosts drop packets into this layer, layer routes towards destination- only promise- try my best The transport layer reliable byte-oriented stream 75 TCP/IP Layering Architecture (cont’d) Host A Host B Application Protocol Application Layer Transport Protocol (TCP) Transport Layer Network Layer Host-toNet Layer CS352 Fall, 2005 Application Layer IP Network Layer Host-toNet Layer IP Network Layer Host-toNet Layer Transport Layer IP Network Layer Host-toNet Layer 76