Computer Communications 4

Embed Size (px)

Citation preview

  • 7/27/2019 Computer Communications 4

    1/16

    Lecture Notes of Computer Communications and Networks

    Prepared by Dr.Eng. Ziyad Tariq Al-Ta'i

    95

    Dr.Eng. Ziyad Al-Ta'i

    Networking and Internetworking

    Two or more devices connected for the purpose of sharingdata can form a network. Putting together a network is often morecomplicated than simply plugging cable into a hub. A LAN mayneed to cover more distance than its media can handle effectively.Or the number of stations may be too great for efficient delivery ormanagement of the network, and the network may need to besubdivided.

    Networking and internetworking devices are divided into fourcategories: repeaters, bridges, routers, and gateways as shown in

    figure below:

    Connecting Devices

    Networking Devices Internetworking Devices

    Repeaters Bridges Routers Gateways

    1- Repeaters:

    A repeater (or regenerator) is an electronic device that

    operates on only the physical layer of the OSI model as shown in

    figure below:

  • 7/27/2019 Computer Communications 4

    2/16

    Lecture Notes of Computer Communications and Networks

    Prepared by Dr.Eng. Ziyad Tariq Al-Ta'i

    96

    Dr.Eng. Ziyad Al-Ta'i

    7 Application Application 7

    6 Presentation Presentation 6

    5 Session Session 5

    4 Transport Transport 4

    3 Network Network 3

    2 Data Link Data Link 2

    1 1

    1 Physical Physical 1

    Signals that carry information within a network can travel a

    fixed distance before attenuation endangers the integrity of thedata. A repeater installed on a link receives the signal before itbecomes too weak or corrupted, regenerates the original bitpattern, and puts the refreshed copy back onto the link.

    A repeater allows us to extend only the physical length of anetwork. The repeater does not change the functionality of thenetwork in any way.

    It is tempting to compare a repeater to an amplifier, but thecomparison is inaccurate. An amplifier can not discriminate

    between the intended signal and noise; it amplifies equally everything fed into it. A repeater does not amplify the signal; itregenerates it. When it receives a weakened or corrupted signal, itcreates a copy bit for bit, at the original strength.

    2- Bridges:

    Bridges operate in both the physical and the data link layersof the OSI model as shown in following figure:

    Repeater

  • 7/27/2019 Computer Communications 4

    3/16

    Lecture Notes of Computer Communications and Networks

    Prepared by Dr.Eng. Ziyad Tariq Al-Ta'i

    97

    Dr.Eng. Ziyad Al-Ta'i

    7 Application Application 7

    6 Presentation Presentation 6

    5 Session Session 5

    4 Transport Transport 4

    3 Network Network 3

    2 Data Link Data Link 2

    2 2

    1 Physical 1 1 Physical 1

    Bridges can divide a large network into smaller segments asshown in figure below:

    A D

    B C

    E H

    F G

    Unlike repeaters, however, bridges contain logic that allows them

    to keep the traffic for each segment separate. For example, figurebelow shows two segments joined by a bridge.

    Bridge

    Bridge

  • 7/27/2019 Computer Communications 4

    4/16

    Lecture Notes of Computer Communications and Networks

    Prepared by Dr.Eng. Ziyad Tariq Al-Ta'i

    98

    Dr.Eng. Ziyad Al-Ta'i

    A D

    F G

    A packet from station A addressed to station D arrives at thebridge. Station A is on the segment as station D; therefore, thepacket is blocked from crossing into the lower segment.

    In figure below, a packet generated by station A is intended forstation G. The bridge allows the packet to cross and relays it to the

    entire lower segment, where it is received by station G.

    A D

    F G

    Bridge

    A to D

    Bridge

    A

    to

    G

  • 7/27/2019 Computer Communications 4

    5/16

    Lecture Notes of Computer Communications and Networks

    Prepared by Dr.Eng. Ziyad Tariq Al-Ta'i

    99

    Dr.Eng. Ziyad Al-Ta'i

    Types of Bridges:

    To select between segments, a bridge must have a look uptable that contains the physical address of every station connectedto it. The table indicates to which segment each station belongs.

    a- Simple Bridge:

    Simple bridges are the most primitive and least expensive typeof bridge. A simple bridge links two segments and contains a tablethat lists the address of all the stations included in each of them.What makes it primitive is that these addresses must be enteredmanually. Before a simple bridge can be used, an operator must sitdown and enter the addresses of every station. Whenever a newstation is added, the table must be modified. If a station isremoved, the newly invalid address must be deleted.

    b- Multiport Bridge:

    A multiport bridge can be used to connect more than twoLANs, as shown in figure below:

    LAN1 LAN3

    LAN2

    In this figure, the bridge has three tables, each one holding thephysical addresses of stations reachable through thecorresponding port.

    Bridge

  • 7/27/2019 Computer Communications 4

    6/16

    Lecture Notes of Computer Communications and Networks

    Prepared by Dr.Eng. Ziyad Tariq Al-Ta'i

    100

    Dr.Eng. Ziyad Al-Ta'i

    c- Transparent Bridge:

    A transparent, or learning, bridge builds its table of stationaddresses on its own as it performs its bridge functions. When thetransparent bridge is first installed, its table is empty. As itencounters each packet, it looks at both the destination and thesource addresses. It checks the destination to decide where tosend the packet. If it does not yet recognize the destinationaddress, it relays the packet to all of the stations on bothsegments. It uses the source address to build its table. As it readsthe source address, it notes which side the packet came from andassociates that address with the segment to which it belong.

    3- Routers:Repeaters and bridges are simple hardware devices capable of

    executing specific tasks. Routers are more sophisticated. Theyhave access to network layer addresses and contain software thatenables them to determine which of several possible pathsbetween those addresses is the best for a particular transmission.Routers operate in the physical, data link, and network layers of theOSI model as shown in figure below:

    7 Application Application 7

    6 Presentation Presentation 6

    5 Session Session 5

    4 Transport Transport 4

    3 Network 3 3 Network 3

    2 Data Link2 2Data Link 2

    1 Physical 1 1 Physical 1

    Routers act like stations on a network. But unlike most stations,

    which are members of only one network, routers have addresseson, and links to, two or more networks at the same time. In their

    Router networ

    networ

  • 7/27/2019 Computer Communications 4

    7/16

    Lecture Notes of Computer Communications and Networks

    Prepared by Dr.Eng. Ziyad Tariq Al-Ta'i

    101

    Dr.Eng. Ziyad Al-Ta'i

    simplest function, they receive packets from one connectednetwork and pass them to a second connected network.

    4- Gateways:

    Gateways operate in all seven layers of the OSI model asshown in figure below:

    7 Application Application 7

    6 Presentation Presentation 6

    5 Session Session 5

    4 Transport Transport 4

    3 Network Network 3

    2 Data Link Data Link 2

    1 Physical Physical 1

    A gateway is a protocol converter. A router by itself transfers,accepts, and relays packets only across networks using similarprotocols. A gateway, on the other hand, can accept a packetformatted for one protocol and convert it to a packet formatted foranother protocol before forwarding it.

    A gateway is generally software installed within a router. Thegateway understands the protocols used by each network linked

    into the router and is therefore able to transfer from one to another.Other Devices:

    1- Multiprotocol Routers:

    At the network layer, a router by default is a single protocoldevice. In other words, if two LANs are to be connected through arouter, they should use the same protocol at the network layer.However, multiprotocol routers have been designed to route

    packets belonging to two or more protocols. For example, two

    Gateway networ

    networ

  • 7/27/2019 Computer Communications 4

    8/16

    Lecture Notes of Computer Communications and Networks

    Prepared by Dr.Eng. Ziyad Tariq Al-Ta'i

    102

    Dr.Eng. Ziyad Al-Ta'i

    protocol routers can handle packets belonging to either of the twoprotocols, as shown in figure below:

    IP table

    LAN using IP Protocol LAN using IP Protocol

    Single protocol router(The router passes only packets using IP, other packets are discarded)

    IP table IPX table

    LAN using IP or IPX Protocol LAN using IP or IPX Protocol

    Multiprotocol router(The router passes only packets using IP or IPX, other packets are discarded)

    2- Brouters:

    A brouter (bridge/router) is a single protocol or multiprotocolrouter that sometimes acts as a router and sometimes as a bridge.When a single protocol or multiprotocol brouter receives a packetbelonging to one of the protocols for which it is designed, it routesthe packet based on the network layer address; otherwise, it actsas a bridge and passes the packet using the data link layeraddress, as shown in figure below:

    Router

    Router

  • 7/27/2019 Computer Communications 4

    9/16

    Lecture Notes of Computer Communications and Networks

    Prepared by Dr.Eng. Ziyad Tariq Al-Ta'i

    103

    Dr.Eng. Ziyad Al-Ta'i

    IP table

    LAN using IP Protocol LAN using IP Protocol

    Single protocol brouter(The brouter routes packets using IP, other packets are passed based on physical

    address)

    IP table IPX table

    LAN using IP or IPX Protocol LAN using IP or IPX Protocol

    Multiprotocol brouter(The brouter routes packets using IP or IPX, other packets are passed based on

    physical address)

    3- Switches:

    A switch is a device that provides bridging functionality withgreater efficiency. A switch may act as a multiport bridge toconnect devices or segments in a LAN. The switch normally has abuffer for each link (network) to which is connected. When itreceives a packet, it stores the packet in the going link. If theoutgoing link is free, the switch sends the packet to that particularlink.

    Switches are made based on two different strategies (calledfabrics): store-and-forward and cut-through. A store-and-forwardswitch stores the packet in the input buffer until the whole packethas arrived. A cut-through switch, on the other hand, forwards thepackets to the output buffer as soon as the destination address isreceived. The following figure shows the concept of a switch:

    Brouter

    Brouter

  • 7/27/2019 Computer Communications 4

    10/16

    Lecture Notes of Computer Communications and Networks

    Prepared by Dr.Eng. Ziyad Tariq Al-Ta'i

    104

    Dr.Eng. Ziyad Al-Ta'i

    Buffers

    Switching table

    1 2 3 4 5

    Frame in Frame out

    A packet arrives at port 2 and is stored in the buffer. The CPUand the control unit, using the information in the packet, consultthe switching table to find the output port. The packet is then sent

    to port 5 for transmission.A new generation of switches that are a combination of a

    router and a bridge has recently appeared on the market. Theserouting switches use the network layer destination address to findthe output link to which the packet should be forwarded. Theprocess is faster because the network layer software in a regularrouter finds only the network address of the next station and thenpasses this information to the data link layer software to find theoutput link.

    Control

    unit

  • 7/27/2019 Computer Communications 4

    11/16

    Lecture Notes of Computer Communications and Networks

    Prepared by Dr.Eng. Ziyad Tariq Al-Ta'i

    105

    Dr.Eng. Ziyad Al-Ta'i

    Routing

    The job of router is to forward packets through a set ofnetworks. But, which path does it choose? The answer is theshortest. In routing the term shortest can mean the combination ofmany factors including shortest, cheapest, fastest, and mostreliable. This is called least cost routing.Routing is classified as:

    1- Non adaptive Routing:

    In some routing protocols, once a pathway to a destination hasbeen selected, the router sends all packets for that destinationalong that one route. In other words, the routing decisions are notmade based on the condition or topology of the networks.

    2- Adaptive Routing:

    Other routing protocols employ a technique called adaptiverouting, by which a router may select a new route for each packet(even packets belonging to the same transmission) in response tochanges in condition and topology of the network.

    Routing Algorithms:

    Many algorithms are used to calculate shortest path betweentwo routers, one of them is distance vector routing.

    Distance Vector Routing:In distance vector routing, each router periodically shares its

    knowledge about the entire network with its neighbors. Tounderstand how distance vector routing works, examine theinternet shown in figure below:

  • 7/27/2019 Computer Communications 4

    12/16

    Lecture Notes of Computer Communications and Networks

    Prepared by Dr.Eng. Ziyad Tariq Al-Ta'i

    106

    Dr.Eng. Ziyad Al-Ta'i

    In this example, the clouds represent LANs. The number insideeach cloud is that LAN's network ID. The LANs are connected byrouters represented by the boxes labeled A, B, C, D, E, and F.

    Distance vector routing simplifies the routing process byassuming a cost of one unit for every link; therefore the cost isbased on hop count. The following figure shows the first step in

    the algorithm:

    Net14

    Net55

    Net

    78

    Net23

    Net

    92

    Net66

    Net

    08

    A

    B

    F

    E D

    C

    Net14

    Net55

    Net78

    Net23

    Net92

    Net66

    Net08

    A

    B

    F

    E D

    C

    I periodically send my

    knowledge about the

    whole network to A,C

    I periodically send my

    knowledge about the

    whole network to B,F,E

    I periodically send my

    knowledge about the

    whole network to A,D

    I periodically send my

    knowledge about the

    whole network to C,E

    I periodically

    send my

    knowledge

    about the whole

    network to B,D

    I periodically send my knowledge

    about the whole network to A

  • 7/27/2019 Computer Communications 4

    13/16

    Lecture Notes of Computer Communications and Networks

    Prepared by Dr.Eng. Ziyad Tariq Al-Ta'i

    107

    Dr.Eng. Ziyad Al-Ta'i

    A router sends its knowledge to its neighbors. The neighborsadd this knowledge to their own knowledge and send the wholetable to their own neighbors. In this way, the first router gets itsown information back plus new information about its neighbor's

    other neighbors. Each of these neighbors adds its knowledge andsends the updated table on to its own neighbors and so on.Eventually, every router knows about every other router in theinternetwork.

    Creating Routing Table:

    At start up, a router's knowledge of the internetwork is sparse.All it knows is that it is connected to some number of LANs.Because a router is a station on each of those LANs, it also knowsthe ID of each station. This information is enough for it to constructits original routing table as shown in table below:

    Network ID Cost Next Hop

    ..

    ..

    ..

    ..

    .

    ..

    ..

    ..

    .

    .

    .

    .

    A routing table has columns for at least three types ofinformation: the network ID, the cost, and the ID of the next router(next hop). The network ID is the final destination of the packet.The cost is the number of hops a packet must make to get there.

    And the next router is the router to which a packet must bedelivered on its way to a particular destination. The table tells arouter that it costs x to reach network y via router z.

    The original routing tables for our sample internetwork areshown in figure below:

  • 7/27/2019 Computer Communications 4

    14/16

    Lecture Notes of Computer Communications and Networks

    Prepared by Dr.Eng. Ziyad Tariq Al-Ta'i

    108

    Dr.Eng. Ziyad Al-Ta'i

    At this point, the third column is empty because the onlydestination networks identified are those attached to the currentrouter. No multiple-hop destinations and therefore no next routershave been identified. These basic tables are sent out to neighborsas shown at figure above.

    Updating the Table:

    When A receives a routing table from B, it uses the informationto update its own table as shown in figure below:

    + = A's new table

    Received from B after adjustment combined

    Updating routing table for router (A)

    The combined table may contain duplicate data for somenetwork destination. Router A therefore finds and purges anyduplications and keep whichever version shows the lowest cost.

    Net14

    Net55

    Net

    78

    Net23

    Net

    92

    Net66

    Net

    08

    A

    B

    F

    E D

    C

    14 1

    23 1

    78 1

    14 1

    55 1

    55 166 178 1

    92 1

    08 1

    23 1

    23 1

    66 1

    14 1

    23 1

    78 1

    14 155 1 Onehop 14 2 B55 2 B

    14 1 --

    14 2 B

    23 1 --55 2 B

    78 1 --

    14 1 --

    23 1 --

    55 2 B

    78 1 --

  • 7/27/2019 Computer Communications 4

    15/16

  • 7/27/2019 Computer Communications 4

    16/16

    Lecture Notes of Computer Communications and Networks

    Prepared by Dr.Eng. Ziyad Tariq Al-Ta'i

    110

    Dr.Eng. Ziyad Al-Ta'i

    Net14

    Net55

    Net78

    Net23

    Net92

    Net

    66

    Net

    08

    A

    B

    F

    E

    D

    C

    08 2 E

    14 1

    23 1

    55 2 B

    66 3 E

    78 1

    92 2 F

    08 3 A14 1

    23 2 A

    55 1

    66 2 C

    78 2

    92 3 A 08 2 D

    14 2 B

    23 3 D

    55 1

    66 1

    78 3 B

    92 4 B08 3 A

    14 2 A

    23 2 A

    55 3 A

    66 4 A

    78 1

    92 2 F

    08 1

    14 2 A23 1

    55 3 A

    66 2 D

    78 2 A

    92 3 A

    08 1

    14 3 E

    23 2 E

    55 2 C

    66 1

    78 3 E

    92 4 E