ONGD lecture slides Part 3

Dec 03, 2009 23:32

Networking Fundamental
  • Topics
    • Overview of Networks
    • Reasons for Networks
    • Latency on large networks
    • Local Area Network Topologies
    • Network Performance
    • Wireless Networks
    • Addresses
    • Protocols
    • OSI Protocol Model
    • Comparing TCP/IP to OSI
  • Overview of Networks
    • Distributed applications run over networks that link computers together
    • In Information Technology, a network is a series of points or nodes interconnected by communication paths
    • Networks can be characterized in terms of either the topology or spatial distance
    • A network can also be characterized by the type of data transmission technology it uses
  • Networks by size
    • LAN (Local Area Network)
      • Unswitched (does not use routers)
      • Usually covers a building
    • MAN (Metropolitan Area Network)
      • Unswitched
      • Covers a city
    • WAN (Wide Area Network)
      • Switched (uses routers)
      • May cover a country, state or the whole world
  • Reasons for Networks
    • Resource Sharing
    • High Reliability
    • Save Money
    • Improve Corporate Communication
    • Quality of Service
  • Performance Issues for Distributed Networks
    • Performance issues are concerned with the speed at which messages can be transferred over the network. There are two key concerns:
    • Latency is the delay after a send operation is executed and before data starts to arrive at the destination node
    • Data Transfer Rate is the speed that data can be transferred over the network, usually defined in bits per second (bps)
  • Network speed
    • The time required to transmit a message is transmission time = latency + length ÷ data transfer rate
    • The total system bandwidth is a way of measuring the capacity or throughput of a network. It refers to the volume of traffic that can be transferred across the network in a period of time, usually one second. It is frequently expressed in millions or billions of bits per second, as Mbps or Gbps
  • Latency on large networks
    • Switching delays at routers and the time required to find and set up a communication path can cause latency delays on large networks such as the Internet that are several orders of magnitude larger than local area networks
    • Most of us are familiar with the Internet 404 errors that occur when the time to access information is longer than the timeout allowed for searching. Some of this is from latency delays, although most of it is from busy hosts or missing nodes
  • Scalability
    • As a network grows in the number of nodes, it is a severe challenge to maintain performance. Bottlenecks and complexity often degrade throughput
    • Scalability refers to the ability of a network to grow in size without substantial loss of performance
  • Reliability
    • The original DARPANET, from which the Internet evolved, was designed as a military network to survive a nuclear attack. A key concern was reliability, in this case the ability to continue to transfer messages in the event of failures on the network. Error tolerant and error free communications are key reliability concerns
  • Security
    • Networks are also concerned with protection from unauthorized use, loss or compromise of data and with external threats to the ability to transfer messages or the integrity of messages. These topics are the subject of future lectures on distributed system security
  • Mobility
    • Personal digital assistants, laptop computers and cellular phones are examples of mobile devices that may need access to a network at different locations. Networks must be designed to allow this to occur in an efficient, secure and productive manner
  • Quality of Service
    • Metrics have been established to measure the reliability and bandwidth of networks. These often focus on throughput or bandwidth adjusted for possible failures and expressed as a minimum acceptable quality of service and a desired level
  • Multicasting
    • Most networks are designed for point to point transfer of information between two nodes. There may also be a requirement for one-to-many communication, and some networks are designed to do this in an efficient manner
  • Local Area Network Topologies
    • Bus Topology
    • Ring Topology
    • Star Topology
    • Tree Topology
  • Local Area Network Bandwidth
    • As new and existing network applications increase the demands of using high-resolution graphics, video and other rich media data types, pressure is growing at the desktop computers, the servers, hubs and switches, for increasing needs of bandwidth.
    • There are various categories of bandwidth-intensive applications, such as:
      • Scientific modeling, publication and medical imaging applications, producing multimedia and graphic files that range in size from megabytes to gigabytes and even terabytes
      • Data warehousing and backup applications, handling gigabytes and terabytes of data distributed among hundred of servers and storage systems
      • Internet and intranet applications, creating traffic pattern composed of text, graphics and images. They are expected to expand in the near future to include more bandwidth-intensive audio, video and voice
      • Mission-critical business applications, such as desktop video conferencing, interactive white boarding and real-time video. Not only do they require more raw bandwidth, they also demand low latency and limited jitter to be effective
  • Network Principles: Packets
    • In order to send many messages across a network, individual messages can be broken into smaller chunks, called packets.
    • Packets usually have a maximum size, to allow nodes in the network to reserve enough memory buffer space, ensuring that:
      • the message can be received
      • sharing of the network is be allowed
      • and reliability and fault detection are improved
  • Network Principles: Contention
    • A basic problem in almost every network is resource contention.
    • One of the most basic resources is the connections between nodes. Unless you have a fully connected network (where the nodes are directly connected to one another using dedicated lines), you are likely to have a time when two or more messages want to use the same connection at the same time
      • A fully connected network is not practical
      • Imagine spending your first few months at Temasek Polytechnic connection twelve thousand individual wires between your computer and every other computer on campus
  • Addresses
    • Nodes on a network need to have an identifer, so that messages can be sent to the proper node
    • These identifiers are called addresses
      • Example of addresses include telephone numbers and URLs (Uniform Resource Locator)
    • The Internet uses IPV4 and IPV6 addresses as primary identifiers
  • Packet Delivery
    • There are two ways that packets can be delivered to their destination
    • Datagram packet delivery
    • Virtual circuit (or stream) packet delivery
  • Network Principles: Protocols
    • In order to accomplish communications, networks need standard rules to define what is to be done and how to do it
    • These rules are formally specified in documents called protocols
    • A protocol must be specific enough that two nodes, technologies, systems or other parties can communicate without any difficulty
  • Parts of a Protocol
    • Protocols have two parts:
      • A specification of the sequence of the messages that must be exchanged
      • A specification of the format of the data in each part of the message
    • Protocols are implemented with a pair of software modules on the sending and receiving ends
  • Protocols and Interfaces

  • The OSI Protocol Model
    • In 1992, the International Standards Organization (ISO) defined a protocol suite defining a seven layer reference model for open systems
    • By specifying agreed upon layer boundaries, it is possible to divide network tasks into common segments such that collections of cooperating behaviors can accomplish the tasks performed by each segment


  • The Seven OSI Layers
    • Application Layer defines the communication needs of specific applications such as FTP or HTTP
    • Presentation Layer includes encryption and such tasks as placement of fields in a display
    • Session Layer includes reliability and adaptation such as failure detection and automatic recovery
    • Transport Layer defines connection oriented and connectionless protocols at the message level
  • OSI Low Level Layers
    • Network Layer transfers packets between nodes using a protocol specific to the particular network. This may include setting up connections between routers
    • Data Link Layer manages the transfer between nodes connected by a physical link
    • Physical Layer specifies the circuits and hardware that carry electrical, light or electromagnetic signals between nodes
  • How OSI Works

  • Headers and trailers
    • Each level is packaged as data to other levels with a header attached

  • Physical Layer
    • The physical layer just sends bits that might be encoded as different voltage layers for a specified instant of time on an electric wire or as pulses of light on a fiber optic line. There are many possible ways to distinguish a 1 or a 0 on a communications medium
  • Data Link Layer
    • The Data Link layer groups bits into frames or other units and adds additional bits of information to group the bits, indicate the beginning and end of a character, assign sequence numbers for ordering, and provide for error detection and correction with parity and checksums
    • Sequence numbers, parity bits and checksums are all examples of overhead
  • Network Layer
    • The Network Layer adds information that allows the receiver of a message to identify traffic that belongs to it and allows intermediate devices to route information to the proper destination
    • The most common form uses Internet Protocol, which uses IP addresses and ports to identify clients and servers
    • Each message contains the addresses and port numbers of both the client and the server as overhead
  • Transport Layer
    • The Transport Layer can add information for sychronization, breaking messages into chunks, acknowledgement of receipt, timeouts and retransmission of data not acknowledged
    • The most common transport protocols are TCP and UDP
  • Session Layer
    • The Session Layer is an enhancement of the Transport Layer
    • It can add information for dialog control, synchronization, error recovery and similar functions
    • The session and lower levels are all concerned with getting a bit stream across a connection reliably
  • Presentation Layer
    • The Presentation Layer is the lowest layer that is concerned with the meaning of the bits transmitted
    • It identifies collection of bits with identifiers so that they can be assigned meaning
    • Data can be collected into fields and records and assigned labels
  • Application Layer
    • While the Application Layer was originally designed to contain a collection of standardized network applications like electronic mail and file transfer, it has become a general purpose container for applications and protocols that do not fit into the lower levels
    • It lacks a clear separation between applications, application specific protocols, and general purpose protocols such as File Transfer Protocol
  • Packet Assembly
    • The Network layer is responsible for preparing packets to move across the network
    • One requirement is to break up messages into packets that can be no longer than the Maximum Transfer Unit (MTU), including both the header and the data field
      • For example, the MTU for Ethernet is 1500 bytes
    • The IP protocol MTU is 64KB, although most systems are set for 8KB to allow for smaller I/O buffers. If IP packets are sent over Ethernet, they must be fragmented to the Ethernet MTU size
  • Transmission Control Protocol Layers
    • The early specifications of network layers were defined before the OSI model and only include four layers
    • This was done for the Defense Advanced Research Projects Agency (for DARPANET)
    • When the anti-war sentiment was common on college campuses during the Vietnam war, it was renamed the Advanced Research Projects Agency (ARPANET)
    • When portions of ARPANET were opened to public use, those portions became the Internet
  • Comparing TCP/IP to OSI

  • Initial TCP/IP Networks and Protocols

Introduction to Sockets
  • Topics
    • Introduction to Sockets
    • The Socket Interface
    • TCP/IP Network Standard
    • Three Types of Socket
    • TCP vs UDP
    • Connection Oriented Protocols
  • Introduction to Sockets
    • A socket is one of the most fundamental technologies of computer networking
    • The socket is the BSD method for accomplishing interprocess communication (IPC)
    • What this means is that a socket is used to allow one process to speak to another, very much like how the telephone is used to allow one person to speak to another
    • Many of today's most popular software packages - including web browsers, Instant Messaging and File Sharing - rely on sockets
  • The Socket Interface
    • Funded by ARPA (Advanced Research Projects Agency) in 1980
    • Developed at UC Berkeley
    • Objective: To transport TCP/IP software to UNIX
    • The socket interface has become a de facto standard
  • Three Types of Socket
    • Stream sockets interface to the TCP (transmission control protocol)
    • Datagram sockets interface to the UDP (user datagram protocol)
    • Raw sockets interface to the IP (Internet protocol)
  • TCP vs UDP
    • TCP is used for services with a large data capacity and a persistent connection, while UDP is more commonly used for quick lookups and single use query-reply actions
    • Some common examples of TCP and UDP with their default ports:
      • DNS lookup UDP 53 FTP TCP 21 HTTP TCP 80 POP3 TCP 110 Windows shared printed name lookup UDP 137 Telnet TCP 23
  • IPv4 and IPv6
    • Between 1978 to 1982, when the TCP/IP protocols were developed, provisions were made for 232 (about 4 million) hosts. The address protocol, IPv4, has proven inadequate due to the unexpected rapid growth of the Internet and inefficient use of address space
    • IPv6 uses 16 byte (128 bit) addresses allowing 2128 addressable entities. This is roughly 1,000 IP addresses for each square meter of the surface of the Earth, including the oceans
  • Connection Oriented Protocols
    • Also known as session-based protocols, virtual circuits, or sequenced packet exchanges
    • Provide reliable two-way connection service over a session
    • Packets are given unique sequence numbers
    • Delivered packets are individually acknowledged
    • Duplicated packets are detected and discarded
    • Connection-oriented protocols operate in three phases
      • The first phase is the connection setup phase, during which the corresponding entities establish the connection and negotiate the parameters defining the connection
      • The second phase is the data transfer phase, during which the corresponding entities exchange messages under the auspices of the connection
      • Finally, the connection release phase is when the correspondents "tear down" the connection because it is no longer needed
  • TCP/IP
    • TCP/IP is a family of protocols
    • TCP/IP is built on "connectionless" technology. Information is transferred as a sequence of "datagrams"
    • Generally, TCP/IP applications use four layers:
      • An application protocol such as mail
      • A protocol such as TCP that provides services need by many applications
      • IP, which provides the basic service of getting datagrams to their destination
      • The protocols needed to manage to a specific physical medium, such as Ethernet or a point to point line
  • Cost of Session Oriented
    • Reliable service has an overhead cost. You must create and manage the session
    • A lost session must be reestablished by one of the parties, a problem for fault tolerant servers that switch automatically to backup
    • Sessions are a two party affair, and not well suited to broadcasting
  • Passive/Active Socket
    • A passive socket is used by a server to wait for an incoming connection
    • An active socket is used by a client to initiate a connection
  • Sockets
    • When a socket is created it does not contain information about how it will be used
    • TCP/IP protocols define a communication endpoint to consist of an IP address and a protocol port number


  • OSI Layers vs TCP/IP

  • Four Types of Servers

Window Sockets (Client-Server)
  • Topics
    • Internet Protocol (IP)
    • Transport Protocols
    • IP Address and Port
    • Clients and Servers
  • Computer Chat
    • How do we make computers talk?
    • How are they interconnected?
      • Internet Protocol (IP)
  • Internet Protocol (IP)
    • Datagram (packet) protocol
    • Best-effort service
      • Loss
      • Reordering
      • Duplication
      • Delay
    • Host-to-host delivery (not application-to-application)
      • This means that IP takes packets from one host to another host
      • Datagram service analogy to the post office
  • IP Address
    • 32-bit identifier
    • Dotted-quad: 192.118.56.25
    • www.mkp.com → 167.208.101.28
    • Identifies a host interface (not a host)
      • We need some way to identify computers on an Internet network
      • The "dotted-quad" representation is just a more readable version of a real 32-bit number
  • Transport Protocols
    • Best-effort not sufficient
    • Add services on top of IP
    • User Datagram Protocol (UDP)
      • Data checksum
      • Best-effort
    • Transmission Control Protocol (TCP)
      • Data checksum
      • Reliable byte-stream delivery
      • Flow and congestion control
  • Ports
    • Identifying the ultimate destination
    • IP addresses identify hosts
    • Host has many applications
    • Port (16-bit identifier)
    • Application
      WWW
      E-mail
      Telnet Port
      80
      25
    • Ports are analogous to phone extensions from main switchboard
  • Socket
    • How does one speak TCP/IP?
      • Sockets provide interface to TCP/IP
      • Generic interface for many protocols
  • Two Tier Client and Server

  • Clients and Servers
    • Client: Initiates the connection
    • Server: Passively waits to respond
  • TCP Client/Server Interaction
    • Server starts by getting ready to receive client connections
    • Server is now waiting for connection from a client
    • Client is still not ready to talk to the server
    • A new socket is created on the server that is connected to the client socket
    • Client is now ready to send something while the server is waiting
    • Client
      1. Create a TCP socket
      2. Establish connection
      3. Communicate
      4. Close the connection
    • Server
      1. Create a TCP socket
      2. Bind socket to port
      3. Set socket to listen
      4. Repeatedly
        1. Accept new connection
        2. Communicate
        3. Close the connection
  • TCP Tidbits
    • Client must know the server's address and port
    • Server only needs to know its own port
    • The server discovers the client's address and port at connection
    • No correlation between send() and recv()
  • Closing a Connection
    • close() used to delimit communication
    • Analogous to EOF
      • In echo application, how does server know when client is done considering, if it doesn't know echo string length?
      • Role of closer can (and is, in HTTP) be reversed
Window Socket (2-Tier)
  • Topics
    • Multiple Clients design Introduction
    • Multiple Clients design Implementation
  • Two Tier Client and Server

  • Multiple Clients

  • Two Tier Design
    • Client: Initiates the connection
    • Server: Passively waiting for connection
  • Multiple Clients Design
    • Client: Initiates the connection
    • Server: Passively waits for connection
    • Client: Passively waiting for server to respond
  • TCP Client/Server Interaction
    • Server starts by getting ready to receive clients connection
    • Server is now waiting for clients or after certain amount of time elapsed
    • A new socket is created on the server that is connected to the client socket
    • Client is now ready to send something while the server is waiting
    • Note that server closes connection socket, not listening socket
  • TCP Tidbits
    • Client must know the server's address and port
    • Server needs to know its own port
    • Server discovers the client's address and port at connection
    • Server need to keep track of the multiple client data
    • There is a relationship between send() and recv()for the different client

school

Previous post Next post
Up