Manual of Ethernet Networking

Embed Size (px)

Citation preview

  • 8/14/2019 Manual of Ethernet Networking

    1/28

    Manual For NetworkSetup and DiffServConfiguration inNetwork Research Lab

  • 8/14/2019 Manual of Ethernet Networking

    2/28

    Contents

    1. Acknowledgement 2

    2. Introduction 3

    3. System Configuration 6

    4. NIC Installation 7

    5. Cabling 9

    6. Network Configuration 13

    7. Linux Kernel Recompilation 14

    8. DiffServ Configuration 18

    9. VLC Client 25

    10. HTTP Server 25

    11. Traffic Generator 25

    12. Testing Tools 27

    1

  • 8/14/2019 Manual of Ethernet Networking

    3/28

    Acknowledgement

    This project work entitled Performance analysis of DiffServ in Linux

    Network has been done by us under the guidance ofProf Anirudha Sahoo atNetworks Research Lab, KReSIT, IIT Bombay. As a part of this project, we havegenerated a private network consisting of around 12 machines, loaded with Linux. These

    machines are then configured into routers and users as per the topology. They are

    interconnected to form a network and we have configured DiffServ on the core machinesand edge machines as well. Thereafter we use a video streaming application to stream a

    video file from a user across the domain to another user at the other end. And we analyze

    the performance when the DiffServ is active and when it is not.

    We are thankful to Prof Anirudha Sahoo for the valuable guidance he has given us and

    for all the support that he has provided without which this work would not have beenpossible. We thank him for his patience at all the times when we had some problems and

    were not able to generate an output. And we are always thankful to him for the resources

    that was allocated to us for this project without which such a good simulation of theproject would have been nearly impossible.

    Also we are thankful to Mrs. VijayaLakshmi (Systems Manager) and Prof. Krishna

    Paul who have also rendered support for this project completion. Again we would like to

    thank all those people who have some or the other way helped us in this project.

    Regards,

    Avinash K.

    Avinash P.V.

    2

  • 8/14/2019 Manual of Ethernet Networking

    4/28

    INTRODUCTION

    About the Experiment:The experiment goes like this; connect the systems as per the given topology, thus

    develop a full network. Enable the QoS modules in the kernel and configure the edge andcore routers. A video file resides in a user machine, acting as an HTTP Server, on oneend of the domain, This file is being played in another machine, which is on the other

    side of the network, using a video streaming tool like VLC. Congest the network with

    some packet generating programs, and analyze the video in both DiffServ enabled and

    disabled states of the network. More precise packet level analysis can be performed withthe built in tool, ethereal that is shipped in along with Linux.

    Experiment procedure:

    The experiment title is performance analysis of DiffServ in Linux. It includes bothimplementation of the DiffServ and observation of its performance. The steps for the

    procedure are stated below.

    Here we observe how DiffServ support the real time flow of a video stream through a

    congested network and compare its performance with normal Best Effort (BE) traffic.

    The steps for the experiment are

    step 1.

    Configure the systems as per the given specification.

    step 2.Enable the QoS in the kernel by adding the required modules and recompile the kernel.

    step 3.Prepare the cables and configure the network cards properly.

    step 4.Establish the network with given topology.

    step 5.

    Configure and start the service ospf on all the routers.

    3

    step 6.Figure out two user machines as source and destination, which come at both sides of the

    DiffServ domain.

  • 8/14/2019 Manual of Ethernet Networking

    5/28

    step 7.Figure out the path from source to destination and mark the routers, which come in the

    path.

    step 8.

    Turn up the Apache server and store video file in a server directory in the source usermachine.

    step 9.Install VLC client on the other user machine.

    step 10.Configure the edge and core routers using the scripts and make it DiffServ enabled.

    step 11.Put some packet-generating program in any user machine, which can overlap with the

    path of the video stream.

    step 12.Play the VLC in the network mode and stream the packets from the apache server.

    step 13.Tune the packet generator to get a jerking effect for the video.

    step 14.

    Enable the DiffServ and observe the changes.

    step 15.More precise packet level observation can be performed with the tool, ethereal.

    step 16.Record the results.

    4

  • 8/14/2019 Manual of Ethernet Networking

    6/28

    The Topology:

    This is the basic topology that was decided upon. This topology consists of 12 machines

    loaded with RedHat Linux 9. Of this, 4 machines act as Core Routers and 4 machines act

    as Edge Routers. And the rest four are maintained as Users, which will be configured asServers and Clients who would communicate with each other across the domain. The

    domain consists of only 8 machines; 4 core and 4 edge routers.

    5

  • 8/14/2019 Manual of Ethernet Networking

    7/28

    SYSTEM CONFIGURATION

    6

    System Type Core Routers Edge RoutersUser

    Machines

    RAM 1GB 512 MB 256 MBC1: 4 E1: 2 U1: 1

    C2: 3 E2: 3 U2: 1

    C3: 3 E3: 3 U3: 1# NIC

    C4: 4 E4: 2 U4: 1C1 :

    eth0 192.168.1.1eth1 192.168.2.1

    eth2 192.168.3.1

    eth3 192.168.6.1

    E1 :eth0 192.168.6.2

    eth1 192.168.8.1

    U1 :eth0 192.168.8.2

    eth1 192.168.9.2

    C2 :eth0 192.168.4.1

    eth1 192.168.2.2

    eth2 192.168.11.1

    E2 :eth0 192.168.7.2

    eth1 192.168.9.1

    eth2 192.168.10.1

    U2 :

    eth0 192.168.10.2

    C3 :eth0 192.168.1.2eth1 192.168.7.1

    eth2 192.168.5.1

    E3 :

    eth0 192.168.11.2eth1 192.168.14.1

    eth2 192.168.13.1

    U3 :eth0 192.168.15.2eth1 192.168.14.2

    IP ADDRESS

    C4 :

    eth0 192.168.4.2eth1 192.168.5.2

    eth2 192.168.3.2

    eth3 192.168.12.1

    E4 :eth0 192.168.12.2

    eth1 192.168.15.1

    U4 :

    eth0 192.168.13.2

    NET MASK 255.255.255.0 255.255.255.0 255.255.255.0

  • 8/14/2019 Manual of Ethernet Networking

    8/28

    NIC INSTALLATION AND CONFIGURATION

    The NICs (Network Interface Cards) were installed as per the requirements based on thetopological requirements. The machines have one on-board NIC and the rest weremanually installed. These NICs were to be fixed into the PCI slots provided on the

    motherboard. There are 3 PCI slots in the machines. Thus a machine can have a

    maximum of 4 NICs (including the on-board card).

    How to configure network interface card (NIC) in

    Linux

    Assume there is root privilege and eth0 is the network device.

    Note: The commands given hereby are applicable to RedHat Linux 9 and may vary

    with respect to other versions of Linux.

    1. To set IP address and netmask

    /sbin/ifconfig -a netmask

    eg , /sbin/ifconfig -a eth0 192.168.1.2 netmask 255.255.255.0

    2. To verify

    /sbin/ifconfig

    eg , /sbin/ifconfig eth0

    3. To add the default gateway

    /sbin/route add default gw

    4. To verify the default gateway setting.

    7

    /sbin/route

  • 8/14/2019 Manual of Ethernet Networking

    9/28

    5. To activate the device

    /sbin/ifconfig eth0 up

    6. To deactivate the device

    /sbin/ifconfig eth0 down

    7. To display the configuration of all devices including inactive

    /sbin/ifconfig -a

    8. To restart the network service

    service network restart

    start, stop, status are the other options to perform corresponding operations in the place of

    restart in the above command.

    Alternate methods

    (1) Edit the file

    /etc/sysconfig/network-scripts/ifcfg-eth0

    To set hostname edit the file

    /etc/sysconfig/network

    (2) The easiest method is through network configuration menu by giving the command

    redhat-config-network

    OR the same by selecting

    Main menu -> System settings -> Network

    This is just for one NIC. Similarly configure all the NICs present in all the

    systems. Assign the proper IPs and the netmasks and turn up all the network cards.

    8

  • 8/14/2019 Manual of Ethernet Networking

    10/28

    CABLING

    The basic information you will need to make your own Ethernet cables. For the

    experiment we had the cables made manually.

    Parts: You'll need several feet of CAT 5/5e/6 cable, RJ45 ends and an RJ45 crimpingtool to complete this. You'll also need a nice cut-off plier. A wire striper and a cable

    tester are greatly helpful as well.

    Cable: First, start off with good quality cable, it has to be UTP (Unshielded TwistedPair) Category 5/5e/6 cable, don't skimp on this (Shielded works too, but isn't necessary).Bulk cable comes in many types; there are 2 basic categories, solid and braided cable.

    Braided cable tends to work better in "patch" applications for desktop use. It is more

    flexible and resilient than solid cable and easier to work with, but really meant for shorter

    lengths. Solid cable is meant for longer runs in a fixed position. Plenum rated cableshould/must be used whenever the cable travels through an air circulation space. For

    example, above a false ceiling or below a raised floor. We have used the CAT 5e UTP

    kind ones to make the connection cables.

    Here is what the internals of the cable look like:

    Figure 1 Cable

    Internal Cable Structure and Color Coding:

    9

    There are 8 color-coded wires. These wires are twisted into 4 pairs of wires; each

    pair has a common color theme. One wire in the pair being a solid or primarily solid

    colored wire and the other being a primarily white wire with a colored stripe (Sometimescheap cable doesnt have any color on the striped cable, the only way to tell is to check

    which other wire it is twisted around). Examples of the naming schemes used are: Orange

    (alternatively Orange/White) for the solid colored wire and White/Orange for the stripedcable. The twists are extremely important. They are there to counteract noise and

    interference. It is important to wire according to a standard to get proper performance

    from the cable. The hardware expects the cable to have certain properties, a cable that

  • 8/14/2019 Manual of Ethernet Networking

    11/28

    does not fall within tolerance will cause errors and/or failures. Besides, this maintains allyour cables to the standards and makes it easy to find errors and cross-over cables.

    RJ45 Ends:

    The RJ45 (Registered Jack 45) end is an 8-position modular connector that lookslike a large phone plug. There are a couple variations available. The primary variation

    you need to pay attention to be whether the connector is intended for braided or solid

    wire. For braided/stranded wires, the connector has contacts that actually pierce the wire.

    For solid wires, the connector has fingers, which pierce the insulation and make contactwith the wire by grasping it from both sides. The connector is the weak point in an

    Ethernet cable, choosing the wrong one will often cause problems. Here is a diagram and

    pin out:

    Figure 2 - RJ45 Jack and Plug Pinout

    Ethernet Cables: Now, on to the cables. There are two basic cables. A straightthrough cable, which is used to connect to a hub or switch, and a cross-over cable used to

    operate in a peer-to-peer fashion without a hub/switch. Some gigabit copper interfacescan cross and un-cross a cable automatically as needed. Since we intended to have a

    network with no hub or switch included we needed the cross-over cables.

    Standard, Straight-Through Wiring (both ends are the same):

    10

    RJ45Pin #

    Wire ColorWire

    Diagram10Base-T/100Base-TX Signal

    1000Base-TSignal

    1 White/Orange Transmit+ BI_DA+

    2 Orange Transmit- BI_DA-

    3 White/Green Receive+ BI_DB+

    4 White/Blue Unused BI_DC+

  • 8/14/2019 Manual of Ethernet Networking

    12/28

    5 Blue Unused BI_DC-

    6 Green Receive- BI_DB-

    7 White/Brown Unused BI_DD+

    8 Brown Unused BI_DD-

    Table 1 - Straight-Through Cable Pinout

    Note: Always make sure that the order of the wires is correct before crimping it on

    to the jack.

    Cross-Over Cable:

    11

    RJ45 Pin #(END 1)

    Wire Color Diagram End #1

    1 White/Orange

    2 Orange

    3 White/Green

    4 White/Blue

    5 Blue

    6 Green

    7 White/Brown

    8 Brown

  • 8/14/2019 Manual of Ethernet Networking

    13/28

    RJ45 Pin #

    (END2)Wire Color Diagram End #2

    1 White/Green

    2 Green

    3 White/Orange

    4 White/Blue

    5 Blue

    6 Orange

    7 White/Brown

    8 Brown

    Tables 2 & 3 - Cross-Over Cable Pinouts

    Procedure: To create the cable, strip off about 2 inches of the cable sheath. Whenyou get to the second side, cut the wire to length and make sure it is more than long

    enough for your needs. Remember, an end-to-end connection should extend at least 1m

    (3ft) and not more than 100m (~328ft). Yes, there is a minimum, its little known, little

    referred to and not usually important. The longer the cable becomes, the more it mayaffect the performance, and usually it is a gradual decrease in speed and increase in

    latency.

    Next untwist the pairs, don't untwist them beyond what you have exposed, the

    more untwisted cable you have the worse the problems you can run into.

    12

    Now you want to align the colored wires according to the diagrams above. When nicelyaligned, hold them in line together and trim them all to the same length, about 1/2" to

    3/4" left exposed from the sheath. And then you want to insert them into the RJ45 end

    and make sure each wire is fully inserted to the front of the RJ45 end and in the correctorder. The sheath of the cable should extend into the RJ45 end by about 1/2" and will be

    held in place by the crimp. Crimp the end with the crimping tool and once again verify

  • 8/14/2019 Manual of Ethernet Networking

    14/28

    the wires ended up the right order and that the wires extend to the front of the RJ45 endand make good contact with the metal contacts in the RJ45 end. If you have a cable

    tester, put it to use, and verify the proper connectivity of your newly made cable.

    That should be it, if your cable doesn't turn out, look closely at each end and see if you

    can find the problem. Usually a wire ended up in the wrong place or more commonly,one of the wires didn't extend to the front of the RJ45 connector and is making no, or

    poor contact. If you see a mistake or problem, cut the end off and start again.

    NETWORK CONFIGURATION

    After the NICs were installed and the cables created, the systems were interconnected to

    form the above network. Here the systems labeled Cx are the Core routers and those

    labeled Ex are the Edge routers. Those labeled Ux are the User machines. When thetopology was decided it was also decided as to what router-ids should be allotted to the

    machines and the OSPF costs (numbers in blue color) that have to be assigned to the links

    connecting the whole network. The details on router-id and OSPF cost are mentioned inthe later part.

    13

  • 8/14/2019 Manual of Ethernet Networking

    15/28

    LINUX KERNEL RECOMPILATION

    The Kernel is the 'heart and soul' of the Linux Operating System. The Linux Kernelcontains all of the drivers and support for new hardware and should be kept as up to date

    as possible. The QoS modules are already present in Linux kernels of version 2.4 andlater ones. We need to add the modules necessary for DiffServ and recompile the Linux

    kernel. For this purpose of recompiling, root privilege is required .The time taken for

    the compilation process is based on the system resources like memory size, processor

    speed etc. It varies from system to system.

    Note: The list of the necessary modules is given at the end of this section.

    Step 1.

    Download the required version of kernel from any mirror site that provides Linux kernel.

    www.kernel.org is official site for getting the downloads for the Linux Kernel. Thekernel may be in any of the compressed format like '*.tar.gz'.

    For example: Like the one we downloaded; linux-2.4.25.tar.gz

    Step 2.

    Uncompress the downloaded file using the command

    tar -zxvf

    eg, tar -zxvf linux-2.4.25.tar.gz

    Then you will get directory 'linux-2.4.25' containing the whole source files for the version

    2.4.25

    Step 3.

    Move the 'linux-2.4.25' directory to the normal source location '/usr/src/' by the command

    mv linux-2.4.25 /usr/src/

    and go to the top directory of the new kernel by the command

    cd /usr/src/linux-2.4.25

    Step 4.

    14

    If u want to change the extra version number, then edit the 'Makefile' and put the number

    (if you need to put as 3 then give as -3 ). Save and close the file.

  • 8/14/2019 Manual of Ethernet Networking

    16/28

    Otherwise leave this step.

    Step 5.

    Delete all the unwanted object files, which may exist with the kernel source, using any

    one of the commands:

    make clean

    or

    make mrproper

    Step 6.

    Customizing the kernel; in this step you can decide which all modules are to be added to

    the kernel. There are 3 ways to do it.

    (a) make config

    Prompts whether to add or not, a particular module in the new kernel. You have to press

    y/n. Keep pressing the return key if you want to take the default value .

    (b) make menuconfig

    gives a menu driven environment to the configuration

    (c) make xconfig

    gives a X-Window system to configure, here mouse can be also used for the selection

    operation of the modules.

    Step 7.

    generating the dependencies, just give the command

    make dep

    Step 8.

    compile the code for kernel image; this is where the real process of compilation takes

    place,

    make bzImage

    15

    This will make the executable kernel at /usr/src/linux/arch/i386/boot/bzImage

  • 8/14/2019 Manual of Ethernet Networking

    17/28

  • 8/14/2019 Manual of Ethernet Networking

    18/28

    If the problem is not regarding with ext3, then edit the grub for the new kernel's kernelparameter line by removing all after the parameter 'ro'. Save and reboot with the new

    kernel once again.

    3. To edit the grub

    vi /boot/grub/grub.conf

    or

    vi /etc/grub.conf

    4. To install kernel source, it is also available in rpm form. It is very easy; in that case to

    get the source, use the command

    rpm -ivh

    In this case take care about the old kernel.

    5. To make a boot up disk. It is better to make and keep a boot-up floppy; will be helpful

    for facing any critical situation, the command is

    mkbootdisk --device /dev/fd0

    eg mkbootdisk --device /dev/fd0 2.4.25

    6. It is recommended to take stable kernel for normal usage, which will be with even

    number for its minor version number. The format of kernel version number is

    ..-

    eg 2 . 4 . 25 - 3

    The other developing kernel is normally used for kernel side research purposes and to get

    the next stable kernel.

    7. It is possible to do all the compilation steps with a single command

    make clean menuconfig dep bzImage modules modules_install install

    17

  • 8/14/2019 Manual of Ethernet Networking

    19/28

    List of Kernel Modules to be included for QoS:

    Support for DiffServ is already integrated into 2.4 kernels. In order to enable it, you may

    have to reconfigure and rebuild your kernel, or at least some modules.

    The following kernel configuration options have to be enabled in the section Networking

    options while configuring the kernel source (in step 6 of the kernel configuration):

    Kernel/User netlink socket (CONFIG_NETLINK)

    Network packet filtering (CONFIG_NETFILTER)

    QoS and/or fair queueing (CONFIG_NET_SCHED)

    The following kernel configuration options should be enabled in the section Networking

    options, QoS and/or fair queueing:

    CBQ packet scheduler (CONFIG_NET_SCH_CBQ)

    The simplest PRIO pseudoscheduler (CONFIG_NET_SCH_PRIO)

    RED queue (CONFIG_NET_SCH_RED)

    GRED queue (CONFIG_NET_SCH_GRED)

    Diffserv field marker (CONFIG_NET_SCH_DSMARK)

    Ingress Qdisc (CONFIG_NET_SCH_INGRESS)

    QoS support (CONFIG_NET_QOS)

    Packet classifier API (CONFIG_NET_CLS)

    TC index classifier (CONFIG_NET_CLS_TCINDEX)

    Firewall based classifier (CONFIG_NET_CLS_FW)

    U32 classifier (CONFIG_NET_CLS_U32) Traffic policing (CONFIG_NET_CLS_POLICE)

    In some cases, additional elements may be needed. It is therefore recommended to enable

    all options in QoS and/or fair queueing.

    DIFFSERV CONFIGURATION

    First of all we have to configure OSPF in the all the Core and Edge routers to

    generate routing tables. After that develop the required tc scripts to enable the queuing

    disciplines for DiffServ.

    18

  • 8/14/2019 Manual of Ethernet Networking

    20/28

    Router Configuration Through OSPF

    OSPF (Open Shortest Path First) is s routing protocol used to generate routing tablesdynamically. OSPF runs under Zebra engine so we need to configure both Zebra and

    OSPF for the service to be running correctly.

    Zebra

    A minimal zebra configuration file, /etc/zebra/zebra.conf is created.

    This contains just the hostname, password and the enable password. The hostname is for

    recognition, password is the password used to enter into the telnet prompt of zebra and

    enable password is the password for entering into the privileged mode.

    There after when we telnet to the port used by Zebra, i.e., port number 2601 and enterinto the enhanced mode, Zebra engine detects the number of network interface cards, that

    has been installed on the machine.

    Once in the Zebra configuration interface we can have a list of possible commands at the

    press of the key ? or by the command list.

    At the Zebra configuration prompt, we have to use the following commands for our

    purpose:

    1. to assign IPs to the cards using the interface configuration prompt.

    ip address

    eg: ip address 192.168.1.1/24

    where 192.168.1.1 is the IP for corresponding NIC and 24 is the bits used for netmask,;

    which in this case is 255.255.255.0.

    In Zebra, after the Zebra engine has detected the network interfaces you can end the

    session by giving the command end

    Before exiting from the Zebra session take care to use the command write file to save

    your configurations to the zebra.conf file.

    OSPF

    19

    A minimal ospf configuration file, /etc/zebra/ospfd.conf contains just the

    hostname, password and the enable password just like the case of the zebra.conffile. The

  • 8/14/2019 Manual of Ethernet Networking

    21/28

    hostname is for recognition, password is the password used to enter into the telnet prompt

    of OSPF and enable password is the password for entering into the supervisory mode.

    There after when we telnet to the port used by ospfd (OSPF daemon), i.e., port

    number 2604 and enter into the enhanced mode.

    The commands to be used in the OSPF configuration interface are:

    1. The OSPF cost can be assigned for each card by going to the interface configuration

    prompt using interface command

    ip ospf cost

    eg: ip ospf cost 25

    This command allocates a cost of 25 to the corresponding NIC. This cast was pre-

    decided. Also there is no rule as to what should be the cost of a particular link. There stillis a recommendation that the OSPF cost of a link should be inversely proportional to the

    bandwidth of the link, but this is not mandatory.

    2. After assigning the cost you can give the network router -id for the router, using the

    command router-id from the router ospf configuration mode.

    router id

    eg: router-id 1.1.1.1

    This command allocates the router id of the particular system as 1.1.1.1., which serves as

    an identification for the neighboring routers/systems.

    3.After having done that you have to specify to the router as to which all networks are

    directly connected to it. This can be achieved by using the network command from the

    router ospf prompt.

    network area

    eg: network 192.168.1.0/24 area 0

    This command tells as to which all networks is the current system directly connected to.

    20

    Save the configuration file and exit to the local prompt.

  • 8/14/2019 Manual of Ethernet Networking

    22/28

    Start the services of Zebra and OSPF with commands service zebra restart and

    service ospfd restart.

    This will re-run the daemon and in a few seconds the routing table can be seen using the

    command route or route -n.

    The route n command will give detailed list of the network addresses, the gateways,

    netmask, metric, network device, etc.

    DiffServ Implementation:

    Core Router

    figure : queuing diagram for core routers

    Script for implementation of queuing discipline for a core router:

    To enable the service

    #!/bin/sh

    21

    # a core script with PRIO queue with higher priority for EF traffic ,

    TBF for avoid starvation

  • 8/14/2019 Manual of Ethernet Networking

    23/28

    # Script for eth2 (to C4)

    clear

    echo -e "Enter the rate for TBF (like xMbit):"

    read RATE

    echo -e "Enter the burst for TBF (like xKB):"

    read BURST

    echo -e "Enter the limit for TBF (like xMB):"

    read LIMIT

    # Setting the root Qdisc

    tc qdisc add dev eth2 handle 1:0 root dsmark indices 64 set_tc_index

    # Setting the main tcindex filter

    tc filter add dev eth2 parent 1:0 protocol ip prio 1 tcindex mask 0xfc

    shift 2

    # Adding the priority Qdisc

    tc qdisc add dev eth2 parent 1:0 handle 2:0 prio

    # Add a TBF to avoid starvation due to higher priority by put some

    limits

    tc qdisc add dev eth2 parent 2:1 tbf rate $RATE burst $BURST limit

    $LIMIT

    # Add a tcindex filter to direct the EF traffic to higher priority

    queue

    tc filter add dev eth2 parent 2:0 protocol ip prio 1 handle 0x2e

    tcindex classid 2:1 pass_on

    #BE class(2:2)

    tc filter add dev eth2 parent 2:0 protocol ip prio 2 handle 0 tcindex

    mask 0 classid 2:2 pass_on

    echo -e "\n\n\tCore router C3 is activated !!!\n\n"

    To disable the service

    #!/bin/sh

    # Script to delete the Qdiscs

    clear

    tc filter del dev eth2 parent 2:0 protocol ip prio 1 handle 0x2e

    tcindex classid 2:1 pass_on

    22

    echo -e "tcindex filter deleted *****\n"

  • 8/14/2019 Manual of Ethernet Networking

    24/28

    tc filter del dev eth2 parent 2:0 protocol ip prio 2 handle 0 tcindex

    mask 0 classid 2:2 pass_on

    echo -e "tcindex filter deleted *****\n"

    tc filter del dev eth2 parent 1:0 protocol ip prio 1 tcindex mask 0xfc

    shift 2

    echo -e "tcindex filter deleted *****\n"

    tc qdisc del dev eth2 parent 2:1 tbf

    #rate 1.5Mbit burst 1.5kB limit 1.6kB

    echo -e "TBF queue deleted ****\n"

    tc qdisc del dev eth2 parent 1:0 handle 2:0 prio

    echo -e "PRIO queue deleted ****\n"

    tc qdisc del dev eth2 handle 1:0 root dsmark indices 64 set_tc_index

    echo -e "DSMARK queue deleted ****"

    echo -e "\n\n\tCore Router C3 is Deactivated !!!\n\n"

    Edge Router

    23

    figure : queuing diagram for edge routers

  • 8/14/2019 Manual of Ethernet Networking

    25/28

    Script for implementation of queuing discipline for an edge router:

    To enable the service

    #!/bin/sh

    # a script for edge router which mark the packet as EF type PHB by

    setting TOS value as 0xb8

    # script for eth0 (to C3)

    # ------------------------

    clear

    echo -n "Enter rate for policing the EF traffic (like xmbps) : "

    read RATE

    echo -n "Enter burst for policing the EF traffic (like xK) : "

    read BURST

    # to add qdisc to the device eth0 as the root queue

    tc qdisc add dev eth0 handle 1: root dsmark indices 8

    # to set the class 1:1 DS field as 0xb8

    tc class change dev eth0 classid 1:1 dsmark mask 0x3 value 0xb8

    #to make filters 1: , 2:

    tc filter add dev eth0 parent 1:0 prio 4 protocol ip u32

    tc filter add dev eth0 parent 1:0 prio 4 handle 2: protocol ip u32

    divisor 1

    tc filter add dev eth0 protocol ip parent 1:0 prio 4 u32 ht 2:0:

    match ip dst 192.168.15.2 police rate $RATE burst $BURST drop flowid

    1:1

    tc filter add dev eth0 protocol ip parent 1:0 prio 4 u32 ht 800:: match

    ip dst 192.168.0.0/16 hashkey mask 0x0000ffff at 16 link 2:

    echo -e "\n\n\tEdge Router (E2) is UP now !!!!\n\n "

    24

  • 8/14/2019 Manual of Ethernet Networking

    26/28

    To disable the service

    #!/bin/sh

    # Script to delete the Qdiscs

    tc qdisc del dev eth0 root

    echo -e "\n\n\tEdge Router is DOWN !!!\n\n"

    VLC CLIENT

    A VLC (Video LAN Client) can be installed using the rpms available for the

    same. VLC is free software available easily and can be downloaded from the net. Afterinstallation of VLC the video file can be streamed using the network option in the file

    menu of the VLC. Here we can specify the IP address of the source machine (in our case

    the IP address of the machine with the HTTP server running).

    HTTP SERVER

    HTTP server comes in as built-in feature with Linux. We can turn up the server using the

    command service httpd start httpd uses the TCP port numbered 80.

    The video file to be streamed has to be put inside the default directory of httpd;

    /var/www/html/

    TRAFFIC GENERATOR

    TG (traffic generator) is an application used to pump packets into the traffic tocongest it and thus generate a real life scenario in our network. The binary files for tg was

    downloaded. It is also free software available on the net. This was then installed and later

    configured so as to pump UDP packets into the network. Then the following tg scriptswere generated; one for the tg server and one for the tg client:

    25

  • 8/14/2019 Manual of Ethernet Networking

    27/28

    Script for tg server

    # This script instructs TG to execute in the server or the sink mode

    # in which it only receives packets and records the information in the

    # binary log file. TG is initialized at time 15 secs from the start,

    and

    # starting at 1.1 secs after initialization it waits for clients to

    # send data.

    #

    on 0:15 udp 192.168.10.1. 4336 server

    at 1.1 wait

    Script for tg client

    # This file specifies the following to TG:

    # 1. At 15 secs open a UDP socket to send packets to the server waiting

    at

    # 192.168.10.1 and port 4336

    # 2. after 5 secs setup (times specified are relative to the start time

    -

    # 15 secs here.)

    # 3. starting at time 6 secs send constant packets to the server with

    # interpacket transmission time being 0.01 secs ( == 100

    packets/sec)

    # for 20 secs.

    on 0:15 udp 192.168.13.2.4336

    at 5 setup

    at 6 arrival uniform 0.00007 0.00016 length uniform 1300 1400

    time 60:0

    Commands for executing the tg scripts.

    First we turn up the server by the following command

    ./tg i udpserver.tg o foo

    Here the udpserver.tg is the script file for the tg server and foo is the output file.

    Then we turn up the client, which starts sending UDP packets after a particular interval oftime.

    ./tg i udpclient.tg o foo

    26

  • 8/14/2019 Manual of Ethernet Networking

    28/28

    Here the udpclient.tg is the script file for the tg client and foo is the output file.

    TESTING TOOLS

    Ethereal

    For the purpose of detail testing of packets we can use ethereal that is in-built inLinux. Ethereal is a freely available packet analyzer. Using ethereal we can see that

    DSCP value of the EF packets are marked as b8 and the BE packets as 0.

    mtr

    mtr (Matts TraceRoute) is a built-in feature of Linux, that provides the

    functionalities of both the ping command and traceroute command together. This alsoshows us the packets sent, packets received and percentage packet loss in a particular

    path. We have used mtr inorder to test the network connectivity between the systems.