networking theory

Upload: irsan-ehc

Post on 04-Apr-2018

217 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/30/2019 Networking Theory

    1/54

    Networking Theory

    (Part 1)

  • 7/30/2019 Networking Theory

    2/54

    Introduction

    Overview of the basic concepts of

    networking

    Also discusses essential topics ofnetworking theory

  • 7/30/2019 Networking Theory

    3/54

    What is a Network?

    A network is a collection of devices that

    share a common communication protocol

    and a common communication medium. Devices - computers, printers, telephones,

    televisions, coke machines, etc.

  • 7/30/2019 Networking Theory

    4/54

    What is a Network?

    Computing-centric model - services and

    devices bound to individual machines

    Network-centric model - services anddevices are distributed across a network

    Network and software standards (e.g. Jini)

    exist to allow devices and hardware talk toeach other over networks and to allow

    instant plug-and-play functionality

  • 7/30/2019 Networking Theory

    5/54

    What is a Network?

    Besides devices providing services, thereare also devices that keep the networkgoing, for example,

    Network cards - to allow a computer to talk toa network. E.g. ethernet card.

    Routers - machines that direct data to the

    next "hop" in the networkHubs - allow multiple computers to access a

    network

    Gateways - connect one network to another.

    E.g. a LAN to the Internet.

  • 7/30/2019 Networking Theory

    6/54

    How do Networks Communicate?

    Networks consist of connections between

    computers and devices.

    Connections:

    Wires and cables - use electricity for

    transmitting data

    Wireless - use infrared / radioFiber-optic cables - use light

  • 7/30/2019 Networking Theory

    7/54

    How do Networks Communicate?

    Connections carry data (bits - 0's and 1's)

    between one point (node) in the network

    and another. For data to be successfully delivered to

    individual nodes, these nodes must be

    clearly identifiable.

  • 7/30/2019 Networking Theory

    8/54

    Addressing

    Each node in a network is typically

    represented by an address.

    The manufacturer of the network interfacecard (NIC) is responsible for ensuring that

    no two card addresses are alike, and

    chooses a suitable addressing scheme. Each card will have this address stored

    permanently, so that it remains fixed.

  • 7/30/2019 Networking Theory

    9/54

    Addressing

    There are many addressing schemesavailable. E.g. Ethernet network cards are

    assigned a unique 48-bit number. This physical address is referred to by

    many names, such as:

    Hardware address

    Ethernet address

    Media Access Control (MAC) address

    NIC address

  • 7/30/2019 Networking Theory

    10/54

    Addressing

    Often, machines are known by more than

    one type of address. E.g. a network

    server may have a physical Ethernetaddress as well as an Internet Protocol

    (IP) address, or it may have more than

    one network card. For inter-network communications, the IP

    address is used.

  • 7/30/2019 Networking Theory

    11/54

    Data Transmission Using Packets

    Sending individual bits of data from node

    to node is not very cost effective.

    Overhead involved - e.g address ofdestination node.

    Most networks group data into packets.

  • 7/30/2019 Networking Theory

    12/54

    Data Transmission Using Packets

    A packet consists of a header and data

    segment.

    Header fields Data 1101000111010100001

    The header contains:

    Addressing information (e.g sender & recipient)Checksums to ensure packet has not been

    corrupted

    Other info needed for transmission across

    network

  • 7/30/2019 Networking Theory

    13/54

    Data Transmission Using Packets

    To transmit data, a direct connection is

    usually not available. So packets are sent

    to their destination nodes via intermediarynodes in the network.

    Due to network conditions (such as

    congestion or network failures), packetsmay take arbitrary routes, and sometimes

    may be lost or arrive out of sequence.

  • 7/30/2019 Networking Theory

    14/54

    Data Transmission Using Packets

    Packet transmission and transmission of

    raw bits are low-level processes.

    Most network programming deals withhigh-level transmission of data.

  • 7/30/2019 Networking Theory

    15/54

    Communication Across Layers

    The concept of layers was introduced to

    acknowledge and address the complexity

    of networking theory. The most popular approach to network

    layering is the Open Systems

    Interconnection (OSI) model created bythe International Standards Organization

    (ISO)

  • 7/30/2019 Networking Theory

    16/54

    Communication Across Layers

    The OSI model groups network operations into

    seven layers.

  • 7/30/2019 Networking Theory

    17/54

    Communication Across Layers

    Each layer is responsible for some form of

    communication task, but each task is

    narrowly defined and usually relies on theservices of one or more layers beneath it.

    Generally, programmers work with one

    layer at a time; details of the layers beloware hidden from view.

  • 7/30/2019 Networking Theory

    18/54

    Layer 1 - Physical Layer

    This layer is network communication at itsmost basic level.

    At this level, networking hardware transmitsequence of bits between two nodes.

    Java programmers do not work at this

    layer - it is the domain of hardware driverdevelopers and electrical engineers.

    No real attempt is made to ensure error-free data transmission

  • 7/30/2019 Networking Theory

    19/54

    Layer 2 - Data Link Layer

    This layer is responsible for providing amore reliable transfer of data, and for

    grouping data together into frames. Frames are similar to data packets but are

    blocks of data specific to a single type ofhardware architecture.

    Frames have checksums to detect errorsin transmission.

    Corrupted frames are discarded so that

    they will not be passed to higher layers.

  • 7/30/2019 Networking Theory

    20/54

    Layer 3 - Network Layer

    The network layer deals with data packets

    which are sent across the network.

    Communication at this level is still verylow-level; network programmers are rarely

    required to write software services for this

    layer.

  • 7/30/2019 Networking Theory

    21/54

    Layer 4 - Transport Layer

    This layer is concerned with controlling

    how data is transmitted.

    It deals with issues such as automaticerror detection and correction, and flow

    control (limiting the amount of data sent to

    prevent overload).

  • 7/30/2019 Networking Theory

    22/54

    Layer 5 - Session Layer

    The purpose of this layer is to facilitateapplication-to-application data exchange,

    and the establishment and termination ofcommunication sessions.

    Connection-oriented communication canincrease network delays and bandwidth

    consumption. Some applications chooseto use a connectionless form ofcommunication.

  • 7/30/2019 Networking Theory

    23/54

    Layer 6 - Presentation Layer

    This layer deals with data representation

    and data conversion.

    Different machines use different types of datarepresentation (e.g. 8-bit integers on one

    system and 16-bit integers on another).

    Data compressionData encryption

  • 7/30/2019 Networking Theory

    24/54

    Layer 7 - Application Layer

    This layer is where the vast majority of

    programmers write code.

    Protocols for this layer dictate thesemantics of how requests for services are

    made (e.g requesting a file).

    In Java, almost all network softwarewritten will be for this layer.

  • 7/30/2019 Networking Theory

    25/54

    Advantages of Layering

    Helps simplify networking protocols.

    Protocols can be designed for

    interoperabilitySoftware that uses Layern can talk to

    software running on another machine that

    supports Layern, regardless details of thelower layers.

    Example: a network layer protocol can work with an

    Ethernet network and a token ring network.

  • 7/30/2019 Networking Theory

    26/54

    Networking Theory

    (part 2)

  • 7/30/2019 Networking Theory

    27/54

    Internet Architecture

    The Internet is a worldwide collection of

    smaller networks that share a common

    suite of communication protocols(TCP/IP).

    It is an open system, built on common

    network, transport and application layerprotocols, while granting the flexibility to

    connect a variety of computers, devices

    and operating systems to it.

  • 7/30/2019 Networking Theory

    28/54

    Design of the Internet

    The Internet is the result of many decades

    of innovation and experimentation.

    The TCP/IP protocols have been carefullydesigned, tested and improved over the

    years.

  • 7/30/2019 Networking Theory

    29/54

    Design of the Internet

    Major design goals:

    Resource sharing between networks

    Hardware and software independence

    Reliability and robustness

    Fault tolerant protocols - data could be rerouted

    depending on the state of the network

    "Good" protocols that are efficient and simple.

  • 7/30/2019 Networking Theory

    30/54

    TCP/IP Protocol Suite

    Major protocols:

    Internet Protocol (IP)

    Internet Control Message Protocol (ICMP)

    Transmission Control Protocol (TCP)

    User Datagram Protocol (UDP)

  • 7/30/2019 Networking Theory

    31/54

    Internet Protocol (IP)

    IP is a Layer 3 protocol (network layer)

    It is used to transmit data packets over the

    Internet

    It is the most widely used networking

    protocol in the world.

    IP acts as a bridge between networks ofdifferent types

  • 7/30/2019 Networking Theory

    32/54

    Internet Protocol (IP)

    IP is a packet-switching network protocol.

    Information is exchanged between twohosts in the form of IP packets (IP

    datagrams). Each datagram is treated as a discrete

    unit - there are no "connections" between

    machines at the network layer. Connection services are provided by the

    higher-level protocols at the transportlayer.

  • 7/30/2019 Networking Theory

    33/54

    Internet Protocol (IP)

    The IP datagram consists of a header and

    the actual data being sent.

    The header contains essential informationfor controlling how it will be delivered.

  • 7/30/2019 Networking Theory

    34/54

    IPV4 datagram format

  • 7/30/2019 Networking Theory

    35/54

    Internet Protocol (IP)

    Although each machine has its own physical

    address, each host machine under the Internet

    Protocol must be assigned a unique IP address.

    The IP address is a four-byte (32-bit) address.

    Example: 192.168.1.5

    The IP address is not bound to a particular

    physical machine. Network programming in Java does not require

    the use of the physical address; only the IP

    address is used.

  • 7/30/2019 Networking Theory

    36/54

    Internet Protocol (IP)

    Humans do not find IP addresses easy to

    remember.

    An addressing scheme is also used whichallows the use of textual names

    (hostnames) instead of numerical values.

    Example: java.sun.com

  • 7/30/2019 Networking Theory

    37/54

    Internet Control Message Protocol

    (ICMP) The Internet Protocol provides absolutely

    no guarantee of datagram delivery.

    The Internet Control Message Protocol(ICMP) is a mechanism for error-control. It

    is used in conjunction with the Internet

    Protocol to report errors when and if theyoccur.

  • 7/30/2019 Networking Theory

    38/54

    Internet Control Message Protocol

    (ICMP) The relationship between IP and ICMP is astrong one.

    E.g: IP uses ICMP if it needs to notify another

    host of an error. ICMP requires IP to send theerror message.

    Note that a host cannot rely solely onICMP to guarantee delivery as there is noguarantee that ICMP messages will besent or that they will reach their intendeddestination.

  • 7/30/2019 Networking Theory

    39/54

    Internet Control Message Protocol

    (ICMP) Five error messages are defined:

    Destination Unreachable

    If a gateway is unable to pass a datagram on to itsdestination, this message is sent back to the

    original host.

    Parameter Problem

    This message is sent to the sending host if agateway is unable to process the header

    parameters of an IP datagram.

  • 7/30/2019 Networking Theory

    40/54

    Internet Control Message Protocol

    (ICMP)Redirect If a shorter path, or alternate route, is available, a

    gateway may send this message to the router thatpassed on a datagram

    Source Quench This message may be sent in an attempt to reduce

    the number of incoming datagrams when a router,gateway or host becomes overloaded.

    Time Exceeded Whenever the TTL value of a datagram reaches

    zero is discarded. This message may be sent ifthis event occurs.

  • 7/30/2019 Networking Theory

    41/54

    Internet Control Message Protocol

    (ICMP) ICMP supports several informational

    messages such as:

    Echo Request/Echo Reply Used to determine whether a host is alive and can

    be reached.

    Address Mask Request/Address Mask Reply

    Provides the functionality to determine the address

    mask which controls which bits of an IP address

    correspond to a host, and which bits determine the

    network/subnet portion.

  • 7/30/2019 Networking Theory

    42/54

    Transmission Control Protocol

    (TCP) TCP is a Layer 4 protocol (transport layer)

    that provides guaranteed delivery and

    ordering of bytes. TCP uses IP to send TCP segments,

    which contain additional information that

    allows it to order packets and resend themif they go astray.

  • 7/30/2019 Networking Theory

    43/54

    Transmission Control Protocol

    (TCP) TCP uses communication ports to

    distinguish one application or service from

    another.A host machine can have many

    applications connected to one or moreports.

    Although TCP provides a simplerprogramming interface, it may reducenetwork performance.

  • 7/30/2019 Networking Theory

    44/54

    User Datagram Protocol (UDP)

    UDP is a Layer 4 protocol (transport layer)that applications can use to send packetsof data across the Internet (as opposed to

    TCP, which sends a sequence of bytes). UDP also supports communication ports.

    UDP does not guarantee delivery packets.

    It also does not guarantee that they willarrive in the right order.

    Although unreliable, UDP offers fastercommunication.

  • 7/30/2019 Networking Theory

    45/54

    Internet Application Protocols

    Network programmers are more interested

    in the protocols at the application layer.

    Examples:Protocols for accessing and sending email

    Protocols for transferring files

    Protocols for reading Web pages

  • 7/30/2019 Networking Theory

    46/54

  • 7/30/2019 Networking Theory

    47/54

    Internet Message Access Protocol (IMAP)

    Less popular than POP3 as it requirescontinual connection to the mail server.

    Message are stored on a server and not on

    the user's system.

    Uses port 143.

    Simple Mail Transfer Protocol (SMTP)

    Allows messages to be delivered over the

    Internet.Uses port 25.

  • 7/30/2019 Networking Theory

    48/54

    HyperText Transfer Protocol (HTTP)

    One of the most popular protocols in use onthe Internet; it made the World Wide Web

    possible.

    Java provides good HTTP support.

    Uses TCP port 80.

  • 7/30/2019 Networking Theory

    49/54

  • 7/30/2019 Networking Theory

    50/54

    TCP/IP Protocol Suite Layers

    Internet Protocol

    TCP UDP ICMP

    HTTP SMTP FTP POP3

    TCP/IP Stack

  • 7/30/2019 Networking Theory

    51/54

    TCP/IP Protocol Suite Layers

    POP3 command: RETR1

    TCP segment:

    IP datagram:

    Modem frame:

    Carrier wave:

    Application layer

    Transport layer

    Network layer

    Data link layer

    Physical layer

    TCP header RETR1

    IP header TCP header RETR1

    IP header TCP header RETR1Modem header

  • 7/30/2019 Networking Theory

    52/54

    Security Issues: Firewalls and

    Proxy Servers Firewall: while being an excellent tool for n/w

    admin often is a developers worst enemy

    It blocks direct UDP and TCP access, making

    application that uses these protocols practicallyunusable

    Need to adapt software to proxy requests usingprotocol such as HTTP

    Direct UDP/TCP communication is simpler andoffers better performance

    Using proxy server and HTTP can add delays

  • 7/30/2019 Networking Theory

    53/54

    Proxy Server

    It is a machine that acts as a proxy forapplication protocols

    The server accepts incoming connections frommachines within a local n/w and makes requestson their behalf to machines connected to theInternet

    Advantages:Direct access to internal machines is never

    established

  • 7/30/2019 Networking Theory

    54/54

    Proxy Server

    Only popular protocols such as HTTP is

    permitted access while newer application

    such as games or RealAudio is notpermitted

    Most proxy servers also log networking

    events to allow n/w admin to track unusualcommunications and their origin