Internet Technology - PowerPoint PPT Presentation

1 / 32
About This Presentation
Title:

Internet Technology

Description:

By late 90s, assigning of IP domain names are controlled and managed by ICANN. ... Are managed by ICANN. Registered Ports. Port numbers ranging from 1,024 to 49,151. ... – PowerPoint PPT presentation

Number of Views:60
Avg rating:3.0/5.0
Slides: 33
Provided by: compu369
Category:

less

Transcript and Presenter's Notes

Title: Internet Technology


1
Internet Technology Network Programming
  • Dan Wang

2
Outline
  • Data Communication Model
  • Network Protocol Model
  • OSI Reference Model
  • TCP/IP Protocol Suite
  • Internet Addressing
  • IP Address
  • Port Address
  • Socket Programming

3
Data Communication Model
  • Source Generates data to be transmitted
  • Transmitter Converts data into transmittable
    signals
  • Transmission System Carries data
  • Receiver Converts received signal into data
  • Destination Takes incoming data

4
Network Protocol Model
  • Two entities (source and destination) need
    network protocols to communicate with each other
    over the communication network.
  • The network protocols are organized as
    multi-layer hierarchies
  • OSI Reference Model
  • TCP/IP Protocol Suite

5
OSI Reference Model
  • ISO established the OSI model as a standard for
    data communication.
  • Comprehensive model 7 layers
  • Each layer performs a subset of the required
    communication functions
  • Each layer relies on the next lower layer to
    perform more primitive functions
  • Each layer provides services to the next higher
    layer
  • Changes in one layer should not require changes
    in other layers, they are hided by interface
    between two layers
  • Peer layers sit at both sides
  • Organized but too complicated and not easy to
    implement or deploy
  • Today, OSI model is used as a tool for academic
    teaching and conceptual model to organize
    networking functionality

ISO International Standard Organization OSI
Open System Interconnection
6
OSI Reference Model
  • Physical Layer
  • Representation of bits as electrical signals
  • Physical interface to media
  • Data Link Layer
  • Framing of data into units of frame.
  • Control data transmission from point-to-point or
    broadcast, including flow and error control
  • Network Layer
  • Delivery of packets across network from source
    to destination
  • Logical addressing to provide unified addressing
    scheme
  • Routing
  • Transport Layer
  • First end-to-end protocol that deals with
    end-to-end issues.
  • Provide services such as error, congestion, flow
    controls.

7
OSI Reference Model
  • Session Layer
  • Establishes dialog and synchronizes sessions
    between two end systems.
  • E.g. checkpoint session.
  • Presentation Layer
  • Concern with the syntax and semantic of
    information exchanged between two systems
  • Translate data representation to a common format,
    e.g. from source-dependant format to a common
    format at the source and from a common format to
    a destination dependant format
  • Service encryption and compression
  • Application Layer
  • End user software that accesses the network
  • E.g. Email, FTP, web browser

8
OSI Reference Model
9
TCP/IP Protocol Suite
  • Internet was developed prior to the OSI model, it
    adapt network protocol suite that was developed
    by the US DARPA for its ARPANET
  • Dominant commercial protocol used by the global
    Internet
  • Made up of 5 layers
  • Physical Layer
  • Physical interface between data transmission
    device (e.g. computer) and transmission medium or
    network
  • Characteristics of transmission medium, signal
    rate and encoding, etc

10
TCP/IP Protocol Suite
  • Make up of 5 layers (contd)
  • Data Link Layer
  • Logical interface between end system and network
  • Exchange of data between end system and network
  • Internet layer (IP)
  • Best effort transfer of data, no delivery
    guarantee
  • Provide uniform logical interface for different
    networks
  • Routing functions across multiple networks
  • Implemented in end systems and routers
  • Transport layer (TCP/UDP/SCTP)
  • End to end transfer of data
  • Provide reliability mechanism (TCP) or not (UDP)
  • Hides detail of underlying network
  • Application layer
  • Support for user applications, e.g. HTTP, FTP,
    SMPT

11
TCP/IP Protocol Suite
12
Web on Internet Architecture
13
Layered Web Architecture
  • Web uses the Internet as the underlying network
    infrastructure. The complete architecture of the
    Web is best illustrated using a layered approach.
  • Datalink Layer Implements the link interface to
    the physical medium and provides point-to-point
    services to move frames around the network.
  • Network Layer Overlays a layer of network
    software to provide uniform network layer
    services such as routing across different
    datalink layers.
  • Transport Layer Provides end-to-end delivery of
    packets that resides only in end host.
    Specifically, it adds services to the network
    layer to provide reliable transmission.
  • WWW LayerProvides the concept of hyperlinking
    documents across the network. The service uses
    technologies such as HTML, HTTP, and XML
  • Server-Side Computing Concern with extension of
    server-side functionality that is beyond
    delivering of static documents.
  • Client-Side Computing Concern with client-side
    extension to basic web.

14
Network Layer
  • IP (Internet Protocol)
  • Define the basic unit of data transfer used in
    TCP/IP internet
  • Best effort and connectionless delivery
  • Make an attempt for delivery, but does not
    guarantee delivery
  • Provide a connectionless unreliable packet
    delivery service
  • In the Internet, as routers become overrun or
    change routes, datagram can be lost, duplicated
    or out of order.
  • Provide routing functions across multiple
    networks
  • Other protocols at Network Layer
  • ARP for address translation from logical to
    physical address
  • RARP for address translation of physical to
    logical address
  • ICMP allows gateways and hosts to send
    notification of problems back to sender
  • IGMP facilitates transmission of multicast
    messages

15
Transport Layer
  • Provide end-to-end data transfer for applications
  • Transport Layer Protocols
  • UDP (User Datagram Protocol)
  • TCP (Transport Control Protocol)
  • SCTP (Stream Control Transmission Protocol)

16
TCP
  • Provide a connection-oriented, ordered,
    full-duplex, reliable service.
  • Connection-oriented service
  • An end-to-end virtual circuit connection is
    established before data exchange can happen.
  • Connection is terminated when finished.
  • Use 3-way handshake for connection establishment
    and termination
  • Similar to the phone system
  • Ordered service
  • Data bytes are delivered in sequence.
  • Full-duplex connection
  • Can send and receive data at the same time
  • Reliable service
  • Delivery of data is guaranteed
  • Flow control, congestion control and error
    control
  • TCP datagram is encapsulated in IP datagram for
    delivery.
  • IP identifies the destination computer (How?)
  • TCP identifies the application on the destination
    computer (How?)
  • Used by many of the popular applications in the
    Internet, such as Telnet, FTP, SMTP, HTTP.

17
UDP
  • Provide connectionless, best-effort, not reliable
    datagram service.
  • Connectionless service
  • Provide the ability to send and receive messages.
  • No connection is required before data transfer.
  • Similar to the postal system.
  • Best-effort service
  • Not reliable
  • Message can be delayed, lost, or duplicated, or
    arrive out of order
  • Application accepts full responsibility for
    errors.
  • Used by multimedia applications, DNS

18
Internet Addressing
  • Challenges
  • How to send packets from source to destination
    across the Internet?
  • How to send packets to a specific application?
  • Three different levels of addresses
  • Physical address
  • IP address
  • Port address

19
Internet Addressing
20
IP Address
  • Uniquely identify a host on the Internet.
  • There are two popular ways
  • Using IP address
  • Using names registered in the domain name system
    (DNS).
  • IP Address
  • Each host on the Internet is assigned a 32-bit
    unique address (4 bytes).
  • An IP address is assigned to a single host only.
  • A host may have more than one IP address
    (multi-homed host).
  • Dotted representation
  • Internet addresses are represented in the form of
    four integers separated by decimal points known
    as dotted representation.
  • Examples 131.91.81.40, 131.91.131.67
  • Has netid and hostid
  • Five classes Class A, B, C, D, E
  • Loopback address (127.0.0.1) is used by a host to
    test its internal software

21
Domain Name System (DNS)
  • Translation of hostnames to and from IP addresses
  • E.g., www.polyu.edu.hk, rocket.comp.polyu.edu.hk
  • Why hostname, not only IP address?
  • Easy to remember
  • Re-locatable
  • Same web site available in multiple hosts
  • DNS resolver performs two functions
  • Coverts name to IP address
  • Converts IP address to name
  • A database of mapping is cached

22
DNS
  • How does a client locate DNS?
  • Configured with a list of DNS addresses (How to
    check?)
  • Discover thru DHCP.
  • DNS is a distributed database of hierarchy
    servers.
  • The DNS naming convention is hierarchical.
  • Written in the local-most level first and the
    top-most level last fashion.
  • Each organization connected to Internet is
    responsible to maintain its DNS server.

23
DNS
  • By late 90s, assigning of IP domain names are
    controlled and managed by ICANN.
  • Top level domains are handled by collection of
    root servers, which assist query to recursively
    resolve domain name.
  • Can you think of an example where an application
    would want to perform reverse resolution of IP
    address to name?
  • Logging of clients hostname by Server
  • Restrict access to certain resources based on
    domain
  • Targeted advertisements

24
DNS
  • Busy website may have replication on multiple
    machines with the same contents
  • Located in different geographical locations to
    spread loading, e.g. www.cnn.com may correspond
    to 5 IP addresses located across 5 continents
  • DNS have mapping of 1 hostname to multiple IP
    addresses
  • Local DNS server can select one out of the list.
    (How?)

25
Port Address
  • A (protocol) port is an abstraction used by
    TCP/UDP to distinguish applications on a given
    host.
  • A port is identified by a 16-bit integer, known
    as a port address or a port number.
  • Three ranges of port numbers
  • Well-known ports
  • Registered ports
  • Dynamic ports

26
Port Address
  • Well-known Ports
  • Port numbers ranging from 0 to 1,023.
  • A set of pre-assigned port numbers for specific
    uses.
  • Are managed by ICANN.
  • Registered Ports
  • Port numbers ranging from 1,024 to 49,151.
  • Not assigned or controlled by ICANN however
    their uses need to be registered via an
    ICANN-accredited registrar to prevent
    duplications.
  • Dynamic Ports
  • Port numbers ranging from 49,152 to 65,535.
  • Neither assigned or registered. They can be used
    by anyone.
  • These are ephemeral ports.
  • Also known as private ports.

27
Well-Known Ports
28
Socket Programming
  • What is a socket?
  • Socket is a programming abstraction that enables
    application to interface directly to the
    transport layer and communicate over the network.
  • Socket provides a network programming interface.
  • Used for inter-process communication over the
    network.
  • Used by a process to communicate with a remote
    system via a transport protocol.
  • A socket provides a full-duplex communication
    mechanism.
  • Application uses socket to communicate with the
    network.
  • Data come from and go to the transport layer via
    a port number.
  • Socket address combines IP address and a port
    number.

29
Socket Programming
  • Sockets were first introduced in Berkeley UNIX.
  • An extension of the UNIX abstraction of file I/O
    concepts.
  • Now are commonly supported in almost all modern
    operating systems for intersystem communications.
  • Sockets are popularly used in client/server
    computing.

30
Socket Programming
  • In a client/server model as shown, we have the
    server listening to a socket port continuously
    for a service request.
  • The client wanting to communicate with the server
    is required to know servers socket address (IP
    address and the port number).
  • Upon receiving a request from the well-known
    port, the server will generate a new socket port
    and uses it to connect to the client.
  • The new socket port will be bound to the port at
    the client-side to begin communications.TCP uses
    socket address as connection identification
    (IPclient, portclient), (IPserver, portserver)
  • The server will return to listening at the
    well-known port for other requests.

31
Socket Programming Client-side
  • In Java, socket programming is supported by the
    java.net package that provides a Socket class.
  • Also includes the ServerSocket class, which
    servers can use to listen and accept connections
    to clients.
  • The basic network programming structure at the
    client-side
  • Open a socket Socket clientSocket new
    Socket(hostname, portNumber) (What is this
    socket, TCP socket or UDP socket?)
  • Open an input and output streams to the socket.
  • out new PrintWriter(clientSocket.getOutputStream
    (), true)
  • in new BufferedReader(new InputStreamReader(clie
    ntSocket.getInputStream()))
  • Read and write to the corresponding stream
    handlers to communicate. E.g. out.writeBytes()
    in.readLine()
  • Close the streams out.close() in.close()
  • Close the socket clientSocket.close()
  • Ex1 echoClient.java

32
Socket Programming Server-side
  • The basic network programming structure at the
    server-side
  • Open a serverSocket, with its well-known port
    number
  • ServerSocket listenSocket new
    ServerSocket(portNumber)
  • If server successfully connects to a client, the
    Socket object is returned
  • Socket clientSocket listenSocket.accept()
  • Open an input and output streams to the socket.
  • out new PrintWriter(clientSocket.getOutputStream
    (), true)
  • in new BufferedReader(newInputStreamReader(clien
    tSocket.getInputStream()))
  • Read and write to the corresponding stream
    handlers to communicate. E.g. out.writeBytes()
    in.readLine()
  • Close the streams out.close() in.close()
  • Close the socket clientSocket.close()
  • Ex2 echoServer.java
Write a Comment
User Comments (0)
About PowerShow.com