• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Governing Communication
 

Governing Communication

on

  • 601 views

 

Statistics

Views

Total Views
601
Views on SlideShare
600
Embed Views
1

Actions

Likes
0
Downloads
6
Comments
0

1 Embed 1

http://www.slideshare.net 1

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Governing Communication Governing Communication Presentation Transcript

    • CMPE 151: Network Administration Lecture 2
    • Review?
      • Network protocols.
      • TCP/IP.
    • Outline
      • Network protocols.
      • IP
      • TCP
    • What are protocols?
      • Set of rules governing communication between network elements (applications, hosts, routers).
      • Protocols define:
        • Format and order of messages.
        • Actions taken on receipt of a message.
      • Protocols are hard to design
        • We need design guidelines!
    • Protocol stack Host Host Application Transport Network Link User A User B Teleconferencing Layering: technique to simplify complex systems Peers
    • Layering Characteristics
      • Each layer relies on services from layer below and exports services to layer above.
      • Interface defines interaction,
      • Hides implementation - layers can change without disturbing other layers (black box).
    • Encapsulation
    • OSI Model: 7 Protocol Layers
      • Physical: how to transmit bits
      • Data link: how to transmit frames
      • Network: how to route packets hop2hop
      • Transport: how to send packets end2end
      • Session: how to tie flows together
      • Presentation: byte ordering, security
      • Application: everything else!
    • Layering Functionality
      • Reliability
      • Flow control
      • Fragmentation
      • Multiplexing
      • Connection setup (handshaking)
      • Addressing/naming (locating peers)
    • Example: Transport layer
      • First end-to-end layer.
      • End-to-end state.
      • May provide reliability, flow and congestion control.
    • Example: Network Layer
      • Point-to-point communication.
      • Network and host addressing.
      • Routing.
    • Internetworking
    • Internetworking
      • Interconnection of 2 or more networks forming an internetwork, or internet.
        • LANs, MANs, and WANs.
      • Different networks mean different protocols.
        • TCP/IP, IBM’s SNA, DEC’s DECnet, ATM, Novell and AppleTalk.
    • Internetworks (cont’d)
    • TCP/IP
      • TCP/IP is the most widely used internetworking protocol suite
        • Initially funded through ARPA.
        • Picked up by NSF.
        • Used in the Internet.
      • Other internetworking protocols exist but are less used
        • Example: AppleTalk, X.25, etc.
    • IP
    • The Internet Protocol: IP
      • Glues Internet together.
      • Common network-layer protocol spoken by all Internet participating networks.
      • Best effort datagram service:
        • No reliability guarantees.
        • No ordering guarantees.
    • IP (cont’d)
      • IP is responsible for datagram routing.
      • Important : each datagram is routed independently!
        • Two different datagrams from same source to same destination can take different routes!
        • Why?
        • Implications?
    • IP (cont’d)
      • IP provides a best effort delivery mechanism
        • Does not guarantee to prevent duplicate datagrams, delayed and out-of-order delivery, corruption of data or datagram loss
      • Reliable delivery is provided by the transport layer , not the network layer (IP)
      • Network layer (IP) can detect and report errors without actually fixing them
    • The Internet Protocol Router Router Host Host Application Transport Network IP IP IP IP Network
    • Datagrams
      • Transport layer breaks data streams into datagrams which are transmitted over Internet, possibly being fragmented.
      • When all datagram fragments arrive at destination, reassembled by network layer and delivered to transport layer at destination host.
    • IP Datagram Format
      • IP datagram consists of header and data (or payload).
      • Header:
        • 20-byte fixed (mandatory) part.
        • Variable length optional part.
    • IP Versions
      • IPv4: IP version 4.
        • Current, predominant version.
        • 32-bit long addresses.
      • IPv6: IP version 6.
        • Evolution of IPv4.
        • Longer addresses (16-byte long).
    • IP(v4) Header Format Header Payload
    • Encapsulation
      • Each datagram is encapsulated within a data link layer frame
        • The whole datagram is placed in the data area of the frame.
        • The data link layer addresses for source and destination included in the frame header.
    • Encapsulation - Example
    • Encapsulation Across Multiple Hops
      • Each router in the path from source to destination:
        • Decapsulates datagram from incoming frame.
        • Forwards datagram - determines next hop.
        • Encapsulate datagram in outgoing frame.
    • Encapsulation Across Multiple Hops - Example
    • Maximum Transfer Unit
      • Each data link layer technology specifies the maximum size of a frame.
        • Called the Maximum Transfer Unit (MTU).
          • Ethernet: 1,500 bytes.
          • Token Ring: 2048 or 4096 bytes.
      • What happens when large packet wants to travel through network with smaller MTU?
        • Maximum payloads (data portion of datagram) range from 48 bytes (ATM cells) to 64Kbytes (IP packets).
    • Fragmentation
      • Another solution (used by IP): fragmentation.
      • Gateways break packets into fragments to fit the network’s MTU ; each sent as separate datagram.
      • Gateway on the other side have to reassemble fragments into original datagram.
    • Keeping Track of Fragments
      • Fragments must be numbered so that original data stream can be reconstructed.
      • Define elementary fragment size that can pass through every network.
      • When packet fragmented, all pieces equal to elementary fragment size, except last one (may be smaller).
      • Datagram may contain several fragments.
    • Fragmentation - Example
    • Addressing
    • Universal Addressing
      • One key aspect of internetworks is unique addresses.
      • Sending host puts destination internetworking address in the packet.
      • Destination addresses can be interpreted by any intermediate router/gateway.
      • Router/gateway examines address and forwards packet on to the destination.
    • IP Addresses
      • Each machine on the Internet has a unique IP address.
      • The IP address is different from the “physical” /“MAC” address.
        • The “physical address” is the address of a computer (actually, of a NIC) in the LAN.
          • It is only know within the LAN.
        • The IP address is a universal address.
        • When a packet arrives in a LAN, there needs to be a conversion from IP to MAC address (local “ address resolution ”).
    • IP Addresses (cont’d)
      • An IP address is represented by a binary number with 32 bits (in IPv4).
        • Meaning that there are around 4 billion addresses.
        • Often IP addresses are represented in “dotted decimal”, such as 128.114.144.4.
          • Each group of numbers can go from 0 to 255.
    • IP Address Organization
      • Each IP address is divided into a prefix and a suffix
        • Prefix identifies network to which computers are attached.
        • Suffix identifies computers within that network.
    • Network and Host Numbers
      • Every network in a TCP/IP internet is assigned a unique network number.
      • Each host on a specific network is assigned a host address that is unique within that network.
      • Host’s IP address is the combination of the network number (prefix) and host address (suffix).
      • Assignment of network numbers must be coordinated globally; assignment of host addresses can be managed locally.
    • IP Address Format
      • IP address are 32 bits long.
      • There are different classes of addresses , corresponding to different subdivisions of the 32 bits into prefix and suffix.
        • Some address classes have large prefix , small suffix.
          • Many such networks, few hosts per network.
        • Other address classes have small prefix, large suffix.
          • Few such networks, many hosts per network.
    • IP Address Format (cont’d)
      • How can we recognize to which class an IP address belongs to?
        • Look at the first 4 bits!
    • IP Address Format (cont’d)
      • Class A, B and C are primary classes.
        • Used for ordinary addressing.
      • Class D is used for multicast , which is a limited form of broadcast.
        • Internet hosts join a multicast group.
        • Packets are delivered to all members of the group.
        • Routers manage delivery of single packets from source to all members of multicast group.
      • Class E is reserved.
    • IP Addresses (cont’d)
      • Another way to determine the address class is by looking at the first group of numbers in the dotted decimal notation
    • Networks and Hosts in Each Class
    • Understanding IP Addresses
      • Examples:
        • 10 . 0.0.37 (class A)
        • 128.10 . 0.1 (class B)
        • 192.5.48 . 3 (class C)
    • IP addresses: how to get one?
      • ICANN (Internet Corporation for Assigned Names and Numbers) coordinate IP address assignment.
      • How does host get its IP address in the network? 2 possibilities:
        • 1: Hard-coded by system administrator in a file inside the host.
        • 2: DHCP : “Dynamic Host Configuration Protocol”
          • Dynamically get address: “plug-and-play”.
    • DHCP
      • DHCP allows a computer to join a new network and automatically obtain an IP address The network administrator establishes a pool of addresses for DHCP to assign.
      • When a computer boots, it broadcasts a DHCP request to which a server sends a DHCP reply.
    • DHCP (Cont’d)
      • DHCP allows non-mobile computers that run server software to be assigned a permanent address (won’t change when the computer reboots).
        • The permanent address actually needs to be re-negotiated after a certain period of time.
    • The Internet Transport Protocols: TCP and UDP
      • UDP: user datagram protocol (RFC 768).
        • Connection-less protocol.
      • TCP: transmission control protocol (RFCs 793, 1122, 1323).
        • Connection-oriented protocol.
    • UDP
      • Provides connection-less, unreliable service.
        • No delivery guarantees.
        • No ordering guarantees.
        • No duplicate detection.
      • Low overhead.
        • No connection establishment/teardown.
      • Suitable for short-lived connections.
        • Example: client-server applications.
    • TCP
      • Reliable end-to-end communication.
      • TCP transport entity:
        • Runs on machine that supports TCP.
        • Interfaces to the IP layer.
        • Manages TCP streams.
          • Accepts user data, breaks it down and sends it as separate IP datagrams.
          • At receiver, reconstructs original byte stream from IP datagrams.
    • TCP Reliability
      • Reliable delivery.
        • ACKs.
        • Timeouts and retransmissions.
      • Ordered delivery.
    • TCP Service Model 1
      • Obtained by creating TCP end points.
        • Example: UNIX sockets.
        • Socket number or address: IP address + 16-bit port number (TSAP).
        • Multiple connections can terminate at same socket.
        • Connections identified by socket ids at both ends.
        • Port numbers below 1024: well-known ports reserved for standard services.
          • List of well-known ports in RFC 1700.
    • TCP Service Model 2
      • TCP connections are full-duplex and point-to-point.
      • Byte stream (not message stream).
        • Message boundaries are not preserved e2e.
      A B C D 4 512-byte segments sent as separate IP datagrams A B C D 2048 bytes of data delivered to application in single READ
    • TCP Byte Stream
      • When application passes data to TCP, it may send it immediately or buffer it.
      • Sometimes application wants to send data immediately.
        • Example: interactive applications.
        • Use PUSH flag to force transmission.
        • TCP could still bundle PUSH data together (e.g., if it cannot transmit it right away).
      • URGENT flag.
        • Also forces TCP to transmit at once.
    • TCP Protocol Overview 1
      • TCP’s TPDU: segment.
        • 20-byte header + options.
        • Data.
      • TCP entity decides the size of segment.
        • 2 limits: 64KByte IP payload and MTU.
        • Segments that are too large are fragmented.
          • More overhead by addition of IP header.
    • TCP Protocol Overview 2
      • Sequence numbers.
        • Reliability, ordering, and flow control.
        • Assigned to every byte .
        • 32-bit sequence numbers.
    • TCP Connection Setup
      • 3-way handshake.
      Host 1 Host 2 SYN (SEQ=x) SYN(SEQ=y,ACK=x+1) (SEQ=x+1, ACK=y+1)
    • TCP Connection Release 1
      • Abrupt release:
        • Send RESET.
        • May cause data loss.
    • TCP Connection Release 2
      • Graceful release:
        • Each side of the connection released independently.
          • Either side send TCP segment with FIN=1.
          • When FIN acknowledged, that direction is shut down for data.
          • Connection released when both sides shut down.
        • 4 segments: 1 FIN and 1 ACK for each direction; 1st. ACK+2nd. FIN combined.
    • TCP Connection Release 3
      • Timers to avoid 2-army problem.
        • If response to FIN not received within 2*MSL (maximum segment lifetime), FIN sender releases connection.
      • After connection released, TCP waits for 2*MSL (e.g., 120 sec) to ensure all old segments have aged.
    • TCP Transmission
      • Sender process initiates connection.
      • Once connection established, TCP can start sending data.
      • Sender writes bytes to TCP stream.
      • TCP sender breaks byte stream into segments.
        • Each byte assigned sequence number.
        • Segment sent and timer started.
    • TCP Transmission (cont’d)
      • If timer expires, retransmit segment.
        • After retransmitting segment for maximum number of times, assumes connection is dead and closes it.
      • If user aborts connection, sending TCP flushes its buffers and sends RESET segment.
      • Receiving TCP decides when to pass received data to upper layer.
    • TCP Flow Control
      • Sliding window.
        • Receiver’s advertised window .
          • Size of advertised window related to receiver’s buffer space.
          • Sender can send data up to receiver’s advertised window.
    • TCP Flow Control: Example 2K;SEQ=0 ACK=2048; WIN=2048 2K; SEQ=2048 ACK=4096; WIN=0 ACK=4096; WIN=2048 1K; SEQ=4096 App. writes 2K of data 4K 2K 0 App. reads 2K of data 2K 1K App. does 3K write Sender blocked Sender may send up to 2K
    • TCP Flow Control: Observations
      • TCP sender not required to transmit data as soon as it comes in from application.
        • Example: when first 2KB of data comes in, could wait for more data since window is 4KB.
      • Receiver not required to send ACKs as soon as possible.
        • Wait for data so ACK is piggybacked.
    • Congestion Control
      • Why do it at the transport layer?
        • Real fix to congestion is to slow down sender.
      • Use law of “conservation of packets”.
        • Keep number of packets in the network constant.
        • Don’t inject new packet until old one leaves.
      • Congestion indicator: packet loss.
    • TCP Congestion Control
      • Like, flow control, also window based.
        • Sender keeps congestion window (cwin) .
        • Each sender keeps 2 windows: receiver’s advertised window and congestion window.
        • Number of bytes that may be sent is min(advertised window, cwin).
    • TCP Congestion Control (cont’d)
      • Slow start [Jacobson 1988]:
        • Connection’s congestion window starts at 1 segment.
        • If segment ACKed before time out, cwin=cwin+1.
        • As ACKs come in, current cwin is increased by 1.
        • Exponential increase.
    • TCP Congestion Control (cont’d)
      • Congestion Avoidance:
        • Third parameter: threshold .
        • Initially set to 64KB.
        • If timeout, threshold=cwin/2 and cwin=1.
        • Re-enters slow-start until cwin=threshold.
        • Then, cwin grows linearly until it reaches receiver’s advertised window.
    • TCP Congestion Control: Example threshold timeout threshold cwin time
    • TCP Retransmission Timer
      • When segment sent, retransmission timer starts.
        • If segment ACKed, timer stops.
        • If time out, segment retransmitted and timer starts again.
    • How to set timer?
      • Based on round-trip time: time between a segment is sent and ACK comes back.
      • If timer is too short, unnecessary retransmissions.
      • If timer is too long, long retransmission delay.
    • Jacobson’s Algorithm 1
      • Determining the round-trip time:
        • TCP keeps RTT variable.
        • When segment sent, TCP measures how long it takes to get ACK back ( M ).
        • RTT = alpha*RTT + (1-alpha)M.
        • alpha: smoothing factor; determines weight given to previous estimate.
        • Typically, alpha=7/8.
    • Jacobson’s Algorithm 2
      • Determining timeout value:
        • Measure RTT variation, or |RTT-M|.
        • Keeps smoothed value of cumulative variation D=alpha*D+(1-alpha)|RTT-M|.
        • Alpha may or may not be the same as value used to smooth RTT.
        • Timeout = RTT+4*D.
    • Client-Server Model Client Kernel File Server Kernel Printer Server Kernel
    • File Transfer
      • Sharing remote files: “on-line” access versus “file transfer”.
      • “ On-line” access transparent access to shared files, e.g., distributed file system.
      • Sharing through file transfer: user copies file then operates on it.
    • The Web and HTTP
    • The Web
      • WWW, or the world-wide web is a resource discovery service.
        • Resource space is organized hierarchically, and resources are linked to one another according to some relation.
        • Hypertext organization: link “granularity”; allows links within documents.
        • Graphical user interface.
    • The Client Side
      • Users perceive the Web as a vast collection of information.
        • Page is the Web’s information transfer unit.
        • Each page may contain links to other pages.
        • Users follow links by clicking on them which takes them to the corresponding page.
        • This process can go on indefinetly, traversing several pages located in different places.
    • The Browser
      • Program running on client that retrieves and displays pages.
        • Interacts with server of page.
        • Interprets commands and displays page.
      • Examples: Mosaic, Netscape’s Navigator and Communicator, Microsoft Internet Explorer.
      • Other features: back, forward, bookmark, caching, handle multimedia objects.
    • Domain Name System (DNS)
      • Basic function: translation of names (ASCII strings) to network (IP) addresses and vice-versa.
      • Example:
        • zephyr.isi.edu <-> 128.9.160.160
    • DNS
      • Hierarchical name space.
      • Distributed database.
      • RFCs 1034 and 1035.
    • How is it used?
      • Client-server model.
        • Client DNS (running on client hosts), or resolver.
        • Application calls resolver with name.
        • Resolver contacts local DNS server (using UDP) passing the name.
        • Server returns corresponding IP address.
    • Name Resolution 1
      • Application wants to resolve name.
      • Resolver sends query to local name server.
        • Resolver configured with list of local name servers.
        • Select servers in round-robin fashion.
      • If name is local, local name server returns matching authoritative RRs.
        • Authoritative RR comes from authority managing the RR and is always correct.
        • Cached RRs may be out of date.
    • Name Resolution 2
      • If information not available locally (not even cached), local NS will have to ask someone else.
        • It asks the server of the top-level domain of the name requested.
    • Electronic Mail
      • Non-interactive.
        • Deferred mail (e.g., destination temporarily unavailable).
      • Spooling:
        • Message delivery as background activity.
        • Mail spool: temporary storage area for outgoing mail.
    • Mail system User interface User sends mail User reads mail Outgoing mail spool Mailboxes incoming mail Client (send) Server (receive) TCP connection (outgoing) TCP connection (incoming)
    • Observations
      • When user sends mail, message stored is system spool area.
      • Client transfer runs on background.
      • Initiates transfer to remote machine.
      • If transfer succeeds, local copy of message removed; otherwise, tries again later (30 min) for a maximum interval (3 days).
    • Remote access
    • Telnet User’s machine Telnet client OS TCP connection over Internet Telnet server OS
    • Telnet basic operation
      • When user invokes telnet, telnet client on user machine establishes TCP connection to specified server.
      • TCP connection established; user’s keystrokes sent to remote machine.
      • Telnet server sends back response, echoed on user’s terminal.
      • Telnet server can accept multiple concurrent connections.