data comm 2 latest

118
1.1 Unguided Media –wireless It transports electromagnetic signal without using a conductor Signals broadcast through air and the electromagnetic spectrum, ranging from 3kHz to 900 THz is used for wireless communication We can divide wireless transmission in three groups Radio wave Microwave Infrared

Upload: rohit-nair

Post on 29-Jun-2015

851 views

Category:

Education


0 download

TRANSCRIPT

Page 1: Data comm 2 latest

1.1

Unguided Media –wireless

• It transports electromagnetic signal without using a conductor

• Signals broadcast through air and the electromagnetic spectrum, ranging from 3kHz to 900 THz is used for wireless communication

• We can divide wireless transmission in three groups Radio wave Microwave Infrared

Page 2: Data comm 2 latest

1.2

Radio wave:- Electromagnetic wave ranging from 3KHz to 1 GHz

They are Omni directional means when antenna transmits radio wave they propagate in all directions

So that sending and receiving antenna do not have to be aligned

Radio waves of low and medium frequency can penetrate walls

They are used for radio and television, cordless phones system

They can travel long distance so they are good for long distance broadcasting

Page 3: Data comm 2 latest

1.3

• Microwave:-• Electromagnetic wave having frequency between 1GHz to 300GHz

• They are unidirectional so sending and receiving antenna need to be aligned

• Microwave propagation is line of sight so towers with antenna need to be in direct sight of eachother.towers which are far apart need to be tall

• They are used in satellite networks, wireless LAN,

• The parabolic dish and horn antenna are used for transmission and reception of microwave

Page 4: Data comm 2 latest

1.4

• Infrared:-• These signals having frequencies ranging from 300GHz to 400THz

can be used for short distance communication

• They cannot penetrate walls

• So when we use Infrared remote control, we do not interfere with the help of remote by our neighbors

• The recent data rates are 4 Mbps

• Application:-• They are used with communication between keyboards,PCs and

printers

• Some manufacturers provide IrDA port that allows wireless keyboard to communicate with a PC

Page 5: Data comm 2 latest

Specification of cable

• There are several different specifications used to classify cable.

• One of the oldest is the AWG (American Wire Gauge) rating.

• This rating measures the thickness or gauge of the wire with the size being inverse to the rating.

• For example, a 22 AWG cable is thicker than a 24 AWG cable. 

• 22 AWG wire is typically used in telephone wire and UTP

Page 6: Data comm 2 latest

Cable categories• UTP cabling is not recommended for distances greater than 100 meters without the

use of a repeater.

• Category one is used for traditional phone lines. It carries only voice communication.

• Cat2 is capable of carrying data but only at rates up to 4 Mb/second. Cat2 cables consist of four twisted pairs.

• Cat3 contains four twisted pairs at a rate of three twists per foot. Data transmission speeds are up to 10Mb/second.

• Cat4 cables consist of four twisted pairs of copper wire. Cat4 is capable of speeds up to 16Mb/second.

• Cat5 contains four twisted copper pairs and maxes out at 100Mb/second.

• Cat5e was developed to handle speeds up to 1000Mb/second (1Gb/second).

Page 7: Data comm 2 latest

Cable characteristics• characteristics of UTP (unshielded twisted pair)•  Transmission rate of 10-100 Mbps•  Most susceptible to electrical interference or ‘crosstalk’ but shielding may lessen the impact)

Less expensive than coax or fiber-optic.• Very flexible and easy to work with• Wire type is 22-26AWG• Uses an RJ-45 connector• Ethernet designation is 10baseT

• Shielded twisted pair • (STP) is similar to UTP except it contains a copper braid jacket to ‘shield’

the wires from electrical interference. • It can support transmissions over greater distances than UTP.

Page 8: Data comm 2 latest

• Cat5 UTP cable is a popular choice for network cable because it meets the European standard for allowing data transfer speeds of 100Mbps.

• 100BaseT stands for:

• Data Transmission Rate of 100Mbps, i.e. 100

• Uses baseband transmission, i.e. Base

• The media is twisted pair, i.e. the T.

Page 9: Data comm 2 latest

• Co-axial cable

• Thinnet cable (10Base2)• Thicknet cable (10Base5)

• 10Base2 stands for:• Data Transmission Rate of 10Mbps, i.e. 10• Uses baseband transmission, i.e. Base• Used in Ethernet networks it has a maximum cable length of 185 metres, i.e. the 2

for approximately 200 meters

• 10base5 stands for:• Data Transmission Rate of 10Mbps, i.e. 10• Uses baseband transmission, i.e. Base• Used in Ethernet networks it has a maximum cable length of 500 metres, i.e. the 5

is for 500 meters

Page 10: Data comm 2 latest

Characteristics of co-axial cable

• Transmission rate of about 10 Mbps

• Maximum cable length of 185 meters for Thinnet, 500 meters for  Thicknet

• Good resistance to electrical interference

•  Less expensive than fiber-optics but more expensive than twisted pair.

• Flexible and easy to work with (Thinnet)

• Wire type is 20 AWG for Thinnet (R-58) and 12 AWG for Thicknet.

Page 11: Data comm 2 latest

Characteristics if Fiber optic cable

• Transmission rate of 100 Mbps

•  Cable length of 2 kilometers or more

•  Not affected by electrical interference

• Supports voice, video, and data

• Provides the most secure media

• Most expensive cable

• Not very flexible; difficult to work with

Page 12: Data comm 2 latest

Advantages and Disadvantages

• UTP

•                   PRO: Most flexible; cheapest cable ,easy to install; ·                 CON: Shortest usable cable length; susceptible to electrical interference; unsecured;

• Coaxial Cable

• ·                     PRO: Flexible and easy to install; relatively

• good resistance to electronic interference; electronic support components are relatively inexpensive

• ·                     CON: Short cable length; more expensive than UTP; unsecured; hard to change; 

• Fiber-Optic

• ·                     PRO: Fastest transmission rate; not susceptible to electrical interference; secure;

• ·                     CON: Most expensive; relatively difficult to work with

Page 13: Data comm 2 latest

Criteria for Selection of cable                   • Size - How many nodes (computers) and what are the total distances between

them?

• Cost - What is the budget and how much can be spent on cabling?

• Reliability - How dependent are your organization’s operations on the network?

• Speed - How many concurrent users are there be and how critical is response time?

• Security - How important is it to protect data from possible interception?

• Growth - What are the organization’s plans for growth?

• Administration - How will the network be administered?

• Electrical Interference - What is the physical environment in which the network will operate?

Page 14: Data comm 2 latest

Connecting LAN

• Two or more devices connected together for the purpose of sharing resources or data can form a network

• To increase coverable distance a device is inserted which is repeater or regenerator

• Then for traffic management a device called bridge is inserted

• Linking number of LANs, and to create internet, routers and gateways are inserted

• These four devices interacts with protocol at different layers of OSI model

Page 15: Data comm 2 latest

Connecting LAN

• Repeaters act on electrical component of signal and active at physical layer

• Bridge can affect flow control of single LAN, active at Data Link Layer

• Routers provide links between two separate LAN,active at Network layer

• Gateway provides translation services between incompatible LAN or application and active in all layers

Page 16: Data comm 2 latest

Connecting Devices

Page 17: Data comm 2 latest

Network Components• Repeaters or regenerator is electronic device operate on physical

layer

• Signals carry information within a network can travel a fixed distance before attenuation

• So a repeater is installed on a link that receives a signal before it becomes weak or corrupted and regenerate original bit pattern onto link

• It allows us to extend length of network and it does not change any function of network

• Repeater is not an amplifier: It regenerates the signal

• Whenever it receives a weakened or corrupted signal,It creates a copy for that bit

Page 18: Data comm 2 latest

Repeaters Here station A sends a frame to station B,all stations including (C

and D) receive it So repeater does not have intelligence to keep track of frame from

passing to right when it is meant for left side

Page 19: Data comm 2 latest

Bridge

Page 20: Data comm 2 latest

Bridge It operates in Physical and data link layer

It divides large network in small segment or network

It contains logic to relay frame to intended receiver

It keeps the traffic for each segment separate, so it filter the traffic, control congestion and provide security

Bridges do not modify the content of packet therefore it can be used between segments that use same protocol

When a frame enters a bridge, It checks the address of destination ,compares address with a table of all stations

When it finds a match, It relays a packet to that segment

Page 21: Data comm 2 latest

Routers

Page 22: Data comm 2 latest

Routers• It operates in physical,datalink and network layer

• They have access to network layer addresses and contain software that enables them to determine which path is best for particular transmission

• A packet sent from a station on a neighbouring network goes first to jointheld router, which switches it to destination network

• If there is no router connected to sending and receiving device,the sending router transfer packet across one of its network to next router in direction of destination

Page 23: Data comm 2 latest

Gateways• It operates in all seven layers of OSI model

• It is a protocol converter

• A gateway can accept a packet formatted for one protocol (Appletalk) and convert it to packet formatted for another protocol (TCP/IP) before forwarding it

• It is a software installed within a router

• It understands a protocol used by each network, linked into the router and able to translate from one to another

Page 24: Data comm 2 latest

Gateways

Page 25: Data comm 2 latest

Data communication

Page 26: Data comm 2 latest

Addressing• In computer networking addressing is classified into three

catagories

• Physial Addressing• Logical Addressing/ Network Addressing• Port Addressing

• Through logical address the system identify a network (source to destination).

• After identifying the network physical address is used to identify the host on that network.

• The port address is used to identify the particular application running on the destination machine. 

Page 27: Data comm 2 latest

• Logical Address:•  An IP address of the system is called logical address.

• This address is the combination of Net ID and Host ID.

• This address is used by network layer to identify a particular network (source to destination) among the networks.

• This address can be changed by changing the host position on the network. So it is called logical address. 

• Physical address:

• Each system having a NIC(Network Interface Card) through which two systems physically connected with each other with cables.

• The address of the NIC is called Physical address or mac address.

• This is specified by the manficture company of the card. This address is used by data link layer. 

Page 28: Data comm 2 latest

• Port Address: • There are many application running on the computer.

• Each application run with a port no.(logically) on the computer. This port no. for application is decided by the Karnal of the OS. This port no. is called port address.

• Port numbers are most commonly used with TCP/IP connections..

• These port numbers allow different applications on the same computer to share network resources simultaneously.

• How Port Numbers Work

• Port numbers are associated with network addresses. For example, in TCP/IP networking, bothTCP and UDP utilize their own set of ports that work together with IP addresses.

• In both TCP and UDP, port numbers start at 0 and go up to 65535.

Page 29: Data comm 2 latest

• Network Addressing

• A network address serves as a unique identifier for a computer on a network.

• When set up correctly, computers can determine the addresses of other computers on the network and use these addresses to send messages to each other.

• One of the best known form of network addressing is the Internet Protocol (IP) address.

• IP addresses consist of four bytes (32 bits) that uniquely identify all computers on the public Internet.

• Internet address define three fields: class, net id,host id

Page 30: Data comm 2 latest

• One portion of address indicates network,(netid) and other indicates host or router on network(host id)

• That means that to reach a host on internet we must first reach to the network using first portion of the address then we must reach host using host id

Page 31: Data comm 2 latest

IP address classes

Page 32: Data comm 2 latest

• Class A addresses, indicated by a 0 bit in the first bit of the address

• It has an 8 bit NETID and a 24 bit HOSTID.

• Class A addresses are intended for use in very large networks since the 24 bit HOSTID can uniquely identify over 16 million hosts.

• Class B addresses, indicated by a 1 bit followed by a 0 bit in the first two bits of the address,

• Have a 16 bit NETID and a 16 bit HOSTID. Subnetworks can support up to 65,534 hosts and there are 16,382 possible network

addresses.

Page 33: Data comm 2 latest

• class C addresses, indicated by two 1s followed by a 0 in the first three bits of the address,

• Class C addresses have a 24 bit NETID and an 8 bit HOSTID,

permitting over two million possible network addresses. each subnetwork can support up to 254 hosts

• Class D addresses begin with a digit between 224 and 239, and are used for multicast applications

• Class E addresses begin with a number between 240 and 255 and are used for experimental purposes.

Page 34: Data comm 2 latest

•  multicast is the delivery of a message or information to a group of destination computers simultaneously in a single transmission

• unicast transmission is the sending of messages to a single network destination identified by a unique address

Page 35: Data comm 2 latest

Industry open standard

• Because parallel communication is not prevalent in industrial network,this discussion focusing on serial standards

• EIA(Electronic Industry Assoiation) has developed several recommended standards(RS-xxx) to aid in ease of connection

• The Electronics Industry Association (EIA) has produced standards for RS485, RS422, RS232, and RS423 that deal with data communications

Page 36: Data comm 2 latest

RS-232 RS-232

• Architecturally RS-232 is a bi-directional point to point link

• RS-232 is a standard by which two serial devices communicate.

(serial port - PC side)

Two independent channels are established for two-way (full-duplex) communications.

RS-232 can also carry additional signals used for flow control (RTS, CTS) and modem control (DCD, DTR, DSR, RI).

Page 37: Data comm 2 latest

RS-232 settingsRS-232 settings• One byte of async data has:

– Start Bit = 1 (always)– Data Bits = 8 (or 7)

Stop bits = 1 (or 2) Parity = NONE (or EVEN or ODD)

+ 25

- 25

Page 38: Data comm 2 latest

DB-25 connectors and its pinDB-25M Function

Abbreviation

Pin #1 Chassis/Frame Ground GND

Pin #2 Transmitted Data TD

Pin #3 Receive Data RD

Pin #4 Request To Send RTS

Pin #5 Clear To Send CTS

Pin #6 Data Set Ready DSR

Pin #7 Signal Ground GND

Pin #8 Data Carrier Detect DCD or CD

Pin #9 Transmit + (Current Loop) TD+

Pin #11 Transmit - (Current Loop) TD-

Pin #18 Receive + (Current Loop) RD+

Pin #20 Data Terminal Ready DTR

Pin #22 Ring Indicator RI

Pin #25 Receive - (Current Loop) RD-

Page 39: Data comm 2 latest

DB-9 connectors and pins

DB-9M Function Abbreviation

Pin #1 Data Carrier Detect CD

Pin #2 Receive Data RD or RX or RXD

Pin #3 Transmitted Data TD or TX or TXD

Pin #4 Data Terminal Ready DTR

Pin #5 Signal Ground GND

Pin #6 Data Set Ready DSR

Pin #7 Request To Send RTS

Pin #8 Clear To Send CTS

Pin #9 Ring Indicator RI

Page 40: Data comm 2 latest

RS-232 SignalsRS-232 Signals• Common 25 pin D-shell connector pinout used for

asynchronous data communications.

PinPin SignalSignal1 PGND Protective Ground2 TXD Transmit Data3 RXD Receive Data4 RTS Ready To Send5 CTS Clear To Send6 DSR Data Set Ready7 SG Signal Ground8 CD Carrier Detect20 DTR Data Terminal Ready22 RI Ring Indicator

(serial port - PC side)

Page 41: Data comm 2 latest

Handshaking

• Process of using signals to establish conditional communication

• Process– Transmitter activate RTS

– Receiver senses CTS by interrupt or Polling

– Receiver activate RTS

– Transmitter senses CTS• Transmitter waits until

CTS input is activated

– Transmitter send Data

• DTE (Data Terminal Equipment)– Terminal or Computer

• DCE (Data Communications Equipment)– Modem or Printer

Page 42: Data comm 2 latest

• RS-232 Signal Descriptions• DTR: Data Terminal Ready--Used by a DTE to signal

that it is plugged in and available to begin communication.

• DSR: Data Set Ready--Sister signal to DTR, it is used by the DCE to indicate it is ready to begin communication.

• CTS: Clear to Send--Used by DCE to signal it is available to send data, and used in response to a RTS request for data.

• RTS: Request to Send--Used by a DTE to indicate that it wants to send data.

Page 43: Data comm 2 latest

• DCD: Data Carrier Detect--Used by a DCE to indicate to the DTE that it has received a carrier signal from the modem and that real data is being transmitted.

• RI: Ring Indicator--Used by DCE modem to tell the DTE that the phone is ringing and that data will be forthcoming.

• TxD: Transmit Data--This wire is used for sending data.

• RxD: Receive Data--This line is used for receiving data.

• GND: Signal Ground--This pin is the same for DTE and DCE devices, and it provides the return path for both data and hand-shake signals.

Page 44: Data comm 2 latest

Line drivers and receivers• Line drivers and receivers are commonly used to

exchange data between two or more points (nodes) on a network.

• Reliable data communications can be difficult in the presence of induced noise, ground level differences, impedance mismatches,

• EIA standards where previously marked with the prefix "RS" to indicate recommended standard; however, the standards are now generally indicated as "EIA" standards to identify the standards organization.

Page 45: Data comm 2 latest

• Simplex & Duplex

One of the most fundamental concepts of communications technology is the difference between Simplex and Duplex.

• Simplex can be viewed as a communications "one-way street".

• Data only flows in one direction. That is to say, a device can be a receiver or a transmitter exclusively. A simplex device is not a transceiver.

• A good example of simplex communications is an FM radio station and your car radio.

• Information flows only in one direction where the radio station is the transmitter and the receiver is your car radio.

• Simplex is not often used in computer communications because there is no way to verify when or if data is received.

• However, simplex communications is a very efficient way to distributed vast amounts of information to a large number of receivers. 

Page 46: Data comm 2 latest

• Half Duplex 

• devices have the dubious honor of allowing both transmission and receiving, but not at the same time.

•  Essentially only one device can transmit at a time while all other half duplex devices receive.

• Devices operate as transceivers, but not simultaneous transmit and receive.

• RS485 operates in a half duplex manner.

Page 47: Data comm 2 latest

• Duplex communications overcome the limits of Simplex communications by allowing the devices to act as transceivers.

• Duplex communication data flow in both directions thereby allowing verification and control of data reception/transmission.

• Exactly when data flows bi-directionally further defines Duplex communications.

• Full Duplex devices can transmit and receive data at the same time.

• RS232 is a fine example of Full Duplex communications. There are separate transmit and receive signal lines that allow data to flow in both directions simultaneously.

• RS422 devices also operate Full Duplex.

Page 48: Data comm 2 latest

• RS-232 SERIAL COMMUNICATION OVERVIEW

• Data is typically transmitted between two points either asynchronously or synchronously.

• It is simple, inexpensive to implement, and though relatively slow, it is more than adequate for most simple serial communication devices such as keyboards and mice.

• RS-232 is a single-ended data transmission system, which means that it uses a single wire for data transmission.

• (Since useful communication is generally two way, a two-wire system is employed, one to transmit and one to receive.)

Page 49: Data comm 2 latest

Unbalanced Serial Communications

• Signals are processed by determining whether they are positive or negative when compared with a ground.

• Because signals traveling this single wire are vulnerable to degradation,

• RS-232 systems are recommended for communication over short distances 15m (up to 50 feet) and at relatively slow data rates (up to 20 kbps).

Page 50: Data comm 2 latest

• Unbalanced Serial Communications

• Unbalanced connections use single connectors for each signal and a common ground.

• The signal level is relative to the common GROUND.

• Cheap (fewer pins) but susceptible to 'noise' and hence is almost always lower in speed

• RS-232, V.10 etc are all unbalanced serial connections.

Page 51: Data comm 2 latest

• Unbalanced Line DriversFor example, the transmitted data (TD) from a DTE device appears on pin 2 with respect to pin 7 (signal ground) on a DB-25 connector.

• This voltage will be negative if the line is idle and alternate between that negative level and a positive level when data is sent with a magnitude of ±5 to ±15 volts.

• The RS-232 receiver typically operates within the voltage range of

+3 to +12 and -3 to -12 volts as shown in Figure 1.1.

Page 52: Data comm 2 latest

• Balanced Line Drivers

• In a balanced differential system the voltage produced by the driver appears across a pair of signal lines that transmit only one signal.

• A balanced line driver can also have an input signal called an "Enable" signal. • This signal is to connect the driver to its output terminals, A and B. If the

"Enable" signal is OFF, one can consider the driver as disconnected from the transmission line.

• An RS-485 driver must have the "Enable" control signal.

• An RS-422 driver may have this signal, but it is not always required.

• The disconnected or "disabled" condition of the line driver usually is referred to as the "tristate" condition of the driver.

•  The term "tristate" comes from the fact that there is a third output state of an RS-485 driver, in addition to the output states of "1" and "0".

Page 53: Data comm 2 latest
Page 54: Data comm 2 latest

Industry open standard

• Because parallel communication is not prevalent in industrial network,this discussion focusing on serial standards

• EIA(Electronic Industry Assoiation) has developed several recommended standards(RS-xxx) to help in ease of connection

• The Electronics Industry Association (EIA) has produced standards for RS485, RS422, RS232, and RS423 that deal with data communications

Page 55: Data comm 2 latest

• RS-232 SERIAL COMMUNICATION OVERVIEW

• RS-232 is a standard by which two serial devices communicate.

• It is simple, inexpensive to implement, and though relatively slow, it is more than adequate for most simple serial communication devices such as keyboards and mice.

• RS-232 is a single-ended data transmission system, which means that it uses a single wire for data transmission.

• RS-232 systems are recommended for communication over short distances 15m (up to 50 feet) and at relatively slow data rates (up to 20 kbps).

Page 56: Data comm 2 latest

RS-422

• An RS-232 based system allows only two devices to communicate.

• With RS-422 a master can use one communication line to connect up to 10 slaves.

• It provides a mechanism by which serial data can be transmitted over great distances (to 4,000 ft) and at very high speeds (to 10 Mbps).

• It is a balanced and differential system and It makes system immune to noise and interference

• This is accomplished by splitting each signal across two separate wires in opposite states -- one inverted; the other not inverted.

Page 57: Data comm 2 latest

Balance system

• The difference in voltage between the two lines is compared by the receiver to determine the logical state of the signal.

• It can have multiple receivers but one line driver per twisted pairs of wires

• For full duplex communication two separate channels are used(four wires)

Page 58: Data comm 2 latest

RS-485 RS-485 • It is a balance system It uses tri-state line driver • RS-485 driver has always the “Enable” direction control signal.• This signal is to connect the driver to its output terminals, A and B. If the "Enable"

signal is OFF, one can consider the driver as disconnected from the transmission line.

• Differential system provides noise immunity, because much of the common mode signal can be rejected by the receiver.

• The term "tristate" comes from the fact that there is a third output state of an RS-485 driver, in addition to the output states of "1" and "0".

Page 59: Data comm 2 latest

RS 485

• The standard specifies up to 32 drivers and 32 receivers can share a network

• The third state-high impedence state allows inactive device to sit quietly on network making multiple drops

• With high-impedance drivers / receivers this "limitation" can be extended to hundreds (or even thousands) of nodes on a network.

• When the device is not working ,it goes to high impedence state and does not interfere in transmission

• It provides transmission rates upto 100kbps at 4000ft(1219 m)

Page 60: Data comm 2 latest

EIA-485 Half Duplex• This system links multiple drivers and receivers on same single path• So EIA-485 must have ENABLE pins which enable only one driver

to send data at a time• It allows data transmission in both direction but not at same time• It uses two wires for half duplex system

Page 61: Data comm 2 latest

EIA-485 full Duplex• It is known as four wire network connected in master/slave

configuration• It allows communication in both direction at same time between

master and slave nodes

Page 62: Data comm 2 latest

Manchester encoding• None of ethernet(cable) virsion uses binary encoding with 0 volt for

0 bit and 5 volt for1 bit because it leads to ambiguities

• To solve it by 1 volt for 1 bit and -1 volt for 0 bit

• But there is problem of sampling occurs

• It causes transmitter and receiver to get out of synchronization

• So way is needed for receiver to determine start,end,middle without any reference to external clock

Page 63: Data comm 2 latest

Manchester encoding

0 1 0 0 1 1 0 0 0 1 1

• Always transition in middle of bit period:0 = low-to-high transition1 = high-to-low transition

• Transition at beginning of bit period making ease for receiver to synchronize with sender

• used for 10Mbps ethernet over coax and twisted pair

• good clock recovery, good signal recovery

• inefficient use of bandwidth: 10Mbps ethernet uses a 20Mbps signaling rate!

Page 64: Data comm 2 latest

Differential Manchester

0 1 0 0 1 1 0 0 0 1 1

•0 = transition at beginning of bit period (low-to-high or high-to-low, depending on previous output level) 1 = no transition at beginning of bit period

• same properties as Manchester encoding, but better signal detection and better signal recovery

• inefficient use of bandwidth: 2B signaling for a data rate B

Page 65: Data comm 2 latest

protocol• It is a set of rules that governs the communication system

• Segmentation (fragmentation) and re-assembly

• Each protocol has to deal with the limitations of the PDU (protocol data unit) or packet size associated with the protocol below it.

• For example, the Internet protocol (IP) (layer 3) can only handle 65 536 bytes of data, hence the transmission control protocol (TCP) (layer 4) has to segment the data received from layer 5 into pieces no bigger than that.

• IP (layer 3), on the other hand, has to be aware that Ethernet (layer 2) cannot accept more than 1500 bytes of data at a time and has to fragment the data accordingly.

• Obviously, the data stream fragmented by a protocol on the transmitting side has to be re-assembled by its corresponding peer on

the receiving side

Page 66: Data comm 2 latest

• Encapsulation:

• Each protocol has to handle the information received from the layer above it

• For example, the information passed on to IP (layer 3) could contain a TCP header (layer 4) plus an FTP header (layers 5, 6, 7) plus data from an FTP client (e.g. Cute FTP).

• IP simply regards this as a package of information to be forwarded, adds its own header with the necessary control information, and passes it down to the next layer

Page 67: Data comm 2 latest

protocol• It is a set of rules that governs the communication system

• Segmentation (fragmentation) and re-assembly

• Each protocol has to deal with the limitations of the PDU (protocol data unit) or packet size associated with the protocol below it. For example, the Internet protocol (IP) (layer 3) can only handle 65 536 bytes of data, hence the transmission control protocol (TCP) (layer 4) has to segment the data received from layer 5 into pieces no

bigger than that. • IP (layer 3), on the other hand, has to be aware that Ethernet• (layer 2) cannot accept more than 1500 bytes of data at a time and

has to fragment the data accordingly. The term ‘fragmentation’ is normally associated with layer 3, whereas the term ‘segmentation’ is normally associated with layer 4.

• Obviously, the data stream fragmented by a protocol on the transmitting side has to be re-assembled by its corresponding

peer on the receiving side

Page 68: Data comm 2 latest

• Connection control:

• Some layer protocols such as TCP create logical connections with their peers on the other side.

• For example, when browsing the Internet, TCP on the client (user) side has to establish a connection with TCP

on the server side before a web site can be accessed.

• there are mechanisms for terminating the connection as well.

Page 69: Data comm 2 latest

• Ordered delivery:

• Large messages have to be cut into smaller fragments, but on a packet switching network,

• the different fragments can theoretically travel via different paths to their destination.

• This results in fragments arriving at their destination out of sequence, which creates problems in rebuilding the original message.

• protocols use different mechanisms, including sequence numbers and fragment offsets.

Page 70: Data comm 2 latest

• Flow control

• In simple protocols, this is accomplished by a lock-step mechanism (i.e. each packet sent needs to be acknowledged before the next one can be sent) or XON/XOFF

• mechanisms where the receiver sends an XOFF message to the sender to pause transmission,

• then sends an XON message to resume transmission.

• More sophisticated protocols use ‘sliding windows’.

Page 71: Data comm 2 latest

• Error control:-

• The sender needs some mechanism by which it can confirm if the data received is the same as the data sent.

• This is accomplished by performing some form of checksum on the data to be transmitted, including the checksum in the header or in a trailer after the data.

• Types of checksum include CRC

Page 72: Data comm 2 latest

• Addressing• Protocols at various levels need to identify the physical

or logical recipient on the other side. • Layer 4 protocols such as TCP and UDP use port

numbers.• Layer 3 protocols use a protocol address (such as the

IP address for the Internet protocol) and • Layer 2 protocols use a hardware (or ‘media’) address

such as a station number or MAC address.

Page 73: Data comm 2 latest

• Routing: • In an internetwork, i.e. a larger network consisting of two

or more smaller networks interconnected by routers,• the routers have to communicate with each other in

order to know the best path to a given destination on the

network. • This is achieved by routing protocols (RIP, OSPF, etc.)

residing on the routers. RIP – routing information protocol,OSPF – open shortest path first

Page 74: Data comm 2 latest

• Ingress protection

• It describes the degree of protection offered by an enclosure.

• This enclosure can be of any description, including a cable, cable assembly, connector body, the casing of a network hub, or a large cabinet used to enclose electronic equipment.

• Enclosures are rated in the format ‘IP xy’ or ‘IP xyz’.

• (x) describes the degree of protection against access to hazardous parts

• (y) designates the degree of protection against water.

• (z) describes the degree of protection against mechanical impacts and is often omitted. It does, e.g. apply to metal enclosures but not to cables or cable assemblies.

• Here follows a list of meanings attributed to the digits of the IP rating.

Page 75: Data comm 2 latest
Page 76: Data comm 2 latest

• For example, a marking of IP 68 would indicate a dust tight (first digit = 6) piece of equipment that is protected against submersion in water (second digit = 8).

Page 77: Data comm 2 latest

MODBUS• MODBUS Serial Line protocol is a Master-Slave protocol. This protocol takes place at level 2 of the OSI model.

• A master-slave type system has one node (the master node) that issues commands to one of the "slave" nodes and processes

responses. • Slave nodes will not typically transmit data without a request from

the master node, and do not communicate with other slaves.

• MODBUS application layer messaging protocol, positioned at level 7 of the OSI model, provides client/server communication between

devices connected on buses or networks. • On MODBUS serial line the client role is provided by the Master of

the serial bus and the Slaves nodes act as servers.

• slave is any peripheral device (I/O transducer, valve, network drive, or other measuring device),

Page 78: Data comm 2 latest

• Client server Architecture

• The client (on the master device) initiates a request. • The MODBUS messaging protocol (layer 7) then generates a protocol data

unit or PDU, consisting of a function code and a data request.

• At layer 2, this PDU is converted to an application data unit (ADU) by the addition of some bus or network related fields, such as a slave address and a checksum for error detection purposes

• The server (on the slave device) then performs the required action and initiates a response

Page 79: Data comm 2 latest

• ADDRESS field

• On MODBUS Serial Line, the Address field only contains the slave address which are in the range of 1 – 247.

• A master addresses a slave by placing the slave address in the address field of the message.

• When the slave returns its response, it places its own address in the

response address field to let the master know which slave is responding.

• Function code

• Indicates to the server what kind of action to perform. The function code can be followed by a data field that contains request and response parameters.

Page 80: Data comm 2 latest

Transmission Mode

• Transmission mode defines bit definitions of message bytes & method of packing & decoding the message information into message stream

• ASCII transmission mode : • RTU transmission mode (Remote terminal unit)

Page 81: Data comm 2 latest

• The format for each byte ( 11 bits ) in RTU mode is :

• Coding System: 8–bit binary• Bits per Byte: 1 start bit • 8 data bits, least significant bit sent first • 1 bit for parity completion • 1 stop bit • each 8–bit byte in a message is sent as two ASCII characters. The

main advantage of this mode is that it allows time intervals of up to

one second to occur between characters without causing an error.

Page 82: Data comm 2 latest
Page 83: Data comm 2 latest

• A MODBUS message is placed by the transmitting device with starting and Ending point.

• In RTU mode, message frames are separated by a silent interval of

at least 3.5 character times.

• If a silent interval of more than 1.5 character times occurs between two characters, the message frame is declared incomplete and

should be discarded by the receiver.

Page 84: Data comm 2 latest

• MODBUS ERROR CHECKING

• MODBUS networks employ two methods of error checking: • 1. Parity checking of the data character frame (even, odd, or no

parity) • 2. Frame checking within the message frame (Cyclical Redundancy

Check in RTU Mode, or Longitudinal Redundancy Check in ASCII Mode).

• Parity Checking

• A MODBUS device can be configured for even or odd parity, or for no parity checking.

• If even or odd parity checking is selected, the number of 1 bits in the data portion of each character frame is counted.

• Each character in RTU mode contains 8 bits.

• The parity bit will then be set to a 0 or a 1, to result in an even (even parity), or odd (odd parity) total number of 1 bits.

Page 85: Data comm 2 latest

CRC Error Checking (RTU Mode Only) • The CRC value is calculated by the transmitting device, which

appends the CRC to the message.

• The receiving device recalculates a CRC during receipt of the message, and compares the calculated value to the actual value it received in the CRC field.

• If the two values are not equal, an error results.

• Placing the CRC into the Message

• When the 16–bit CRC (two 8–bit bytes) is transmitted in the message, the

low-order byte will be transmitted first, followed by the high-order byte.

• For example, if the CRC value is 1241 hex (0001 0010 0100 0001):

Page 86: Data comm 2 latest

ASCII MODE

• Remark : this mode is less efficient than RTU since each byte needs two characters.

• Example : The byte 0X5B is encoded as two characters : 0x35 and 0x42 ( 0x35 ="5", and 0x42 ="B" in ASCII ).

• The format for each byte ( 10 bits) in ASCII mode is : • Coding System: Hexadecimal, ASCII characters 0–9, A–

F • Bits per Byte: 1 start bit • 7 data bits, least significant bit sent first • 1 bit for parity completion; • 1 stop bit

Page 87: Data comm 2 latest

• The address field of a message frame contains two characters. • In ASCII mode, a message is delimited by specific characters as

Start-of-frames and End-of-frames.

• A message must start with a ‘colon’ ( : ) character (ASCII 3A hex), and end with a ‘carriage return – line feed’ (CRLF) pair (ASCII 0D and 0A hex).

• The devices monitor the bus continuously for the ‘colon’ character. When this character is received, each device decodes the next character until it detects the End-Of-Frame.

Page 88: Data comm 2 latest

LRC Longitudinal Redundancy Check

• The Longitudinal Redundancy Check (LRC) field is one byte, containing an 8–bit binary value.

• The LRC value is calculated by the transmitting device,

which appends the LRC to the message.

• The receiving device recalculates an LRC during receipt of the message, and compares the calculated value to the actual value it received in the LRC field.

• If the two values are not equal, an error results.

Page 89: Data comm 2 latest

LRC Longitudinal Redundancy Check (ASCII Mode Only)

• Placing the LRC into the Message• When the the 8–bit LRC (2 ASCII characters) is transmitted in the

message, the high–order character will be transmitted first, followed by the low–order character.

• For example, if the LRC value is 61 hex (0110 0001):

Page 90: Data comm 2 latest
Page 91: Data comm 2 latest
Page 92: Data comm 2 latest

Data Addresses in Modbus Messages

• All data addresses in Modbus messages are referenced to zero.

• The coil known as ‘coil 1’ in a programmable controller is addressed as coil 0000 in the data address field of a Modbus message.

• Coils are addressed starting at zero: coils 1–16 are addressed as 0–15.

• Holding register 40001 is addressed as register 0000 Holding register 40108 is addressed as register 006B hex (107 decimal).

Page 93: Data comm 2 latest

• When a message is sent from a master to a slave device the function code field tells the slave what kind of action to perform.

• Examples are to read the ON/OFF states of a group of discrete coils or inputs; to read the data contents of a group of registers; to allow loading, recording, or verifying the program within the slave.

• When the slave responds to the master, it uses the function code field to indicate either a normal (error–free) response or that some kind of error occurred.

• For a normal response, the slave simply echoes the original function code. For an exception response, the slave returns a code that is equivalent to the original function code with its most–significant bit set to a logic 1.

Page 94: Data comm 2 latest

• For example, a message from master to slave to read a group of holding registers would have the following function code:

• 0000 0011 (Hexadecimal 03)

• If the slave device takes the requested action without error, it returns the same code in its response. If an exception occurs, it returns:

• 1000 0011 (Hexadecimal 83)

Page 95: Data comm 2 latest

• The data field of messages sent from a master to slave devices contains additional information which the slave must use to take the action defined by the function code.

• To Read coil(function code 01) the data field of the request consists of the relative address of the first coil followed by the number of coils to be read.

• The data field of the response frame consists of a count of the coil bytes followed by that many bytes of coil data.

Page 96: Data comm 2 latest

01 Read Coil Status (query and Response)• Query• The query message specifies the starting coil and quantity of coils to

be read.• Coils are addressed starting at zero: coils 1–16 are addressed as

0–15.• Here is an example of a request to read coils 20–56(37 decimal)

from slave device 17:

Page 97: Data comm 2 latest

• Response• Status is indicated as: 1 = ON; 0 = OFF.

• The LSB of the first data byte contains the coil addressed in the query. The other coils follow from ‘low order to high order’ in subsequent bytes.

• If the returned coil quantity is not a multiple of eight, the remaining bits in the final data byte will be padded with zeros (toward the high order end of the byte).

Page 98: Data comm 2 latest

• The status of coils 27–20 is shown as the byte value CD hex, or binary 1100 1101.

• Coil 27 is the MSB of this byte, and coil 20 is the LSB. Left to right, the status of coils 27 through 20 is: ON–ON–OFF–OFF–ON–ON–OFF–ON.

• In the last data byte, the status of coils 56–52 is shown as the byte value 1B hex,or binary 0001 1011. Coil 56 is in the fourth bit position from the left, and coil 52 is the LSB of this byte.

• The status of coils 56 through 52 is: ON–ON–OFF–ON–ON.

• Note how the three remaining bits (toward the high order end) are zero–filled.

Page 99: Data comm 2 latest

Modbus Plus Protocol

• Modbus Plus protocol was developed to overcome the ‘single-master’ limitation prevalent in the Modbus Protocol.

• Modbus Plus is a local area network system for industrial control applications.

• Networked devices can exchange messages for the control and monitoring of processes at remote locations in the industrial plant.

• The Modbus Plus protocol topography allows for up to 64 devices on a network segment.

• Multiple networks segments may be bridged together to form wide network

Page 100: Data comm 2 latest

Network Terminology• Network:- It is a grouping of nodes connecting on a common

path and is accessed by passing a token

Page 101: Data comm 2 latest

• Section:-A section is a series of nodes that are joined only by cable segments.

• Here the repeater joins two sections. Each section can be up to1500 ft

(450 m) long and can contain up to 32 physical node connections.• Cable segment:- A cable segment is a single length of trunk

cable between two taps.

• Token: A token is a grouping of bits that is passed in sequence from one device to another on a single network, to grant access for sending messages.

• If 2 networks are joined by a bridge plus, each network has its own token that is passed only among the devices on that network.

Page 102: Data comm 2 latest

• Node:-• A node is any device that is physically connected to the

Modbus Plus cable. • Some nodes, like programmable controllers, have

addresses and can serve as sources or destinations for messages.

• The repeater is a node on each of 2 sections, but has no address, serving only to extend the length of cable

Page 103: Data comm 2 latest

• Physical Network• Each network supports up to 64 addressable node

devices.

• The network bus consists of twisted-pair shielded cable that is run in a direct path between successive nodes.

• The network consists of one or more cable sections, with any section supporting up to 32 nodes at a maximum cable distance of 1500 ft (450 m).

• Repeaters can extend the cable distance to its maximum of 6000 ft (1800 meters) and the node count to its maximum of 64.

• Fiber optic repeaters are available for longer distances.

Page 104: Data comm 2 latest

Physical Network• The minimum cable length between any pair of nodes must be at

least 10 ft (3 m).

• The maximum cable length between two nodes is the same as the maximum section length of 1500 ft (450 m).

• On dual-cable networks, the cables are known as cable A & cable B. Each cable can be up to 1500 ft (450 m) long, measured between the two extreme end devices on a cable section.

• The difference in length between cables A and B must not exceed 500 ft (150 m),measured between any pair of nodes on the cable section.

• Nodes are connected to the cable by means of a tap device

Page 105: Data comm 2 latest
Page 106: Data comm 2 latest

Logical Network• The token is a grouping of bits that is passed in a rotating address

sequence from one node to another.• While holding the token, a node initiates message transactions with

other nodes.• Each message contains routing fields that define its source and

destination,including its routing path through bridges to a node on a remote network

Page 107: Data comm 2 latest

• While a node holds the token, it sends its application messages if it has any to transmit.The other nodes monitor the network for incoming messages.

• When a node receives a message, it sends an immediate acknowledgment to the originating node.

• If the message is a request for data, the receiving node will begin assembling the requested data into a reply message.

• When the message is ready, it will be transmitted to the requestor when the node receives a subsequent token granting it access to transmit.

• After a node sends all of its messages, it passes the token on to the next node. Protocols for token passing and messaging are transparent to the user application.

Page 108: Data comm 2 latest

GPIB(General purpose interface bus)• The GPIB bus was invented by Hewlett-Packard Corporation in 1974

to simplify the interconnection of measuring instruments with computers.

• the GPIB standard was adopted by theInstitute for Electrical and Electronic Engineers (IEEE) and is referred as the

IEEE 488 bus.

• The devices that are connected to this bus fall into three categories: controller, listener and talker

• Controller manages the flow of information over the bus

• A GPIB Digital Voltmeter is acting as a Listener as its input configurations and ranges are set, and then as a Talker when it actually sends its readings to the computer.

• A printer will act as listener only because it will only need to accept data to print out on the paper

Page 109: Data comm 2 latest

GPIB

General Purpose Interface Bus (GPIB)

GPIB-USB GPIB-RS232 GPIB-PCI

Page 110: Data comm 2 latest

Instrument Control OverviewControl any instrument if you know the following:– Type of connector on the instrument − Type of cables needed– Electrical properties involved − Communication protocols used– Software drivers available

Instruments Computer

Page 111: Data comm 2 latest

GPIB Communication

GPIB Instruments

GPIB Cable

GPIB Interface

Page 112: Data comm 2 latest

GPIB Hardware Specifications

• Max cable length between devices = 2 m • Max cable length = 20 m• Max number of devices = 15

1

12

13

24

DIO5DIO6DIO7DIO8RENGND (TW PAIR W/DAV)GND (TW PAIR W/NRFD)GND (TW PAIR W/NDAC)GND (TW PAIR W/IFC)GND (TW PAIR W/SRQ)GND (TW PAIR W/ATN)SIGNAL GROUND

DIO1DIO2DIO3DIO4EOIDAV

NRFDNDAC

IFCSRQATN

SHIELD

It is 24 conductor parallel busThe GPIB uses an eight-bit parallel, byte-serial, asynchronous data transfer scheme.

Page 113: Data comm 2 latest

• DATA LINES• DIO1 through DIO8 are the data transfer bits. Most GPIB systems

send 7-bit data and use the eight bit as a parity

• HANDSHAKING LINES

• NRFD (Not Ready For Data): this is used to indicate the readiness (or lack thereof) of a device to accept data

• DAV (Data Valid): This is used to indicate to receiving devices that data has been placed on the bus and is available to read.

• NDAC (Not Data Accepted): is asserted by the receiving device to indicate that data has been read and may now be removed from the bus

Page 114: Data comm 2 latest

IEEE488 Data Bus Transfer Timing

Page 115: Data comm 2 latest

• SYSTEM MANAGEMENT LINES

• ATN (Attention): is used by the controller to specify how data on the DIO lines is interpreted and which devices must respond to the data

• IFC (Interface Clear): is used by the system controller to reset the bus . This is used when system needs resetting

• REN (Remote Enable): is used by the controller in conjunction with other messages to place a device on the bus into either remote or local mode

• SRQ (Service Request): is used by a device on the bus to indicate

the need for attention so when this line goes low it indicates the device wants to interrupt current activity

• EOI (End or Identify): Is used by Talkers to indicate the end of a

message string, or is used by the Controller to command a polling sequence.

Page 116: Data comm 2 latest

GPIB configuration

Page 117: Data comm 2 latest
Page 118: Data comm 2 latest

• Advantages

• Simple hardware interface• Ease of connecting multiple device to a single host• Allows mixing of slow and fast devices• Well-established and mature, widely supported

• Disadvantages

• Mechanically bulky connectors and cables• Limited speed and expansion• implementation options (e.g. end of transmission handling) can

complicate interoperability in pre-IEEE-488.2 devices• High cost (compared to RS-232/USB/Firewire/Ethernet)• Limited availability (again compared to

RS-232/USB/Firewire/Ethernet)