Top Banner
PILLAI’S HOC COLLEGE OF ENGINEERING AND TECHNOLOGY RASAYANI, DIST - RAIGAD. “Computer Communication Networks” LABORATORY MANUAL SEM: VII B.E. (EXTC) DEPARTMENT OF ELECTRONICS AND TELE COMMUNICATION ENGINEERING PHCET, RASAYANI Page 1
38

CCN Manual Jayesh Rane

Oct 01, 2015

Download

Documents

PrabhatGSingh

sem 6 ccn manual
extc department
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript

PILLAIS HOC COLLEGE OF ENGINEERING AND TECHNOLOGYRASAYANI, DIST - RAIGAD.

Computer Communication NetworksLABORATORY MANUAL

SEM: VII B.E. (EXTC)

DEPARTMENT OFELECTRONICS AND TELE COMMUNICATION ENGINEERING

INDEX

1. Study of Networking Components 3

2. OSI Layer Implementation7

3. Header Checksum Implementation using C13

4. To Implement Dijstras Algorithm17

5. To Study Routing Techniques22

6. To Study LAN and WAN Designing27

EXPERIMENT NO : 1Study of Network Components

Name of student:Roll no & batch:Date of performance:Date of submission:Remark & Signature:

EXPERIMENT 1Study of Network Components1. AIM To study Network Components3. THEORY

HUB Hubs (also called repeaters) are simple and inexpensive devices used to connect networked workstations together, and extend the power of network signals. Network cables all suffer from what is called signal attenuation. The farther a signal travels, the weaker it gets. A hub (repeater) boosts the signal, and renews its strength to make sure it gets where it is going and at a strength that is still readable. Hubs are very easy to set up: Just plug the network cables in, and off you go.

Hubs do not filter data and therefore every packet of information sent out through the hub is passed along to every computer, which can become an issue on hard working networks, where bandwidth and speed is an issue. Virtually all hubs come with a series of LEDs that can be consulted to see which computers are online and working and which are not. Quite often when a workstation loses all contact with the network, it is a burned out port on the hub, or failed network interface card. The absence of any LED activity of the hub for the offending workstation can confirm this. Hubs cannot join dissimilar types of LANs (Ethernet to Token Ring, etc.).

SWITCHES Switches are a fairly new technology and are often used in place of hubs, especially on networks where network bandwidth and speed are issues.

A switch is capable of reading incoming packets and only sending those packets to the computers to which they are addressed thereby reducing network traffic. Switches cannot join dissimilar types of LANs (Ethernet to Token Ring, etc.).

BRIDGES Bridges, like switches, are capable of filtering data packets and only sending packets to the computers for which they are addressed. The most common form of bridge today is the learning bridge, which over time learns which computer is where, what each computers unique address is (just like your mailing address) and who receives what, although bridges lack the ability to determine which routes are the fastest.

A learning bridge is not as fast as a switch, and has far fewer ports. Many companies are abandoning bridges in favor of switches. Bridges cannot join dissimilar types of LANs (Ethernet to Token Ring, etc.).

ROUTERS Routers are more intelligent that bridges. All routers maintain a routing table of paths that data can travel, and can be configured to send specific data packets down specific routes to maximize speed. Routers come in two types: Static and dynamic. Static routers require the network administrators to program the routing table.

Dynamic routers periodically check all available routes and are capable of building their own routing tables and learning the fastest routes for data travel. Routers can join dissimilar networks, filter packets to decrease the overall load on the network. A router requires the use of routable protocols like TCP/IP and IPX/SPX. NetBEUI will not work with a router.

GATEWAYSOnce used as an alternative term for a router, the term is now applied to any system on the network that can connect different networks using different protocols.

A gateway can strip off protocol specific information from a data packet and replace it with protocol specific information from an entirely different protocol standard. In other words, a gateway allows a network using IPX/SPX to talk to a network using TCP/IP.

6. CONCLUSION

EXPERIMENT NO : 2OSI layer implementation

Name of student :Roll no & batch :Date of performance :Date of submission :Remark & Signature :

EXPERIMENT 2OSI layer implementation1. AIM To implement OSI layer3. THEORY The Open Systems Interconnect (OSI) model has seven layers. The layers are explained, beginning with the 'lowest' in the hierarchy (the physical) and proceeding to the 'highest' (the application). The layers are stacked this way: .Layer 1: PHYSICAL LAYERThe physical layer, the lowest layer of the OSI model, is concerned with the transmission and reception of the unstructured raw bit stream over a physical medium. It describes the electrical/optical, mechanical, and functional interfaces to the physical medium, and carries the signals for all of the higher layers. The major functions and services performed by the physical layer are the following: Establishment and termination of a connection to a communications medium. Participation in the process whereby the communication resources are effectively shared among multiple users. For example, contention resolution and flow control. Modulation or conversion between the representation of digital data in user equipment and the corresponding signals transmitted over a communications channel. These are signals operating over the physical cabling (such as copper and optical fiber) or over a radio link.Layer 2: DATA LINK LAYERThe data link layer provides error-free transfer of data frames from one node to another over the physical layer, allowing layers above it to assume virtually error-free transmission over the link. Following are the functions of data link layer:- Framing Physical Addressing Flow Control Error Control Layer 3: NETWORK LAYER

The network layer controls the operation of the subnet, deciding which physical path the data should take based on network conditions, priority of service, and other factors. It provides:

Routing: routes frames among networks. Subnet traffic control: routers (network layer intermediate systems) can instruct a sending station to "throttle back" its frame transmission when the router's buffer fills up. Frame fragmentation: if it determines that a downstream router's maximum transmission unit (MTU) size is less than the frame size, a router can fragment a frame for transmission and re-assembly at the destination station. Logical-physical address mapping: translates logical addresses, or names, into physical addresses

Layer 4: TRANSPORT LAYER

The transport layer ensures that messages are delivered error-free, in sequence, and with no losses or duplications. It relieves the higher layer protocols from any concern with the transfer of data between them and their peers. The size and complexity of a transport protocol depends on the type of service it can get from the network layer. For a reliable network layer with virtual circuit capability, a minimal transport layer is required. The transport layer provides: Message segmentation: accepts a message from the (session) layer above it, splits the message into smaller units (if not already small enough), and passes the smaller units down to the network layer. The transport layer at the destination station reassembles the message. Message acknowledgment: provides reliable end-to-end message delivery with acknowledgments. Message traffic control: tells the transmitting station to "back-off" when no message buffers are available.

Layer 5: SESSION LAYER The session layer allows session establishment between processes running on different stations. It provides: Session establishment, maintenance and termination: allows two application processes on different machines to establish, use and terminate a connection, called a session. Session support: performs the functions that allow these processes to communicate over the network, performing security, name recognition, logging, and so on.

Layer 6: PRESENTATION LAYER The presentation layer formats the data to be presented to the application layer. It can be viewed as the translator for the network. This layer may translate data from a format used by the application layer into a common format at the sending station, then translate the common format to a format known to the application layer at the receiving station. The presentation layer provides: Character code translation Data conversion: bit order, CR-CR/LF, integer-floating point, and so on. Data compression: reduces the number of bits that need to be transmitted on the network.Layer 7: APPLICATION LAYER

The application layer serves as the window for users and application processes to access network services. This layer contains a variety of commonly needed functions: Resource sharing and device redirection Remote file access Remote printer access Inter-process communication Network management Directory services Electronic messaging (such as mail) Network virtual terminalsProgram for OSI model implementation in c.

/* Draw ISO - OSI Model using C */#include< stdlib.h>#include< graphics.h>#include< conio.h>#include< stdio.h>void main(){int driver, mode;int i,j;driver = DETECT;initgraph(&driver,&mode,"");outtextxy(250,450,"ISO OSI Model");delay(2000);outtextxy(90,30,"Sender");delay(500);setcolor(6);for(i=50;i< =350;i+=50){rectangle(200,i,50,i+30);delay(500);}setcolor(10);outtextxy(70,60,"Application");delay(500);outtextxy(70,110,"Presentation");delay(500);outtextxy(70,160,"Session");delay(500);outtextxy(70,210,"Transport");delay(500);outtextxy(70,260,"Network");delay(500);outtextxy(70,310,"Data Link");delay(500);outtextxy(70,360,"Physical");delay(500);setcolor(15);outtextxy(390,30,"Receiver");delay(500);setcolor(6);for(i=50;i< =350;i+=50){rectangle(350,i,500,i+30);delay(500);}setcolor(10);outtextxy(370,60,"Application");delay(500);outtextxy(370,110,"Presentation");delay(500);outtextxy(370,160,"Session");delay(500);outtextxy(370,210,"Transport");delay(500);outtextxy(370,260,"Network");delay(500);outtextxy(370,310,"Data Link");delay(500);outtextxy(370,360,"Physical");delay(500);// sender Linesline(120,80,120,100);delay(500);line(120,130,120,150);delay(500);line(120,180,120,200);delay(500);line(120,230,120,250);delay(500);line(120,280,120,300);delay(500);line(120,330,120,350);delay(500);line(120,380,120,400);delay(500);// Physical Connectionline(120,400,420,400);// Receiver Linesline(420,380,420,400);delay(500);line(420,330,420,350);delay(500);line(420,280,420,300);delay(500);line(420,230,420,250);delay(500);line(420,180,420,200);delay(500);line(420,130,420,150);delay(500);line(420,80,420,100);//virtual connectionsetcolor(15);delay(500);outtextxy(210,35,"Virtual Connection");delay(1000);for(j=65;j< =365;j+=50){for(i=0;i< 15;i++){setcolor(i);line(200,j,230,j);delay(10);line(235,j,265,j);delay(10);line(270,j,300,j);delay(10);line(305,j,335,j);delay(10);line(340,j,350,j);delay(10);}}delay(500);}/* OUTPUT

CONCLUSION

EXPERIMENT NO : 3Header Checksum Implementation

Name of student :Roll no & batch :Date of performance :Date of submission :Remark & Signature :EXPERIMENT 3Header Checksum Implementation1. AIMHeader checksum of TCP/IP Implementation Using C Programming 2. THEORYAchecksumis a small-sizedatumcomputed from an arbitrary block ofdigitaldata for the purpose ofdetecting errors that may have been introduced during itstransmissionorstorage. The integrity of the data can becheckedat any later time by recomputing the checksum and comparing it with the stored one. If the checksums match, the data was likely not accidentally altered. The Transmission Control Protocol is designed to provide reliable data transfer between a pair of devices on an IP internetwork. Much of the effort required to ensure reliable delivery of data segments is of necessity focused on the problem of ensuring that data is not lost in transit. But there's another important critical impediment to the safe transmission of data: the risk of errors being introduced into a TCP segment during its travel across the internetwork. Detecting Transmission Errors Using Checksums If the data gets where it needs to go but is corrupted and we do not detect the corruption, this is in some ways worse than it never showing up at all. To provide basic protection against errors in transmission, TCP includes a 16-bit Checksum field in its header. The idea behind a checksum is very straight-forward: take a string of data bytes and add them all together. Then send this sum with the data stream and have the receiver check the sum. In TCP, a special algorithm is used to calculate this checksum by the device sending the segment; the same algorithm is then employed by the recipient to check the data it received and ensure that there were no errors. The checksum calculation used by TCP is a bit different than a regular checksum algorithm. A conventional checksum is performed over all the bytes that the checksum is intended to protect, and can detect most bit errors in any of those fields. The designers of TCP wanted this bit error protection, but also desired to protect against other type of problems.

PROGRAME for Caclulation of Checksum:#include#include#includevoid main(){clrscr();int n1,n2,sum,chksm,comp;coutn1;coutn2;chksm=0;cout