Presentation is loading. Please wait.

Presentation is loading. Please wait.

Institute for Experimental Mathematics Ellernstrasse 29 45326 Essen - Germany packet transmission A.J. Han Vinck January 19, 2010.

Similar presentations


Presentation on theme: "Institute for Experimental Mathematics Ellernstrasse 29 45326 Essen - Germany packet transmission A.J. Han Vinck January 19, 2010."— Presentation transcript:

1 Institute for Experimental Mathematics Ellernstrasse 29 45326 Essen - Germany packet transmission A.J. Han Vinck January 19, 2010

2 University Duisburg-Essendigital communications group A.J. Han Vinck Packets (1) Information is often transmitted in packets –Fixed or variable length bursty continuous Important to know time interval : – for an information symbol on bit level – for an information symbol on character level – block or message level (start of frame or packet )

3 University Duisburg-Essendigital communications group A.J. Han Vinck Start of packets flag Flag data 1 0 1 1 0 1 0 1 * * * Flag may not may not occur in other positions chosen according to some rule

4 University Duisburg-Essendigital communications group A.J. Han Vinck Bit stuffing Avoid flag in the packet: –Insert stuffing bit at fixed positions in packet –Insert stuffing bit if necessary only k+2 Example:01110>101>0>111>1>000>0>110fixed 01110>1011>0>11>0>00011>0>0 variable Fixed: after every k data bits insert stuffing bit Redundancy = 1/(k+1) Variable: After observing 011 insert 0 In general, insert 0 after observing 01 k-1 Homework: proof that this is a correct way

5 University Duisburg-Essendigital communications group A.J. Han Vinck detection After k-1 1‘s check next bit(s) If 0 remove it (stuffed bit) If 10, end of frame marker (011...10) If 11, error detected ( k 1‘s not allowed )

6 University Duisburg-Essendigital communications group A.J. Han Vinck Some standards CANafter 00000 insert 1 after 11111 insert 0 HDLC 01111110 as flag after 5 1‘s insert a 0 X25111111 may not occur in frame insert 0 after 5 1‘s 802.1180 bits: 010101... 16 bits start of frame: 0000 1100 1011 1101

7 University Duisburg-Essendigital communications group A.J. Han Vinck Efficiency fixed length packets Packet of length N has –k+2 + (N-(k+2))/(k+1) stuffing bits Minimizing with respect to redundancy gives k   N, minimum redundancy R min  2  N. Example: for N = 1024, K = 23; R min = 64

8 University Duisburg-Essendigital communications group A.J. Han Vinck Variable length packets Rule: stuffing only when necessary! For FLAG: 01 k 0 and Random data P(0) = P(1) = ½ the redundancy R  k+2 + (N-(k+2)) / 2 k is minimized for k  log 2 N  log 2 N + 1 stuff bits per packet! 00 Ex: 01110|1011101011100|:= 01110|101101010110110| Homework: use a Markov state diagram to find R

9 University Duisburg-Essendigital communications group A.J. Han Vinck Calculations of average length Generate 0 and 1 with probability ½ average redundancy = P(k-1)=1/(2 k –1) Very important for practical applications: how far away from optimal? 1 1 1 0 0 0 0 1 2 k-1

10 University Duisburg-Essendigital communications group A.J. Han Vinck At receiver LOOK for FLAG in BITSTREAM –For fixed length: remove stuffed bits –For variable length, parse for 1 k-1 0, remove the 0 –due to transmission errors Flag may appear in packet Flag may disappear CRC might be correct!

11 University Duisburg-Essendigital communications group A.J. Han Vinck Synchronization with correlation Strategy: locate a flag in the data stream –Pass the received digits through a „correlator“ compare 1 1 1 0 0 1 0 –Example: ESA uses 11101011100100000 Test N positions One must be the correct one

12 University Duisburg-Essendigital communications group A.J. Han Vinck What can happen? Errors may distroy the flag –01111110  01101110 Errors may cause a flag to appear in the packet –01111100  01111110 Errors may increase or decrease the packet length (this has a strong influence on the CRC) –01111000  01111100  0111110-1 –01111100  01011100 +1

13 University Duisburg-Essendigital communications group A.J. Han Vinck A rule Packets consist of : k+2 flag-digits and N-(k+2) random data RULE RULE: -for N subsequent possible starting positions, find the position m = u; 1  u  N which maximizes the number of agreements with the flag

14 University Duisburg-Essendigital communications group A.J. Han Vinck An example: Calculate # of agreements = minimize Hamming distance Example:Barker 7 = 1110010 + + 1 1 1 0 0 1 0 + + + + worst case best case 1 1 1 0 0 1 0 77 1 1 1 0 0 1 0 43 1 1 1 0 0 1 0 4 2 1 1 1 0 0 1 0 52 1 1 1 0 0 1 0 51 etc In sync we expect k+2 agreements; out-of-sync we expect (k+2)/2 agreements Best position

15 University Duisburg-Essendigital communications group A.J. Han Vinck Barker codes exist of lengths 2, 3, 4, 5, 7, 11, and 13. Barker codes length 21 0 31 1 0 41 0 1 1 51 1 1 0 1 71 1 1 0 0 1 0 111 1 1 0 0 0 1 0 0 1 0 131 1 1 1 1 0 0 1 1 0 1 0 1 Property:. |# of agreements - # disagreements|  1 1 1 1 0 0 1 0 7 1 1 1 0 0 1 0 0 1 1 1 0 0 1 0 1 1 1 1 0 0 1 0 0 1 1 1 0 0 1 0 1 1 1 1 0 0 1 0 0 1 1 1 0 0 1 0 1

16 University Duisburg-Essendigital communications group A.J. Han Vinck Byte or character Stuffing [HDLC Example] ASCII characters are used as framing delimiters (e.g. DLE STX and DLE ETX) The problem occurs when these character patterns occur within the “transparent” data. Solution: sender stuffs an extra DLE into the data stream just before each occurrence of an “accidental” DLE in the data stream.

17 University Duisburg-Essendigital communications group A.J. Han Vinck HDLC Byte Stuffing DLESTXDLEETXTransparent Data DLESTXDLEETXABDLEHW STXDLEETXABDLEHW STXDLEETXABDLEHW Stuffed Unstuffed Before

18 University Duisburg-Essendigital communications group A.J. Han Vinck ppp stuffing example Example: Data to be sent 41 7D 42 7E 50 70 46 After stuffing and framing 7E 41 7D 5D 42 7D 5E 50 70 46 7E PPP also provides the framing in Packet-over-SONET PPP is character-oriented version of HDLC Flag is 0x7E (01111110) Control escape 0x7D (01111101) replace 0x7E by0x7D 0x5E 0x7D by0x7D 0x5D

19 University Duisburg-Essendigital communications group A.J. Han Vinck Conclusion: Structure of flag is of great importance –Several classes designed: Barker, Gold, Kasami, etc flag should not appear in data – bit stuffing can be used

20 University Duisburg-Essendigital communications group A.J. Han Vinck Comma free codes A set code words is called comma-free if for every pair C = (c 0,c 1, ,c N-1 ) and C‘ = (c‘ 0,c‘ 1, ,c‘ N-1 ) the N tuple (c i, ,c N-1,c‘ 0,  c‘ i-1 ) is not a code word for any 1  i  N-1

21 University Duisburg-Essendigital communications group A.J. Han Vinck Example Comma free { 00001 00101 00110 11001 11010 11110 } A concatenation is uniquely decodable! Thus  010010100110110011101011110  is decoded as  01,00101,00110,11001,11010,11110 

22 University Duisburg-Essendigital communications group A.J. Han Vinck Comma free: efficiency The # of code words in a comma free code of length N –M  2 N /N Reason: every code word eliminates (N-1) shifts example for two shifted codewords: 010011 and 100110 the two codewords 100110-100110 can be synchronized as 0-10011 Redundancy: R  log 2 N (look at variable stuffing) Check!

23 University Duisburg-Essendigital communications group A.J. Han Vinck Packets Synchronous arrivals: –accuracy in clock 0.0000001% (may be atom-clock) A-synchronous arrivals: –clock derived from received signals needs special regeneration of clock

24 University Duisburg-Essendigital communications group A.J. Han Vinck Asynchronous Transmission (example) overhead is 20% ; (8 bits of data, 2 bits for start/stop)

25 University Duisburg-Essendigital communications group A.J. Han Vinck Support of timing recovery Use of special symbols, e.g. Manchester code 1 0 Prevent long runs of ones and zeros in data by precoding Insert preamble, e.g. 1010101010 before start of packet

26 University Duisburg-Essendigital communications group A.J. Han Vinck Ethernet/IEEE 802.3 7 1 2/6 2/6 2 46-1500 4 Preamble SFD DA SA L Data FCS Bytes field Preamble: 56 bits alternating 10 used to synchronize the receiver SFD: Start Frame Delimiter. 10101011 to signal beginning of the transmission DA/SA: Destination and Source Addresses L: Length of the data part Data: Minimum length required for proper operation. Padding used if needed FCS: Extra bits appended for error checking: the CRC


Download ppt "Institute for Experimental Mathematics Ellernstrasse 29 45326 Essen - Germany packet transmission A.J. Han Vinck January 19, 2010."

Similar presentations


Ads by Google