Governing Communication

  • 273 views
Uploaded on

 

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
273
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
6
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. CMPE 151: Network Administration Lecture 2
  • 2. Review?
    • Network protocols.
    • TCP/IP.
  • 3. Outline
    • Network protocols.
    • IP
    • TCP
  • 4. 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!
  • 5. Protocol stack Host Host Application Transport Network Link User A User B Teleconferencing Layering: technique to simplify complex systems Peers
  • 6. 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).
  • 7. Encapsulation
  • 8. 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!
  • 9. Layering Functionality
    • Reliability
    • Flow control
    • Fragmentation
    • Multiplexing
    • Connection setup (handshaking)
    • Addressing/naming (locating peers)
  • 10. Example: Transport layer
    • First end-to-end layer.
    • End-to-end state.
    • May provide reliability, flow and congestion control.
  • 11. Example: Network Layer
    • Point-to-point communication.
    • Network and host addressing.
    • Routing.
  • 12. Internetworking
  • 13. 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.
  • 14. Internetworks (cont’d)
  • 15. 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.
  • 16. IP
  • 17. 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.
  • 18. 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?
  • 19. 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
  • 20. The Internet Protocol Router Router Host Host Application Transport Network IP IP IP IP Network
  • 21. 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.
  • 22. IP Datagram Format
    • IP datagram consists of header and data (or payload).
    • Header:
      • 20-byte fixed (mandatory) part.
      • Variable length optional part.
  • 23. 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).
  • 24. IP(v4) Header Format Header Payload
  • 25. 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.
  • 26. Encapsulation - Example
  • 27. 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.
  • 28. Encapsulation Across Multiple Hops - Example
  • 29. 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).
  • 30. 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.
  • 31. 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.
  • 32. Fragmentation - Example
  • 33. Addressing
  • 34. 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.
  • 35. 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 ”).
  • 36. 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.
  • 37. 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.
  • 38. 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.
  • 39. 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.
  • 40. IP Address Format (cont’d)
    • How can we recognize to which class an IP address belongs to?
      • Look at the first 4 bits!
  • 41. 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.
  • 42. 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
  • 43. Networks and Hosts in Each Class
  • 44. Understanding IP Addresses
    • Examples:
      • 10 . 0.0.37 (class A)
      • 128.10 . 0.1 (class B)
      • 192.5.48 . 3 (class C)
  • 45. 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”.
  • 46. 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.
  • 47. 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.
  • 48. 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.
  • 49. 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.
  • 50. 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.
  • 51. TCP Reliability
    • Reliable delivery.
      • ACKs.
      • Timeouts and retransmissions.
    • Ordered delivery.
  • 52. 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.
  • 53. 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
  • 54. 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.
  • 55. 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.
  • 56. TCP Protocol Overview 2
    • Sequence numbers.
      • Reliability, ordering, and flow control.
      • Assigned to every byte .
      • 32-bit sequence numbers.
  • 57. 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)
  • 58. TCP Connection Release 1
    • Abrupt release:
      • Send RESET.
      • May cause data loss.
  • 59. 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.
  • 60. 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.
  • 61. 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.
  • 62. 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.
  • 63. 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.
  • 64. 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
  • 65. 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.
  • 66. 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.
  • 67. 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).
  • 68. 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.
  • 69. 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.
  • 70. TCP Congestion Control: Example threshold timeout threshold cwin time
  • 71. TCP Retransmission Timer
    • When segment sent, retransmission timer starts.
      • If segment ACKed, timer stops.
      • If time out, segment retransmitted and timer starts again.
  • 72. 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.
  • 73. 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.
  • 74. 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.
  • 75. Client-Server Model Client Kernel File Server Kernel Printer Server Kernel
  • 76. 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.
  • 77. The Web and HTTP
  • 78. 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.
  • 79. 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.
  • 80. 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.
  • 81. 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
  • 82. DNS
    • Hierarchical name space.
    • Distributed database.
    • RFCs 1034 and 1035.
  • 83. 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.
  • 84. 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.
  • 85. 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.
  • 86. 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.
  • 87. 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)
  • 88. 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).
  • 89. Remote access
  • 90. Telnet User’s machine Telnet client OS TCP connection over Internet Telnet server OS
  • 91. 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.