Top Banner

of 42

16629327 Computer Networks Lecture Notes

Apr 10, 2018

Download

Documents

surya_2008
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
  • 8/8/2019 16629327 Computer Networks Lecture Notes

    1/42

    Lecture 2Goal of the Course:

    The objective is to build a scalable network, that is a network having potential to

    grow indefinitely and to support applications of diverse origins like teleconferencing,

    video-on-demand, voice over IP, electronic commerce, distributed computing and

    digital libraries to name a few.

    Asking the question why? and answering it.

    What are Computer networks?

    A computer network is an interconnection between general purpose programmable

    devices that deals with the handling of data.

    Identifying The Requirement Constraints Of A Network:

    Different people who interact with a network will have different requirements: e.g.,

    an application programmerwill want the network to be efficient, easy to work with,

    and provide error free data transfer, while a network designer will want the network

    to be cost-effective and allow efficient resource utilization.

    A- The Connectivity:

    The goal of a network is to achieve the connectivity between two or more systems.For the purpose ofsecuritythe networks may be public, like the Internet or Wi-Fi

    hotspots, or it may be private, like the Local Area Network in SEECS.

    Some of the components and issues related to a Network are following:

    Link:

    Link is defined as the physical transmission medium that connects networked

    devices/systems.

  • 8/8/2019 16629327 Computer Networks Lecture Notes

    2/42

    Different types of links:

    There are two types of links:

    1. Point-to-Point or Direct Access Link:

    Such links are used to connect two devices only. Such links provide a direct path

    between two devices, thus forming a network that does not have any intermediate

    device.

    Such an approach can not be used to interconnect a large network since it's not

    feasible to have a direct point-to-point link between all the nodes in a network.

    The drawback of such networks is that for large networks, it is not feasible to have a

    direct point to point link between all nodes for cost reasons. A network in which

    there is a direct point-to-point link between every node and all other nodes is called

    a fully connected network.

    http://en.wikipedia.org/wiki/Fully_connected_networkhttp://en.wikipedia.org/wiki/Fully_connected_networkhttp://en.wikipedia.org/wiki/Fully_connected_networkhttp://en.wikipedia.org/wiki/Fully_connected_network
  • 8/8/2019 16629327 Computer Networks Lecture Notes

    3/42

    2. Multiple Access Link:

    When multiple devices are connected to one another via a single link, such that

    each of the devices is connected by the link to all other devices at the same time,

    the link is said to be a multiple-access link. The main channel that connects all the

    devices is also called as a bus or an 'ether'

  • 8/8/2019 16629327 Computer Networks Lecture Notes

    4/42

    Multiple access links solves the problem of connecting multiple nodes withoutrequiring point-to-point links. However, they have limitations of the number of

    nodes they can connect, and the geographical distance they can span.

    Classification Based on Media of Transmission:

    Some types the transmission links are:

    1. Magnetic media:

    One of the most common ways to transport data from one computer to another is

    by physically transport the tape or disks to the destination machine. The hard disk

    drives, the USB flash drives, CDs, DVDs are examples. It is the most cost effective

    method for most applications, because of their lower cost per bit transported.

    Their one draw back is the delay factor, as the magnetic device itself has to be

    transported from one device to the next.

    2. Copper Twisted pair :

    Consists of a pair of copper wires, twisted together to reduce losses (and hence the

    name), running from source to destination.

    They have a relatively small range of several kilometers before they require

    amplification, and have a capacity to transmit several megabits/sec at low costs.

    Applications are in telephone industry, DSL etc.

    3. Coaxial Cable

    http://en.wikipedia.org/wiki/Twisted_pairhttp://en.wikipedia.org/wiki/Coaxial_cablehttp://en.wikipedia.org/wiki/Twisted_pairhttp://en.wikipedia.org/wiki/Twisted_pairhttp://en.wikipedia.org/wiki/Twisted_pairhttp://en.wikipedia.org/wiki/Coaxial_cablehttp://en.wikipedia.org/wiki/Coaxial_cablehttp://en.wikipedia.org/wiki/Coaxial_cable
  • 8/8/2019 16629327 Computer Networks Lecture Notes

    5/42

    It is a shielded copper line, providing better range than the twisted pair cable. Coax

    is widely used for cable television and metropolitan area networks (MAN).

    4. Optical Fiber

    5. Wireless media

    [More explanation needed; remove this comment when relevant information has

    been added]

    Node:

    Nodes are, in simple words, the machines that are connected through different links

    in networks. Formally, nodes are active electronic devices that are attached to a

    network, and are capable ofsending, receiving, or forwarding information or data.

    Types of nodes:

    http://en.wikipedia.org/wiki/Optical_fiberhttp://en.wikipedia.org/wiki/Wirelesshttp://en.wikipedia.org/wiki/Optical_fiberhttp://en.wikipedia.org/wiki/Optical_fiberhttp://en.wikipedia.org/wiki/Optical_fiberhttp://en.wikipedia.org/wiki/Wirelesshttp://en.wikipedia.org/wiki/Wirelesshttp://en.wikipedia.org/wiki/Wireless
  • 8/8/2019 16629327 Computer Networks Lecture Notes

    6/42

    There are two types of nodes:

    1. Nodes that use the network (Hosts)

    It is the node that it does not participate in routing or packet switching. They

    support users and run application programs.

    2. Nodes that implement the Network (Switches/Routers/ Hubs/ Repeaters)

    These are the networks nodes whose function is to implement the functionality of

    the network (such as receiving data from end hosts and forwarding to the other

    hosts [potentially through other network implementing nodes]).

    Switches:

    Switches are the nodes that provide communication between systems. The number

    of users that a switch can support is limited and so is the geographical distance in

    which it can provide service. For example Ethernet can support about 1000 users in

    an area as large as a building. For more users, we need to form separate networks

    and then join those networks.

    Routers:

    The nodes that provide communication between differentnetworks (that may be

    based on different underlying technologies). Thus to connect two separate LANs, a

    router may be used. As the name implies it routes data, that is it receives

    data/messages from the source and systematically forward these messages towardthe destination node based on their address.

    (For further reading : http://www.livinginternet.com/i/iw_route_arch.htm

    http://computer.howstuffworks.com/router.htm (courtesy Sami-ur-Rehman) )

    Cloud:

    In the networks the cloud is used to represent a higher level ofabstraction.The

    cloud is a placeholder for a network, that we are using or are connected to, but we

    do not want to see into its inner workings, thus simplifying the study of the network.

    For example when showing an interconnection of several networks, we may

    represent each network with a cloud, to hide the network it self and only see the

    bigger picture.

    http://www.livinginternet.com/i/iw_route_arch.htmhttp://computer.howstuffworks.com/router.htmhttp://www.livinginternet.com/i/iw_route_arch.htmhttp://www.livinginternet.com/i/iw_route_arch.htmhttp://www.livinginternet.com/i/iw_route_arch.htmhttp://computer.howstuffworks.com/router.htmhttp://computer.howstuffworks.com/router.htmhttp://computer.howstuffworks.com/router.htm
  • 8/8/2019 16629327 Computer Networks Lecture Notes

    7/42

  • 8/8/2019 16629327 Computer Networks Lecture Notes

    8/42

    __________________________________________________________

    Mode of Data Transfer:

    Data is transferred in networks by two primary ways- circuit switching and

    packet switching.These form the core of the networks.

    Circuit Switched Networks:

    The type of network that establishes a connection or channel between the

    communicating nodes as if they were physically connected with an electrical circuit

    is called as circuit switched network. They are used for example in telephone

    connections.

  • 8/8/2019 16629327 Computer Networks Lecture Notes

    9/42

    Thus, in circuit-switched networks, the resources needed along a path (for example

    the bandwidth) to provide for communication between the nodes are reservedfor

    the duration of the session. And the channel is freed when the connection itself is

    terminated.

    The figure above shows that User 1 communicates with User 5 (and User 2

    communicated with User 4), a dedicated connection is to be established, in which a

    stream of data will flow in sequence. The circuit switching follows the message

    stream technique.

    There are certain advantages and disadvantages to this approach.

    1. The dedicated connection provides with no loss of data due to theunavailability of network resources like bandwidth.

    2. Another feature of circuit switched networks is that the delay present duringthe data transfer is constant, because the data travels through the same pathevery time (thus introducing the same delay each time).

    3. A disruption in the link/channel will cause the communication to end as thereis no alternate path for the data to flow. The connection has to be setupagain.

    4. In the circuit switched networks the resources remain allocated during the fulllength of a communication, even if no data is flowing on a circuit thus wastinglink capacity when a link does not carry data to its full capacity or does not

    carry data at all.

    Packet Switched Networks:

    The packet switching was developed in 1960s to cater for the problems related to

    circuit switched networks.

  • 8/8/2019 16629327 Computer Networks Lecture Notes

    10/42

    What happens here is that the data is broken down into chunks/pieces and those

    chunks are wrapped into structures called packets. Each packet contains, along with

    the data (or payload), the information about the address of the source and the

    destination nodes, sequence numbers and other control information. A packet can

    also be called a segmentor datagram.

    Thus the packet switched networks can be described as the networks in which the

    communication is done via packets of data which do not flow through dedicated

    channels but are routed in any sequence, through any route available between the

    two nodes. Thus if no data is available at the sender at some point during a

    communication, then no packet is transmitted over the network.

    The figure shows that user1 communicates with user5 (and user2 communicated

    with user4). Unlike the previous figure the datapackets can move in any order,

    through any path available to reach the destination. The packet switching follows

    the store and forward technique.

    There are certain advantages and disadvantages to this approach;

    1. A major advantage is absence of wastage of network resources. Since thelink/channel is only in use when the packets are being sent, there is no lost of

    resources2. If any one of the route is blocked or disrupted, the packets can still reach

    their destination by choosing an alternate route.

    3. A corruption in data will prompt to the dropping/deletion of only thosepackets that are corrupt and not the entire message.

  • 8/8/2019 16629327 Computer Networks Lecture Notes

    11/42

    4. Different part of the message may arrive at different time at destination dueto the different routes taken by the packet. This causes problems when datais required in a certain sequence.

    5. The delay in the data transfer may be variable.

    6. Packets may be lost or corrupted while travelling through faulty links and

    nodes.

    (For further reading/source:

    http://www.cs.virginia.edu/~mngroup/projects/mpls/documents/thesis/node8.html )

    Internetworking:

    Internetworking is the interconnection of two distinct disparate networking

    technology into a single homogeneous logical network (using routers/gateways).

    Internetwork is also abbreviated as internet (note the small i). An example of the

    internetis the Internet.

    For achieving scalability, internetworks should be able to be connected into even

    larger internetworks, this gives rise to issues and complexities.

    Issues of Internetworking:

    On an internet all of the following issues must be resolved.

    Addressing:

    Joining of hosts, directly or indirectly, does not mean automatic connectivity

    between them, because each of them is not yet identifiable from the other. We

    require a way to distinguish between the nodes on the network and thus allow

    communication between two specific nodes. This is done by assigning an address to

    each node.

    An address is a piece of binary code (or byte string) that identifies a node, that is,

    the network can use a nodes address to distinguish it from the other nodes

    connected to the network.

    Routing:

    When a source node wants the network to deliver a message to a certain

    destination node, it specifies the address of the destination node. If the sending and

    receiving nodes are not directly connected, then the switches and routers of the

    network use this address to decide how to forward the message toward the

    destination. This process is called as routing.

    http://www.cs.virginia.edu/~mngroup/projects/mpls/documents/thesis/node8.htmlhttp://www.cs.virginia.edu/~mngroup/projects/mpls/documents/thesis/node8.htmlhttp://www.cs.virginia.edu/~mngroup/projects/mpls/documents/thesis/node8.htmlhttp://www.cs.virginia.edu/~mngroup/projects/mpls/documents/thesis/node8.html
  • 8/8/2019 16629327 Computer Networks Lecture Notes

    12/42

    Unicast, Multicast and Broadcast:

    A message sent by a node may be delivered to 3 types of recipients, it may be

    destined to be delivered to a single host (called as unicast), it may be meant for

    several hosts (called as multicast) or it may be for all the hosts inside that network

    (called as broadcast).

    An internetwork is required to support all three kinds of message addressing.

    This is analogous to a class room. If a teacher is talking to a student A then the

    teacher is unicasting, if he is talking to a group of students A,B,C etc, then he

    is multicasting, and if he is talking to the whole class the he is broadcasting.

    B- Cost-effective Resource Sharing:

    The need of resource sharing arises when multiple nodes want to use the network at

    the same time or when several hosts share the same linkand they all want to use it

    at the same time. The resource sharing is done by multiplexing.

    Multiplexing is defined as the means through which a system resource is shared

    among multiple users.

    Multiplexing is similar to the timesharingconcept in the computer systems, where

    a single physical CPU is shared (or multiplexed) among multiple jobs; such that each

    of the process believes it has its own private processor. Similarly, data being sent by

    multiple users can be multiplexed over the physical links that make up a network.

    Types Of Multiplexing:

    Multiplexing For Circuit Switched Networks:

    1. Frequency Division Multiplexing (FDM)

    In FDM, the frequency spectrum of a link/channel is shared among the connections

    established across the link. Specifically, the link dedicates a frequency band (or

    Bandwidth) to each connection for the duration of the connection. FM radio stations,

    TV channels etc, for example use FDM to share the frequency spectrum.

    (For further reading: http://en.wikipedia.org/wiki/Time-division_multiplexing)

    http://en.wikipedia.org/wiki/Time-division_multiplexinghttp://en.wikipedia.org/wiki/Time-division_multiplexinghttp://en.wikipedia.org/wiki/Time-division_multiplexinghttp://en.wikipedia.org/wiki/Time-division_multiplexing
  • 8/8/2019 16629327 Computer Networks Lecture Notes

    13/42

    2. Time Division Multiplexing (TDM) (or Synchronous Time Division

    Multiplexing STDM)

    In a TDM link, time is divided equal-sized quanta in a round-robin fashion, giving

    each connection an equal chance to send its data over the physical link. The

    majority of the telephone systems use TDM.

    (For Further Reading: http://en.wikipedia.org/wiki/Frequency-division_multiplexing)

    Multiplexing for Packet Switched Networks:

    3. Statistical Multiplexing

    The multiplexed links for the circuit switched networks suffer the same problems of

    inefficiency that is if there is no data to send then the connection will be idle, and

    that the maximum number of users/flows is fixed ahead of time, thus making it non-

    http://en.wikipedia.org/wiki/Frequency-division_multiplexinghttp://en.wikipedia.org/wiki/Frequency-division_multiplexinghttp://en.wikipedia.org/wiki/Frequency-division_multiplexinghttp://en.wikipedia.org/wiki/Frequency-division_multiplexing
  • 8/8/2019 16629327 Computer Networks Lecture Notes

    14/42

    scalable. The solution lies in packet switching.

    Packet switching uses statistical multiplexing.

    The statistical multiplexing uses the time sharing concept of STDM that is the link is

    shared over time but it allow data to flow on demand rather than in predetermined

    time slots, thus eliminating the problem of under efficiency.

    Such networks suffer the problem of congestion. This happens when the inward flow

    of data into a switch/router is more than the outward flow, causing lack of buffer

    space on the networking device. Fairly allocating link capacity to different flows and

    dealing with congestion when it occurs are the key challenges of statistical

    multiplexing.

    (For Further reading: http://en.wikipedia.org/wiki/Statistical_multiplexing)

    C- Support for Common Services:

    One view of the network can be that it is delivering packets among collection of

    Devices and computers. In an alternate view the network can be considered as

    providing the means for a set ofapplication processes that are distributed over the

    connected computers to communicate. The requirement of a computer network is

    that the application programs running on the hosts connected to the network must

    be able to communicate in a meaningful way.

    http://en.wikipedia.org/wiki/Statistical_multiplexinghttp://en.wikipedia.org/wiki/Statistical_multiplexinghttp://en.wikipedia.org/wiki/Statistical_multiplexinghttp://en.wikipedia.org/wiki/Statistical_multiplexing
  • 8/8/2019 16629327 Computer Networks Lecture Notes

    15/42

    Logical Channels:

    The network can be viewed as providing logical channels over which application-

    level processes can communicate with each other, with each channel providing the

    set of services required by that application. The one can use a cloud to abstractly

    represent the connectivity (which can be complex) among a set of computers andthink of a channel as connecting one process to another.

    The channel itself can be considered as being like a pipe connecting two

    applications, so that a sending application put data in one end and expect that datato be delivered by the network (the cloud) to the application at the other end of the

    pipe.

    The channel must ensure that all the requirements of the application program which

    it is serving. The issues of whether the order of the arrival of packets is important, is

    security the prime concern, how much packet loss is acceptable, are all to be taken

  • 8/8/2019 16629327 Computer Networks Lecture Notes

    16/42

    into consideration when designing channels.

    Types of Channels:

    Two channel types are listed in the following, but it should be kept in mind that a

    new type of channel can be created if non of the existing types are not able toprovide for the application programs, and closing this gap between the two (the

    technology in the form of channels and the application requirements) is the

    challenge of this field of study.

    This gap (between the what the technology can provide and what the applications

    require and demand is called as semantic gap).

    1. Request/Reply Channels:

    The client process, in the client machine, makes a request(for certain data or

    service) from the server process, through the network. The server process replies to

    the client in return.

    The client machine (or the client process) is the machine that sends the request

    while the server machine (or the server process) is the machine that replies to the

    request. When a client receives data (or download it) from sever it is called as

    reading and when the client sends data to be written on the server machine

    (uploads data) it is called as writing.

    The Request/Reply Channels can be used for file transfer for example. The structure

    of the channel supports security, as data is sent only when request, thus making it

    less likely for it to be leaked. It is generally a loss free (no packet losses) channel.

  • 8/8/2019 16629327 Computer Networks Lecture Notes

    17/42

    2. Message Stream Channels:

    The type of channel that provides data transfer with an emphasis on sequence in

    which it arrives at the user end.

    It is used in the applications where data loss may be tolerable, but sequence of data

    is important, for example video steaming and teleconferencing, because video

    application can operate adequately even if some frames are not received.

    Other features may include the support 'multicast' (For example: it is required for

    multiple parties to participate in the teleconference or view the video), and the

    need for security over the channel to ensure the privacy and integrity of the video

    data for example.

  • 8/8/2019 16629327 Computer Networks Lecture Notes

    18/42

  • 8/8/2019 16629327 Computer Networks Lecture Notes

    19/42

    Reliability:

    Reliable delivery of the data is the first concern of the network. Data corruption may

    occur due to several reasons. It is the job of the network to correct such errors and

    effectively mask certain errors and provide an error free transmission.

    The three types of errors/failures:

    1. Bit or Burst Errors:

    When a single transmission bit is corrupted, it is called a bit error. When several

    bits are corrupted, the error is said to be a burst error. The error may be a

    conversion of 1 to 0 or a 0 to 1.

    Bit or burst errors occur due to Electromagnetic interference, for example lightning

    strikes, power surges, microwave ovens, or interfere with other transmission lines.

  • 8/8/2019 16629327 Computer Networks Lecture Notes

    20/42

    They affect 1 out of (10^6) to (10^7) bits on a typical copper-based cable and 1 out

    of every (10^12) to (10^14) bits on an optical fiber.

    The correction involves identification of the corrupt bit and inverting it. If the error

    can not be corrected the entire packet of data is discarded and request its

    retransmission.

    2. Packet Loss:

    It occurs when an entire packet is lost or discarded by the network.

    One of the reasons can be an uncorrectable error, as seen in bit/burst errors.

    Another way it could occur is due to congestion in the network. The buffer of a

    switch or router is full so it cannot accept further packets and thus drops them. A

    third reason can be a buggy software which may incorrectly forward a packet on the

    wrong link.

    The late arrival of packets is often incorrectly attributed as the Packet loss.

    3. Node/Link Failure:

    The failures at the node and link level form the third type of error.

    The reasons for this failure are: thephysical linkbetween nodes is cut (when done

    intentionally they are sometimes called as 'malicious cuts').The system connected

    to the node/link has crashed; caused by software crashes,power failures etc.

    Such failures cause dramatic amount ofstress on the other nodes and links in the

    network as the traffic is now rerouted through them, and may cause a slow down of

    the entire network. An example can be the served submarine optic fibers in the

    Mediterranean Sea which slowed down the Internet in 3 continents.

    One of the difficulties in dealing with this class of failure is distinguishing between

    failed nodes and ones that are merely slow, or in the case of links, between ones

    that have been cut and ones that are introducing a high number of bit errors due to

    their bad condition (insulation, material quality etc).

    http://news.bbc.co.uk/2/hi/technology/7222536.stmhttp://news.bbc.co.uk/2/hi/technology/7222536.stmhttp://news.bbc.co.uk/2/hi/technology/7222536.stmhttp://news.bbc.co.uk/2/hi/technology/7222536.stmhttp://news.bbc.co.uk/2/hi/technology/7222536.stmhttp://news.bbc.co.uk/2/hi/technology/7222536.stmhttp://news.bbc.co.uk/2/hi/technology/7222536.stmhttp://news.bbc.co.uk/2/hi/technology/7222536.stm
  • 8/8/2019 16629327 Computer Networks Lecture Notes

    21/42

    Lecture 3Lecture 3

    OSI architecture:

    ISO was one of the first organizations to formally define a common standard way to connectcomputers.

    Their architecture called Open Systems Interconnection architecture partitioned networkfunctionality into seven layers where one or more protocols implement the functionality assignedto a given layer. In this sense, OSI model is not a protocol graph (since it defines layers and notrelationships between protocols) but a reference model.

    ISO, in conjunction with another standardization body called ITU, publishes a series of protocol

    specifications based on the OSI model. This series is sometimes called the X dot series since theprotocols are given names like X.25, X.400 and X.500.

    Starting at the bottom and moving up, the physical layer handles the transmission of raw bitsover a communications link. The data link layer then collects a stream of bits into a largeaggregate called aframe. Network adapters, along with device drivers, running in the node's OStypically implement this layer. This means that frames (and not raw bits) are delivered to hosts.The network layer handles routing among nodes within a packet switched network. At this layer,the unit of data exchange is a packet rather than a frame, although they are fundamentally thesame thing. The lower three layers are implemented on all nodes in clouding switches within thenetwork and hosts connected along the exterior of the network. The transport layer then

    implements what we have up to this point being called the process to process channel. Here theunit of data is called a message (or segment) rather than a packet or a frame. The transport layerand the higher layers typically run only on the end hosts and not on the intermediate switches orrouters.

    There is less agreement about the definition of the top layers. Skipping ahead to the seventh layer(the top most layer), we find the application layer. Example protocols include HTTP and FTP.Below that presentation layer is concerned with the format of data exchanged between peers;e.g., whether an integer is 16/32/64 bits long and whether the MSB is transmitted first or last.Finally, the session layer provides a name space that is used to tie together potentially differenttransport streams that are part of a single application. For example, an audio stream and a videostream may be managed in a teleconferencing application.

  • 8/8/2019 16629327 Computer Networks Lecture Notes

    22/42

    Internet Architecture:

    The internet architecture, also called TCP/ IP architecture based on its two most famousprotocols. is shown above. The architecture evolved from experience in implementingARPANET.

    While the 7 layer OSI model can be applied to the Internet (with some imagination), a four layermodel is used instead. At the lowest layer is a variety of network protocols (also called data linklayer or subnetwork layer). In practice, these protocols are implemented using a combination ofhardware (network adapters) and software (network device driver). For example, you might findEthernet card or Fiber Distributed Data Interface (FDDI) protocols at this layer.

    The second layer consists of a single protocol called Internet Protocol (IP). This is the protocolthat supports the interconnection of multiple networking technologies into a single logicalinternetwork.

    The third layer consists of two main protocols---the Transmission Control Protocol and the UserDatagram Protocol (UDP). TCP and UDP provide alternative logical channels to applicationprograms. TCP provides a bye steam channel and UDP provides an unreliable datagram service.TCP and UDP are sometimes called end to end protocol.

  • 8/8/2019 16629327 Computer Networks Lecture Notes

    23/42

    Running above the transport layer are a range of application protocol such as FTP, TFTP, HTTP,SMTP, Telnet, etc.

    Difference between application programs and application layer protocol. All the WWW browsers(Safari, Firefox, IE, Opera, Lynx, etc.) There is a similarly large numbers of webservers. Thereason all of them can interwork is that they all conform to the HTTP application layer protocol.

    Internet architecture does not imply strict layering. The application is free to bypass the definedtransport layer protocols and to directly use IP or any of the underlying networks. In fact,programmers are free to define new channel abstractions.

    Hour glass shape: Wide at the top and bottom but narrow at the waist: IP serves as the focal pointof the architecture. IP is a common method of exchanging packets among a wide collection ofnetworks.

    Application Example:

    To clarify concepts a simplified model of the LAN of NUST-SEECS is considered.Networks domain name is seecs.edu.pk

    Why Domain Name:

    Domain names are used because the users can memorize names (seecs.edu.pk) better than

    http://en.wikipedia.org/wiki/Domain_namehttp://en.wikipedia.org/wiki/Domain_namehttp://en.wikipedia.org/wiki/Domain_namehttp://en.wikipedia.org/wiki/Domain_name
  • 8/8/2019 16629327 Computer Networks Lecture Notes

    24/42

    numbers (202.125.157.196).There are multiple levels in domain name

    e.g. in seecs.edu.pk there are 3 levels.

    Level 1 or high level is .pkLevel 2 is .eduLevel 3 is seecsThere are different approaches for keeping levels of domain name, one approach is to keep all inone file but this is not scalable.Decentralized approach is followed, in which responsibility or load is not carried out by onecentral node. Functionality is divided into all nodes.

    Lets assume that a student (in the seecs.edu.pkLAN) wishes to access NUST-SEECS websitehosted at www.seecs.edu.pkTo access NUST-SEECS website we have to use a browser, there are many browsers availablee.g. Internet explorer, Firefox, Opera etc.The student enters http://www.seecs.edu.pkhttp is the hyper text transfer protocol

    The HTTP request sent

    by the student PC (the machinepc.seecs.edu.pk)to the webserver (the machinewww.seecs.edu.pk) would be something like GET / HTML/1.1

    http://www.seecs.edu.pk/http://en.wikipedia.org/wiki/Httphttp://www.pc.niit.edu.pk/http://www.niit.edu.pk/http://www.niit.edu.pk/http://www.seecs.edu.pk/http://www.seecs.edu.pk/http://www.seecs.edu.pk/http://en.wikipedia.org/wiki/Httphttp://en.wikipedia.org/wiki/Httphttp://en.wikipedia.org/wiki/Httphttp://www.pc.niit.edu.pk/http://www.pc.niit.edu.pk/http://www.pc.niit.edu.pk/http://www.niit.edu.pk/http://www.niit.edu.pk/http://www.niit.edu.pk/
  • 8/8/2019 16629327 Computer Networks Lecture Notes

    25/42

    In this case base directorys default document will be requested.

    Packets so far GET/HTML/1.1

    Certain questions should be answered:

    1. How to send this request to Webserver?

    To communicate the IP address should be known, but how to get it?The domain name is translated to IP address and this is done by another server calledDNS(Domain Name Service).DNS maps domain name to IP address. The student pc request the DNS about the IP (ofwww.seecs.edu.pk) and DNS replies the IP (202.125.157.196) .

    2. Which application at webserver must process this packet?

    In TCP/IP, each well-known application is identified using ports. Every application has its port.

    Port is an abstraction of process. A process is represented by a number.The port of DNS is 53; HTTP is 80; SMTP is 25.In our considered example, HTTP server application (port 80) would process the packet.

    Packets so far:Source port Destination Port GET/HTML/1.1>1024 80

    The destination IP address (found through DNS) is 202.125.157.196.Lets assume the source IP address is 202.125.157.150

    Packets so far:

    Source IP Destination IP Source port Destination Port GET/HTML/1.1202.125.157.150 202.125.157.196 >1024 803. How to send the created packet to Webserver?

    To communicate with any host its physical address must be known. This physical address iscalled MAC address. All actual communications is in MAC. Now we should convert IP to MAC.Address Resolution Protocol (ARP) is used to map IP to MAC. An important point must be keptin mind that IP address may change but MAC address is physical it cannot change. To get MACaddress we do not make a server as we do to get IP address. It is just a request from source and

    the reply is from the destination. The source request the MAC by referring to IP.There is difference in notation of IP and MAC address. IP is 32 bits dotted notation(202.125.157.196) and MAC is hexadecimal notation (12:34:aa:bb:cc:dd).Now we know the MAC addresses now the communication can take place. The destination MACaddress is 12:34:aa:bb:cc:dd. The source MAC address (lets assume) is 23:34:aa:bb:cc:dd.

    IP packet containing the data

    http://www.seecs.edu.pk/http://www.seecs.edu.pk/http://www.seecs.edu.pk/http://www.seecs.edu.pk/
  • 8/8/2019 16629327 Computer Networks Lecture Notes

    26/42

    Source IP Destination IP Source port Destination Port GET/HTML/1.1202.125.157.150 202.125.157.196 >1024 80

    MAC frameSource MAC Destination MAC Paylaod FCS

    FCS: frame check sequence, used for error checking.

  • 8/8/2019 16629327 Computer Networks Lecture Notes

    27/42

    Lecture 4Part 1#

    Topology, Addressing and Routing

    TYPES OF ADDRESSES:There are two types of addresses:

    a)Logical:The logical address is what the IP (Internet Protocol) address, can also be called virtual address,is and it looks like this 216.109.112.135.IP address can change and often does when you have ahigh speed Internet connection.It is in hierarchical fashion i-e a network part and a host part.IP Version 4; Address: 32 bitsIP Version 6; Address: 128 bits

    b)Physical :The physical address is just like mailing address it is real,it is also called MAC address (MediaAccess Control address) and looks like this 00-56-7E-4A-DD-8D i-e in a hexadecimal form. It isdifferent for every technology e.g Ethernet uses different physical addresses than othertechnologies available.The communicating applications (source/ destination applications) must also be identifiable.

    SOCKET:In computer networking, an Internet socket (or commonly, a network socket or socket) is theendpoint of a bidirectional communication flow across an Internet Protocol-based computernetwork such as the Internet.Internet sockets (in plural) are an application programming

    interface (API) in an operating system, used for in inter-process communication. Internet socketsconstitute a mechanism for delivering incoming data packets to the appropriate applicationprocess orthread, based on a combination of local and remote IP addresses andport numbers.Each socket is mapped by the operational system to a communicating applicationprocessorthread.A socket address is the combination of ana)IP address (the location of the computer) andb) Aport (which is mapped to the application program process) into a single identity, much likeone end of a telephone connection is between a phone number and a particular extension line atthat location.An Internet socket is characterized by a unique combination of the following:

    Protocol(TCP,UDP orraw IP). Consequently, TCP port 53 is not the same socket as

    UDP port 53. (90% of net traffic is carried by TCP)

    Local socket address (LocalIP address andport number)

    Remote socket address (Only for established TCP sockets. As discussed in the Client-

    Server section below, this is necessary since a TCP server may serve several clientsconcurrently. The server creates one socket for each client, and these sockets share thesame local socket address.)

    http://en.wikipedia.org/wiki/Communication_flowhttp://en.wikipedia.org/wiki/Internet_Protocolhttp://en.wikipedia.org/wiki/Computer_networkhttp://en.wikipedia.org/wiki/Internethttp://en.wikipedia.org/wiki/Internethttp://en.wikipedia.org/wiki/Application_programming_interfacehttp://en.wikipedia.org/wiki/Application_programming_interfacehttp://en.wikipedia.org/wiki/Inter-process_communicationhttp://en.wikipedia.org/wiki/Inter-process_communicationhttp://en.wikipedia.org/wiki/Process_(computing)http://en.wikipedia.org/wiki/Thread_(computer_science)http://en.wikipedia.org/wiki/IP_addresshttp://en.wikipedia.org/wiki/Port_numberhttp://en.wikipedia.org/wiki/Processhttp://en.wikipedia.org/wiki/Processhttp://en.wikipedia.org/wiki/Threadhttp://en.wikipedia.org/wiki/IP_addresshttp://en.wikipedia.org/wiki/TCP_and_UDP_porthttp://en.wikipedia.org/wiki/TCP_and_UDP_porthttp://en.wikipedia.org/wiki/Protocol_(computing)http://en.wikipedia.org/wiki/Transmission_Control_Protocolhttp://en.wikipedia.org/wiki/User_Datagram_Protocolhttp://en.wikipedia.org/wiki/User_Datagram_Protocolhttp://en.wikipedia.org/wiki/Raw_sockethttp://en.wikipedia.org/wiki/Raw_sockethttp://en.wikipedia.org/wiki/IP_addresshttp://en.wikipedia.org/wiki/IP_addresshttp://en.wikipedia.org/wiki/TCP_and_UDP_porthttp://en.wikipedia.org/wiki/Communication_flowhttp://en.wikipedia.org/wiki/Communication_flowhttp://en.wikipedia.org/wiki/Communication_flowhttp://en.wikipedia.org/wiki/Internet_Protocolhttp://en.wikipedia.org/wiki/Internet_Protocolhttp://en.wikipedia.org/wiki/Internet_Protocolhttp://en.wikipedia.org/wiki/Computer_networkhttp://en.wikipedia.org/wiki/Computer_networkhttp://en.wikipedia.org/wiki/Computer_networkhttp://en.wikipedia.org/wiki/Internethttp://en.wikipedia.org/wiki/Internethttp://en.wikipedia.org/wiki/Internethttp://en.wikipedia.org/wiki/Application_programming_interfacehttp://en.wikipedia.org/wiki/Application_programming_interfacehttp://en.wikipedia.org/wiki/Application_programming_interfacehttp://en.wikipedia.org/wiki/Application_programming_interfacehttp://en.wikipedia.org/wiki/Application_programming_interfacehttp://en.wikipedia.org/wiki/Application_programming_interfacehttp://en.wikipedia.org/wiki/Inter-process_communicationhttp://en.wikipedia.org/wiki/Inter-process_communicationhttp://en.wikipedia.org/wiki/Inter-process_communicationhttp://en.wikipedia.org/wiki/Process_(computing)http://en.wikipedia.org/wiki/Process_(computing)http://en.wikipedia.org/wiki/Process_(computing)http://en.wikipedia.org/wiki/Thread_(computer_science)http://en.wikipedia.org/wiki/Thread_(computer_science)http://en.wikipedia.org/wiki/Thread_(computer_science)http://en.wikipedia.org/wiki/IP_addresshttp://en.wikipedia.org/wiki/IP_addresshttp://en.wikipedia.org/wiki/IP_addresshttp://en.wikipedia.org/wiki/Port_numberhttp://en.wikipedia.org/wiki/Port_numberhttp://en.wikipedia.org/wiki/Port_numberhttp://en.wikipedia.org/wiki/Processhttp://en.wikipedia.org/wiki/Processhttp://en.wikipedia.org/wiki/Processhttp://en.wikipedia.org/wiki/Threadhttp://en.wikipedia.org/wiki/Threadhttp://en.wikipedia.org/wiki/Threadhttp://en.wikipedia.org/wiki/IP_addresshttp://en.wikipedia.org/wiki/IP_addresshttp://en.wikipedia.org/wiki/IP_addresshttp://en.wikipedia.org/wiki/TCP_and_UDP_porthttp://en.wikipedia.org/wiki/TCP_and_UDP_porthttp://en.wikipedia.org/wiki/TCP_and_UDP_porthttp://en.wikipedia.org/wiki/Protocol_(computing)http://en.wikipedia.org/wiki/Protocol_(computing)http://en.wikipedia.org/wiki/Protocol_(computing)http://en.wikipedia.org/wiki/Transmission_Control_Protocolhttp://en.wikipedia.org/wiki/Transmission_Control_Protocolhttp://en.wikipedia.org/wiki/Transmission_Control_Protocolhttp://en.wikipedia.org/wiki/User_Datagram_Protocolhttp://en.wikipedia.org/wiki/User_Datagram_Protocolhttp://en.wikipedia.org/wiki/User_Datagram_Protocolhttp://en.wikipedia.org/wiki/Raw_sockethttp://en.wikipedia.org/wiki/Raw_sockethttp://en.wikipedia.org/wiki/Raw_sockethttp://en.wikipedia.org/wiki/IP_addresshttp://en.wikipedia.org/wiki/IP_addresshttp://en.wikipedia.org/wiki/IP_addresshttp://en.wikipedia.org/wiki/TCP_and_UDP_porthttp://en.wikipedia.org/wiki/TCP_and_UDP_porthttp://en.wikipedia.org/wiki/TCP_and_UDP_port
  • 8/8/2019 16629327 Computer Networks Lecture Notes

    28/42

    PHYSICAL ADDRESSING (MAC):

  • 8/8/2019 16629327 Computer Networks Lecture Notes

    29/42

  • 8/8/2019 16629327 Computer Networks Lecture Notes

    30/42

    Here;IP Address: It identifies the network.It is of 32-bits.(Processes are identified through ports)Subnet Mask: We use it to identify network and host parts.It is composed of networkpath and host part.Forexample in 255.255.255.0 the net work path is255.255.255And host part is 0EXAMPLE 2:network part is:10010110.11010111and the host part is00010001.00001001 In this IP Address i-e 192.168.15.1/24 of Ethernet make the host part zero and we will getnetwork part 192.168.15 and it is of 24 bits. In subnet mask 255.255.128.0

    Default gateway:A default gateway is a network setting on a computer that specifies the IP address of thecomputer or router that network traffic should be sent to when the traffic is not on the same

    subnet as the sending computer.LOGICAL ADDRESSING IP:

    IP Address192.168.15.2(decimal)11000000101010000000111100000010 (binary)Subnet Mask:

  • 8/8/2019 16629327 Computer Networks Lecture Notes

    31/42

    255.255.255.0 (decimal)11111111111111111111111100000000 (binary)Network partHost partNETWORKING LAN:While an application running on say host # 1 is to communicate to a process running on host # 2several networks apart, transport layer appends its own header with the data .At this level thedata is called a segment. Network layer than attaches its own header indicating the possibledestination and source IPs.ARP than converts the IP address into the physical MAC address andthe data is forwarded onto the data link layer. On the data link layer the ARP appends the MACaddress of the next hop. Each network just detaches the MAC frame and attaches the MACaddress of the relevant destination until the data reaches the destination network, where IPaddress of the receiver host takes the data to the required host.

    At receive host network layer detaches the attached IP layer. Transport layer is used to identifythe process and than even this layer is removed until the data remains and thats what werequired at the destination host.

    INERNETWORKING EXAMPLE:

  • 8/8/2019 16629327 Computer Networks Lecture Notes

    32/42

    In this figure we are having the three technologies i-e ETH,PPP,FDDI.R1,R2,R3 acts as a routerbetween the source and the destination. Our required job is to transmit the packets from thesource to the destination.In first block ETH header is on the IP while in R1 block ETH willremove its header and IP will assign header to the FDDI similarly in R2 FDDI will remove itsheader and it is assigned to PPP through IP and in R3 PPP will remove its header and is assignedto the ETH through IP.At destination i-e H8 ETH header is again on the IP we get requiredpackets.

    The same can be understood by the following figure:

  • 8/8/2019 16629327 Computer Networks Lecture Notes

    33/42

    PART#2

    NETWORK PERFORMANCE ANALYSIS:

    BANDWIDTH:Network performance is measured in two fundamental ways:A) bandwidth (also called throughput) andB) latency (also called delay).

    The bandwidth of a network is given by the number of bits that can be transmittedover the network in a certain period of time. For example, a network might have a bandwidthof 10 million bits/second (Mbps),meaning that it is able to deliver 10 million bits every second. Itis sometimes useful to think of bandwidth in terms of how long it takes to transmit each bit ofdata. On a 10-Mbps network, for example, it takes 0.1 microsecond (s) to transmit each bit.

    Latency = Propagation + Transmit + QueuePropagation = Distance/SpeedOfLightTransmit = Size/Bandwidth

    Bandwidth andThroughput: Bandwidth is literally a measure of the width of a frequency band. For example, a

    voice-grade telephone line supports a frequency band ranging from 300 to 3300 Hz; it is said tohave a bandwidth of 3300 Hz 300 Hz = 3000 Hz. If we see the word bandwidth used in asituation in which it is being measured in hertz, then it probably refers to the range of signals thatcan be accommodated. When we talk about the bandwidth of a communication link, we normallyrefer to the number of bits per second that can be transmitted on the link. We might say that thebandwidth of an Ethernet is 10 Mbps. A useful distinction might be made, however, between thebandwidth that is available on the link and the number of bits per second that we can actuallytransmit over the link in practice.

  • 8/8/2019 16629327 Computer Networks Lecture Notes

    34/42

    While throughput to refer to the measured performance of a system. Thus, because of variousinefficiencies of implementation,a pair of nodes connected by a link with a bandwidth of 10Mbps might achieve a throughput of only 2 Mbps. This would mean that an application on onehost could send data to the other host at 2 Mbps.

    Bandwidth and latency combine to define the performance characteristics of a given link orchannel. Their relative importance,however, depends on the application. For some applications,latency dominates bandwidth. For example, a client that sends a 1-byte message to a server andreceives a 1-byte message in return is latency bound. Assuming that no serious computation isinvolved in preparing the response, the application will perform much differently on atranscontinental channel with a 100-ms RTT than it will on an across-the-room channel with a 1-ms RTT. Whether the channel is 1 Mbps or 100 Mbps is relatively insignificant, however, sincethe former implies that the time to transmit a byte (Transmit)is 8 s and the latter implies Transmit = 0.08 s.

    In contrast, consider a digital library program that is being asked to fetch a 25-megabyte (MB)imagethe more bandwidth that is available, the faster it will be able to return the image to theuser. Here, the bandwidth of the channel dominates performance. To see this, suppose that thechannel has a bandwidth of 10 Mbps. It will take 20 seconds to transmit the image, making itrelatively unimportant if the imageis on the other side of a 1-ms channel or a 100-ms channel; the difference between a 20.001-second response time and a 20.1-second response time is negligible.Figure shown below gives a sense of how latency or bandwidth can dominate performancein different circumstances. The graph shows how long it takes to move objects of various sizes (1byte, 2 KB, 1 MB) across networks with RTTs ranging from 1 to 100 ms and link speeds ofeither 1.5 or 10 Mbps. We use logarithmic scales to show relative performance. For a 1-byteobject (say, a keystroke), latency remains almost exactly equal to the RTT, so that you cannotdistinguish between a 1.5-Mbps networkand a 10-Mbps network. For a 2-KB object (say, an email message), the link speed makes quite adifference on a 1-ms RTT network but a negligible difference on a 100- ms RTT network. Andfor a 1-MB object (say, a digital image), the RTT makes no differenceit is the link speed thatdominates performance across the full range ofRTT.

  • 8/8/2019 16629327 Computer Networks Lecture Notes

    35/42

    Delay BandwidthProduct:

    If we think of a channel between a pair of processes as a hollow pipe where the latencycorresponds to the length of the pipe and the bandwidth gives the diameter of the pipe, then thedelay bandwidth product gives the volume of the pipethe number of bits it holds. Saidanother way, if latency (measured in time) corresponds to the length of the pipe, then given thewidth of each bit (also measured in time),we can calculate how many bits fit in the pipe. Forexample, a transcontinental channel with a one-way latency of 50 ms and a bandwidth of 45Mbps is able to hold 50 103 seconds 45 106 bits/second = 2.25 106 bits orapproximately 280 KB of data. In other words, this example channel (pipe) holds as many bytesas the memory of a personal computer from the early 1980s could hold.

    The delay bandwidth product is important to know when constructing highperformance

    networks because it corresponds to how many bits the sender must transmit before the first bitarrives at the receiver. If the sender is expecting the receiver to somehow signal that bits arestarting to arrive, and it takes another channel latency for this signal to propagate back to thesender (i.e., we are interested in thechannels RTT rather than just its one-way latency), then the sender can send up to twodelaybandwidths worth of data before hearing from the receiver that all is well. The bits in thepipe are said to be in flight, which means that if the receiver tells the sender to stoptransmitting, it might receiveup to a delay bandwidths worth of data before the sender manages to respond.

  • 8/8/2019 16629327 Computer Networks Lecture Notes

    36/42

    In our example above, that amount corresponds to 5.5 106 bits (671 KB) of data.On the otherhand, if the sender does not fill the pipesend a whole delay bandwidth products worth ofdata before it stops to wait for a signalthe sender will not fully utilize the network. Note thatmost of the time we are interested in the RTT scenario, which we simply refer to as the delay bandwidth product, without explicitly saying that this product is multiplied by two. Again,whether the delay in delay bandwidthmeans one-way latency or RTT is made clear by the context.

    High-Speed Networks:High-speed networks bring a dramatic change in the bandwidth available to applications, inmany respects their impact on how we think about networking comes in what does notchange asbandwidth increases: the speed of light.High speed does not mean that latency improves at the same rate as bandwidth; the

    transcontinental RTT of a 1-Gbps link is the same 100 ms as it is for a 1-Mbps link.

    To appreciate the significance of ever-increasing bandwidth in the face of fixedlatency, consider what is required to transmit a 1-MB file over a 1-Mbps networkversus over a 1-Gbps network, both of which have an RTT of 100 ms. In the caseof the 1-Mbps network, it takes 80 round-trip times to transmit the file; during eachRTT, 1.25% of the file is sent. In contrast, the same 1-MB file doesnt even come closeto filling 1 RTTs worth of the 1-Gbps link, which has a delay bandwidth productof 12.5 MB.

    Figure illustrates the difference between the two networks. In effect, the 1-MB file looks like a

    stream of data that needs to be transmitted across a 1-Mbps network, while it looks like a singlepacket on a 1-Gbps network. To help drive this point home, consider that a 1-MB file is to a 1-Gbps network what a 1-KBpacketis to a 1-Mbps network.Perhaps the best way to understand the relationship between throughput andlatency is to return to basics. The effective end-to-end throughput that can be achievedover a network is given by the simple relationshipThroughput = TransferSize/TransferTime

    where TransferTime includes not only the elements of one-way Latency identified earlier

  • 8/8/2019 16629327 Computer Networks Lecture Notes

    37/42

    in this section, but also any additional time spent requesting or setting up the transfer.Generally, we represent this relationship as

    TransferTime = RTT + 1/Bandwidth TransferSize

    We use RTT in this calculation to account for a request message being sent across thenetwork and the data being sent back. For example, consider a situation where a userwants to fetch a 1-MB file across a 1-Gbps network with a round-trip time of 100 ms.The TransferTime includes both the transmit time for 1 MB (1/1 Gbps 1MB = 8 ms),and the 100-ms RTT, for a total transfer time of 108 ms. This means that the effectivethroughput will be

    1 MB/108 ms = 74.1 Mbps

    not 1 Gbps. Clearly, transferring a larger amount of data will help improve the effectivethroughput, where in the limit, an infinitely large transfer size will cause theeffective throughput to approach the network bandwidth. On the other hand, having

    to endure more than 1 RTTfor example, to retransmit missing packetswill hurtthe effective throughput for any transfer of finite size and will be most noticeable forsmall transfers.

    Application Performance Needs:

  • 8/8/2019 16629327 Computer Networks Lecture Notes

    38/42

    In this section , we have talked in terms of what a given link or channel will support. Theunstated assumption has been that application programs have simple needsthey want as much

    bandwidth as the network can provide. This is certainly true of the aforementioned digital libraryprogram that is retrieving a 25-MB image; the more bandwidth that is available, the faster theprogram will be able to return the image to the user.However, some applications are able to state an upper limit on how much bandwidththey need. Video applications are a prime example. Suppose you want to streama video image that is one-quarter the size of a standard TV image; that is, it has aresolution of 352 by 240 pixels. If each pixel is represented by 24 bits of information,as would be the case for 24-bit color, then the size of each frame would be

    (352 240 24)/8 = 247.5 KBIf the application needs to support a frame rate of 30 frames per second, then it mightrequest a throughput rate of 75 Mbps. The ability of the network to provide more

    bandwidth is of no interest to such an application because it has only so much data totransmit in a given period of time.Unfortunately, the situation is not as simple as this example suggests. Becausethe difference between any two adjacent frames in a video stream is often small, it ispossible to compress the video by transmitting only the differences between adjacentframes. This compressed video does not flow at a constant rate, but varies with timeaccording to factors such as the amount of action and detail in the picture and thecompression algorithm being used. Therefore, it is possible to say what the average bandwidthrequirement will be, but the instantaneous rate may be more or less.

  • 8/8/2019 16629327 Computer Networks Lecture Notes

    39/42

  • 8/8/2019 16629327 Computer Networks Lecture Notes

    40/42

    Lecture 6by Jawad Riffat Paracha& Imran Tahir

    TOPIC 2DIRECT LINK NETWORK

    In this lectures following questions were the main concerns1. How to build a direct link ?2. How to start a process to build network between two nodes?3. What is ETHERNET?

    The simplest network possible is one in which all the hosts are directly connectedby some physical medium. This may be a wire or a fiber, and it may cover a smallarea (e.g., an office building) or a wide area (e.g., transcontinental).Lan is a physical link between nodes. There is a network adapter at every host, host receives datafrom this network adapter it copies data from link to memory and the pc access it.NODESNodes are often general-purpose computers, like a desktop workstation, a multiprocessor,or a PC. For our purposes, lets assume its a workstation-class machine. ThisWorkstation can serve as a host that users run application programs on, it might beUsed inside the network as a switch that forwards messages from one link to another,or it might be configured as a router that forwards internet packets from one networkto another. In some cases, a network nodemost commonly a switch or router insidethe network, rather than a hostis implemented by special-purpose hardware. Thisis usually done for reasons of performance and cost: It is generally possible to build

    custom hardware that performs a particular function faster and cheaper than a general purposeprocessor can perform it. When this happens, we will first describe the basicfunction being performed by the node as though this function is being implementedin software on a general-purpose workstation, and then explain why and how this functionalitymight instead be implemented by special hardware.LINKSNetwork links are implemented using the following media.1. COPPER TWISTED PAIR2. CO_AXIAL CABLE3. OPTICAL FIBRE4. WIRELESS5. SNEAKERS NETWORK

    FUNDAMENTALS DATA LINK PROBLEMSENCODINGThe first step in turning nodes and links into usable building blocks is to understandhow to connect them in such a way that bits can be transmitted from one node to the

  • 8/8/2019 16629327 Computer Networks Lecture Notes

    41/42

    other. The task, therefore, is to encode the binary data that the source node wants to sendinto the signals that the links are able to carry, and then to decode the signal backinto the corresponding binary data at the receiving node. a network adaptora piece of hardwarethat connects a node to a link. The network adaptor contains a signalling component that actuallyencodes bits into signals at the sending node and decodes signals into bits at the receiving node.

    FRAMINGBlocks of data (called frames at this level), not bit streams, are exchanged betweennodes. It is the network adaptor that enables the nodes to exchange frames. Whennode A wishes to transmit a frame to node B, it tells its adaptor to transmit a framefrom the nodes memory. This results in a sequence of bits being sent over the link.The adaptor on node B then collects together the sequence of bits arriving on the linkand deposits the corresponding frame in Bs memory.

    ERROR DETECTIONBit errors are sometimes introduced into frames. This happens, for example, because of electricalinterference or thermal noise. Although errors are rare, especially on optical links, some

    mechanism is needed to detect these errors so that corrective action can be taken. Otherwise, theend user is left wondering why the C program that successfully compiled just a moment ago nowsuddenly hasa syntax error in it, when all that happened in the interim is that it was copied acrossa network file system. Detecting errors is only one part of the problem. The other part iscorrectingerrors once detected. There are two basic approaches that can be taken when therecipient of a message detects an error. One is to notify the sender that the messagewas corrupted so that the sender can retransmit a copy of the message. If bit errorsare rare, then in all probability the retransmitted copy will be error-free. Alternatively,there are some types of error detection algorithms that allow the recipient to reconstructthe correct message even after it has been corrupted; such algorithms rely onerror-correcting codes, discussed below.

    RELIABLE DELIEVERYEven when error-correcting codes are used some errors will be too severe to be corrected. As aresult, some corrupt frames must be discarded. A link-level protocol that wants to deliver framesreliably must somehow recover from these discarded (lost) frames.This is usually accomplishedusing a combination of two fundamental mechanismsACKNOWLEDGMENTTIMEOUTS. An acknowledgment is a small control frame that a protocol sends back to its peer saying that ithas receivedan earlier frame. By control frame we mean a header without any data, although a

    protocol canpiggybackan ACK on a data frame it just happens to be sending in theopposite direction. The receipt of an acknowledgment indicates to the sender of theoriginal frame that its frame was successfully delivered. If the sender does not receivean acknowledgment after a reasonable amount of time, then it retransmits the originalframe. This action of waiting a reasonable amount of time is called a timeout.

    ACCESS MADIATIONThis final problem is not relevant to point to point links but it is about multiple access links . it

  • 8/8/2019 16629327 Computer Networks Lecture Notes

    42/42

    means how to mediate access to shared link so that all nodes eventually have a chance to tranmittheir data . in this case we see different media access protocols i-e Ethernet,token ring andseveral wireless protocols .CHANNEL PARTITION

    Channel partion is done for packet switching according to frequency,time and code multiplexing.It is good when every wants to talk .It is inefficient for light load and not overall a good approach.RANDOM ACCESSEthernet is use for random access .This protocol is notable for its distributed nature butinefficient for high load because at high loads collision rate will be increased . it is very easy tomaintain no switch can fail it . it is very inexpensive .TOKEN RINGA ring network consist of a set of nodes connected in a ring .A token which consists of a specialsequence of bits circulates around the ring and goes to every node . Each node receive the token ,saving a copy and then forward the token to other node . when token come back to sender node

    then it will stop forward it . Nodes are serviced as round robin pattern.if a node dont want toreceive token then it will just forward to next node .we introduce electromechanical relaysbetween the nodes so that if network failure not stop circulation . one of its drawback thatwaiting time will increase .COLLISIONIf two nodes wants to talk at the same time then randomness come in picture . Both nodes willsend a message and collision will occur. After collision a jamming signal will send to the senderend and packet will not received to the receiver .HUBHub is a device which receive signal and send it to all nodes .