+ All Categories
Home > Documents > Dcn Lab Manual Gecr

Dcn Lab Manual Gecr

Date post: 03-Apr-2018
Category:
Upload: tariq4609
View: 233 times
Download: 0 times
Share this document with a friend

of 26

Transcript
  • 7/28/2019 Dcn Lab Manual Gecr

    1/26

    Electronics & Communication Department

    Lab Manual

    Data Communication & Networking

    B. E. SEMESTER-VIII

    Enrollment Number: ________________________

    Name of the Student: _____________________________________________

    Academic Year: __________________

  • 7/28/2019 Dcn Lab Manual Gecr

    2/26

    List of Experiments

    1 Introduction to LAN cabling scheme & crimping process

    2 Study of Network planning and setup (e.g. - GEC-Rajkot)

    3 Study of Network commands

    4 Introduction to RS 232C & UART

    5 To perform byte transfer between 2 PCs using serial port (using C code)

    6 To perform simple file transfer between 2 PCs using serial port (using C code)

    7 To perform character stuffing & de-stuffing

    8 Demonstration of Linux OS installation and network utilities

    9 Study of Internetworking devices Network Hardware

    10 Study of IP addressing and subnetting

    11 Network Simulator- ns-2: Installation, Programming & Simulation demo

  • 7/28/2019 Dcn Lab Manual Gecr

    3/26

    EXPERIMENT 1

    Introduction to LAN cabling scheme & crimping process

    Pin out for EIA/TIA 568A/B cabling

    Pin Signal EIA/TIA 568A EIA/TIA 568B Ethernet

    1 Transmit + White/Green White/Orange X

    2 Transmit - Green/White orGreen

    Orange/White orOrange X

    3 Receive + White/Orange White/Green X

    4 N/ABlue/White or

    BlueBlue/White or

    BlueNot Used

    5 N/A White/Blue White/Blue Not Used

    6 Receive - Orange/White orOrange

    Green/White orGreen

    X

    7 N/A White/Brown White/Brown Not Used

    8 N/ABrown/White or

    Brown

    Brown/White or

    BrownNot Used

    Wiring/Color Coding for CAT5 Cable

  • 7/28/2019 Dcn Lab Manual Gecr

    4/26

    RJ -45 Connector "Pin-Outs"

    TUTORIAL Questions

    1) What are hubs and repeaters?2) How many types of LED indicators are there at back panel of a Hub? What is theirsignificance?3) What is the need of an uplink feature in a Hub?4) What is an NIC card?5) What is maximum length that category 5 up cable support?6) What is the difference between a router and a repeater or a bridge?7) There are how many types of connecting devices?8) In which layer/layers does the repeater function?9) In which layer/layers does the router function?10) What do you mean by 10BASE5?11) What is the meaning of T in 10BASE-T?12) What is a crossover cable?13) What is power consumption for DE 816TP hub?14) What is the function of Collision LED?

  • 7/28/2019 Dcn Lab Manual Gecr

    5/26

    EXPERIMENT 2

    Study of Network planning and setup (e.g. - GEC-Rajkot)

  • 7/28/2019 Dcn Lab Manual Gecr

    6/26

    EXPERIMENT 3

    Study of Network commands

    Objectives

    To test different network utilities likeping, tracert, arp, ipconfig, ftp To study and use different options for these utilities

    Concepts

    (1)PING (Packet Internet Groper Command)If any system (host or router) want to communicate with the other system (host orroute) then it is necessary to check the communication is possible or not? For this,First of all we have to check for destination system is reachable or not. Due tohardware failure or any other reason it is possible the system may on network butnot reachable. How can we detect that the destination system is reachable or not?PING command is useful for checking the reach ability of the system.

    Procedure:

    First go to command prompt For help and information about this command type ping /?Type ping IP address of system

    Example:

    C:\ >ping 192.168.11.42

    Pinging 192.168.11.42 with 32 bytes of data:Reply from 192.168.11.42: bytes=32 time

  • 7/28/2019 Dcn Lab Manual Gecr

    7/26

    Example:

    C:\>tracert 192.168.11.41

    Tracing route to EC9-41 [192.168.11.41]

    over a maximum of 30 hops:

    1

  • 7/28/2019 Dcn Lab Manual Gecr

    8/26

    Example:

    C:\>arp -a

    Interface: 192.168.11.7 on Interface 0x1000003

    Internet Address Physical Address Type192.168.11.1 00-50-af-0a-5b-80 dynamic192.168.11.2 00-80-ad-83-02-82 dynamic192.168.11.20 00-80-ad-83-4d-35 dynamic192.168.11.21 00-11-5b-d2-51-c4 dynamic

    TUTORIAL Questions

    (1) Which protocol is used in PING command?(2) Explain briefly about each field received in reply while using PING command.

    (3) Is it possible to find IP address of the system on which you are working using PINGcommand?(4) Which kind of ICMP messages used in PING command?(5) What is maximum size of a packet practically? Prove it using PING command?(6) State the minimum number of hop count is requiring for checking reach ability of host?(7) Which message will display while hop count is less than the number of routers on thepath.(8) Which protocol is used in TRACERT command?(9) If more than one router in the route than first reply comes from which router while using

    TRACERT?(10) If final destination is not reachable than how many reply comes while using TRACERTcommand?(11) Explain briefly about each field in an ARP table.(12) Explain briefly about each field displayed while running ipconfig command.(13) Which information we get from subnet mask?(14) Write subnet mask for class A, class B, class C and class D addresses.(15) If one router on the path to reach the final destination How can we find the IP addresses

    of the two interfaces of the router?

  • 7/28/2019 Dcn Lab Manual Gecr

    9/26

    EXPERIMENT 4

    Introduction to RS 232C & UARTObjectives

    [A] To understand RS232-C standard and UART functions. To study RS232-C cabling scheme. To test RS232-C cable using Windows inbuilt utility.[B] To verify serial port communication between two PCs by writing simple C code. (byte

    transfer). To implement byte transfer using ALP.ConceptIn most cases, any device you connect to the serial port will need the serial transmission

    converted back to parallel so that it can be used. This can be done using a UART. Onsoftware side, there are many more registers that you have to attend to than on a StandardParallel Port. (SPP)

    What are the advantages of using serial data transfer rather than parallel?

    Serial Cables can be longer than Parallel cables. The serial port transmits a '1' as -3 to -25volts and a '0' as +3 to +25 volts where as a parallel port transmits a '0' as 0v and a '1' as5v. Therefore the serial port can have a maximum swing of 50V compared to the parallel

    port which has a maximum swing of 5 Volts. Therefore cable loss is not as much of aproblem for serial cables then they are for parallel. You don't need as many wires then parallel transmission. If your device needs to be

    mounted a far distance away from the computer then 3 core cable (Null ModemConfiguration) is going to be cheaper that running 19 or 25 core cable. However youmust take into account the cost of the interfacing at each end.

    Many electronic diaries and palmtop computers have infra red capabilities build in.Serial transmission is used where one bit is sent at a time. IrDA-1 (The first infra redspecifications) was capable of 115.2k baud and was interfaced into a UART. The pulselength however was cut down to 3/16th of an RS 232 bit length to conserve powerconsidering these devices are mainly used on diaries, laptops and palmtops.

    Serial Communication reduces the pin count of Microcontrollers. Only two pins arecommonly used, Transmit Data (TXD) and Receive Data (RXD) compared with at least8 pins if you use an 8 bit Parallel method (You may also require a Strobe).

    Hardware Properties

    Devices which use serial cables for their communication are split into two categories.These are DCE (Data Communications Equipment) and DTE (Data TerminalEquipment.) Data Communications Equipments are devices such as your modem, TAadapter, plotter etc while Data Terminal Equipment is your Computer or Terminal

  • 7/28/2019 Dcn Lab Manual Gecr

    10/26

    The electrical specifications of the serial port are contained in the RS232C standard. Itstates many parameters such as

    1. A "Space" (logic 0) will be between +3 and +25 Volts.

    2. A "Mark" (Logic 1) will be between -3 and -25 Volts3. The region between +3 and -3 volts is undefined.4. An open circuit voltage should never exceed 25 volts. (In Reference

    to GND)5. A short circuit current should not exceed 500mA. The driver should

    be able to handle this without damage. (Take note of this one!)

    The RS 232 C standard specifies a maximum baud rate of 20,000 BPS. Serial Ports comein two "sizes". There are the D-Type 25 pin connector and the D-Type 9 pin connectorboth of which are male on the back of the PC, thus you will require a female connector onyour device. Below is a table of pin connections for the 9 pin and 25 pin D-Typeconnectors.

    Serial Pin outs (D25 and D9 Connectors)D-Type-25 Pin No. D-Type-9 Pin No. Abbreviation Full NamePin 2 Pin 3 TD Transmit DataPin 3 Pin 2 RD Receive DataPin 4 Pin 7 RTS Request To SendPin 5 Pin 8 CTS Clear To SendPin 6 Pin 6 DSR Data Set Ready

    Pin 7 Pin 5 SG Signal GroundPin 8 Pin 1 CD Carrier DetectPin 20 Pin 4 DTR Data Terminal ReadyPin 22 Pin 9 RI Ring Indicator

    Pin Functions

    Abbreviation Full Name FunctionTD Transmit Data Serial Data Output (TXD)RD Receive Data Serial Data Input (RXD)CTS Clear to Send This line indicates that the Modem is ready to

    exchange data.DCD Data Carrier Detect When the modem detects a "Carrier" from the

    modem at the other end of the phone line, this Linebecomes active.

    DSR Data Set Ready This tells the UART that the modem is ready toestablish a link.

    DTR Data Terminal Ready This is the opposite of DSR. This tells the Modemthat the UART is ready to link.

    RTS Request To Send This line informs the Modem that the UART isready to exchange data.

    RI Ring Indicator Goes active when modem detects a ringing signalfrom the PSTN.

  • 7/28/2019 Dcn Lab Manual Gecr

    11/26

    Null Modems

    A Null Modem is used to connect two DTE's together without using intermediate DCEs..

    9D to 25D Conversion

    Loopback Plug WiringDiagram

    This Loopback plug can come in extremely handy whenwriting Serial / RS232 Communications Programs. Ithas the receive and transmit lines connected together, sothat anything transmitted out of the Serial Port is

    immediately received by the same port. If you connectthis to a Serial Port a load a Terminal Program, anythingyou type will be immediately displayed on the screen.

    This can be used with the examples later in this tutorial.

    Please note that this is not intended for use withDiagnostic Programs and thus will probably not work.For these programs you require a differently wiredLoop Back plug which may vary from program toprogram.

  • 7/28/2019 Dcn Lab Manual Gecr

    12/26

    The UART (8250 and Compatibles)

    UART stands for Universal Asynchronous Receiver / Transmitter. UART 8250 is thedevice that controls the serial port. Most cards will have the UART's integrated into otherchips which may also control your parallel port, games port, floppy or hard disk drives

    and are typically surface mount devices. The 8250 series, which includes the 16450,16550, 16650, & 16750 UARTS are the most commonly found type in your PC.

    All the UARTs pins are TTL compatible. That includes TD, RD, RI, DCD, DSR, CTS,DTR and RTS which all interface into your serial plug, typically a D-type connector.

    Therefore RS 232 Level Converters are used.

    The UART requires a Clock to run. If you look at your serial card a common crystalfound is either a 1.8432 MHZ or an 18.432 MHZ Crystal. This clock will be used for theProgrammable Baud Rate Generator which directly interfaces into the transmit timingcircuits but not directly into the receiver timing circuits. For this an external connection

    mast be made from pin 15 (Baud Out) to pin 9 (Receiver clock in.) Note that the clocksignal will be at Baud rate * 16.

    Serial Port's Registers (PC's)

    Port Addresses & Iraqs

    Name Address IRQCOM 1 3F8 4COM 2 2F8 3

    COM 3 3E8 4COM 4 2E8 3

    Above is the standard port addresses. These should work for most PC's. If you just happen tobe lucky enough to own a IBM P/S2 which has a micro-channel bus, then expect a differentset of addresses and IRQ's. Just like the LPT ports, the base addresses for the COM ports canbe read from the BIOS Data Area.

    Start Address Function0000:0400 COM1's Base Address0000:0402 COM2's Base Address

    0000:0404 COM3's Base Address0000:0406 COM4's Base Address

    COM Port Addresses in the BIOS Data Area;

    The above table shows the address at which we can find the Communications (COM) portsaddresses in the BIOS Data Area. Each address will take up 2 bytes.

  • 7/28/2019 Dcn Lab Manual Gecr

    13/26

    Registers

    RBR, THR, IER, IIR, FCR, LCR, MCR, LSR, MSR, SCR, DLL, DLMThe communication between the processor and the UART is completely controlled bytwelve registers. These registers can be read or written to check and change the behavior of

    the communication device. Each register is eight bits wide. On a PC compatible, theregisters are accessible in theI/O port map.

    RBR: Receiver buffer register (RO)

    The receiver buffer register contains the byte received if no FIFO is used, or the oldestunread byte with Fifes. If FIFO buffering is used, each new read action of the registerwill yield the next byte, until no more bytes are present. Bit 0 in the line status registercan be used to check if all received bytes have been read. This bit will change to zero ifno more bytes are present.

    THR: Transmitter holding register (WO)

    The transmitter holding register is used to buffer outgoing characters. If no FIFObuffering is used, only one character can be stored. Otherwise the amount of charactersdepends on the type of UART. Bit 5 in the line status register can be used to check ifnew information must be written to the transmitter holding register. The value 1indicates that the register is empty. If FIFO buffering is used, more than one charactercan be written to the transmitter holding register when the bit signals an empty state.

    There is no indication of the amount of bytes currently present in the transmitter FIFO.

    The transmitter holding register is not used to transfer the data directly. The byte is first

    transferred to a shift register where the information is broken in single bits which aresent one by one.

    LCR: L ine control registers (R/W)

    The line control register is used at initialization to set the communication parameters.Parity and number of data bits can be changed for example. The register also controlsthe accessibility of the DLL and DLM registers. Because they are only accessed atinitialization when no communication occurs this register swapping has no influence onperformance.

    Common settings are:

    8 data bits, one stop bit, no parity7 data bits, one stop bit, even parity

    http://www.lammertbies.nl/comm/info/RS-232_uart.html#RBRhttp://www.lammertbies.nl/comm/info/RS-232_uart.html#THRhttp://www.lammertbies.nl/comm/info/RS-232_uart.html#IERhttp://www.lammertbies.nl/comm/info/RS-232_uart.html#IIRhttp://www.lammertbies.nl/comm/info/RS-232_uart.html#FCRhttp://www.lammertbies.nl/comm/info/RS-232_uart.html#LCRhttp://www.lammertbies.nl/comm/info/RS-232_uart.html#MCRhttp://www.lammertbies.nl/comm/info/RS-232_uart.html#LSRhttp://www.lammertbies.nl/comm/info/RS-232_uart.html#MSRhttp://www.lammertbies.nl/comm/info/RS-232_uart.html#SCRhttp://www.lammertbies.nl/comm/info/RS-232_uart.html#DLLhttp://www.lammertbies.nl/comm/info/RS-232_uart.html#DLMhttp://www.lammertbies.nl/comm/info/RS-232_io.html#regihttp://www.lammertbies.nl/comm/info/RS-232_io.html#regihttp://www.lammertbies.nl/comm/info/RS-232_uart.html#DLMhttp://www.lammertbies.nl/comm/info/RS-232_uart.html#DLLhttp://www.lammertbies.nl/comm/info/RS-232_uart.html#SCRhttp://www.lammertbies.nl/comm/info/RS-232_uart.html#MSRhttp://www.lammertbies.nl/comm/info/RS-232_uart.html#LSRhttp://www.lammertbies.nl/comm/info/RS-232_uart.html#MCRhttp://www.lammertbies.nl/comm/info/RS-232_uart.html#LCRhttp://www.lammertbies.nl/comm/info/RS-232_uart.html#FCRhttp://www.lammertbies.nl/comm/info/RS-232_uart.html#IIRhttp://www.lammertbies.nl/comm/info/RS-232_uart.html#IERhttp://www.lammertbies.nl/comm/info/RS-232_uart.html#THRhttp://www.lammertbies.nl/comm/info/RS-232_uart.html#RBR
  • 7/28/2019 Dcn Lab Manual Gecr

    14/26

    LCR: L ine Control Register

    Bit Value Detail

    0,1 Bit 1 Bit 0 Data Word Length

    0 0 5 Bits

    0 1 6 Bits

    1 0 7 Bits

    1 1 8 Bits

    2 0 1 stop bit

    1 1.5 stop bits(5 bits word)2 stop bits (6,7 or 8 bit word)

    3,4,5 Bit 5 Bit 4 Bit 3

    X X 0 No parity

    0 0 1 Odd Parity

    0 1 1 Even Parity

    1 0 1 High Parity(stick)

    1 1 1 Low Parity(stick)

    6 0 Break signal disabled

    1 Break signal enabled

    7 0 DLAB : RBR, THR and IER accessible

    1 DLAB : DLL and DLM accessible

  • 7/28/2019 Dcn Lab Manual Gecr

    15/26

    LSR: Line Status Register (RO)

    The line status register shows the current state of communication. Errors are reflected inthis register. The state of the receiver and transmitter buffers is also available. Bit 5 and6 both show the state of the transmitting cycle. The difference is, that bit 5 turns high as

    soon as the transmitter holding register is empty whereas bit 6 indicates that also theshift register which outputs the bits on the line is empty

    LSR: L ine status register

    Bit Comment

    0 Data available

    1 Overrun error

    2 Parity error

    3 Framing error

    4 Break signal received

    5 THR is empty

    6 THR is empty, and line is idle

    7 Erroneous data in FIFO

    DLL and DLM: Divisor latch registers (R/W)

    The frequency (1.8432 MHz) is divided by 16 to generate the time base forcommunication. Because of this division, the maximum allowed communication speedis 115200 bps. Modern UARTS like the 16550 are capable of handling higher inputfrequencies up to 24 MHz which makes it possible to communicate with a maximumspeed of 1.5 Mbps. This 115200 bps communication speed is not suitable for all

    applications. To change the communication speed, the frequency can be furtherdecreased by dividing it by a programmable value. For very slow communications, thisvalue can go beyond 255. Therefore, the divisor is stored in two separate bytes, theDLL and DLM which contain the least, and most significant byte.

    It is necessary that both the transmitting and receiving UART use the same time base.Default values have been defined which are commonly used. The table shows the mostcommon values with the appropriate settings of the divisor latch bytes.

  • 7/28/2019 Dcn Lab Manual Gecr

    16/26

    DLL and DLM: Divisor latch registers

    Speed(bps) Divisor DLL DLM

    50 2304 0x00 0x09

    300 384 0x80 0x01

    1200 96 0x60 0x00

    2400 48 0x30 0x00

    4800 24 0x18 0x00

    9600 12 0x0C 0x00

    19200 6 0x06 0x00

    38400 3 0x03 0x00

    57600 2 0x02 0x00

    115200 1 0x01 0x00

    Table of Registers

    Base AddressDLABRead/Writ Abr. Register Name

    +0

    =0 Write - Transmitter Holding Buffer

    =0 Read - Receiver Buffer

    =1 Read/Write - Divisor Latch Low Byte

    +1=0 Read/Write IER Interrupt Enable Register

    =1 Read/Write - Divisor Latch High Byte

    +2- Read IIR Interrupt Identification Register

    - Write FCR FIFO Control Register

    +3 - Read/Write LCR Line Control Register

    +4 - Read/Write MCR Modem Control Register

    +5 - Read LSR Line Status Register

    +6 - Read MSR Modem Status Register

    +7 - Read/Write - Scratch Register

  • 7/28/2019 Dcn Lab Manual Gecr

    17/26

    Exercise

    1. Prepare 9 9 pin serial cables with null modem configuration.2. Load divisors in DLM & DLL to support communication at 9600 bps. After

    configuration restore transmission mode.

    3. Check functioning of prepared cable using Direct Cable Communication underwindows.4. Perform simple byte transfer between 2 PCs through serial ports connected via serial

    cable tested in previous exercise. (Using C program)

  • 7/28/2019 Dcn Lab Manual Gecr

    18/26

    EXPERIMENT 5

    To perform byte transfer between 2 PCs using serial port (using C code)

    EXPERIMENT 6

    To perform simple file transfer between 2 PCs using serial port (using C code)

    EXPERIMENT 7

    To perform character stuffing & de-stuffing

    EXPERIMENT 8

    Demonstration of L inux OS installation and network utilities

  • 7/28/2019 Dcn Lab Manual Gecr

    19/26

    EXPERIMENT 9

    Study of Internetworking devices Network Hardware

    Objectives

    To study network devices and the specifications of each for existing networkplan

    To study existing network plan To draw a new network plan as per the new constraints

    Concepts

    Local area networks generally called LANs are privately owned networks within a singlebuilding or campus or up to few kilometers in size. They are widely used to connect personalcomputers and workstations in company offices and factories to share resources andexchange information. LANs are distinguished from other kinds of networks by threecharacteristics.

    1) Transmission media2) Transmission mechanism3) Topology4) Protocol

    A Local area network is a data communication system that allows a number of independent

    devices to communicate directly with each other in a limited geographic area such as singledepartment, single building, or campus. A large organization may need several connectedLANs.

    ImplementationsThe IEEE standard defined several implementations for Internet

    Implementation Maximum DistanceSupported

    10BASET 100 m10BASE2 200 m

    10BASE5 500 m10BASE-FL 2000 m

    Connecting Devices

    RepeatersA repeater is a device that operates only in the physical layer. A repeater receives a signalbefore it becomes too weak or corrupted and regenerates the original signal. A repeater canextend the physical length of a network. A repeater connects segments of LAN together. Ithas no filtering capability.

  • 7/28/2019 Dcn Lab Manual Gecr

    20/26

    Hubs

    A hub is a multiport repeater. It is used to create connections in physical star topology.

    Nodes. Nodes ..

    Bridges

    A bridge operates in both physical layer and data link layers. As a physical layer device itregenerates the signal it receives. As a data link layer device the bridge can check thephysical address contained in the packet. A bridge like a repeater has no physical address. Itonly acts as a filter, not an original sender to a final destination. Filtering means that it cancheck the destination address of a packet and decide if the packet should be forwarded ordropped.

    Switches

    A two layer switch is a bridge with many interfaces and a design that allows betterperformance. A three layer switch is router with an improved design to allow betterperformance.

    When a packet is received by the switch, the switch examines the destination and sourcehardware addresses and compares them to a table of network segments and addresses. If thesegments are the same, the packet is dropped ("filtered"); if the segments are different, thenthe packet is "forwarded" to the proper segment. Filtering of packets and the regeneration offorwarded packets enables switching technology to split a network into separate collisiondomains. Regeneration of packets allows for greater distances and more nodes to be used inthe total network design, and dramatically lowers the overall collision rates. In switched

    networks, each segment is an independent collision domain. Switches can connect differentnetworks types (such as Ethernet and Fast Ethernet) or networks of the same type.

    Routers

    Router is a three layer device; it operates in physical, data link and network layers. As aphysical layer device, it regenerates the signal it receives. As a data link layer device therouter checks the physical addresses (source and destination) contained in the packet. As anetwork layer device, a router checks the network layer addresses.

    A Router can connect LANs together, a router can connect WANs together and it can also

    connect LANs and WANs together. A router is an internetworking device.

    Hub

    Hub

    Hub

  • 7/28/2019 Dcn Lab Manual Gecr

    21/26

    Gateways

    Many networks exist in the world, often with different hardware & software. Peopleconnected to one network often want to communicate with people attached to a different one.

    This desire requires connecting together different and frequently incompatible networks. Thisis done by using machines called gateways to make the connection and provide the necessarytranslation, both in terms of hardware and software. Stopping point can be either a gatewaynode. It can also be referred as entrance point.

    Network Interface Cards

    A network interface card (NIC) is used to connect a PC to a network. NIC provides a physicalconnection between the networking cable and the computers internal bus. NIC comes in 3basic varieties.8 bit, 16 bits and 32 bits. The larger the number of bits faster the NIC.

    CAT Cabling

    Ethernet networks use unshielded twisted pair (UTP) Category 5 cable. CAT5 cable runsshould not exceed 100 meters.

    CAT5 cables are typically terminated with RJ -45 connectors. There are two different types ofRJ-45 connectors. There is the "bent type" connector intended for use with solid core CAT5,and then there is the "aligned type" connector for use with stranded CAT5 cable.

    Two types of CAT5 cables are typically used in a network: the straight-through cable and thecrossover cable. The difference between the two has to do with how the conductors terminateto the RJ-45 connector at each end of the cable. The chart below shows the RJ-45 connector"pin-outs" for CAT5 crossover and straight-through cables.RJ-45 Connector "Pin-Outs". A straight-through cable is used to connect a DTE to a switch.Crossover cables are used to connect switches to other switches. . If the wiring is identical atboth ends, you are holding a straight-through cable, if it is different; you most likely have acrossover cable.

    Access Technique for LAN

    CSMA-CD

    The IEEE 802.3 standard defines carrier sense multiple access with collision detection as theaccess method for Ethernet. Stations on an Ethernet can be connected together using aphysical star topology with a logical bus topology. By this we mean that the medium isshared between the stations and only one station at a time can use it. It also implies that allstations receive a frame sent by a station. The real destination keeps the frame while the restdrop it.

    CSMA-CD stands for Carrier Sense Multiple Access / Collision Detection, a set of rulesdetermining how network devices respond when two devices attempt to use a data channelsimultaneously (called acollision). Standard Ethernet networks use CSMA/CD. This standard

    enables devices to detect a collision. After detecting a collision, a device waits a randomdelay time and then attempts to re-transmit the message.

  • 7/28/2019 Dcn Lab Manual Gecr

    22/26

    Specification of a network device

    Model DE-816TP Ethernet Hub

    Data transfer rate: 10 MbpsProtocol: CSMA/CD

    Topologies: Star, BusEMI Certification: DE-812TP+and DE-824TP:

    FCC Class A, VCCI I, CE ADE-816TP:FCC Class B, VCCI I I, CE B

    AC power: 100 - 250 V, 50 - 60 Hz

    Power consumption: DE-812TP+: 18 WDE-816TP: 18 WDE-824TP: 20W

    Dimensions: W x H x L, mm (including

    mounting brackets):DE-812TP+: 483 x 44 x 125DE-816TP: 483 x 44 x 125DE-824TP 483 x 44 x 211

    Weight: DE-812TP+: 2.0 kgDE-816TP: 2.0 kgDE-824TP: 3.03 kg

    Operating temperature: 0 - 55 C

    Humidity: 10 - 90 % non-condensing

    Power cord: Type 1 (US) or Type 2 (Europe)Per purchase order

    Type 1 Type 2

    Plug Rating 125V, 7A 250V, 10A

    Cord Rating 125V, 7A 250V, 10A

    Length 1830mm (6ft) 1830mm (6ft)

    Safety Standard UL, CSA VDE

  • 7/28/2019 Dcn Lab Manual Gecr

    23/26

    EXPERIMENT 10

    Study of IP addressing and subnetting

    Objectives

    To implement a program for IP class identification To implement a program for IP address conversion (BCD to Binary) To implement a program for finding Network ID (with or without subnet

    mask)and number of hosts

    Concepts

    IP address is the identifier used in the IP layer of the TCP/IP protocol suite. It provideslogical identity to each device connected to the Internet. An IP address is a 32-bit binaryaddress that uniquely and universally defines the connection of a host or a router to theInternet.

    There are two types of IP addressing scheme: A) Classful IP addressing and B) Classless IPaddressing. Classful IP addressing consists of several blocks of IP addresses, logicallyidentified as a class. IP address of a device is a combination of network ID and Host ID. HostID refers to a unique host in a given network identified by network ID. To retrieve networkID information from an IP address a specific pattern of bits is used, known as subnet mask.

    Classless IP address uses /n notation to make CIDR possible. Here n represents number ofhost bits in an IP address.

    TUTORIAL Questions

    (1) A device can have more than one IP addresses-true or false, justify your answer.(2) What is the use of Loopback address?(3) IP addresses are unique- true or false, justify your answer.(4) Which version of IP addressing scheme is currently in use and what could be the futureexpansion in the IP addressing scheme?(5) What is meant by Net ID and Host ID?(6) An address space has a total 1024 addresses, how many bits are needed to represent anaddress?

    (7) A router has an IP address 108.5.18.22; it sends a direct broadcast packet to all hostsin this network. What are the source and destination addresses used in this packet?(8) A host with IP address 185.42.56.88 wants to use Loopback testing what are the sourceand destination addresses?

  • 7/28/2019 Dcn Lab Manual Gecr

    24/26

    EXPERIMENT 11

    Network Simulator- ns-2: Installation, Programming & Simulation demonstration

    o To study various features of Network Simulator & Network Emulatoro To test a given script on Network Simulator platform and observe the behavior

    of the network with the help of the key parameterso To measure the performance of a network for a given topologyo To understand the network setup with a network emulatoro Toimplement different types of link characteristics and measure the

    performance by changing various parameters using NIST Net

    Concepts

    Network Simulator is a very powerful tool for studying the working of layers and relatedprotocols. Though it is giving protocol stack independent performance, which is anadvantage, but it is highly recommended by researchers around the world. Its simulatedoutput is considered to be valid for most of real protocol implementations.

    Network Simulator includes The Network Animator, which is helping Network Simulator tosupport a graphical environment. The Network Animator uses the parameters from the scriptand writes it into .namfile and then according to that it will create a topology identical to thescript. So we can see graphically how the packets are forwarded and traffic is handled in thenetwork, so this can give the more realistic implementation and observation.

    Network Simulator uses tcl script for simulation. Syntax of this script can be understood by

    referring theNS_DOC.PDF

    We can understand Network Simulators simulation process and tcl script format and TheNetwork Animator graphical representation with the help of the following scripts:

    UDP

    #Create a simulator objectset ns [new Simulator]

    #Define different colors for data flows

    $ns color 1 Blue$ns color 2 Red

    #Open the nam trace fileset nf [open out.nam w]$ns namtrace-all $nf

    #Define a 'finish' procedureproc finish {} {

    global ns nf$ns flush-trace

    #Close the trace fileclose $nf

    #Execute nam on the trace file

  • 7/28/2019 Dcn Lab Manual Gecr

    25/26

    exec nam out.nam &exit 0

    }#Create four nodesset n0 [$ns node]

    set n1 [$ns node]set n2 [$ns node]set n3 [$ns node]

    #Create links between the nodes$ns duplex-link $n0 $n2 1Mb 10ms DropTail$ns duplex-link $n1 $n2 1Mb 10ms DropTail$ns duplex-link $n3 $n2 1Mb 10ms SFQ$ns duplex-link-op $n0 $n2 orient right-down$ns duplex-link-op $n1 $n2 orient right-up$ns duplex-link-op $n2 $n3 orient right

    #Monitor the queue for the link between node 2 and node 3$ns duplex-link-op $n2 $n3 queuePos 0.5

    #Create a UDP agent and attach it to node n0set udp0 [new Agent/UDP]$udp0 set class_ 1$ns attach-agent $n0 $udp0

    #Create a CBR traffic source and attach it to udp0set cbr0 [new Application/Traffic/CBR]$cbr0 set packetSize_ 500$cbr0 set interval_ 0.005$cbr0 attach-agent $udp0

    #Create a UDP agent and attach it to node n1set udp1 [new Agent/UDP]$udp1 set class_ 2$ns attach-agent $n1 $udp1

    #Create a CBR traffic source and attach it to udp1

    set cbr1 [new Application/Traffic/CBR]$cbr1 set packetSize_ 500$cbr1 set interval_ 0.005$cbr1 attach-agent $udp1

    #Create a Null agent (a traffic sink) and attach it to node n3set null0 [new Agent/Null]$ns attach-agent $n3 $null0

    #Connect the traffic sources with the traffic sink$ns connect $udp0 $null0

    $ns connect $udp1 $null0

    #Schedule events for the CBR agents

  • 7/28/2019 Dcn Lab Manual Gecr

    26/26

    $ns at 0.5 "$cbr0 start"$ns at 1.0 "$cbr1 start"$ns at 4.0 "$cbr1 stop"$ns at 4.5 "$cbr0 stop"#Call the finish procedure after 5 seconds of simulation time

    $ns at 5.0 "finish"

    #Run the simulation$ns run

    OUTPUT:-

    Installation Procedure

    (1)Copy ns-allinone-2.27.tar.gzfile to /root(2)Type tar xvzf ns-allinone-2.27.tar.gz and press enter(3)Directory of the namens-allinone-2.27will be created(4)After entering in this directory, type./install and press enter(5)

    After the completion of the installation set the library paths in .bash_profilefile in/root

    (6)After the completion of the installation gotons-2.27directory which is in thens-allinone-2.27directory

    (7)In this directory gotons-tutorial directory(8)In this directory gotoexamplesdirectory(9).tcl files will be available there.(10)To run .tcl files typens filename.tcl

    To view source code typevi filename.tcl(11) To modify the source code press INSERT and make changes and at last press

    ESC and give:wq for save and quit.


Recommended