Docstoc

CS 352 Internet Technology

Document Sample
CS 352 Internet Technology Powered By Docstoc
					      CS 352
Internet Technology
   Fundamentals

Dept. of Computer Science
   Rutgers University


                            1
              Administrative

• Special permission
• Class web pages:
     http://remus.rutgers.edu/cs352/F01/




                                            2
        Why Study Networks?

• Rapidly becoming integral part of society
      – Work, entertainment, community
• Pervasive
      – Home, car, office, school, mall …
• Understand what they do, how they
  work, and limitations
     Jobs

                                            3
   Impact of the Net on People
• Anytime access to remote information
     HW assignments from my server
• Person-to-person and group
  communication
     email, chat, meetings
• Form and strengthen communities
     chat rooms, MUDs, newsgroups


                                         4
   Impact of the Net on Society
• Huge impact!
     Continuation of technologies that reduce
      problems of time & space (e.g.
      railroads,phone,autos,TV)
• Good, bad and ugly
     mirror of society
• Changes still on the horizon
     Commerce, services, entertainment,
      socializing
                                                 5
              Internet Roles
• Users
    – Everyone (mom and pop, kids)
    – work, leisure, serious, frivolous
• Designers
    – protocol design and implementation
    – performance, cost and scale
• Service Providers
    – Administrators and ISPs
    – Management, revenue, deployment

                                           6
   What is Internet Technology?

• What is an internet?
     Network of networks
• What is the Internet?
     A global internet based on the IP protocol
• To what does “Internet technology”
  refer?
     Architecture, protocols and services

                                                   7
Sample Internet Applications

       •   Electronic mail
       •   Remote terminal
       •   File transfer
       •   Newsgroups
       •   File sharing
       •   Resource distribution
       •   World Wide Web
       •   Video conferencing
       •   Games
                                   8
            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

                                         9
           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.


                                               10
            Course Approach

• Lectures: theory behind how networks operate
   Tested in exams
   See last semester’s class for sample problems

• Programming assignments:
   Real world experience with networks
   Program design

   Working in groups

   Communicating your design




                                                    11
      Programming assignments

• Single long project
     Broken into three parts
• Groups of up to 3
• Code and write-up required
• Background needed to get started:
       – Java (111 and 112 level)
       – Unix (login, handin, permissions, javac)


                                                    12
                Facilities

• “Cereal” machines
   ~20 UltraSparc 10 machines
   ~20 Linux machines

• Romulus and remus for general use
   Create your accounts now!
   http://remus.rutgers.edu/newaccount.html




                                               13
          What is a Network?

• Carrier of information between 2 or more
  entities
• Interconnection may be any media
  capable of communicating information:
   copper wire
   lasers

   microwave

   satellite link



                                        14
        Some Definitions

 Network: Collection of interconnected
  machines
 Host: Machine running user application

 Channel: Logical line of communication

 Media: Physical process used

 Protocol: Rules of communication

 Router: decide were to send data next

 Topology: How network is interconnected


                                            15
        1. How Do Computers
            Communicate?

• With 1’s and 0’s
   Computers only deal with 1’s and 0’s
   So do networks

• How do we transmit 1’s and 0’s in a
  network?



                                           16
Physical Transmission


             A physical quantity
               (e.g. voltage),
               varying over time
               represents a digital
               0 or 1




                                17
         Overview of the Topics

1.   Fundamentals
2.   Media Access
3.   Link state management
4.   Routing
5.   Congestion control
6.   Protocols
7.   Security
8.   Physical layer
                                  18
              Possible Media

• Broadcast or shared channels




   Point-to-point links



                                 19
            Media Access

Many users typically share a single link or
             a single medium




   How do you give them all access?


                                          20
    Media Access Protocols

If more than one host sends at the same
          time, there is a collision




 Need algorithm to share the channel:
      Media access protocol
                                          21
     Fixed Assignment Schemes

Example: Time Division Multiple Access
         (TDMA)


                                                 time
 host       1    2   3    4   1    2


Channel capacity is assigned even to users who have
  nothing to send

                                                      22
          Demand Assignment
Assign channel capacity only to those who have packets to send
           Example: Token Passing Scheme




                                      Token




 Hosts may send packets when they grab the token

                                                                 23
                Random Access

Send when you have a packet to send. If collision, retransmit
                     Example: Ethernet


                 1        2        3       4


Listen before transmission     Listen during transmission
       if busy, wait                  if collision, abort
       if idle, transmit              and retransmit

                                                        24
             7.2.4 Comparison
                 Random    Demand
                 Access   Assignment
                                         Fixed
                                       Assignment



Access
 Delay




         light                          heavy
                           Network
                            Traffic
                                                    25
      Link-State Management

• Error Detection and Correction
• Flow control




                                   26
  Error Detection/Correction

  Physical channels are not perfect




Can we detect, possibly correct errors?

                                          27
           Error Detection

Example: Parity bit

Message          Parity Bit
 0011                1        (odd)
 1000                0        (odd)
 0101                0        (even)
 1000                1        (even)

                                       28
      Error Correcting Codes

Detect and correct errors

Example: Hamming Code
         Capable of detecting and
         correcting a single bit error



                                         29
          Flow Control

             A         B


If A sends at a faster rate than B can
        receive, bits will be lost



       We need flow control!
                                         30
        Stop-and-Wait

               A    B


A sends data
                        B sends ACK
A sends more data



                                  31
     Windowed Flow Control

               A        B


A sends packets 1, 2, 3
                    B sends ACK for 1, 2
A sends packets 4, 5
                    B sends ACK for 3, 4, 5

                                        32
        Switching Schemes

How much “state” about the connection
  between two hosts does each
  node/router along a path through the
  network maintain?




                                         33
         Switching Schemes

(1) Circuit Switching

(2) Message Switching (Store-and-Forward)

(3) Packet Switching (Store-and-Forward)



                                       34
          Circuit Switching

• Provides service by setting up the total
  path of connected lines from the origin
  to the destination
• Example: Telephone network




                                             35
     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

                                               36
       Circuit Switching (cont’d)
                      Call request signal



Propagation Delay
Time




                                                                     Transmission
                                                                     Delay

                                            Call accept signal



              Data
       Transmission
              Time
                                               Data


                      A                B                    C    D          IMPs
                                                                                    37
            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



                                                       38
       Message Switching (cont’d)


        Header
                     Msg
Time




                                                        Transmission
                                                        Delay

                               Msg
                                         Queueing
                                         Delay



                                            Msg



                 A         B         C              D          IMPs
                                                                       39
            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
• Pipelining




                                                  40
       Packet Switching (cont’d)

                    Pkt 1
       Header
Time




                    Pkt 2

                                Pkt 1
                    Pkt 3
                                                        Transmission
                                Pkt 2
                                                        Delay
                                            Pkt 1
                                Pkt 3

                                            Pkt 2


                                            Pkt 3




                A           B           C           D      IMPs
                                                                  41
              Comparisons

(1) Header Overhead
      Circuit < Message < Packet
(2) Transmission Delay
     Short Bursty Messages:
           Packet < Message < Circuit
     Long Continuous Messages:
           Circuit < Message < Packet


                                        42
                     Routing

        A slightly more complex network:
        packet
                     ?
    A            B              D          E

                 ?
                         C
If A sends packets to E, B has to make a routing
                     decision
   Analogy: Zip code specifies destination, not
              route used to get there
                                               43
        Fixed Routing Schemes
             A       B            D      E


                            C




• For every source/destination pair, a fixed path is given
• Example: A to B to D to E
• Easy to implement, but
   (1) What if link BD fails?
   (2) What if link BD is congested?


                                                        44
     Dynamic Routing Schemes
             A       B            D      E


                            C


• Hosts and IMPs periodically exchange information
  and find the best paths for all source/destination pairs
• Can adjust to link failure or congestion, but
   (1) information exchange creates extra traffic
   (2) it takes time for information exchange to happen,
       so information could be outdated
   (3) packet looping can happen

                                                         45
       Congestion Control

What if too many packets flow through a
                network?



             Congestion

   Analogy: Two merging freeways
                                          46
          Packet discarding

• In case of congestion, discard some
  packets
• Require receiving host to send ACK
  when it receives a packet; this way the
  transmitter will know when a packet is
  lost and it can retransmit the packet
• Reactive

                                            47
           Choke Packets

• When the network becomes congested,
  a host or router sends a “choke packet”
  telling a transmitter to slow down
• Reactive




                                        48
       Resource Reservation

• Before sending packets, the transmitter
  tells the network how many packets it
  wants to send
• The network checks to see if it can
  handle those packets and if so, reserves
  resources for those packets. It not, the
  packets have to wait.
• Preventive

                                         49
Layering and Encapsulation




                             50
            Why Layering?

• Network communication is very complex
• Separation of concerns
   Different vendors and organizations
    responsible for different layers
   Testing and maintenance is simplified

   Easy to replace a single layer with a

    different version


                                            51
            Protocol Hierarchy

• Use layers to hide complexity
     Each layer implements a service
       – Layer N uses service provided by layer N-1
       – layer N-1 provides a service to layer N
     Protocols
       – Each layer communicates with its peer by a set
         of rules
• Interface
     A layers interface specifies the operations
                                                      52
Protocol Hierarchy (cont’d)
Host A                        Host B
Layer 7
           Layer 7 Protocol   Layer 7


           Layer 6 Protocol
Layer 6                       Layer 6

           Layer 5 Protocol
Layer 5                       Layer 5

           Layer 4 Protocol
Layer 4                       Layer 4

           Layer 3 Protocol
Layer 3                       Layer 3


           Layer 2 Protocol
Layer 2                       Layer 2

           Layer 1 Protocol
Layer 1                       Layer 1
           Physical Medium              53
Different Layering Architectures

• ISO OSI 7-Layer Architecture
• TCP/IP 4-Layer Architecture
• Novell NetWare IPX/SPX 4-Layer
  Architecture




                                   54
 Standards Making Organizations

ISO = International Standards Organization
ITU = International Teletraffic 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


                                                          55
       Why So Many Standards
          Organizations?

• Multiple technologies
• Different areas of emphasis and history
     Telecommunications/telephones
       – ITU,ISO,ATM
     Local area networking/computers
       – IETF, IEEE
     System area networks/storage
       – ANSI

                                            56
ISO OSI Layering Architecture
  Host A                                     Host B
  Application        Application Protocol    Application
    Layer                                      Layer


 Presentation       Presentation Protocol    Presentation
    Layer                                       Layer


   Session             Session Protocol       Session
    Layer                                      Layer


  Transport           Transport Protocol     Transport
    Layer                                      Layer

   Network      Network           Network     Network
    Layer        Layer             Layer       Layer


   Data Link    Data Link        Data Link   Data Link
    Layer        Layer            Layer       Layer


   Physical     Physical          Physical    Physical
    Layer        Layer             Layer       Layer
                                                            57
                  Router            Router
        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


                                                          58
       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?

                                                   59
      Layer 2: Data Link Layer

• Functions:
   Provides reliable transfer of information between
    two adjacent nodes
   Creates frames, or packets, 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
                                                        60
        Layer 3: Network Layer

• Functions:
     Responsible for routing decisions
       – Dynamic routing
       – Fixed routing
     Performs congestion control




                                          61
       Layer 4: Transport Layer

• Functions:
     Hide the details of the network from the
      session layer
       – 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



                                                           62
                Transport Layer (cont’d)
              Host A                                     Host B
              Application        Application Protocol    Application
                Layer                                      Layer
   first
end-to-end
             Presentation       Presentation Protocol    Presentation
  layer         Layer                                       Layer


               Session             Session Protocol       Session
                Layer                                      Layer


              Transport           Transport Protocol     Transport
                Layer                                      Layer

               Network      Network           Network     Network
                Layer        Layer             Layer       Layer


               Data Link    Data Link        Data Link   Data Link
                Layer        Layer            Layer       Layer


               Physical     Physical          Physical    Physical
                Layer        Layer             Layer       Layer
                                                                        63
                            Router            Router
      Transport Layer (cont’d)

• Functions (cont’d):
   Perform end-to-end flow control
   Perform packet retransmission when

    packets are lost by the network




                                         64
      Layer 5: Session Layer

• May perform synchronization between
  several communicating applications
• Groups several user-level connections
  into a single “session”




                                          65
      Layer 6: Presentation Layer

• Performs specific functions that are
  requested regularly by applications
• Examples:
   encryption
   ASCII to Unicode, Unicode to ASCII

   LSB-first representations to MSB-first

    representations


                                             66
      Layer 7: Application Layer

• Application layer protocols are
  application-dependent
• Implements communication between
  two applications of the same type
• Examples:
   FTP
   Quake

   SMTP (email)


                                      67
               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

                                                   68
               Encapsulation
                Data

 Application
               AH   Data
   Layer


Presentation
               PH      Data
                                            • Headers
   Layer


  Session
               SH       Data
   Layer


 Transport
               TH          Data
   Layer

  Network
   Layer
               NH             Data
                                            • Trailer
  Data Link
               DH              Data         DT
   Layer


  Physical
               PH                    Data
   Layer                                                69
TCP/IP Layering Architecture

                   • A simplified model
Application
                   • The network layer
                         Hosts drop packets into
 Transport                this layer, layer routes
                          towards destination- only
                          promise- try my best
Internet/Network
                   • The transport layer
                         reliable byte-oriented
Host-to-Net               stream




                                                   70
TCP/IP Layering Architecture (cont’d)


   Host A                                               Host B
   Application             Application Protocol         Application
     Layer                                                Layer

   Transport           Transport Protocol (TCP)         Transport
     Layer                                                Layer

    Network
                 IP   Network
                                  IP    Network
                                                   IP    Network
     Layer             Layer             Layer            Layer


    Host-to-           Host-to-         Host-to-         Host-to-
   Net Layer          Net Layer        Net Layer        Net Layer




                                                                      71
     Internet Design Principles

   Scale
     – Protocols should work in networks of all sizes and
       distances
   Incremental deployment
     – New protocols need to be deployed gradually
   Heterogeneity
     – Different technologies, autonomous organizations
   End-to-end argument
     – Some functions can only be correctly implemented at the
       end hosts; the network should not provided these.


                                                             72
Measuring Network Performance

       A Brief Introduction



                              73
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




                                                     74
              Some Definitions

• Packet length: size of a packet (units = bits or bytes)
• Channel speed: How fast the channel can transmit
  bits (units = bits/second)
• Packet transmission time: amount of time to
  transmit an entire packet (units = seconds)
• Propagation delay: Delay imposed by the properties
  of the link. Depends on the link’s distance (units =
  seconds)



                                                        75
            More Definitions

4 Performance Metrics:
• Overhead: Time computer spends managing protocol
  layers (packet is not even on the wire yet … )
• Latency: Time packet spends from one host to
  another
• Per-bit Bandwidth: amount of time to move B bits
  (units = seconds)
• Per-message Bandwidth: Amount of time to move P
  packets (units = seconds)


                                                 76
                         Example
                     A                   B
                             500 m

                   Protocol overhead = 40 msec
                    packet length = 1500 bytes
                   channel capacity = 100 Mbps
               propagation delay factor = 5 msec/km

1.   How long to format the data?
2.   How long does it take a single bit to travel on the link
     from A to B?
3.   How long does it take A to transmit an entire packet
     onto the link?
                                                            77
                  Digression: Units
• Bits are the units used to describe an amount of data in a
  network
       1 kilobit (Kbit)     = 1 x 103 bits = 1,000 bits
       1 megabit (Mbit)     = 1 x 106 bits = 1,000,000 bits
       1 gigabit (Gbit)     = 1 x 109 bits = 1,000,000,000 bits
• Seconds are the units used to measure time
       1 millisecond (msec) = 1 x 10-3 seconds = 0.001 seconds
       1 microsecond (msec) = 1 x 10-6 seconds = 0.000001 seconds
       1 nanosecond (nsec) = 1 x 10-9 seconds = 0.000000001 seconds
• Bits per second are the units used to measure channel
  capacity/bandwidth and throughput
       bit per second (bps)
       kilobits per second (Kbps)
       megabits per second (Mbps)
                                                                       78
              Getting to the wire

Stylized format required to send data
    Analogy: adding envelope to letter
Host A
Application
  Layer       How long does it take to execute all
 Transport    these layers?
   Layer
              Why is this time important?
 Network
  Layer
              Higher traffic -> less compute time for
  Host-to-
 Net Layer
              application

                                                        79
                          Analogy
     Think of a transmission link as a water pipe
     with buckets of ice either end


1.   Get the water in a movable form (packet formatting)
2.   The thicker the pipe, the more water it can carry from one end
     to the other
3.   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 delay
                                                                      80
      Packet Transmission Time

How long does it take A to transmit an entire packet onto
   the link?
   Relevant information: packet length = 1500 bytes
                         channel capacity = 10 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       1500 x 8 bits   Solving for t…
                 =                     t = 0.00012 sec (or 120 msec)
       1 sec               t
                                                               81
                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           t           Solving for t…
                =
      1000 m         500 m                  t = 2.5 msec

                                                                  82
              Putting it all together
Host A                                  Host B
Application
  Layer        40 msec     40 msec up   Application
                                          Layer

Transport
                down                    Transport
  Layer                                   Layer

 Network                                 Network
  Layer              120 msec             Layer


 Host-to-             in/out             Host-to-
Net Layer                               Net Layer



                     2.5 across

Total time: 40+120+2.5+40 = 202.5 msec

                                                      83
             Timeline Method
             Host A        Host B

       40                       Send overhead
                1st bit
       2.5                      Propagation delay

Time
       120                     Transmission time

                last bit



       40                       Receive Overhead
                                                84
                                      84

				
DOCUMENT INFO