tcp/ip lecture 2 cs193i – internet technologies summer 2004 stanford university

Download TCP/IP Lecture 2 cs193i – Internet Technologies Summer 2004 Stanford University

Post on 13-Jan-2016

214 views

Category:

Documents

4 download

Embed Size (px)

TRANSCRIPT

  • TCP/IPLecture 2cs193i Internet TechnologiesSummer 2004Stanford University

  • AnnouncementsLab #1 due WednesdayHW #1 assignedExtra perl session tomorrowTuesday, June 29, 2:15-3:05pm, Skilling 193Broadcast live on E2, Stanford OnlineSilas Thursday office hours moved to Wednesday this weekSweet Hall, 6:30-8:30pm

  • Communicating with Anyone

    Ethernet

    Token-ring

    Cloud

    Server

    Client

    Balloon callout. Select shape and start typing. Resize box to desired dimensions. Move control handle to aim pointer at speaker.

    MSN Messenger

    Network

    Token-ring

    Ethernet

    mar@cs.washington.edu

    kashaw@cs.stanford.edu

    Hows the weather in Seattle, Mar?

  • Local Area Network (LAN)High speed, data network over small regionFew thousand metersNetwork technologies:EthernetFDDIToken ringData link layer Packets routed based on physical address (MAC)LAN 1 LAN 2

    Server

    Client

    Ethernet

    Ethernet

    Token-ring

    Server

    Token-ring

  • Local Area Network (LAN)High speed, data network over small regionFew thousand metersNetwork technologies:EthernetFDDIToken ringData link layer Packets routed based on physical address (MAC)LAN 1 LAN 2 ?

    Server

    Client

    Ethernet

    Ethernet

    Token-ring

    Server

    Token-ring

  • Connecting Below Internet LevelHubCenter of star topologyIn Ethernet, multiport repeater or concentratorBridgeConnects 2 networks of same technology extended LANFilters/forwards/floods based on MAC Link layer - framesSwitchConnects 2+ networks packet-switched networkReduces collisions

    HubBridgeSwitch

    Client

    Hub

    Server

    Client

    Ethernet

    Bridge

    Ethernet

    Ethernet

    Server

    Client

    Ethernet

    Ethernet

    Ethernet

    T3

    STS-N

  • Connecting at the Internet LevelRouterOriginally gatewayForwards packets based on network layer info (IP)Separate broadcast domainsIn each domain, IP packet encapsulated in domain-specific packetRouter

    Cisco Switch

    Ethernet

    Token-

    ring

    Ethernet

    Cisco Switch

  • Internet SocietyGoverning body for Internet since 1992http://www.isoc.orgDomain names and addresses assignedUpper level: Internet Assigned Numbers AuthorityRegional: Latin America / CaribbeanAsia PacificAmericaEurope

  • How Does Everyone Work Together?NetworksMCI Worldcom, Sprint, Earthlink, Exchange points provide connections between networksNetwork Access Points open access policiesNetwork Service Provider Build national or global networksLease space at NAPsSell bandwidth to regional NSPsRegional NSP sell bandwidth to ISPInternet Service Provider sells bandwidth to end users

  • How Does Everyone Work Together?

  • OSI Reference Model for Network DesignApplication (Layer 7)PresentationSessionTransportNetworkData LinkPhysical (Layer 1)

  • OSI vs. TCP/IP Stack

  • Internet Protocol

  • IP Datagram

  • IP Addresses4 8-bit numbers (Hierarchical)

    Specifies both network and hostNumber of bits allocated to specify network variesThree classes:

    18.26.0.1network32-bitshost

  • IP AddressesIP (Version 4) Addresses are 32 bits longIP Addresses Assigned Statically or Dynamically (DHCP)IPv6 addresses are 128 bits long

  • IP Address SpaceOriginally, 3 ClassesA, B, CProblemClasses too rigid (C too small, B too big)SolutionSubnetting (e.g. within Stanford)Classless Interdomain Routing (CIDR)

  • SubnettingIP Address plus subnet mask (netmask)IP Addr: 171.64.15.82 Netmask: 0xFFFFFF00 (111...1100000000)First 24 bits are the Subnet ID (the neighborhood)Last 8 bits are Host ID (the street address)Can be written as Prefix + Length171.64.15.0/24 or 171.64.15/24

  • Subnetting at Stanford

  • IP RoutingRouters are not omniscientNext-HopHop-by-HopThus IP makes no guaranteesexcept to try its best (Best Effort)packets may get there out of order, garbled, duplicatedmay not get there at all!Unreliable datagram service

  • IP Routing Hop-by-HopHow a Router Forwards Datagrams

  • Classless Interdomain Routing (CIDR)

  • Classless Interdomain Routing (CIDR)

  • Classless Interdomain Routing (CIDR)

  • Classless Interdomain Routing (CIDR)

  • Five Minute Break

  • Network Programshostpingtraceroutenslookup

  • Summary of IPConnectionless/DatagramUnreliable/Best Effort

  • Transmission Control Protocol

  • CharacteristicsConnection-OrientedReliableByte-StreamFlow Control (aka Congestion Control)

  • Three PhasesEstablish ConnectionData TransferTerminate Connection

  • Establishing the Connection

  • Data Transfer

  • Data Transfer

  • Maintaining the Connection

  • Terminating the Connection

  • Connection-OrientedReliableByte-StreamFlow Control (aka Congestion Control)

  • Reliability & Flow ControlSequence numbers & Acknowledgements (ACKs)Receiver detects Corrupt, Lost, Duplicated, Out-of-order Tell sender which packets it has received correctlySender can resendIn Flight Window (Window Size)Sender only has N unacknowledged packets in

  • Sending a Message

  • Connection-OrientedReliableByte-StreamFlow Control (aka Congestion Control)

  • UDP

  • User Datagram Protocol (UDP)Like TCP, in the Transport LayerCharacteristicsConnectionless, Datagram, UnreliableAdds only application multiplexing/demultiplexing and checksumming to IPGood for Streaming Media, Real-time Multiplayer Networked Games, VoIP

  • SummaryIP is the basis of InternetworkingTCP builds on top of IP adds reliable, congestion-controlled, connection-oriented byte-stream.UDP builds on top of IP allows access to IP functionality

    The model divides the functions of a protocol into a series of layers. Each layer has the property that it only uses the functions of the layer below, and only exports functionality to the layer above. A system that implements protocol behaviour consisting of a series of these layers is known as a 'protocol stack' or 'stack'. Protocol stacks can be implemented either in hardware or software, or a mixture of both. Typically, only the lower layers are implemented in hardware, with the higher layers being implemented in software.

    Useful, but dont take it too seriously... because in actuality, we only use a 4 layer model

    Not enough Addresses in IPv4

    Small organizations wanted class B in case they grew > 255 hosts, but there were only about 16000 Class B network IDs

    Subnetting (hierarchical routing) within an organizationCIDR is subnetting but applied to the Internet as a whole... introduced in 1993 to provide flexible use of IP Address Space...

    Netmask is in hexadecimal... if you recall what that means, it is essentially

    Next Hop Concept... Each Router will look at the IP address... find the next hop based on the subnet prefix + length... and send it off..

    You want to divide this line segment and allocate it to different organizations... before, we used ABCDE... but too strict...

    cidr extends subnetting concept to the Internet as a whole....

    TCP is a protocol that is built on TOP of IPs basic best-effort datagram service...

    TCP interfaces between network layer below and application layer above. For example, FTP uses TCP which sits on IP wich might use the Ethernet...

    TCP Packet (or Segment) is just the Data of the IP Packet... which in turn is the data of the Ethernet Packet!

    It has these characteristics:

    First, it is connection-oriented, unlike IP.IP, where each packet is conceptually separate... TCP packets are part of one connectionIn Addition, the connection is two-way. Software can write bytes to the connection, and it shows up other side.Second, its End-to-End ReliableThe destination will reassemble and error check packetsLost, Corrupted packets will be resent by the senderThird, TCP provides illusion of continuous, byte stream from sender to recipient. Bytes written 1234 by the sender... will show up 1234 at the receiverFinally, TCP has Flow Control which means thatSender wills slow down to a packet rate that the receiver and network can cope with. The way it does this is with ACK packets. Helps to share network capacity between users...

    So first, how does it achieve the connection oriented characteristic?

    Through these three phases... Every TCP connection goes through these phases:

    Data Transfer has the Byte-Stream characteristic... meaning that bytes written in a certain order on Host A will show up in the same order once put together at host B... how does this work?

    TCP Segments...

    Concept that well talk about later called Sequence Numbers....

    Provide Reliability Through Sequence NumbersProvides Byte-Stream Through Sequence Numbers.... 3 2 4 1, reorganize to 1 2 3 4, and say ACK up until 4... Provide Flow Control Through Acknowledgement Segments & In Flight WindowIf Sender notices slow network/host (lots of packets in flight, few acknowledged)... it will slow down....

    In summary, TCP adds all these on top of IP... and hides it from the application via the TCP/IP Protocol Stack....

    The key is that each layer is a layer of abstraction. The Application layer doesnt know how the Transport Layer is implemented.... it only sees that the TCP Transport layer provides these 4 services... The Transport Layer in Turn doesnt know how the Network layer is implemented... it just knows it provides routing and addressing. And so on and so forth...

    Basically allows access to IP functionality without TCP overhe

Recommended

View more >