Transcription

PresentsPractical Routers and Switches(Including TCP/IP and Ethernet)For Engineers and TechniciansWeb Site: www.idc-online.comE-mail: [email protected] – Rev 5

CopyrightAll rights to this publication, associated software and workshop are reserved.No part of this publication or associated software may be copied, reproduced,transmitted or stored in any form or by any means (including electronic,mechanical, photocopying, recording or otherwise) without prior writtenpermission of IDC Technologies.DisclaimerWhilst all reasonable care has been taken to ensure that the descriptions,opinions, programs, listings, software and diagrams are accurate and workable,IDC Technologies do not accept any legal responsibility or liability to anyperson, organization or other entity for any direct loss, consequential loss ordamage, however caused, that may be suffered as a result of the use of thispublication or the associated workshop and software.In case of any uncertainty, we recommend that you contact IDC Technologiesfor clarification or assistance.TrademarksAll terms noted in this publication that are believed to be registered trademarksor trademarks are listed below:IBM, XT and AT are registered trademarks of International Business MachinesCorporation. Microsoft, MS-DOS and Windows are registered trademarks ofMicrosoft Corporation.AcknowledgementsIDC Technologies expresses its sincere thanks to all those engineers andtechnicians on our training workshops who freely made available theirexpertise in preparing this manual.

Who is IDC Technologies?IDC Technologies is a specialist in the field of industrial communications,telecommunications, automation and control and has been providing highquality training for more than six years on an international basis from officesaround the world.IDC consists of an enthusiastic team of professional engineers and supportstaff who are committed to providing the highest quality in their consultingand training services.The Benefits to you of Technical Training TodayThe technological world today presents tremendous challenges to engineers,scientists and technicians in keeping up to date and taking advantage of thelatest developments in the key technology areas. The immediate benefits of attending IDC workshops are:Gain practical hands-on experienceEnhance your expertise and credibilitySave s for your companyObtain state of the art knowledge for your companyLearn new approaches to troubleshooting Improve your future career prospectsThe IDC Approach to TrainingAll workshops have been carefully structured to ensure that attendees gainmaximum benefits. A combination of carefully designed training software,hardware and well written documentation, together with multimediatechniques ensure that the workshops are presented in an interesting,stimulating and logical fashion.IDC has structured a number of workshops to cover the major areas oftechnology. These courses are presented by instructors who are experts intheir fields, and have been attended by thousands of engineers, techniciansand scientists world-wide (over 11,000 in the past two years), who havegiven excellent reviews. The IDC team of professional engineers isconstantly reviewing the courses and talking to industry leaders in thesefields, thus keeping the workshops topical and up to date.

Technical Training WorkshopsIDC is continually developing high quality state of the art workshops aimedat assisting engineers, technicians and scientists. Current workshopsinclude:Instrumentation & Control Practical Automation and Process Control using PLC’s Practical Data Acquisition using Personal Computers and StandaloneSystems Practical On-line Analytical Instrumentation for Engineers and Technicians Practical Flow Measurement for Engineers and Technicians Practical Intrinsic Safety for Engineers and Technicians Practical Safety Instrumentation and Shut-down Systems for Industry Practical Process Control for Engineers and Technicians Practical Programming for Industrial Control – using (IEC 1131-3;OPC) Practical SCADA Systems for Industry Practical Boiler Control and Instrumentation for Engineers and Technicians Practical Process Instrumentation for Engineers and Technicians Practical Motion Control for Engineers and Technicians Practical Communications, SCADA & PLC’s for ManagersCommunications Practical Data Communications for Engineers and TechniciansPractical Essentials of SNMP Network ManagementPractical Field Bus and Device Networks for Engineers and TechniciansPractical Industrial Communication ProtocolsPractical Fibre Optics for Engineers and TechniciansPractical Industrial Networking for Engineers and TechniciansPractical TCP/IP & Ethernet Networking for IndustryPractical Telecommunications for Engineers and TechniciansPractical Radio & Telemetry Systems for IndustryPractical Local Area Networks for Engineers and Technicians Practical Mobile Radio Systems for Industry

Electrical Practical Power Systems Protection for Engineers and Technicians Practical High Voltage Safety Operating Procedures for Engineers &Technicians Practical Solutions to Power Quality Problems for Engineers andTechnicians Practical Communications and Automation for Electrical Networks Practical Power Distribution Practical Variable Speed Drives for Instrumentation and Control SystemsProject & Financial Management Practical Project Management for Engineers and Technicians Practical Financial Management and Project Investment Analysis How to Manage ConsultantsMechanical Engineering Practical Boiler Plant Operation and Management for Engineers andTechnicians Practical Centrifugal Pumps – Efficient use for Safety & ReliabilityElectronics Practical Digital Signal Processing Systems for Engineers and Technicians Practical Industrial Electronics Workshop Practical Image Processing and Applications Practical EMC and EMI Control for Engineers and TechniciansInformation Technology Personal Computer & Network Security (Protect from Hackers, Crackers &Viruses) Practical Guide to MCSE Certification Practical Application Development for Web Based SCADA

Comprehensive Training MaterialsWorkshop DocumentationAll IDC workshops are fully documented with complete reference materialsincluding comprehensive manuals and practical reference guides.SoftwareRelevant software is supplied with most workshops. The software consistsof demonstration programs which illustrate the basic theory as well as themore difficult concepts of the workshop.Hands-On Approach to TrainingThe IDC engineers have developed the workshops based on the practicalconsulting expertise that has been built up over the years in various specialistareas. The objective of training today is to gain knowledge and experience inthe latest developments in technology through cost effective methods. Theinvestment in training made by companies and individuals is growing eachyear as the need to keep topical and up to date in the industry which they areoperating is recognized. As a result, the IDC instructors place particularemphasis on the practical hands-on aspect of the workshops presented.On-Site WorkshopsIn addition to the quality of workshops which IDC presents on a world-widebasis, all IDC courses are also available for on-site (in-house) presentation atour clients’ premises. On-site training is a cost effective method of trainingfor companies with many delegates to train in a particular area.Organizations can save valuable training ’s by holding courses on-site,where costs are significantly less. Other benefits are IDC’s ability to focuson particular systems and equipment so that attendees obtain only thegreatest benefits from the training.All on-site workshops are tailored to meet with clients training requirementsand courses can be presented at beginners, intermediate or advanced levelsbased on the knowledge and experience of delegates in attendance. Specificareas of interest to the client can also be covered in more detail. Our externalworkshops are planned well in advance and you should contact us as early aspossible if you require on-site/customized training. While we will alwaysendeavor to meet your timetable preferences, two to three month’s notice ispreferable in order to successfully fulfil your requirements. Please don’thesitate to contact us if you would like to discuss your training needs.

Customized TrainingIn addition to standard on-site training, IDC specializes in customizedcourses to meet client training specifications. IDC has the necessaryengineering and training expertise and resources to work closely with clientsin preparing and presenting specialized courses.These courses may comprise a combination of all IDC courses along withadditional topics and subjects that are required. The benefits to companies inusing training are reflected in the increased efficiency of their operations andequipment.Training ContractsIDC also specializes in establishing training contracts with companies whorequire ongoing training for their employees. These contracts can beestablished over a given period of time and special fees are negotiated withclients based on their requirements. Where possible, IDC will also adaptcourses to satisfy your training budget.References from various international companies to whom IDC is contractedto provide on-going technical training are available on request.Some of the thousands of Companies worldwide that havesupported and benefited from IDC workshops are:Alcoa, Allen-Bradley, Altona Petrochemical, Aluminum Company ofAmerica, AMC Mineral Sands, Amgen, Arco Oil and Gas, Argyle DiamondMine, Associated Pulp and Paper Mill, Bailey Controls, Bechtel,BHP Engineering, Caltex Refining, Canon, Chevron, Coca-Cola,Colgate-Palmolive, Conoco Inc, Dow Chemical, ESKOM, Exxon,Ford, Gillette Company, Honda, Honeywell, Kodak, Lever Brothers,McDonnell Douglas, Mobil, Modicon, Monsanto, Motorola, Nabisco,NASA, National Instruments, National Semi-Conductor, Omron Electric,Pacific Power, Pirelli Cables, Proctor and Gamble, Robert Bosch Corp,Siemens, Smith Kline Beecham, Square D, Texaco, Varian,Warner Lambert, Woodside Offshore Petroleum, Zener Electric.

Table of Contents1Introduction to communications1.11.21.31.41.51.61.7Data communicationsTransmitters, receivers and communication channelsTypes of communication channelsCommunications channel propertiesData transmission modesEncoding methodsError detection2Networking 2OverviewNetwork communicationTypes of networksThe open systems interconnection modelInteroperability and internetworkingProtocols and protocol standardsIEEE/ISO standardsNetwork topologiesBus topologyStar topologyRing topologyMedia access methods3Ethernet networks3.13.23.33.43.53.63.7IEEE 802.3 CSMA/CD ("Ethernet")Physical layerSignaling methodsMedium access controlFrame transmissionFrame 839424545465252535354

3.83.93.103.11MAC frame formatDifference between 802.3 and EthernetReducing collisionsEthernet design rules565757584Fast and gigabit Ethernet systems4.14.24.34.44.5Achieving higher speed100BaseT (100BaseTX, T4, FX,T2)Fast Ethernet design considerationsGigabit Ethernet 1000BaseTGigabit Ethernet design considerations5Introduction to TCP/IP5.15.25.3The origins of TCP/IPThe ARPA model Vs The OSI modelThe TCP/IP protocol suite Vs The ARPA model6Internet layer rnet Protocol version 4 (IPv4)Internet Protocol version 6 (IPv6/ IPng)Address Resolution Protocol (ARP)Reverse Address Resolution Protocol (RARP)Internet Control Message Protocol (ICMP)Routing protocolsInterior gateway protocolsExterior Gateway Protocols (EGP’s)8282971061101111181221247Host to Host (transport) layer protocols7.17.2TCP (Transmission Control Protocol)UDP (User Datagram Protocol)61616268697477777878127128136

8Application layer 13IntroductionFile Transfer Protocol (FTP)Trivial File Transfer Protocol (TFTP)TELNET (Telecommunications Network)RLOGIN (Remote Login)NFS (Network File System)DNS (Domain Name System)WINSSNMP (Simple Network Management Protocol)SMTP (Simple Mail Transfer Protocol)POP (Post Office Protocol)BOOTP (Bootstrap Protocol)DHCP (Dynamic Host Configuration Protocol)9TCP/IP onPING (Packet Internet Groper)ARPNETSTATNBTSTATIPCONFIGWINIPCFGTRACE RouTeROUTEThe HOSTS file10LAN system tionRepeatersMedia 4174175176177179180181181182183184187189194195

10.910.1010.1110.1210.13Print serversTerminal serversThin serversRemote access serversNetwork timeservers11Internet access11.111.211.3Connecting a single host to the InternetConnecting remote hosts to corporate LANConnecting multiple hosts to the Internet12Troubleshooting TCP/IP12.112.212.3Maintenance and troubleshooting of real TCP/IP networksNetwork troubleshootingTroubleshooting with TCP/IP Utilities13Virtual LAN13.113.213.313.413.513.613.713.813.913.10Need for VLANBenefits of a VLANVLAN restrictionsBasic operation of a VLANVLAN implementationCombination of definitionsMethod of connectionsFiltering tableTaggingConclusion14Virtual Private Networks14.114.214.314.414.514.614.714.8The Internet and the new communication paradigmWhat is a VPN?Types of VPNRequirements for designing a VPN systemDefining of policyFunctional 23225226227227228229229236247

15Routing basics and RIP15.115.2Routing basicsRouting Information Protocol (RIP)16Interior Gateway Routing Protocol (IGRP)16.116.216.316.416.516.616.7OriginsIGRP metricsSpecificationsOperation of IGRPDealing with topology changesLimitations of IGRPMultipath Routing17Enhanced IGRP d IGRP capabilities and attributesUnderlying processes and technologiesRouting conceptsEnhanced IGRP packet typesSummary18Open Shortest Path First18.118.218.318.418.5BackgroundRouting hierarchySPF algorithmPacket formatAdditional OSPF features19Advanced router considerations19.119.219.319.4BackgroundMPLS and tag switchingMPLS operationsMPLS/Tag-switching 3273274275276277279279280281282283285285286287288

19.519.619.719.8Hierarchical routingMulticast routingLabel switching with ATMQuality of service and traffic engineering289290290291Appendix A: Glossary293Appendix B: Port number allocation311Appendix C: Security considerations313Appendix D: Firewalls331Appendix E: Border Gateway Protocol347Appendix F: CISCO Devices355Appendix G: Routers – Practical Exercise473

1Introduction tocommunicationsObjectivesWhen you have completed study of this chapter you should be able to: Understand the main elements of the data communication process Understand the difference between analog and digital transmission Explain how data transfer is affected by attenuation, bandwidth and noise inthe channel Know the importance of synchronization of digital data systems Describe the basic synchronization concepts used with asynchronous andsynchronous systems Explain the following types of encoding: Manchester RZ NRZ MLT-3 4B/5BDescribe the basic error detection principles.1.1Data communicationsCommunications systems exist to transfer information from one location to another. Thecomponents of the information or message are usually known as data (derived from theLatin word for items of information). All data are made up of unique code symbols orother entities on which the sender and receiver of the messages have agreed. For examplebinary data is represented by two states "0" and "1". These are referred to as Binary digitsor "bits".

2 Practical routers and switches (including TCP/IP and Ethernet) for engineers and techniciansThese bits are represented inside our computers by the level of the electrical signalswithin storage elements; a high level could represent a "1", and a low-level represent a"0". Alternatively, the data may be represented by the presence or absence of light in anoptical fiber cable.1.2Transmitters, receivers and communication channelsA communications process requires the following components: A source of the information A transmitter to convert the information into data signals compatible withthe communications channel A communications channel A receiver to convert the data signals back into a form the destination canunderstand The destination of the informationThis process is shown in Figure 1.1.Figure 1.1Communication processThe transmitter encodes the information into a suitable form to be transmitted over thecommunications channel. The communications channel moves this signal aselectromagnetic energy from the source to one or more destination receivers. Thechannel may convert this energy from one form to another, such as electrical to opticalsignals, whilst maintaining the integrity of the information so the recipient can understandthe message sent by the transmitter.For the communications to be successful the source and destination must use a mutuallyagreed method of conveying the data.The main factors to be considered are: The form of signaling and the magnitude(s) of the signals to be used The type of communications link (twisted pair, coaxial, optic fiber, radioetc.) The arrangement of signals to form character codes from which the messagecan be constructed The methods of controlling the flow of data The procedures for detecting and correcting errors in the transmissionThe form of the physical connections is defined by Interface Standards, some agreedcoding is applied to the message and the rules controlling the data flow and detection andcorrection of errors are known as the protocol.1.2.1Interface standardsAn Interface Standard defines the electrical and mechanical aspects of the interface toallow the communications equipment from different manufacturers to operate together.

Introduction to communications 3A typical example is the EIA/TIA-232-E interface standard.following three components:This specifies the Electrical signal characteristics - defining the allowable voltage levels,grounding characteristics etc Mechanical characteristics - defining the connector arrangements and pinassignments Functional description of the interchange circuits - defining the functionof the various data, timing and control signals used at the interfaceIt should be emphasized that the interface standard only defines the electrical andmechanical aspects of the interface between devices and does not cover how data istransferred between them (see Table 1.1).Table 1.1ASCII code table1.2.2CodingA wide variety of codes have been used for communications purposes. Early telegraphcommunications used Morse code with human operators as transmitter and receiver. TheBaudot code introduced a constant 5-bit code length for use with mechanical telegraphtransmitters and receivers. The commonly used codes for data communications today arethe Extended Binary Coded Decimal Interchange Code (EBCIDIC) and the AmericanStandards Committee for Information Interchange (ASCII).

4 Practical routers and switches (including TCP/IP and Ethernet) for engineers and technicians1.2.3ProtocolsA protocol is essential for defining the common message format and procedures fortransferring data between all devices on the network. It includes the following importantfeatures: Initialization: Initializes the protocol parameters and commences the datatransmission Framing and Synchronization: Defines the start and end of the frame andhow the receiver can synchronize to the data stream Flow Control: Ensures that the receiver is able to advise the transmitter toregulate the data flow and ensure no data is lost. Line Control: Used with half-duplex links to reverse the roles of transmitterand receiver and begin transmission in the other direction. Error Control: Provides techniques to check the accuracy of the receiveddata to identify transmission errors. These include Block Redundancy checksand Cyclic Redundancy Checks Time Out Control: Procedures for transmitters to retry or aborttransmission when acknowledgments are not received within agreed timelimits1.2.4Some commonly used communications protocols Xmodem or Kermit for asynchronous file transmission Binary Synchronous Protocol (BSC), Synchronous Data Link Control(SDLC) or High Level Data Link Control (HDLC) for synchronoustransmissions Industrial Protocols such as Manufacturing Automation Protocol (MAP),Technical Office Protocol (TOP), Modbus, Data Highway Plus, HART,Profibus, Foundation Fieldbus, etc1.3Types of communication channels1.3.1Analog communications channelsAn analog communications channel conveys analog signals that are changingcontinuously in both frequency and amplitude. These signals are commonly used foraudio and video communication as illustrated in Figure 1.2 and Figure 1.3.Figure 1.2Analog signal

Introduction to communications 51.3.2Digital communications channelsFigure 1.3Digital signal1.4Communications channel propertiesThe physical properties of the communications channels limit their ability to carryinformation in either analogue or digital form. The principal effects are signal attenuation,channel bandwidth and noise.1.4.1Signal attenuationAs the signal travels along a communications channel its amplitude decreases as thephysical medium resists the flow of the electromagnetic energy. This effect is known assignal attenuation. With electrical signaling some materials such as copper are veryefficient conductors of electrical energy. However, all conductors contain impurities thatresist the movement of the electrons that constitute the electric current. The resistance ofthe conductors causes some of the electrical energy of the signal to be converted to heatenergy as the signal progresses along the cable resulting in a continuous decrease in theelectrical signal. The signal attenuation is measured in terms of signal loss per unit lengthof the cable, typically dB/km (see Figure 1.4).

6 Practical routers and switches (including TCP/IP and Ethernet) for engineers and techniciansFigure 1.4Signal attenuationTo allow for attenuation, a limit is set for the maximum length of the communicationschannel. This is to ensure that the attenuated signal arriving at the receiver is of sufficientamplitude to be reliably detected and correctly interpreted. If the channel is longer thanthis maximum length, amplifiers or repeaters must be used at intervals along the channelto restore the signal to acceptable levels (see Figure 1.5).Figure 1.5Signal repeatersSignal attenuation increases as the frequency increases. This causes distortion topractical signals containing a range of frequencies. This is illustrated in Figure 1.4 wherethe rise-times of the attenuated signals progressively decrease as the signal travelsthrough the channel, caused by the greater attenuation of the high frequency components.This problem can be overcome by the use of amplifiers that amplify the higherfrequencies by greater amounts.

Introduction to communications 71.4.2Channel bandwidthThe quantity of information a channel can convey over a given period is determined by itsability to handle the rate of change of the signal, that is its frequency. An analog signalvaries between a minimum and maximum frequency and the difference between thosefrequencies is the bandwidth of that signal. The bandwidth of an analog channel is thedifference between the highest and lowest frequencies that can be reliably received overthe channel. These frequencies are often those at which the signal has fallen to half thepower relative to the mid band frequencies, referred to as 3dB points. In this case thebandwidth is known as the 3dB bandwidth (see Figure 1.6).Figure 1.6Channel bandwidthDigital signals are made up of a large number of frequency components, but only thosewithin the bandwidth of the channel will be able to be received. It follows that the largerthe bandwidth of the channel, the higher the data transfer rate can be and more highfrequency components of the digital signal can be transported, and so a more accuratereproduction of the transmitted signal can be received (see Figure 1.7).Figure 1.7Effect of channel bandwidth on digital signal

8 Practical routers and switches (including TCP/IP and Ethernet) for engineers and techniciansThe maximum data transfer rate (C) of the transmission channel can be determinedfrom its bandwidth, by use of the following formula derived by Shannon.C 2Blog2M bpsWhereBbandwidth in hertz and M levels are used for each signaling element.In the special case where only two levels, "ON" and "OFF" are used (binary), M 2and C 2 B. As an example, the maximum data transfer rate for a PSTN channel ofbandwidth 3200 Hertz carrying a binary signal would be 2 x 3200 6400 bps. Theachievable data transfer rate is reduced to ½ of 6400 because of the Nyquist rate. It isfurther reduced in practical situations because of the presence of noise on the channel toapproximately 2400 bps unless some modulation system is used.1.4.3NoiseAs the signals pass through a communications channel the atomic particles and moleculesin the transmission medium vibrate and emit random electromagnetic signals as noise.The strength of the transmitted signal is normally large relative to the noise signal.However, as the signal travels through the channel and is attenuated, its level canapproach that of the noise. When the wanted signal is not significantly higher than thebackground noise, the receiver cannot separate the data from the noise andcommunication errors occur.An important parameter of the channel is the ratio of the power of the received signal(S) to the power of the noise signal (N). The ratio S/N is called the signal to noise ratio,which is normally expressed in decibels, abbreviated to dB.S/N 10 log 10 (S/N) dBA high signal to noise ratio means that the wanted signal power is high compared to thenoise level, resulting in good quality signal reception. The theoretical maximum datatransfer rate for a practical channel can be calculated using the Shannon-Hartley Law,which states:C B log2 (1 S/N) bpsWhereCdata rate in bpsBbandwidth of the channel in HertzSsignal power in watts and N is the noise power in wattsIt can be seen from this formula that increasing the bandwidth or increasing the signalto noise ratio will allow increases to the data rate, and that a relatively small increase inbandwidth is equivalent to a much greater increase in signal to noise ratio.Digital transmission channels make use of higher bandwidths and digital repeaters orregenerators to regenerate the signals at regular intervals and maintain acceptable signalto noise ratios. The degraded signals received at the regenerator are detected, then retimed and retransmitted as nearly perfect replicas of the original digital signals, as shownin Figure 1.8. Provided the signal to noise ratios are maintained in each link, there is noaccumulated noise on the signal, even when transmitted thousands of kilometers.

Introduction to communications 9Figure 1.8Digital link1.5Data transmission modes1.5.1Direction of signal flowSimplexA simplex channel is unidirectional and allows data to flow in one direction only, asshown in Figure 1.9. Public radio broadcasting is an example of a simplex transmission.The radio station transmits the broadcast program, but does not receive any signals backfrom your radio receiver.Figure 1.9Simplex transmissionThis has limited use for data transfer purposes, as we invariably require the flow of datain both directions to control the transfer process, acknowledge data etc.Half-duplexHalf-duplex transmission allows us to provide simplex communication in both directionsover a single channel, as shown in Figure 1.10. Here the transmitter at station "A" sendsdata to a receiver at station "B". A line turnaround procedure takes place whenevertransmission is required in the opposite direction. The station "B" transmitter is thenenabled and communicates with the receiver at station "A". The delay in the lineturnaround procedures reduces the available data throughput of the communicationschannel.

10 Practical routers and switches (including TCP/IP and Ethernet) for engineers and techniciansFigure 1.10Half-duplex transmissionFull-duplexA Full-duplex channel gives simultaneous communications in both directions, as shownin Figure 1.11.Figure 1.11Full duplex transmission1.5.2Synchronization of digital data signalsData communications depends on the timing of the signal generation and reception beingkept correct throughout the message transmission. The receiver needs to look at theincoming data at the correct instants before determining whether a "1" or "0" wastransmitted. The process of selecting and maintaining these sampling times is calledsynchronization.In order to synchronize their transmissions, the transmitting and receiving devices needto agree on the length of the code elements to be used, known as the bit time. Thereceiver needs to extract the transmitted clock signal encoded into the received datastream. By synchronizing the bit time of the receiver's clock with that encoded by thesender, the receiver is able to determine the right times to detect the data transitions in themessage and correctly receive the message. The devices at both ends of a digital channelcan synchronize themselves using either asynchronous or synchronous transmission asoutlined below.

Introduction to communications 111.5.3Asynchronous transmissionHere the transmitter and receiver operate independently, and exchange a synchronizingpattern at the start of each message code element (frame).

8.10 SMTP (Simple Mail Transfer Protocol) 161 8.11 POP (Post Office Protocol) 162 8.12 BOOTP (Bootstrap Protocol) 163 8.13 DHCP (Dynamic Host Configuration Protocol) 164 9 TCP/IP utilities 169 9.1 Introduction 169 9.2 PING (Packet Internet Groper) 169 9.3 ARP 173