Sub Netting and Routing

Embed Size (px)

Citation preview

  • 8/3/2019 Sub Netting and Routing

    1/89

    SUBNET & ROUTINGSUBNET & ROUTINGSUBNET & ROUTINGSUBNET & ROUTING

    Sritrusta SukaridhotoSritrusta Sukaridhoto

    LecturerLecturerPens EEPISPens EEPIS--ITSITS

  • 8/3/2019 Sub Netting and Routing

    2/89

    Netmask / Subnet maskNetmask / Subnet masktutorialtutorial

    Netmask / Subnet maskNetmask / Subnet masktutorialtutorial

  • 8/3/2019 Sub Netting and Routing

    3/89

    IP AddressingIP AddressingIP AddressingIP Addressing

  • 8/3/2019 Sub Netting and Routing

    4/89

    Subnet & Routing 4

    IP addressing Introduction to IP addressing

    Classes of IP addressing

    Why Subnet Masks are necessary?

    How to create subnet masks

  • 8/3/2019 Sub Netting and Routing

    5/89

    Subnet & Routing 5

    Why are IP addresses

    written as bits? In order for data to pass along the media, it must

    first be changed to electrical impulses.

    When a computer receives these electricalimpulses, it recognizes two things: the presenceof voltage on the wire or the absence of voltageon the wire.

  • 8/3/2019 Sub Netting and Routing

    6/89

    Subnet & Routing 6

  • 8/3/2019 Sub Netting and Routing

    7/89

    Subnet & Routing 7

    What format do IP

    addresses use?

  • 8/3/2019 Sub Netting and Routing

    8/89

    Subnet & Routing 8

    How are IP addresses

    expressed in dottednotation?

  • 8/3/2019 Sub Netting and Routing

    9/89

    Subnet & Routing 9

    Why are IP addresses

    necessary? IP addressing makes it possible for data

    passing over the network media of the

    Internet to find its destination. Because each IP address is a 32-bit value,that means that there are four billiondifferent IP address possibilities.

    IP addresses are hierarchical addresseslike phone numbers and zip codes.

  • 8/3/2019 Sub Netting and Routing

    10/89

    Subnet & Routing 10

    How do IP addresses make itpossible for data sent via the

    Internet to find its destination?

    It is because each network connected to theInternet has a unique network number.

    To ensure that each network number on theInternet will always be unique and unlike thatof any other number, an organization called

    the International Network InformationCenter, or InterNIC

  • 8/3/2019 Sub Netting and Routing

    11/89

    Subnet & Routing 11

    How do IP addresses

    incorporate network addresses? Every IP address has two parts. These are

    known as the network number and the host

    number.

  • 8/3/2019 Sub Netting and Routing

    12/89

    Subnet & Routing 12

    What are the different

    classes of networks? There are three classes of IP

    addresses that a company can receive

    from the InterNIC. The InterNICreserves class "A" IP addresses forgovernments throughout the world,

    class "B" IP addresses for mediumsize companies, and class "C"

  • 8/3/2019 Sub Netting and Routing

    13/89

    Subnet & Routing 13

    IP addressing Classes of Networks

    N H H HClass A:

    N N N HClass C:

    N N H HClass B:

    Network number assigned by NIC

    Host number assigned by Systems Administrator

    1 Byte 1 Byte 1 Byte 1 Byte

  • 8/3/2019 Sub Netting and Routing

    14/89

    Subnet & Routing 14

    IP addressing IP Address Bit Patterns

    0 Network# Host #Class A:

    Bit #1 2 - 8 9 32 (24 bits)

    Class A address range

    1.0.0.0 126.0.0.0 (127.0.0.0 is for loopback)

    Private Class A address: 10.0.0.0

    Number of hosts: 224 -2 = 16,777,214

    8 16 24 32

  • 8/3/2019 Sub Netting and Routing

    15/89

    Subnet & Routing 15

    IP addressing IP Address Bit Patterns

    Class B:

    Bit #1 3 - 16 17 32 (16 bits)

    Class B address range

    128.0.0.0 191.255.0.0

    Private Class B : 172.16.0.0 172.31.0.0

    Number of hosts: 216 - 2 = 65,534

    1 0 Network # Host #

    2

    8 16 24 32

  • 8/3/2019 Sub Netting and Routing

    16/89

    Subnet & Routing 16

    IP addressing IP Address Bit Patterns

    Class C:

    Bit #1 4 - 24 25 32 (8 bits)

    Class C address range

    192.0.0.0 233.255.255.0

    Private Class C : 192.168.0.0

    Number of hosts: 28 - 2 = 254

    2

    8 16 24 32

    1 1 0 Network # Host #

    3

  • 8/3/2019 Sub Netting and Routing

    17/89

    Subnet & Routing 17

  • 8/3/2019 Sub Netting and Routing

    18/89

    Subnet & Routing 18

    How many classes of

    Networks are there? you have learned about three classes

    of networks that can be assigned by

    the InterNIC. In fact, there are five classes of

    networks. However, only three of

    these are used commercially.

  • 8/3/2019 Sub Netting and Routing

    19/89

    Subnet & Routing 19

    reserved for multicast

    purposes and experimental

    purposes? The highest number listed was 223.

    You may have wondered why the

    highest value was only 223 and not255, since there are 255 possiblevalues for an octet.

    in IP addresses the values 224through 255 are not used in the firstoctet for networking purposes.

  • 8/3/2019 Sub Netting and Routing

    20/89

    Subnet & Routing 20

    What IP addresses are

    reserved for the Networks? By convention, in IP addressing schemes,

    any IP address that ends in all binary

    zeroes is reserved for the networkaddress.

    Thus, in a class "A" network, 113.0.0.0would be the IP address of that network.

    Routers use a network's IP address whenforwarding data on the Internet.

  • 8/3/2019 Sub Netting and Routing

    21/89

    Subnet & Routing 21

  • 8/3/2019 Sub Netting and Routing

    22/89

    Subnet & Routing 22

    What IP addresses are

    reserved for broadcasts? for the network that is 176.10.0.0, the broadcast

    address that would be sent out to all devices onthat network would be 176.10.255.255.

  • 8/3/2019 Sub Netting and Routing

    23/89

    Subnet & Routing 23

    Who assigns subnet

    addresses? As with the host number portion of

    class "A," class "B," and class "C

    addresses, subnet addresses areassigned locally.

    Usually this is done by the network

    administrator.

  • 8/3/2019 Sub Netting and Routing

    24/89

    Subnet & Routing 24

  • 8/3/2019 Sub Netting and Routing

    25/89

    Subnet & Routing 25

    IP addressing Subnet

    mask Subnet Masking - Why?

    131 181 115 252IP address

    255 255 0 0Netmask

    131 181 0 0

    10000011 10110101 01110011 11111100

    11111111 1111111100000000

    00000000

    0000000 0000000=

    Network

    Address

    &

  • 8/3/2019 Sub Netting and Routing

    26/89

    Subnet & Routing 26

    IP addressing -

    Subnetting Subnetting

    Is the act of borrowing bits from the host

    portion to create smaller networks (calledsubnetworks)

    Minimum bits that can be borrowed is 2 -why?

    Subnetting is used to reduce the number ofbroadcast domains

    Communication between these subnetworks isachieved through a router

  • 8/3/2019 Sub Netting and Routing

    27/89

    Subnet & Routing 27

  • 8/3/2019 Sub Netting and Routing

    28/89

    Subnet & Routing 28

    How are subnet addressesconcealed from outside

    networks? Subnets are hidden from outside

    networks by using a mask.

    These are referred to as subnetmasks.

    The function of a subnet mask is to

    tell devices which part of an addressis the network number including thesubnet, and which part is the host.

  • 8/3/2019 Sub Netting and Routing

    29/89

    Subnet & Routing 29

    What format do subnet

    masks use? Subnet masks use the same format

    as IP addressing.

    In other words, they are thirty twobits long and divided into four octets.

    Subnet masks have all 1s in the

    network and subnetwork portion, andall 0s in the host portion.

  • 8/3/2019 Sub Netting and Routing

    30/89

    Subnet & Routing 30

  • 8/3/2019 Sub Netting and Routing

    31/89

    Subnet & Routing 31

  • 8/3/2019 Sub Netting and Routing

    32/89

    Subnet & Routing 32

    How many bits can be borrowed fromthe host number in class "B" and class

    "C" networks to create subnets?

    Because there are only two octets in thehost field of a class "B network, up to

    fourteen bits can be borrowed to createsubnetworks.

    A class "C" network has only one octet inthe host field. Therefore, only up to six

    bits can be borrowed in class "C networksto create subnetworks.

  • 8/3/2019 Sub Netting and Routing

    33/89

    Subnet & Routing 33

    What happens to the subnet maskaddress if only some of the bits in an

    octet are borrowed? Imagine that you have a class "B network. This

    time however, instead of borrowing all eight bitsof the third octet, only seven bits are borrowed

    to create subnetworks. Using binary representation, in this example, the

    subnet mask would be11111111.11111111.11111110.00000000.

    Therefore, 255.255.255.0 can no longer be usedas the subnet mask.

  • 8/3/2019 Sub Netting and Routing

    34/89

    Subnet & Routing 34

    If only seven bits are borrowed in a class"B" network, what would the subnet mask

    be in dotted decimal notation? HINT: To convert any eight bit binary number

    into a decimal number, total the powers of 2 that

    occur in the number.

  • 8/3/2019 Sub Netting and Routing

    35/89

    Subnet & Routing 35

    What determines how many subnetworkscan be created by borrowing bits from

    the host field?

    Can you figure out all of the possiblecombinations of 0s and 1s if four bits are

    borrowed from the host field to createsubnetworks?

    16 from 0000 to 1111. However, you knowthat 1111 is reserved for broadcast and

    0000 means this network.

  • 8/3/2019 Sub Netting and Routing

    36/89

    Subnet & Routing 36

    How many subnetworks can becreated by borrowing five bits

    from the host field? Answer: Thirty-two

    subnetworks or 25 =32

    subnetworks can be created byborrowing five bits from thehost field.

  • 8/3/2019 Sub Netting and Routing

    37/89

    Subnet & Routing 37

    Which numbers in a subnetwork

    are reserved for broadcasts? In previous section, we used an example of

    a class "C" network in which three bits are

    borrowed from the host field. You learnedthat when three bits are borrowed fromthe host octet, up to eight subnetworkscan be created each having up to thirty-

    two hosts. You also learned that IP addresses endingin all binary 1s are reserved forbroadcasts. The same is true for

    subnetworks.

  • 8/3/2019 Sub Netting and Routing

    38/89

    Subnet & Routing 38

    For IP address 197.15.22.160 on the sameclass "C network. How would this be

    expressed in a binary numbering scheme? Answer: If 197.15.22.160 is converted to

    binary format, it becomes

    110001010.00001111.00010110. 10100000. The first three bits in the last octet, 101,indicate that this is the sixth subnetwork.As before the remaining bits are all binary

    0s. This means that the IPaddress197.15.22.160 must be one that isreserved for a subnetwork address.

  • 8/3/2019 Sub Netting and Routing

    39/89

    Subnet & Routing 39

    Subnet mask How do we determine how many bits to

    borrow for a subnet?

    Determine the number of sub networksrequired

    Work from the MOST significant (LHS)bits of the first octet after the network

    number and calculate the number of bitsneeded to create the required number ofsubnetworks

  • 8/3/2019 Sub Netting and Routing

    40/89

    Subnet & Routing 40

    Subnet mask Example: You are given a class B address and you are

    required to create 1000 subnetworks.

    By working from the LHS of the (first octetafter the network number) 3rd octet,calculate the number of bits to equal or slightlyexceed 1000. (ie 2x = > 1000)

    This would equate to 210 or 1024-2 networks

    Hence you will need to borrow 10 bits from thehost portion to create 1000 subnetworks

  • 8/3/2019 Sub Netting and Routing

    41/89

    Subnet & Routing 41

    Subnet mask Example:

    The subnetmask in this instance would

    be255.255.255.192

    How many host per network can youobtain from this addressing scheme?

    11111111 11111111 11111111 11 000000

    10 Bits Borrowed

    (subnetmask)Natural Class B netmask6 bits left

    for hosts

  • 8/3/2019 Sub Netting and Routing

    42/89

    Subnet & Routing 42

    Subnet mask How do we determine how many bits to

    borrow for a subnet given the number ofhosts required?

    Determine the number of hosts required Work from the LEAST significant (RHS)

    bits of the last octet and calculate thenumber of bits needed to create the

    required number of subnetworks

  • 8/3/2019 Sub Netting and Routing

    43/89

    Subnet & Routing 43

    Subnet mask Example: You are given a class B address and you require

    1000 nodes per subnet

    By working from the RHS (last octet) of the4th octet, calculate the number of bits toequal or slightly exceed 1000. (ie 2x = > 1000)

    This would equate to 210 or 1024-2 networks Hence you will need to borrow 6 bits from the

    host portion to create subnetworks with 1000hosts each

  • 8/3/2019 Sub Netting and Routing

    44/89

    Subnet & Routing 44

    Subnet mask Example:

    The subnetmask in this instance wouldbe255.255.252.0

    How many subnetworks per network canyou obtain from this addressingscheme?

    Note: Do you recognise this address asthe student supernet address?

    11111111 11111111 111111 00 00000000

    6 Bits Borrowed

    (subnetmask)Natural Class B netmask10 bits required

    for hosts

  • 8/3/2019 Sub Netting and Routing

    45/89

    Subnet & Routing 45

    What about a Supernet? A supernet borrows bits from the networkportion to create contiguous nodes to form asuper network

    For example Company A has about 1000 nodes to address. A class Baddress would be too big (or may not be available).Solution Supernetting using 4 contiguous class Caddresses

    203.10.112.0203.10.113.0203.10.114.0203.10.115.0

    (All netmasked to 255.255.255.0)

  • 8/3/2019 Sub Netting and Routing

    46/89

    Subnet & Routing 46

    What about a Supernet? By allowing the first 2 bits of the third octet

    to be borrowed, a virtual class B address canbe created.

    A supernet address of 203.10.112.0

    203.10.115.255 is formed with a subnet maskof 255.255.252.0. The Host portion will be expanded from 8 10

    bits

    Route summarisation can occur to203.10.112.0/22

  • 8/3/2019 Sub Netting and Routing

    47/89

    Subnet & Routing 47

    What about a Supernet?

    1100101

    1

    00001010011100

    00

    0000000

    011001011

    0000101001110001

    00000000

    11001011

    0000101001110010

    00000000

    11001011

    0000101001110011

    11111111

    11111111

    1111111111111100

    00000000

    Host portionNetwork Portion

    203.10.112.0

    203.10.115.255

    203.10.113.0

    203.10.114.0

    255.255.252.0

    We have expanded the host portion by 2 bits to 10 bits

  • 8/3/2019 Sub Netting and Routing

    48/89

    Subnet & Routing 48

    What is a Broadcast

    Address A broadcast address is used to by a

    node to communicate with ALL nodes

    in a broadcast domain Like the netmask, the broadcastaddress is AND with the networkaddress.

    However, the host portion of thenetwork is identified in a broadcastaddress

  • 8/3/2019 Sub Netting and Routing

    49/89

    Subnet & Routing 49

    What is a Broadcast

    Address A broadcast address does this by inserting all1s in the host portion.

    Eg A natural class B broadcast address would look

    something like this N.N.255.255 If it is not a classful subnetmask, you can

    determine the broadcast address within eachsubnet by locating the host portion and setting

    them to all 1s.

  • 8/3/2019 Sub Netting and Routing

    50/89

    Subnet & Routing 50

    What is a Broadcast

    Address An example of a Broadcast address

    131 181HostID

    HostID

    131 181 255 255

    131 181HostID

    HostID

    &

    =

  • 8/3/2019 Sub Netting and Routing

    51/89

    Subnet & Routing 51

    What is a Broadcast Address

    An example of a cross boundary subnetbroadcast address with a mask of255.255.252.0

    131 181 11[2,3,4,5] x

    131 181 115 255

    131 181 SN + HHostID

    &

    =

    10000011

    1011010101110000

    00000000

    10000011

    10110101011100xx

    xxxxxxxx

    1000001 011100 1111111

    Host portionNetwork Portion SNNetworkAddress

    Broadcast

    Address

    Host

  • 8/3/2019 Sub Netting and Routing

    52/89

    Subnet & Routing 52

    What is a Broadcast Address

    An example of a cross boundary subnetbroadcast address with a mask of255.255.252.0

    In this example, IP addresses 131.181.112.0 131.181.115.255 belongto the same subnetwork

    10000011

    1011010101110000

    00000000

    10000011 10110101

    01110001

    00000000

    10000011

    1011010101110010

    00000000

    1000001

    110110101

    011100

    11

    1111111

    1

    Host portionNetwork Portion SN131.181.112.0

    (Network)

    131.181.115.255

    (Broadacast)

    131.181.113.0

    131.181.114.0

    k dd

  • 8/3/2019 Sub Netting and Routing

    53/89

    Subnet & Routing 53

    Network AddressVS

    Broadcast address Remember

    A Network address has all the hostbits set to 0

    A Broadcast address has all the hostbits set to 1

    Therefore 131.181.112.0 is the network address

    131.181.115.255 is the broadcast address

  • 8/3/2019 Sub Netting and Routing

    54/89

    Subnet & Routing 54

    Network AddressVS

    Broadcast address This is important when you are doing

    ifconfig and routing commands

    For example, if a host has an address131.181.114.10/22

    The ifconfig & route commands would be ifconfig eth inet 131.181.114.10 netmask

    255.255.252.0 broadcast 131.181.115.255

    route add net 131.181.112.0 netmask255.255.252.0 dev eth

    H d d t i

  • 8/3/2019 Sub Netting and Routing

    55/89

    Subnet & Routing 55

    How do you determineNetwork and Broadcast

    address quickly? There are different subnetting exercises

    Given an IP address & mask,

    What is the network/subnetwork address

    What is the network/subnetwork broadcastaddress

    What are the assignable address in thatnetwork/subnetwork

    What are all the valid subnet addresses How many nodes per subnet

  • 8/3/2019 Sub Netting and Routing

    56/89

    Subnet & Routing 56

    Algorithm for deriving

    Subnet information Given an IP address, you will usually begiven a net/subnetmask

    If you are given the mask Subtract the mask from 256 This is known as the multiplier The first number in each multiplier value

    is the network number The broadcast address is the nextmultiplier value subtract 1

  • 8/3/2019 Sub Netting and Routing

    57/89

    Subnet & Routing 57

    Algorithm for deriving

    Subnet information Eg given the IP address 192.168.0.100

    with the subnet mask of255.255.255.240Or 192.168.0.100/28 What is the network number

    What is the broadcast address What are the valid IP hosts for the

    subnet

  • 8/3/2019 Sub Netting and Routing

    58/89

    Subnet & Routing 58

    Subtract 256 from the netmask 256 - 240 = 16 This is the multiplier ie the networks are in steps of 16

    (16,32,48,64,96,112 etc)

    The IP address 192.168.0.100 is in the range of |100 / 16|which is the 6 th subnetwork

    The network address is16* 6 = 96 (01100000b)

    The Broadcast address is 96 + 16 - 1

    => 192.168.0.111 (01101111b) ie (next multiplier 1)

    Algorithm for deriving

    Subnet information

    Host portion

    Subnetwork portion

  • 8/3/2019 Sub Netting and Routing

    59/89

    Subnet & Routing 59

    Algorithm for deriving

    Subnet information11000000

    1010100000000000

    01100100

    11111111

    11111111 11111111

    11110000

    11000000

    1010100000000000

    01100000

    11000000 10101000

    00000000

    01101111

    Host portionNetwork Portion SN

    IP address

    192.168.0.100

    Netmask255.255.255.240

    Network Address

    192.168.0.96

    Broadcast Address

    192.168.0.111

  • 8/3/2019 Sub Netting and Routing

    60/89

    Subnet & Routing 60

    Algorithm for deriving

    Subnet information Valid ranges are

    192.168.0.97 to 192.168.0.110

    Number of allowable hosts 97 to 110 (incl) = 14 or [24]16 - 2 = 14 Remember you cannot use the first address (network address) and the

    last address (broadcast address) in the range The number of allowable networks

    [24]16 - 2 = 14 ( ie 4 bits used. If a class B address with the last bit subnet,then add another 8 bits to give you 212 2 allowable subnet)

  • 8/3/2019 Sub Netting and Routing

    61/89

    Subnet & Routing 61

    Algorithm for deriving

    Subnet information What if the IP range goes over 2 octets

    Use the same principal

    Remember octets with all 0s are consideredboring and will be assigned the mask of 0

    You will then have to locate the position in theaddress with both 1s and 0s (interesting byte)and use the same algorithm

    Similarly all 1s are also considered boring and willbe given the mask of 255 (eg subnetting the lastbyte of a class B address)

  • 8/3/2019 Sub Netting and Routing

    62/89

    Subnet & Routing 62

    Algorithm for deriving

    Subnet information Example

    QUT students supernet address 131.181.112.0/22

    Netmask expanded : 255.255.252.0 Last byte is not interesting hence we set it to 0 for networkand 1 for broadcast

    The third byte is interesting256 252 = 4 (multiplier)

    Networks are in increments of 4 steps

    112/4 = 28 (the 28th subnetwork). Since there is no remainder,it is the beginning of the network address

  • 8/3/2019 Sub Netting and Routing

    63/89

    Subnet & Routing 63

    Algorithm for deriving

    Subnet information

    Network address :

    131.181.112.0 Netmask :

    255.255.252.0 Broadcast :

    112 + 4 1 = 115=>131.181.115.255

    Number of valid hosts :210 2 = 1024 2 = 1022 hosts

    Number of subnetworks available for this network26 2 = 64 2 =62 subnetworks

    Assignable addresses in this subnetwork131.181.112.1 131.181.115.254

    Remember, the 1st and last addressescannot be used (Network and

    broadcast)

  • 8/3/2019 Sub Netting and Routing

    64/89

    Subnet & Routing 64

    handle IP addresses and

    subnet masks? Let's assume that a device on another networkwith an IP address of 197.15.22.44 wants to senddata to another device attached to Cisco's

    network with an IP address of 131.108.2.2. The data is sent out over the Internet until it

    reaches the router that is attached to Cisco'snetwork.

    The router's job is to determine which one ofCisco's subnetworks the data should be routed to.

  • 8/3/2019 Sub Netting and Routing

    65/89

    Subnet & Routing 65

    h n th t p f ms this

  • 8/3/2019 Sub Netting and Routing

    66/89

    Subnet & Routing 66

    when the router performs thisANDing" operation, the host

    portion falls through.

    The router looks at what is left which

  • 8/3/2019 Sub Netting and Routing

    67/89

    Subnet & Routing 67

    The router looks at what is left whichis the network number including the

    subnetwork.

    h h l k bl

  • 8/3/2019 Sub Netting and Routing

    68/89

    Subnet & Routing 68

    The router then looks in its routing tableand tries to match the network number

    including the subnet with an interface.

  • 8/3/2019 Sub Netting and Routing

    69/89

    Subnet & Routing 69

    How does the "Anding operation

    change with different subnet masks? Imagine that you have a class "B network with

    the network number 172.16.0.0.

    After assessing the needs of his network, the

    network administrator has decided to borroweight bits in order to create subnetworks.

    When eight bits are borrowed to create subnets,the subnet mask is 255.255.255.0.

    Someone outside the network sends data to theIP address 172.16.2.120.

  • 8/3/2019 Sub Netting and Routing

    70/89

    Subnet & Routing 70

  • 8/3/2019 Sub Netting and Routing

    71/89

    Subnet & Routing 71

  • 8/3/2019 Sub Netting and Routing

    72/89

    Subnet & Routing 72

    Exercise

    Exercise You are given an IP address for a host

    172.168.35.10/20

    What is/are the

    1. Subnet address? 2. Broadcast address? 3. The number of useable hosts available

    for this subnet?

    4. The number of useable subnets availablefor this network? 5. The assignable address range for this

    subnet?Answers

  • 8/3/2019 Sub Netting and Routing

    73/89

    Subnet & Routing 73

    Exercise

    Exercise Your organisation has been assigned a class B

    IP address of 130.10.0.0 You require about 2000 subnetworks

    Work out the 1. Subnet mask required for this subnet 2. The network and broadcast addresses for

    the first 5 useable subnets

    3. The number of hosts for each subnet 4. The assignable address range of the first5 useable subnets

    Answers

  • 8/3/2019 Sub Netting and Routing

    74/89

    ROUTINGROUTINGROUTINGROUTING

  • 8/3/2019 Sub Netting and Routing

    75/89

    Subnet & Routing 75

    Routing Routing describes a process wherepackets are forwarded from one

    network to another. Routing can be performed by devices

    such as :

    dedicated routers servers with more than one networkinterface: multihomed hosts

    switches incorporating a route function.

  • 8/3/2019 Sub Netting and Routing

    76/89

    Subnet & Routing 76

    Routers Routing devices typically have morethan one network interface, each

    called a port. Routers process datagrams

    individually, making routing aprocessing-intensive operation.

    Dedicated routers offer betterperformance characteristicscompared with multi-homed hosts.

  • 8/3/2019 Sub Netting and Routing

    77/89

    Subnet & Routing 77

    Routing Tables To determining the properdestination network for datagrams,

    routers consult an internal table. The table consists of records, oneper line, each representing a knownnetwork.

    Each record includes a set ofassociated characteristics such asnetmask

  • 8/3/2019 Sub Netting and Routing

    78/89

    Subnet & Routing 78

    Building Route Tables. Routing table entries can be built bytwo methods: Static: entries are entered manually by

    a network administrator Dynamic: entries are entered

    dynamically by routing protocols.Routers learn destination networkaddresses by the periodic exchange ofroute tables between routing devices.Routing protocols use IP to deliver thisinformation.

  • 8/3/2019 Sub Netting and Routing

    79/89

    Subnet & Routing 79

    Configuring Routers Before IP routers can perform the routefunction and use routing protocols toexchange route tables, each interface(port) must be correctly numbered with avalid host IP address and netmask.

    The IP address must be selected from

    within the range for the particularnetwork address. Typically local gatewaysare located the first address in the validhost range.

  • 8/3/2019 Sub Netting and Routing

    80/89

    Subnet & Routing 80

    Routing Protocols Routing protocols are used by routers to: learn the location of destination networks.

    determine the best route to reach networks.

    Examples of routing protocols include: RIP, Routing Information Protocol

    OSPF, Open Shortest Path First

    BGP, Border Gateway Protocol

  • 8/3/2019 Sub Netting and Routing

    81/89

    Subnet & Routing 81

    Routing Protocols - 2 Routing protocols differ in: the way in which they exchange route

    tables determine the route to the destination

    the information that is communicated

  • 8/3/2019 Sub Netting and Routing

    82/89

    Subnet & Routing 82

    Distance Vector Distance Vector routing protocolsbroadcast the entire route table on a

    regular basis. RIP2 typically defaultsat once every 30 seconds.Thiscreates considerable network traffic.

    They determine the best route pathon the basis of the least numbernumber of hops to reach adestination network.

  • 8/3/2019 Sub Netting and Routing

    83/89

    Subnet & Routing 83

    Link State Link state protocols only broadcastchanges to route information after

    an initial entire table has been sent. When determining the best path,other factors such as policies (e.g.preferred path) and cost ( timetaken, available bandwidth) caninfluence the choice when multiplepaths are available.

  • 8/3/2019 Sub Netting and Routing

    84/89

    Subnet & Routing 84

    IP Routing Before a routing device can forwardan IP datagram it must: examine the Destination Address in the

    datagram use the netmask to identify the network

    portion of the packets destinationaddress

    find a corresponding network address inthe route table and forward the packetto the gateway or interface specified

  • 8/3/2019 Sub Netting and Routing

    85/89

    Subnet & Routing 85

    Route Table Fields To forward IP datagrams, the routeruses the following fields of the the

    route table: Destination Network Mask

    Gateway

  • 8/3/2019 Sub Netting and Routing

    86/89

    Subnet & Routing 86

    Destination This field lists the networks which areknown to the router. Addresses may havebeen entered by an administrator, ordynamically learned from thetransmissions of other routers.

    Address entries concerned with routing

    between network addresses will be of theformat{, 0}

  • 8/3/2019 Sub Netting and Routing

    87/89

    Subnet & Routing 87

    Netmask The netmask field provides therouter with the ability to determine

    the network address of packetsbeing examined.

    A logical AND is performed using thenetmask and the destination address.This logically removes the hostportion allowing the router toidentify the destination

  • 8/3/2019 Sub Netting and Routing

    88/89

    Subnet & Routing 88

    Gateway The Gateway field lists the IP addressesof the interface where the datagramshould be sent (forwarded) to reach the

    specified Destination. This field may contain :

    An IP interface address corresponding to anadjacent router

    0.0.0.0

    The address of a interface

  • 8/3/2019 Sub Netting and Routing

    89/89

    Destination Hop=0.0.0.0 A Destination of 0.0.0.0 indicates adirectly connected network. Hosts

    located on this network can bereached using the local networkmethod. If the network is Ethernet,the ARP protocol is used to find the

    physical address of the node.