370 likes | 484 Views
Phones OFF Please. Layer 1: The Physical Layer Digital Encoding Schemes Parminder Singh Kang Home: www.cse.dmu.ac.uk/~pkang Email: pkang@dmu.ac.uk. Topics :. Need of Synchronization. Clocks. Bit Synchronization. (NRZ, Manchester Encoding, Differential Manchester Encoding)
E N D
Phones OFF Please Layer 1: The Physical Layer Digital Encoding Schemes Parminder Singh Kang Home: www.cse.dmu.ac.uk/~pkang Email: pkang@dmu.ac.uk
Topics: • Need of Synchronization. • Clocks. • Bit Synchronization. (NRZ, Manchester Encoding, Differential Manchester Encoding) • Asynchronous Transmission (RS232) • Synchronous Transmission. (Bit Synchronisation, Frame Synchronisation, X25) • Multiplexing. • ADSL. • Connecting to Internet.
1. Need of Synchronisation? 1.1 How can 0’s and 1’s be represented over physical media? • Using particular voltage level. • Note: Sender and Receiver must agree on same voltage level. 1.2 when sender and receiver are agree on same voltage level. Why Synchronisation? • Frame Synchronisation: • To find the start and End of Frame. • Frame represents a message or sequence of characters send from one computer to another .
Bit Synchronisation: • A transmitter sends a stream of bits (as below) at a particular rate in bits per second. • how does the receiver know: • what the bit rate is - how many bits are transmitted per second (bits/sec) ? • when to read a bit value? Q: Meaning of Frame at Physical Layer?
2. Clocks Transmitters and receivers contain electronic clocks which are used to time the transmission and reception of data. These clocks must be synchronised so that bits are transmitted and received at the same rate Problem: If sender and receiver clocks are not in Synchronisation, then receiver receives bit incorrectly. e.g. Sender is working at 100 bits/sec and receiver is working at 101 bits/sec.
3. Bit Synchronisation • There are three methods Defined for Bit Synchronization. • 3.1 Non-Return-to-Zero (NRZ) • A 1’s and 0’s is represented by a specified voltage levels. • e.g. bit pattern1001110110
Bit synchronisation problem :- • Imagine encoding of a sequence of 1s using NRZ how many bits? how do we know when one bit ends and another starts? • Bandwidth Needed :- • To send data at 2Mbps, how rapidly must the signal change? • Answer: Max. 2 million times per second
3.2 Manchester Encoding • Every code includes a transition at the centre of each interval. • i.e. • bit one is represented by transition from low to high and bit zero is represented by high to low transition. • Transition always takes place at centre of bit. • Implementation example: Ethernet. • Note: that some books show the transitions the other way around – not critical so long as both transmitter and receiver agree.
Hence, Midbit transition serves as a clocking mechanism and also as as data. e.g. 1001110110
Advantage: Each bit has a transition in the middle which the receiver uses for synchronisation, i.e. synchronisation is built into the encoding scheme. Disadvantage: To send data at 2 Mbps, how rapidly might the signal have to change? Answer: 4 million times per second Hence, More demanding than NRZ
3.3 Differential Manchester Encoding • Starting at the current voltage level: • If the next bit is a 1 - no transition at the start of the next bit. • If the next bit is a 0 - move to the opposite level for the start of the next bit. • Hence, Midbit transition represents clock and start bit transition or no transition represents data. • Implementation Example: Token Ring.
Advantage: Each bit has a transition in the middle which the receiver uses for synchronisation, i.e. synchronisation is built into the encoding scheme. Disadvantage: More demanding than NRZ
4. Asynchronous Transmission • no common timing mechanism: • Sender and Receiver operate 2 separate clocks. • Clock speeds depend upon the baud-rates set at each end. • Sending interface sends out signals at times controlled by its sending clock. • Receiver must try and sample the incoming bit as near to the centre of the bit-cell as possible. • Receiving interface waits for a transition on the line and its clock begins to tick , e.g. at 16x baud-rate. • After 8 ticks the signal is read • After another 16 ticks the signal is read again
What might happen after a short time? • the clocks will soon drift out of synch. • hence is only used for small amounts of data, i.e. character. • Solution: • clocks need re-synchronising regularly. • NOTE: • NRZ mechanism is used in Asynchronous transmission. • Asynchronous Transmission is used to send small data streams (I.e. from 5 to 8 bits of data). • Hence, receiver can re-synchronise at the beginning of new stream.
4.1 Example: RS232 asynchronous format RS232 is used to transmit characters and uses NRZ signal encoding • when idle (no signal) line is at logic 1. • start bit (0) indicates start of transmission (is used by receiver to start it’s clock). • data bits follow, e.g. a 7 bit ASCII character and a parity bit P. • a stop bit (1) terminates transmission
In a sequence of characters the stop bit separates the last data bit (which may be 0 or 1) from the next start bit (a 0) • Bit synchronisation: is provided by the 1 to 0 transition of the start bit • Frame synchronisation: is provided by the start and stop bits. • Advantage: • Simple to implement. • No clocking mechanism required. • Disadvantage: • wastage of bandwidth. (In RS232 10 bits are required to send 8 bits). • resynchronisation required at the beginning of new stream.
5. Synchronous Transmission • Synchronous transmission represents clocking mechanism between the sender and receiver. • For Successful transmission clocks must be in sink. • Implementation: • providing separate clock line between sender and receiver. • Hence, both sender and receiver are synchronized by separate clock line. • This technique works fine with shorter distances. • Problem with this technique? • Cost of extra clocking line. • Timing delay for longer distances. • Timing error due to noise or signal corruption. • Solution?
5.1 Bit Synchronisation • Bit Synchronization is achieved by using Manchester or Differential Manchester Encoding. • Hence, Sender embeds timing information in data stream. • Receiver uses this to synchronise its clock with the sender and read the line at the correct intervals. • Sender and Receiver should remain in synchronisation since they are both using the same timing mechanism. • 5.2 Frame Synchronisation • There are various ways to delimit a frame, common techniques are: • fixed length frames – used in ATM • bit stuffing – start and end flags (a particular bit pattern) delimit frame – used in X25 and frame relay.
Start Flag Block of Data CRC check End Flag • NOTE: • Manchester and Differential Manchester Encoding techniques are used for bit synchronization in Synchronous transmission. • Synchronous transmission is used to send much larger blocks of data in the frame. • 5.3 Example (X.25) • Start and end flag is bit pattern 01111110 • There will be a problem if this bit sequence actually occurs in the data portion of the frame. • Bit stuffing (see Appendix A) is used to ensure data transparency (that the pattern does not occur in the data portion).
Bit Stuffing: Bit Stream: 01111110 00101011011111111001111110110011 01111110 Insert bit 0 to avoid flag. Resulting Bit Stream: 01111110 0010101101111101110011111010110011 01111110
6. Multiplexing Need: Running individual lines between systems leads to complex and expensive wiring.
Practical implementation: • Long haul and Back bone links. • High capacity links support large number of voice and data calls using multiplexing.
Definition: Multiplexing is the transmission of multiple data communication sessions over a common wire or medium.
6.1 Time division multiplexing • Time is divided into fixed periods or slots with each terminal allocated a specified time slot in sequence (with a gap between them). • e.g. a 100 Kbit/sec line could be used by ten terminals transmitting data at 10 Kbits/sec. • The multiplexor at each end switch between the lines giving each line a time slot to transmit data. • Disadvantage: wastage of Channel when terminal is not sending.
6.2 Statistical time division multiplexing • Statistical TDM overcome the drawback of TDM. • Hence, when terminal is not active then time slot can be allocated to other terminal. • i.e. only terminals needing to send data are allocated a time slot. • Multiplexor is sufficiently intelligent to determine if a terminal is idle. • Implementation: • Terminal can send end frame to notify multiplexor. • Multiplex can wait for random amount of time before assuming that terminal is idle.
6.3 Frequency division multiplexing • The frequency bandwidth is divided up into a number of bands or channels separated by guard bands to avoid any overlap. • Each device is then given the use of a channel on which to transmit its data. • e.g. if a terminal needed a bandwidth of 10KHz to transmit its data a 100KHz line could carry ten channels, terminal 1 using 0 to 10KHz, terminal 2 using 10 to 20KHz, etc.
7. ADSL (Asymmetric Digital Subscriber Line ) • ADSL converts existing telephone lines into high-speed connections between a house and an ISP by using Discrete Multitone (DMT) modulation. • DMT uses frequencies above the voice band to carry data.
The ANSI DMT standard specifies: • up to 255 4.3125 KHz channels (also called bins), each with a 4 KHz symbol rate. • Channel 1 starts at zero frequency (0 - 4.3 KHz) – used for telephone. • Upstream (to ISP) can use channels 6 to 38 (~25 - 163 KHz). • Downstream (from ISP) can use channels 33 to 255 (~142 KHz to 1.1MHz). • Channels 16 (69 KHz) and 64 (276 KHz) are used for pilot tones. • It's called Asymmetric because it allows the downstream connection (from ISP) to be much faster than the upstream. • e.g. for a 500kbit/s downstream rate, the upstream rate can be anything from 64kbit/s to 256kbit/s depending on distance to the telephone exchange and the quality of the telephone line.
Note: • Echo cancellation technique is used to increase the downstream rate. • Filters are required to separate the telephone and modem signals,
8. Connecting to the Internet • There are various ways of connecting to the internet. • 1. A computer can act as a gateway being connected to the internet (e.g. via an ADSL modem). • This computer would have a firewall and control access. • Other computers connect via this computer either directly using extra network cards or through a network hub or router. • 2. Alternatively, a network hub or router connects to the internet with the computers connected to the router. Each computer would need its own firewall.
8.1 IP (Internet Protocol) addresses, Domain names and ports • IP address: • A computer on a TCP/IP network has to have an IP address so packets can be sent to it properly. • e.g. DMUs main email server has IP address 146.227.1.2 • 2. Domain Names: • Numbers are hard for humans to remember, so we have domain names • 3. Port Numbers: • Individual applications running on a machine are referred to by a port identifier in packets. • The port identifier and IP address together enable a message to be routed to a particular application on a particular machine. • Well-known port numbers on the server side of a connection include 20 (FTP data transfer), 21 (FTP control), 23 (Telnet) and 80 (HTTP).
8.2 DHCP (Dynamic Host Configuration Protocol) • A machine can have a static IP address which is the same each time it connects. • or a dynamic address which is assigned when it connects to the Internet. (and can be different each time). • DHCP is the protocol for assigning dynamic IP addresses – the ISP has a range of IP addresses available which are assigned when devices connect and become free on disconnection.
8.3 NAT (Network Address Translation Protocol) • An organisation may be assigned one IP address (or a small number) yet have many machines. • e.g. an domestic ADSL line is assigned one IP address yet a house may have four or five PCs. • NAT is an Internet standard that enables a LAN to use one set of IP addresses for internal traffic and a second set of addresses for external traffic. • A NAT box located where the LAN meets the Internet makes all necessary IP address translations. • For example, IP addresses in the range 192.168.0.1 to 192.168.255.255 (65536 addresses) are assigned for internal network use and may not appear on the internet itself.
Working: • When an outgoing packet arrives at the NAT: • the source IP address (say 192.168.0.4) is replaced by the organisations true IP address. • the source port (say 5000) is replaced by an index (say 1025) into a table in the router and the source IP address and port are stored into the table. • The packet is then sent to the Internet. • When an incoming packet is received by the NAT: • the destination port (1025) is extracted and used as an index into the table. • the local IP address (192.168.0.4) and port (5000) are extracted and put into the packet. • the packet is sent to the correct process on the correct local machine.
Advantage: • machines can access internet without having public IP address. • Because internal IP addresses are hidden NAT also provides a type of firewall in that unsolicited packets arriving at the NAT are rejected. • Note: • in a secure environment additional firewalls should be implemented. • The exception to this is when machines on the internal network run servers which must be accessed from outside. • Port Redirection is used which will pass packets for a particular destination port to a specified machine on the network. • e.g. if 192.168.0.4 is running a HTTP server (WWW) packets arriving at the NAT for port 80 will be sent to port 80 on 192.168.0.4.