Data Communications and Networking By Behrouz A.Forouzan.pdf

5,695 views 190 slides Apr 28, 2024
Slide 1
Slide 1 of 1171
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41
Slide 42
42
Slide 43
43
Slide 44
44
Slide 45
45
Slide 46
46
Slide 47
47
Slide 48
48
Slide 49
49
Slide 50
50
Slide 51
51
Slide 52
52
Slide 53
53
Slide 54
54
Slide 55
55
Slide 56
56
Slide 57
57
Slide 58
58
Slide 59
59
Slide 60
60
Slide 61
61
Slide 62
62
Slide 63
63
Slide 64
64
Slide 65
65
Slide 66
66
Slide 67
67
Slide 68
68
Slide 69
69
Slide 70
70
Slide 71
71
Slide 72
72
Slide 73
73
Slide 74
74
Slide 75
75
Slide 76
76
Slide 77
77
Slide 78
78
Slide 79
79
Slide 80
80
Slide 81
81
Slide 82
82
Slide 83
83
Slide 84
84
Slide 85
85
Slide 86
86
Slide 87
87
Slide 88
88
Slide 89
89
Slide 90
90
Slide 91
91
Slide 92
92
Slide 93
93
Slide 94
94
Slide 95
95
Slide 96
96
Slide 97
97
Slide 98
98
Slide 99
99
Slide 100
100
Slide 101
101
Slide 102
102
Slide 103
103
Slide 104
104
Slide 105
105
Slide 106
106
Slide 107
107
Slide 108
108
Slide 109
109
Slide 110
110
Slide 111
111
Slide 112
112
Slide 113
113
Slide 114
114
Slide 115
115
Slide 116
116
Slide 117
117
Slide 118
118
Slide 119
119
Slide 120
120
Slide 121
121
Slide 122
122
Slide 123
123
Slide 124
124
Slide 125
125
Slide 126
126
Slide 127
127
Slide 128
128
Slide 129
129
Slide 130
130
Slide 131
131
Slide 132
132
Slide 133
133
Slide 134
134
Slide 135
135
Slide 136
136
Slide 137
137
Slide 138
138
Slide 139
139
Slide 140
140
Slide 141
141
Slide 142
142
Slide 143
143
Slide 144
144
Slide 145
145
Slide 146
146
Slide 147
147
Slide 148
148
Slide 149
149
Slide 150
150
Slide 151
151
Slide 152
152
Slide 153
153
Slide 154
154
Slide 155
155
Slide 156
156
Slide 157
157
Slide 158
158
Slide 159
159
Slide 160
160
Slide 161
161
Slide 162
162
Slide 163
163
Slide 164
164
Slide 165
165
Slide 166
166
Slide 167
167
Slide 168
168
Slide 169
169
Slide 170
170
Slide 171
171
Slide 172
172
Slide 173
173
Slide 174
174
Slide 175
175
Slide 176
176
Slide 177
177
Slide 178
178
Slide 179
179
Slide 180
180
Slide 181
181
Slide 182
182
Slide 183
183
Slide 184
184
Slide 185
185
Slide 186
186
Slide 187
187
Slide 188
188
Slide 189
189
Slide 190
190
Slide 191
191
Slide 192
192
Slide 193
193
Slide 194
194
Slide 195
195
Slide 196
196
Slide 197
197
Slide 198
198
Slide 199
199
Slide 200
200
Slide 201
201
Slide 202
202
Slide 203
203
Slide 204
204
Slide 205
205
Slide 206
206
Slide 207
207
Slide 208
208
Slide 209
209
Slide 210
210
Slide 211
211
Slide 212
212
Slide 213
213
Slide 214
214
Slide 215
215
Slide 216
216
Slide 217
217
Slide 218
218
Slide 219
219
Slide 220
220
Slide 221
221
Slide 222
222
Slide 223
223
Slide 224
224
Slide 225
225
Slide 226
226
Slide 227
227
Slide 228
228
Slide 229
229
Slide 230
230
Slide 231
231
Slide 232
232
Slide 233
233
Slide 234
234
Slide 235
235
Slide 236
236
Slide 237
237
Slide 238
238
Slide 239
239
Slide 240
240
Slide 241
241
Slide 242
242
Slide 243
243
Slide 244
244
Slide 245
245
Slide 246
246
Slide 247
247
Slide 248
248
Slide 249
249
Slide 250
250
Slide 251
251
Slide 252
252
Slide 253
253
Slide 254
254
Slide 255
255
Slide 256
256
Slide 257
257
Slide 258
258
Slide 259
259
Slide 260
260
Slide 261
261
Slide 262
262
Slide 263
263
Slide 264
264
Slide 265
265
Slide 266
266
Slide 267
267
Slide 268
268
Slide 269
269
Slide 270
270
Slide 271
271
Slide 272
272
Slide 273
273
Slide 274
274
Slide 275
275
Slide 276
276
Slide 277
277
Slide 278
278
Slide 279
279
Slide 280
280
Slide 281
281
Slide 282
282
Slide 283
283
Slide 284
284
Slide 285
285
Slide 286
286
Slide 287
287
Slide 288
288
Slide 289
289
Slide 290
290
Slide 291
291
Slide 292
292
Slide 293
293
Slide 294
294
Slide 295
295
Slide 296
296
Slide 297
297
Slide 298
298
Slide 299
299
Slide 300
300
Slide 301
301
Slide 302
302
Slide 303
303
Slide 304
304
Slide 305
305
Slide 306
306
Slide 307
307
Slide 308
308
Slide 309
309
Slide 310
310
Slide 311
311
Slide 312
312
Slide 313
313
Slide 314
314
Slide 315
315
Slide 316
316
Slide 317
317
Slide 318
318
Slide 319
319
Slide 320
320
Slide 321
321
Slide 322
322
Slide 323
323
Slide 324
324
Slide 325
325
Slide 326
326
Slide 327
327
Slide 328
328
Slide 329
329
Slide 330
330
Slide 331
331
Slide 332
332
Slide 333
333
Slide 334
334
Slide 335
335
Slide 336
336
Slide 337
337
Slide 338
338
Slide 339
339
Slide 340
340
Slide 341
341
Slide 342
342
Slide 343
343
Slide 344
344
Slide 345
345
Slide 346
346
Slide 347
347
Slide 348
348
Slide 349
349
Slide 350
350
Slide 351
351
Slide 352
352
Slide 353
353
Slide 354
354
Slide 355
355
Slide 356
356
Slide 357
357
Slide 358
358
Slide 359
359
Slide 360
360
Slide 361
361
Slide 362
362
Slide 363
363
Slide 364
364
Slide 365
365
Slide 366
366
Slide 367
367
Slide 368
368
Slide 369
369
Slide 370
370
Slide 371
371
Slide 372
372
Slide 373
373
Slide 374
374
Slide 375
375
Slide 376
376
Slide 377
377
Slide 378
378
Slide 379
379
Slide 380
380
Slide 381
381
Slide 382
382
Slide 383
383
Slide 384
384
Slide 385
385
Slide 386
386
Slide 387
387
Slide 388
388
Slide 389
389
Slide 390
390
Slide 391
391
Slide 392
392
Slide 393
393
Slide 394
394
Slide 395
395
Slide 396
396
Slide 397
397
Slide 398
398
Slide 399
399
Slide 400
400
Slide 401
401
Slide 402
402
Slide 403
403
Slide 404
404
Slide 405
405
Slide 406
406
Slide 407
407
Slide 408
408
Slide 409
409
Slide 410
410
Slide 411
411
Slide 412
412
Slide 413
413
Slide 414
414
Slide 415
415
Slide 416
416
Slide 417
417
Slide 418
418
Slide 419
419
Slide 420
420
Slide 421
421
Slide 422
422
Slide 423
423
Slide 424
424
Slide 425
425
Slide 426
426
Slide 427
427
Slide 428
428
Slide 429
429
Slide 430
430
Slide 431
431
Slide 432
432
Slide 433
433
Slide 434
434
Slide 435
435
Slide 436
436
Slide 437
437
Slide 438
438
Slide 439
439
Slide 440
440
Slide 441
441
Slide 442
442
Slide 443
443
Slide 444
444
Slide 445
445
Slide 446
446
Slide 447
447
Slide 448
448
Slide 449
449
Slide 450
450
Slide 451
451
Slide 452
452
Slide 453
453
Slide 454
454
Slide 455
455
Slide 456
456
Slide 457
457
Slide 458
458
Slide 459
459
Slide 460
460
Slide 461
461
Slide 462
462
Slide 463
463
Slide 464
464
Slide 465
465
Slide 466
466
Slide 467
467
Slide 468
468
Slide 469
469
Slide 470
470
Slide 471
471
Slide 472
472
Slide 473
473
Slide 474
474
Slide 475
475
Slide 476
476
Slide 477
477
Slide 478
478
Slide 479
479
Slide 480
480
Slide 481
481
Slide 482
482
Slide 483
483
Slide 484
484
Slide 485
485
Slide 486
486
Slide 487
487
Slide 488
488
Slide 489
489
Slide 490
490
Slide 491
491
Slide 492
492
Slide 493
493
Slide 494
494
Slide 495
495
Slide 496
496
Slide 497
497
Slide 498
498
Slide 499
499
Slide 500
500
Slide 501
501
Slide 502
502
Slide 503
503
Slide 504
504
Slide 505
505
Slide 506
506
Slide 507
507
Slide 508
508
Slide 509
509
Slide 510
510
Slide 511
511
Slide 512
512
Slide 513
513
Slide 514
514
Slide 515
515
Slide 516
516
Slide 517
517
Slide 518
518
Slide 519
519
Slide 520
520
Slide 521
521
Slide 522
522
Slide 523
523
Slide 524
524
Slide 525
525
Slide 526
526
Slide 527
527
Slide 528
528
Slide 529
529
Slide 530
530
Slide 531
531
Slide 532
532
Slide 533
533
Slide 534
534
Slide 535
535
Slide 536
536
Slide 537
537
Slide 538
538
Slide 539
539
Slide 540
540
Slide 541
541
Slide 542
542
Slide 543
543
Slide 544
544
Slide 545
545
Slide 546
546
Slide 547
547
Slide 548
548
Slide 549
549
Slide 550
550
Slide 551
551
Slide 552
552
Slide 553
553
Slide 554
554
Slide 555
555
Slide 556
556
Slide 557
557
Slide 558
558
Slide 559
559
Slide 560
560
Slide 561
561
Slide 562
562
Slide 563
563
Slide 564
564
Slide 565
565
Slide 566
566
Slide 567
567
Slide 568
568
Slide 569
569
Slide 570
570
Slide 571
571
Slide 572
572
Slide 573
573
Slide 574
574
Slide 575
575
Slide 576
576
Slide 577
577
Slide 578
578
Slide 579
579
Slide 580
580
Slide 581
581
Slide 582
582
Slide 583
583
Slide 584
584
Slide 585
585
Slide 586
586
Slide 587
587
Slide 588
588
Slide 589
589
Slide 590
590
Slide 591
591
Slide 592
592
Slide 593
593
Slide 594
594
Slide 595
595
Slide 596
596
Slide 597
597
Slide 598
598
Slide 599
599
Slide 600
600
Slide 601
601
Slide 602
602
Slide 603
603
Slide 604
604
Slide 605
605
Slide 606
606
Slide 607
607
Slide 608
608
Slide 609
609
Slide 610
610
Slide 611
611
Slide 612
612
Slide 613
613
Slide 614
614
Slide 615
615
Slide 616
616
Slide 617
617
Slide 618
618
Slide 619
619
Slide 620
620
Slide 621
621
Slide 622
622
Slide 623
623
Slide 624
624
Slide 625
625
Slide 626
626
Slide 627
627
Slide 628
628
Slide 629
629
Slide 630
630
Slide 631
631
Slide 632
632
Slide 633
633
Slide 634
634
Slide 635
635
Slide 636
636
Slide 637
637
Slide 638
638
Slide 639
639
Slide 640
640
Slide 641
641
Slide 642
642
Slide 643
643
Slide 644
644
Slide 645
645
Slide 646
646
Slide 647
647
Slide 648
648
Slide 649
649
Slide 650
650
Slide 651
651
Slide 652
652
Slide 653
653
Slide 654
654
Slide 655
655
Slide 656
656
Slide 657
657
Slide 658
658
Slide 659
659
Slide 660
660
Slide 661
661
Slide 662
662
Slide 663
663
Slide 664
664
Slide 665
665
Slide 666
666
Slide 667
667
Slide 668
668
Slide 669
669
Slide 670
670
Slide 671
671
Slide 672
672
Slide 673
673
Slide 674
674
Slide 675
675
Slide 676
676
Slide 677
677
Slide 678
678
Slide 679
679
Slide 680
680
Slide 681
681
Slide 682
682
Slide 683
683
Slide 684
684
Slide 685
685
Slide 686
686
Slide 687
687
Slide 688
688
Slide 689
689
Slide 690
690
Slide 691
691
Slide 692
692
Slide 693
693
Slide 694
694
Slide 695
695
Slide 696
696
Slide 697
697
Slide 698
698
Slide 699
699
Slide 700
700
Slide 701
701
Slide 702
702
Slide 703
703
Slide 704
704
Slide 705
705
Slide 706
706
Slide 707
707
Slide 708
708
Slide 709
709
Slide 710
710
Slide 711
711
Slide 712
712
Slide 713
713
Slide 714
714
Slide 715
715
Slide 716
716
Slide 717
717
Slide 718
718
Slide 719
719
Slide 720
720
Slide 721
721
Slide 722
722
Slide 723
723
Slide 724
724
Slide 725
725
Slide 726
726
Slide 727
727
Slide 728
728
Slide 729
729
Slide 730
730
Slide 731
731
Slide 732
732
Slide 733
733
Slide 734
734
Slide 735
735
Slide 736
736
Slide 737
737
Slide 738
738
Slide 739
739
Slide 740
740
Slide 741
741
Slide 742
742
Slide 743
743
Slide 744
744
Slide 745
745
Slide 746
746
Slide 747
747
Slide 748
748
Slide 749
749
Slide 750
750
Slide 751
751
Slide 752
752
Slide 753
753
Slide 754
754
Slide 755
755
Slide 756
756
Slide 757
757
Slide 758
758
Slide 759
759
Slide 760
760
Slide 761
761
Slide 762
762
Slide 763
763
Slide 764
764
Slide 765
765
Slide 766
766
Slide 767
767
Slide 768
768
Slide 769
769
Slide 770
770
Slide 771
771
Slide 772
772
Slide 773
773
Slide 774
774
Slide 775
775
Slide 776
776
Slide 777
777
Slide 778
778
Slide 779
779
Slide 780
780
Slide 781
781
Slide 782
782
Slide 783
783
Slide 784
784
Slide 785
785
Slide 786
786
Slide 787
787
Slide 788
788
Slide 789
789
Slide 790
790
Slide 791
791
Slide 792
792
Slide 793
793
Slide 794
794
Slide 795
795
Slide 796
796
Slide 797
797
Slide 798
798
Slide 799
799
Slide 800
800
Slide 801
801
Slide 802
802
Slide 803
803
Slide 804
804
Slide 805
805
Slide 806
806
Slide 807
807
Slide 808
808
Slide 809
809
Slide 810
810
Slide 811
811
Slide 812
812
Slide 813
813
Slide 814
814
Slide 815
815
Slide 816
816
Slide 817
817
Slide 818
818
Slide 819
819
Slide 820
820
Slide 821
821
Slide 822
822
Slide 823
823
Slide 824
824
Slide 825
825
Slide 826
826
Slide 827
827
Slide 828
828
Slide 829
829
Slide 830
830
Slide 831
831
Slide 832
832
Slide 833
833
Slide 834
834
Slide 835
835
Slide 836
836
Slide 837
837
Slide 838
838
Slide 839
839
Slide 840
840
Slide 841
841
Slide 842
842
Slide 843
843
Slide 844
844
Slide 845
845
Slide 846
846
Slide 847
847
Slide 848
848
Slide 849
849
Slide 850
850
Slide 851
851
Slide 852
852
Slide 853
853
Slide 854
854
Slide 855
855
Slide 856
856
Slide 857
857
Slide 858
858
Slide 859
859
Slide 860
860
Slide 861
861
Slide 862
862
Slide 863
863
Slide 864
864
Slide 865
865
Slide 866
866
Slide 867
867
Slide 868
868
Slide 869
869
Slide 870
870
Slide 871
871
Slide 872
872
Slide 873
873
Slide 874
874
Slide 875
875
Slide 876
876
Slide 877
877
Slide 878
878
Slide 879
879
Slide 880
880
Slide 881
881
Slide 882
882
Slide 883
883
Slide 884
884
Slide 885
885
Slide 886
886
Slide 887
887
Slide 888
888
Slide 889
889
Slide 890
890
Slide 891
891
Slide 892
892
Slide 893
893
Slide 894
894
Slide 895
895
Slide 896
896
Slide 897
897
Slide 898
898
Slide 899
899
Slide 900
900
Slide 901
901
Slide 902
902
Slide 903
903
Slide 904
904
Slide 905
905
Slide 906
906
Slide 907
907
Slide 908
908
Slide 909
909
Slide 910
910
Slide 911
911
Slide 912
912
Slide 913
913
Slide 914
914
Slide 915
915
Slide 916
916
Slide 917
917
Slide 918
918
Slide 919
919
Slide 920
920
Slide 921
921
Slide 922
922
Slide 923
923
Slide 924
924
Slide 925
925
Slide 926
926
Slide 927
927
Slide 928
928
Slide 929
929
Slide 930
930
Slide 931
931
Slide 932
932
Slide 933
933
Slide 934
934
Slide 935
935
Slide 936
936
Slide 937
937
Slide 938
938
Slide 939
939
Slide 940
940
Slide 941
941
Slide 942
942
Slide 943
943
Slide 944
944
Slide 945
945
Slide 946
946
Slide 947
947
Slide 948
948
Slide 949
949
Slide 950
950
Slide 951
951
Slide 952
952
Slide 953
953
Slide 954
954
Slide 955
955
Slide 956
956
Slide 957
957
Slide 958
958
Slide 959
959
Slide 960
960
Slide 961
961
Slide 962
962
Slide 963
963
Slide 964
964
Slide 965
965
Slide 966
966
Slide 967
967
Slide 968
968
Slide 969
969
Slide 970
970
Slide 971
971
Slide 972
972
Slide 973
973
Slide 974
974
Slide 975
975
Slide 976
976
Slide 977
977
Slide 978
978
Slide 979
979
Slide 980
980
Slide 981
981
Slide 982
982
Slide 983
983
Slide 984
984
Slide 985
985
Slide 986
986
Slide 987
987
Slide 988
988
Slide 989
989
Slide 990
990
Slide 991
991
Slide 992
992
Slide 993
993
Slide 994
994
Slide 995
995
Slide 996
996
Slide 997
997
Slide 998
998
Slide 999
999
Slide 1000
1000
Slide 1001
1001
Slide 1002
1002
Slide 1003
1003
Slide 1004
1004
Slide 1005
1005
Slide 1006
1006
Slide 1007
1007
Slide 1008
1008
Slide 1009
1009
Slide 1010
1010
Slide 1011
1011
Slide 1012
1012
Slide 1013
1013
Slide 1014
1014
Slide 1015
1015
Slide 1016
1016
Slide 1017
1017
Slide 1018
1018
Slide 1019
1019
Slide 1020
1020
Slide 1021
1021
Slide 1022
1022
Slide 1023
1023
Slide 1024
1024
Slide 1025
1025
Slide 1026
1026
Slide 1027
1027
Slide 1028
1028
Slide 1029
1029
Slide 1030
1030
Slide 1031
1031
Slide 1032
1032
Slide 1033
1033
Slide 1034
1034
Slide 1035
1035
Slide 1036
1036
Slide 1037
1037
Slide 1038
1038
Slide 1039
1039
Slide 1040
1040
Slide 1041
1041
Slide 1042
1042
Slide 1043
1043
Slide 1044
1044
Slide 1045
1045
Slide 1046
1046
Slide 1047
1047
Slide 1048
1048
Slide 1049
1049
Slide 1050
1050
Slide 1051
1051
Slide 1052
1052
Slide 1053
1053
Slide 1054
1054
Slide 1055
1055
Slide 1056
1056
Slide 1057
1057
Slide 1058
1058
Slide 1059
1059
Slide 1060
1060
Slide 1061
1061
Slide 1062
1062
Slide 1063
1063
Slide 1064
1064
Slide 1065
1065
Slide 1066
1066
Slide 1067
1067
Slide 1068
1068
Slide 1069
1069
Slide 1070
1070
Slide 1071
1071
Slide 1072
1072
Slide 1073
1073
Slide 1074
1074
Slide 1075
1075
Slide 1076
1076
Slide 1077
1077
Slide 1078
1078
Slide 1079
1079
Slide 1080
1080
Slide 1081
1081
Slide 1082
1082
Slide 1083
1083
Slide 1084
1084
Slide 1085
1085
Slide 1086
1086
Slide 1087
1087
Slide 1088
1088
Slide 1089
1089
Slide 1090
1090
Slide 1091
1091
Slide 1092
1092
Slide 1093
1093
Slide 1094
1094
Slide 1095
1095
Slide 1096
1096
Slide 1097
1097
Slide 1098
1098
Slide 1099
1099
Slide 1100
1100
Slide 1101
1101
Slide 1102
1102
Slide 1103
1103
Slide 1104
1104
Slide 1105
1105
Slide 1106
1106
Slide 1107
1107
Slide 1108
1108
Slide 1109
1109
Slide 1110
1110
Slide 1111
1111
Slide 1112
1112
Slide 1113
1113
Slide 1114
1114
Slide 1115
1115
Slide 1116
1116
Slide 1117
1117
Slide 1118
1118
Slide 1119
1119
Slide 1120
1120
Slide 1121
1121
Slide 1122
1122
Slide 1123
1123
Slide 1124
1124
Slide 1125
1125
Slide 1126
1126
Slide 1127
1127
Slide 1128
1128
Slide 1129
1129
Slide 1130
1130
Slide 1131
1131
Slide 1132
1132
Slide 1133
1133
Slide 1134
1134
Slide 1135
1135
Slide 1136
1136
Slide 1137
1137
Slide 1138
1138
Slide 1139
1139
Slide 1140
1140
Slide 1141
1141
Slide 1142
1142
Slide 1143
1143
Slide 1144
1144
Slide 1145
1145
Slide 1146
1146
Slide 1147
1147
Slide 1148
1148
Slide 1149
1149
Slide 1150
1150
Slide 1151
1151
Slide 1152
1152
Slide 1153
1153
Slide 1154
1154
Slide 1155
1155
Slide 1156
1156
Slide 1157
1157
Slide 1158
1158
Slide 1159
1159
Slide 1160
1160
Slide 1161
1161
Slide 1162
1162
Slide 1163
1163
Slide 1164
1164
Slide 1165
1165
Slide 1166
1166
Slide 1167
1167
Slide 1168
1168
Slide 1169
1169
Slide 1170
1170
Slide 1171
1171

About This Presentation

useful msterial


Slide Content

Don'tforgettocheckouttheOnlineLearningCenter,www.mhhe.com/forouzanfor
additionalresources!
InstructorsandstudentsusingDataCommunicationsandNetworking,FourthEdition
byBehrouzA.Forouzanwillfindawidevariety
ofresourcesavailableatthe Online
LearningCenter,www.mhhe.comlforouzan
InstructorResources
InstructorscanaccessthefollowingresourcesbycontactingtheirMcGraw-HillRepre­
sentativeforasecurepassword.
aPowerPointSlides.Containfigures,tables,highlightedpoints,andbriefdescriptions
ofeachsection.
oCompleteSolutions Manual.Password-protectedsolutionstoallend-of-chapter
problemsareprovided.
aPageout.Afreetoolthathelpsyoucreateyourowncoursewebsite.
DInstructorMessageBoard.Allowsyoutoshareideaswithotherinstructors
usingthetext.
StudentResources
Thestudentresourcesareavailabletothosestudentsusingthebook.Onceyouhave
accessedtheOnlineLearningCenter,clickon
"StudentResources,"thenselectachap­
terfromthedropdownmenuthatappears.Eachchapterhasawealth
ofmaterialsto
helpyoureviewcommunicationsandnetworkingconcepts.Includedare:
aChapterSummaries.Bulletedsummarypointsprovideanessentialreview of
majorideasandconceptscoveredineachchapter.
aStudentSolutionsManual.Containsanswersforodd-numberedproblems.
oGlossary.Defineskeytermspresentedinthebook.
oFlashcards.Facilitatelearningthroughpracticeandreview.
aAnimatedFigures.Visualrepresentationsmodelkeynetworkingconcepts,bringing
themtolife.
DAutomatedQuizzes.Easy-to-usequizzesstrengthenlearningandemphasizeimpor­
tantideasfromthebook.
aWeblinks.Connectstudentstoadditionalresourcesavailableonline.

DATA
COMMUNICATIONS
AND
NETWORKING

McGraw-HillForouzanNetworkingSeries
TitlesbyBehrouzA.Forouzan:
DataCommunications
andNetworking
TCPflPProtocolSuite
LocalAreaNetworks
BusinessDataCommunications

DATA
COMMUNICATIONS
AND
NETWORKING
FourthEdition
BehrouzA.Forouzan
DeAnzaCollege
with
SophiaChungFegan
•HigherEducation
BostonBurrRidge,ILDubuque, IAMadison,WINewYorkSanFranciscoS1.Louis
BangkokBogotaCaracas KualaLumpurLisbonLondonMadridMexicoCity
MilanMontrealNewDelhiSantiagoSeoulSingaporeSydney TaipeiToronto

TheMcGraw·HiIICompanies .~I
IIHigherEducation
DATACOMMUNICATIONS ANDNETWORKING, FOURTHEDITION
PublishedbyMcGraw-Hill,abusinessunit
ofTheMcGraw-HillCompanies.Inc., 1221Avenue
oftheAmericas,NewYork,NY10020.Copyright©2007byTheMcGraw-HillCompanies,Inc.
AlIrightsreserved.Nopart
ofthispublicationmaybereproducedordistributedinanyformor
byanymeans,orstoredinadatabaseorretrievalsystem,withoutthepriorwrittenconsent
of
TheMcGraw-HillCompanies,Inc.,including,butnotlimitedto,inanynetwork orother
electronicstorageortransmission,orbroadcastfordistancelearning.
Someancillaries,includingelectronicandprintcomponents,maynotbeavailabletocustomers
outsidetheUnitedStates.
Thisbookisprintedonacid-freepaper.
1234567890DOC/DOC09876
ISBN-13978-0-07-296775-3
ISBN-to0-07-296775-7
Publisher:AlanR.Apt
DevelopmentalEditor: RebeccaOlson
ExecutiveMarketingManager: MichaelWeitz
SeniorProjectManager: SheilaM.Frank
SeniorProductionSupervisor: KaraKudronowicz
SeniorMediaProjectManager: JodiK.Banowetz
AssociateMediaProducer: ChristinaNelson
SeniorDesigner: David
WHash
CoverDesigner: RokusekDesign
(USE)CoverImage:WomenascendingMountMcKinley,Alaska.MountMcKinley(Denali)
12,000 feet,
©AllanKearney/GettyImages
Compositor:InteractiveCompositionCorporation
Typeface:10/12TimesRoman
Printer:R. R.DonnelleyCrawfordsville, IN
LibraryofCongress
Cataloging-in~Publication Data
Forouzan,BehrouzA.
Datacommunicationsandnetworking
IBehrouzAForouzan.
-4thed.
p.em.-(McGraw-HilIForouzannetworkingseries)
Includesindex.
ISBN
978-0-07-296775-3-ISBN 0-07-296775-7(hardeopy:alk.paper)
1.Datatransmissionsystems. 2.Computernetworks. I.Title.II.Series.
TK5105.F6617
004.6--dc22
www.mhhe.com
2007
2006000013
CIP

Tolnywife,Faezeh,withlove
BehrouzForouzan

PrefaceXXlX
PART1 Overview1
Chapter1 Introduction3
Chapter2 NetworkModels 27
PART2
Chapter3
Chapter4
Chapter5
Chapter6
Chapter7
Chapter8
Chapter9
PART3
Chapter10
Chapter
11
Chapter12
Chapter13
Chapter14
Chapter15
Chapter16
Chapter17
Chapter18
PhysicalLayerandMedia55
DataandSignals57
DigitalTransmission 101
AnalogTransmission141
BandwidthUtilization:Multiplexing
andSpreading161
TransmissionMedia191
Switching213
UsingTelephoneandCableNetworksforDataTransmission241
DataLinkLayer265
ErrorDetectionandCorrection 267
DataLinkControl 307
MultipleAccess363
WiredLANs:Ethernet395
WirelessLANs421
ConnectingLANs,BackboneNetworks,andVirtualLANs445
WirelessWANs:CellularTelephone
andSatelliteNetworks 467
SONETISDH 491
Virtual-Circuit
Nenvorks:FrameRelay andATM517
vii

viiiBRIEFCONTENTS
PART4
Chapter19
Chapter20
Chapter
21
Chapter22
PARTS
Chapter23
Chapter24
PART6
Chapter25
Chapter26
Chapter27
Chapter28
Chapter29
NetworkLayer547
NetvvorkLayer:LogicalAddressing 549
NetvvorkLayer:InternetProtocol579
Netl,vorkLa.ver:AddressMapping,ErrorReporting,
andMulticasting611
NetworkLayer:Delivery,Fonvarding,andRouting647
TransportLayer701
Process-to-ProcessDelivery:UDp, TCP,andSCTP703
CongestionControl
andQuality
ql'Sen'ice761
ApplicationLayer795
DomainNameSystem797
RemoteLogging,ElectronicMail,
andFile
Transfer817
WWWandHTTP851
NetworkManagement: SNMP873
Multimedia901
PART7 Security929
Chapter30
Cf}1Jtography931
Chapter31NetworkSecurity961
Chapter32 Securit}'intheInternet:IPSec,SSLlTLS,PCp,VPN,
andFirewalls995
AppendixA Unicode1029
AppendixBNumberingSystems1037
AppendixC MathematicalReview1043
AppendixD 8B/6TCode1055
AppendixE TelephoneHistory 1059
AppendixF Co!1tactAddresses1061
AppendixG RFCs1063
AppendixH UDPandTCPPorts1065
Acron.Vl11s1067
ClOSSOlY1071
References1107
Index
IIII

Prefacexxix
PART1Overview1
Chapter1
Introduction3
1.1DATACOMMUNICATIONS 3
Components4
DataRepresentation
5
DataFlow6
1.2NETWORKS 7
DistributedProcessing7
NetworkCriteria7
PhysicalStructures8
NetworkModels
13
CategoriesofNetworks13
InterconnectionofNetworks:Internetwork IS
1.3THEINTERNET 16
ABriefHistory17
TheInternetToday 17
1.4PROTOCOLSANDSTANDARDS 19
Protocols19
Standards19
StandardsOrganizations20
InternetStandards
21
1.5RECOMMENDED READING 21
Books21
Sites22
RFCs22
1.6KEYTERMS22
1.7SUMMARY 23
1.8PRACTICESET24
ReviewQuestions24
Exercises24
ResearchActivities25
Chapter2 NetworkModels 27
2.1LAYEREDTASKS27
Sender,Receiver,andCarrier28
Hierarchy29
ix

x CONTENTS
2.2THEOSIMODEL 29
LayeredArchitecture30
Peer-to-PeerProcesses30
Encapsulation
33
2.3LAYERSINTHEOSIMODEL 33
PhysicalLayer 33
DataLinkLayer34
NetworkLayer36
TransportLayer37
SessionLayer39
PresentationLayer39
ApplicationLayer
41
SummaryofLayers42
2.4TCP/IPPROTOCOLSUITE42
PhysicalandDataLinkLayers43
NetworkLayer
43
TransportLayer 44
ApplicationLayer
45
2.5ADDRESSING 45
PhysicalAddresses46
LogicalAddresses47
PortAddresses49
SpecificAddresses50
2.6RECOMMENDED READING 50
Books51
Sites51
RFCs51
2.7KEY lERMS51
2.8SUMMARY 52
2.9PRACTICESET52
ReviewQuestions52
Exercises53
ResearchActivities54
PART2PhysicalLayerandMedia55
Chapter3
DataandSignals 57
3.1ANALOGANDDIGITAL 57
AnalogandDigitalData57
AnalogandDigitalSignals58
PeriodicandNonperiodicSignals58
3.2PERIODICANALOGSIGNALS59
SineWave59
Phase
63
Wavelength64
TimeandFrequencyDomains
65
CompositeSignals66
Bandwidth69
3.3DIGITALSIGNALS 71
BitRate73
BitLength73
DigitalSignal
asaCompositeAnalogSignal74
Transmission
ofDigitalSignals74

3.4TRANSMISSIONIMPAIRMENT 80
Attenuation81
Distortion83
Noise84
3.5DATARATELIMITS 85
NoiselessChannel:NyquistBitRate86
NoisyChannel:ShannonCapacity87
UsingBothLimits
88
3.6PERFORMANCE 89
Bandwidth89
Throughput90
Latency(Delay)90
Bandwidth-DelayProduct92
Jitter94
3.7RECOMMENDED READING 94
Books94
3.8KEYTERMS 94
3.9SUMMARY 95
3.10PRACTICESET 96
ReviewQuestions96
Exercises96
Chapter4 DigitalTransmission101
4.1DIGITAL-TO-DIGITALCONVERSION 101
LineCoding 101
LineCodingSchemes
106
BlockCoding 115
Scrambling118
4.2ANALOG-TO-DIGITAL CONVERSION 120
PulseCodeModulation(PCM) 121
DeltaModulation(DM)129
4.3TRANSMISSIONMODES 131
ParallelTransmission 131
SerialTransmission132
4.4RECOMMENDED READING 135
Books135
4.5KEYTERMS 135
4.6SUMMARY 136
4.7PRACTICESET 137
ReviewQuestions137
Exercises137
Chapter5 Analog
TranSl1'lission141
5.1DIGITAL-TO-ANALOG CONVERSION 141
AspectsofDigital-to-AnalogConversion142
AmplitudeShiftKeying
143
FrequencyShiftKeying146
PhaseShiftKeying148
QuadratureAmplitudeModulation152
5.2ANALOG-TO-ANALOGCONVERSION 152
AmplitudeModulation 153
FrequencyModulation 154
PhaseModulation 155
CONTENTS xi

xiiCONTENTS
5.3RECOMMENDED READING 156
Books156
5.4KEYlERMS157
5.5SUMMARY 157
5.6PRACTICESET 158
ReviewQuestions 158
Exercises158
Chapter6Ba17chridthUtili::.ation:Multiplexing
andSpreading161
6.1MULTIPLEXING 161
Frequency-DivisionMultiplexing162
Wavelength-DivisionMultiplexing167
SynchronousTime-DivisionMultiplexing169
StatisticalTime-DivisionMultiplexing179
6.2SPREADSPECTRUM 180
FrequencyHoppingSpreadSpectrum(FHSS) 181
DirectSequenceSpreadSpectrum184
6.3RECOMMENDED READING 185
Books185
6.4KEYlERMS185
6.5SUMMARY 186
6.6PRACTICESET 187
ReviewQuestions187
Exercises
187
Chapter7 TransmissionMedia191
7.1GUIDEDMEDIA 192
Twisted-PairCable 193
CoaxialCable 195
Fiber-OpticCable 198
7.2UNGUIDEDMEDIA:WIRELESS203
RadioWaves 205
Microwaves206
Infrared207
7.3RECOMMENDED READING 208
Books208
7.4KEYlERMS208
7.5SUMMARY 209
7.6PRACTICESET209
ReviewQuestions209
Exercises210
Chapter8
Svvitching213
8.1CIRCUIT-SWITCHEDNETWORKS 214
ThreePhases217
Efficiency217
Delay217
Circuit-SwitchedTechnologyinTelephoneNetworks218
8.2DATAGRAM NETWORKS 218
RoutingTable220

CONTENTS xiii
Efficiency220
Delay
221
DatagramNetworksintheInternet 221
8.3VIRTUAL-CIRCUITNETWORKS 221
Addressing222
ThreePhases
223
Efficiency226
DelayinVirtual-CircuitNetworks226
Circuit-SwitchedTechnologyin
WANs227
8.4STRUCTUREOFASWITCH 227
StructureofCircuitSwitches227
Structure
ofPacketSwitches232
8.5RECOMMENDED READING 235
Books235
8.6KEYTERMS235
8.7SUMMARY 236
8.8PRACTICESET236
ReviewQuestions236
Exercises
237
Chapter9 UsingTelephoneandCableNetworks forData
Transm,ission241
9.11ELEPHONENETWORK 241
MajorComponents 241
LATAs242
Signaling244
ServicesProvidedbyTelephoneNetworks
247
9.2DIAL-UPMODEMS 248
ModemStandards249
9.3DIGITALSUBSCRIBERLINE 251
ADSL252
ADSLLite254
HDSL
255
SDSL255
VDSL255
Summary255
9.4CABLETVNETWORKS 256
TraditionalCableNetworks256
HybridFiber-Coaxial(HFC)Network256
9.5CABLETVFORDATATRANSFER 257
Bandwidth257
Sharing259
CMandCMTS259
DataTransmissionSchemes:DOCSIS260
9.6RECOMMENDED READING 261
Books261
9.7KEYTERMS 261
9.8SUMMARY 262
9.9PRACTICESET263
ReviewQuestions 263
Exercises264

xivCONTENTS
PART3 DataLinkLayer265
Chapter10 ErrorDetectionandCorrection267
10.1INTRODUCTION 267
TypesofErrors267
Redundancy269
DetectionVersusCorrection
269
ForwardErrorCorrectionVersusRetransmission269
Coding
269
ModularArithmetic270
10.2BLOCKCODING 271
ErrorDetection272
ErrorCorrection273
HammingDistance
274
MinimumHammingDistance274
10.3LINEARBLOCKCODES277
MinimumDistanceforLinearBlockCodes278
SomeLinearBlockCodes278
10.4CYCLICCODES284
CyclicRedundancyCheck284
HardwareImplementation287
Polynomials
291
CyclicCodeAnalysis293
Advantages
ofCyclic Codes297
OtherCyclicCodes297
10.5CHECKSUM 298
Idea298
One'sComplement 298
InternetChecksum299
10.6RECOMMENDED READING 30I
Books301
RFCs301
10.7KEY lERMS301
10.8SUMMARY 302
10.9PRACTICESET303
ReviewQuestions303
Exercises303
Chapter11DataLinkControl 307
11.1FRAMING 307
Fixed-SizeFraming308
Variable-SizeFraming308
11.2FLOW ANDERRORCONTROL 311
FlowControl 311
ErrorControl 311
11.3PROTOCOLS 311
11.4NOISELESSCHANNELS 312
SimplestProtocol312
Stop-and-WaitProtocol315
11.5NOISYCHANNELS 318
Stop-and-WaitAutomaticRepeatRequest318
Go-Back-NAutomaticRepeatRequest324

11.6
11.7
11.8
11.9
11.10
11.11
SelectiveRepeatAutomaticRepeatRequest
Piggybacking339
HDLC340
ConfigurationsandTransferModes340
Frames
341
ControlField343
POINT-TO-POINTPROTOCOL 346
Framing348
TransitionPhases349
Multiplexing350
MultilinkPPP355
RECOMMENDED READING 357
Books357
KEYTERMS357
SUMMARY 358
PRACTICESET359
ReviewQuestions359
Exercises359
332
CONTENTS xv
Chapter12 MultipleAccess363
12.1RANDOMACCESS 364
ALOHA 365
CarrierSenseMultipleAccess(CSMA)370
CarrierSenseMultipleAccesswithCollisionDetection
(CSMAlCD) 373
CarrierSenseMultipleAccesswithCollisionAvoidance (CSMAlCA)377
12.2CONTROLLED ACCESS379
Reservation379
Polling380
TokenPassing381
12.3CHANNELIZATION 383
Frequency-DivisionMultipleAccess(FDMA)383
Time-DivisionMultipleAccess(TDMA)384
Code-DivisionMultipleAccess(CDMA)385
12.4RECOMMENDED READING 390
Books391
12.5KEYTERMS 391
12.6SUMMARY 391
12.7PRACTICESET392
ReviewQuestions392
Exercises393
ResearchActivities394
Chapter13 WiredLANs:Ethernet395
13.1IEEESTANDARDS 395
DataLinkLayer396
PhysicalLayer397
13.2STANDARDETHERNET 397
MACSublayer398
PhysicalLayer402
13.3CHANGESINTHESTANDARD 406
BridgedEthernet406
SwitchedEthernet407
Full-DuplexEthernet408

xviCONTENTS
13.4FASTETHERNET 409
MACSublayer409
PhysicalLayer410
13.5GIGABITETHERNET 412
MACSublayer412
PhysicalLayer414
Ten-GigabitEthernet416
13.6RECOMMENDED READING 417
Books417
13.7KEYTERMS417
13.8SUMMARY 417
13.9PRACTICESET418
ReviewQuestions418
Exercises419
Chapter14 WirelessLANs421
14.1IEEE802.11 421
Architecture421
MACSublayer423
AddressingMechanism428
PhysicalLayer432
14.2BLUETOOTH 434
Architecture435
BluetoothLayers436
RadioLayer436
BasebandLayer437
L2CAP440
OtherUpperLayers
441
14.3RECOMMENDED READING 44I
Books442
14.4KEYTERMS 442
14.5SUMMARY 442
14.6PRACTICESET443
ReviewQuestions443
Exercises443
Chapter15 ConnectingLANs,BackboneNetworks,
andVirtuaLLANs445
15.1CONNECTINGDEVICES445
PassiveHubs446
Repeaters446
ActiveHubs447
Bridges447
Two-LayerSwitches454
Routers455
Three-LayerSwitches455
Gateway455
15.2BACKBONENETWORKS 456
BusBackbone456
StarBackbone457
ConnectingRemoteLANs457

15.3VIRTUALLANs 458
Membership
461
Configuration461
CommunicationBetweenSwitches462
IEEE Standard462
Advantages463
15.4RECOMMENDED READING 463
Books463
Site463
15.5KEYTERMS463
15.6SUMMARY 464
15.7PRACTICESET464
ReviewQuestions464
Exercises465
CONTENTS xvii
Chapter16 WirelessWANs:CellularTelephone and
SatelliteNetworks 467
16.1CELLULARTELEPHONY 467
Frequency-ReusePrinciple467
Transmitting468
Receiving469
Roaming469
FirstGeneration469
SecondGeneration470
ThirdGeneration477
16.2SATELLITENETWORKS 478
Orbits479
Footprint480
ThreeCategories
ofSatellites480
GEOSatellites481
MEOSatellites481
LEOSatellites484
16.3RECOMMENDED READING487
Books487
16.4KEYTERMS487
16.5SUMMARY 487
16.6PRACTICESET488
ReviewQuestions488
Exercises488
Chapter17 SONETISDH 491
17.1ARCHITECTURE 491
Signals491
SONETDevices492
Connections493
17.2SONETLAYERS494
PathLayer494
LineLayer495
SectionLayer495
PhotonicLayer495
Device-LayerRelationships495

xviiiCONTENTS
17.3SONETFRAMES496
Frame,Byte,andBitTransmission496
STS-lFrameFormat497
OverheadSummary501
Encapsulation501
17.4STSMULTIPLEXING 503
ByteInterleaving504
ConcatenatedSignal505
AddlDropMultiplexer506
17.5SONETNETWORKS 507
LinearNetworks507
RingNetworks509
MeshNetworks510
17.6VIRTUALTRIBUTARIES512
TypesofVTs512
17.7RECOMMENDED READING513
Books513
17.8KEYlERMS513
17.9SUMMARY 514
17.10PRACTICESET514
ReviewQuestions514
Exercises515
Chapter18 Virtual-CircuitNetworks: Frame
Relm'andATM517
18.1FRAMERELAY517
Architecture518
FrameRelayLayers519
ExtendedAddress521
FRADs522
VOFR522
LMI522
CongestionControlandQuality
ofService522
18.2ATM523
DesignGoals523
Problems523
Architecture526
Switching529
ATMLayers529
CongestionControlandQuality
ofService535
18.3ATMLANs536
ATMLANArchitecture536
LANEmulation(LANE)538
Client/ServerModel539
MixedArchitecturewithClient/Server540
18.4RECOMMENDED READING540
Books541
18.5KEYlERMS541
18.6SUMMARY 541
18.7PRACTICESET 543
ReviewQuestions543
Exercises543

CONTENTS xix
PART4NetworkLayer547
Chapter19 Netvl/arkLayer:LogicalAddressing549
19.1IPv4ADDRESSES 549
AddressSpace550
Notations550
ClassfulAddressing552
ClasslessAddressing555
NetworkAddressTranslation
(NAT)563
19.2IPv6ADDRESSES 566
Structure567
AddressSpace568
19.3RECOMMENDED READING 572
Books572
Sites572
RFCs572
19.4KEYTERMS572
19.5SUMMARY 573
19.6PRACTICESET574
ReviewQuestions574
Exercises574
ResearchActivities577
Chapter20 NetworkLayer:InternetProtocol579
20.1INTERNETWORKING 579
NeedforNetworkLayer579
InternetasaDatagramNetwork581
InternetasaConnectionlessNetwork582
20.2IPv4582
Datagram583
Fragmentation589
Checksum594
Options594
20.3IPv6596
Advantages597
PacketFormat597
ExtensionHeaders602
20.4TRANSITIONFROMIPv4TOIPv6 603
DualStack604
Tunneling604
HeaderTranslation605
20.5RECOMMENDED READING 605
Books606
Sites606
RFCs606
20.6KEYTERMS606
20.7SUMMARY 607
20.8PRACTICESET607
ReviewQuestions607
Exercises608
ResearchActivities609

xx CONTENTS
Chapter21NetworkLayer:AddressMapping,ErrorReporting,
andMulticasting611
21.1ADDRESSMAPPING 611
MappingLogicaltoPhysicalAddress:ARP612
MappingPhysicaltoLogicalAddress:RARp,BOOTP,andDHCP618
21.2ICMP 621
TypesofMessages621
MessageFormat 621
ErrorReporting622
Query625
DebuggingTools627
21.3IGMP630
GroupManagement630
IGMPMessages
631
MessageFormat 631
IGMPOperation632
Encapsulation635
NetstatUtility637
21.4ICMPv6638
ErrorReporting638
Query639
21.5RECOMMENDED READING 640
Books641
Site641
RFCs641
21.6KEYTERMS 641
21.7SUMMARY 642
21.8PRACTICESET
643
ReviewQuestions643
Exercises644
ResearchActivities645
Chapter22 NetworkLayer:Delivery,Forwarding,
andRouting647
22.1DELIVERY647
DirectVersusIndirectDelivery647
22.2FORWARDING 648
ForwardingTechniques648
ForwardingProcess650
RoutingTable655
22.3UNICASTROUTINGPROTOCOLS 658
Optimization658
Intra-andInterdomainRouting659
DistanceVectorRouting660
LinkStateRouting666
PathVectorRouting674
22.4MULTICASTROUTINGPROTOCOLS 678
Unicast,Multicast,andBroadcast678
Applications
681
MulticastRouting682
RoutingProtocols684

CONTENTS xxi
22.5RECOMMENDED READING 694
Books694
Sites694
RFCs694
22.6KEY lERMS694
22.7SUMMARY 695
22.8PRACTICESET697
ReviewQuestions697
Exercises697
ResearchActivities699
PART5TransportLayer701
Chapter23 Process-fa-ProcessDelivery:UDp,TCp,
andSeTP703
23.1PROCESS-TO-PROCESS DELIVERY 703
Client/ServerParadigm704
MultiplexingandDemultiplexing707
ConnectionlessVersusConnection-OrientedService707
ReliableVersusUnreliable708
ThreeProtocols708
23.2USERDATAGRAM PROTOCOL(UDP)709
Well-KnownPortsforUDP709
UserDatagram710
Checksum
711
UDPOperation713
Use
ofUDP715
23.3TCP715
TCPServices715
TCPFeatures719
Segment
721
ATCPConnection723
FlowControl728
ErrorControl
731
CongestionControl735
23.4SCTP736
SCTPServices736
SCTPFeatures738
PacketFormat742
AnSCTPAssociation743
FlowControl748
ErrorControl751
CongestionControl753
23.5RECOMMENDED READING 753
Books753
Sites753
RFCs753
23.6KEY lERMS754
23.7SUMMARY 754
23.8PRACTICESET756
ReviewQuestions756
Exercises757
ResearchActivities 759

xxiiCONTENTS
Chapter24 CongestionControl andQuality(~j'Service 767
24.1DATAlRAFFIC 761
TrafficDescriptor76]
TrafficProfiles762
24.2CONGESTION 763
NetworkPerformance764
24.3CONGESTIONCONTROL 765
Open-LoopCongestionControl766
Closed-LoopCongestionControl767
24.4lWOEXAMPLES 768
CongestionControlin TCP769
CongestionControlinFrameRelay773
24.5QUALITYOFSERVICE775
FlowCharacteristics775
FlowClasses776
24.6TECHNIQUESTOIMPROVEQoS776
Scheduling776
TrafficShaping777
ResourceReservation780
AdmissionControl
780
24.7INTEGRATEDSERVICES780
Signaling781
FlowSpecification781
Admission781
ServiceClasses781
RSVP782
ProblemswithIntegratedServices784
24.8DIFFERENTIATEDSERVICES785
DSField785
24.9QoSINSWITCHEDNETWORKS 786
QoSinFrameRelay787
QoS
inATM789
24.10RECOMMENDED READING 790
Books791
24.11KEYTERMS791
24.12SUMMARY 791
24.13PRACTICESET792
ReviewQuestions792
Exercises793
PART6ApplicationLayer795
Chapter25 DO/nainNameSvstem 797
25.1NAMESPACE 798
FlatNameSpace798
HierarchicalNameSpace798
25.2DOMAINNAMESPACE799
Label799
DomainNarne799
Domain801

25.3
25.4
25.5
25.6
25.7
25.8
25.9
25.10
25.11
25.12
25.13
25.14
DISTRIBUTIONOFNAMESPACE 801
HierarchyofNameServers802
Zone802
RootServer803
PrimaryandSecondaryServers803
DNSINTHEINTERNET 803
GenericDomains804
CountryDomains805
InverseDomain805
RESOLUTION 806
Resolver806
MappingNamestoAddresses807
MappingAddresstoNames807
RecursiveResolution808
IterativeResolution808
Caching808
DNSMESSAGES 809
Header809
TYPESOFRECORDS 811
QuestionRecord 811
ResourceRecord 811
REGISTRARS 811
DYNAMICDOMAINNAMESYSTEM(DDNS)
ENCAPSULATION 812
RECOMMENDED READING 812
Books813
Sites813
RFCs813
KEYTERMS813
SUMMARY
813
PRACTICESET814
ReviewQuestions814
Exercises815
812
CONTENTS xxiii
Chapter26 RemoteLogging,ElectronicMail,andFileTransfer817
26.1REMOTELOGGING 817
TELNET817
26.2ELECTRONICMAIL824
Architecture824
UserAgent828
MessageTransferAgent:SMTP834
MessageAccessAgent:POPandIMAP837
Web-BasedMail839
26.3FILETRANSFER 840
FileTransferProtocol(FTP)840
AnonymousFTP844
26.4RECOMMENDED READING 845
Books845
Sites845
RFCs845
26.5KEYlERMS845
26.6SUMMARY 846

xxiv CONTENTS
26.7PRACTICESET847
ReviewQuestions 847
Exercises848
ResearchActivities 848
Chapter27 WWWandHTTP851
27.1ARCHITECTURE 851
Client(Browser) 852
Server852
UniformResourceLocator 853
Cookies853
27.2WEBDOCUMENTS 854
StaticDocuments855
DynamicDocuments857
ActiveDocuments
860
27.3HTTP 861
HTTPTransaction 861
PersistentVersusNonpersistentConnection 868
ProxyServer 868
27.4RECOMMENDED READING 869
Books869
Sites869
RFCs869
27.5KEY1ERMS869
27.6SUMMARY 870
27.7PRACTICESET
871
ReviewQuestions 871
Exercises871
Chapter28 NetworkManagement:SNMP873
28.1NETWORKMANAGEMENT SYSTEM873
ConfigurationManagement 874
FaultManagement875
PerformanceManagement
876
SecurityManagement 876
AccountingManagement877
28.2SIMPLENETWORKMANAGEMENT PROTOCOL(SNMP) 877
Concept877
ManagementComponents 878
StructureofManagementInformation 881
ManagementInformationBase(MIB)886
LexicographicOrdering
889
SNMP891
Messages893
UDPPorts895
Security
897
28.3RECOMMENDED READING 897
Books897
Sites897
RFCs897
28.4KEY1ERMS897
28.5SUMMARY 898

28.6PRACTICESET899
ReviewQuestions899
Exercises899
Chapter29 Multimedia901
29.1DIGITIZINGAUDIOANDVIDEO902
DigitizingAudio902
DigitizingVideo902
29.2AUDIOANDVIDEOCOMPRESSION 903
AudioCompression903
VideoCompression904
29.3STREAMINGSTOREDAUDIO/VIDEO 908
FirstApproach:UsingaWebServer909
SecondApproach:Usinga
WebServerwithMetafile909
ThirdApproach:UsingaMediaServer910
FourthApproach:UsingaMediaServerandRTSP
911
29.4STREAMINGLIVEAUDIOIVIDEO 912
29.5REAL-TIMEINTERACTIVEAUDIOIVIDEO 912
Characteristics912
29.6RTP916
RTPPacketFormat917
UDPPort919
29.7RTCP919
SenderReport919
ReceiverReport920
SourceDescriptionMessage920
ByeMessage920
Application-Specific Message920
UDPPort920
29.8VOICEOVER IP920
SIP920
H.323923
29.9RECOMMENDED READING 925
Books925
Sites925
29.10KEY1ERMS 925
29.11SUMMARY 926
29.12PRACTICESET927
ReviewQuestions927
Exercises927
ResearchActivities928
PART7Security929
Chapter30 Cryptography931
30.1INTRODUCTION 931
Definitions931
TwoCategories932
30.2SYMMETRIC-KEY CRYPTOGRAPHY 935
TraditionalCiphers935
SimpleModemCiphers938
CONTENTS xxv

xxvi CONTENTS
ModernRoundCiphers940
Mode
ofOperation945
30.3ASYMMETRIC-KEY CRYPTOGRAPHY 949
RSA 949
Diffie-Hellman952
30.4RECOMMENDED READING 956
Books956
30.5KEYTERMS956
30.6SUMMARY 957
30.7PRACTICESET958
ReviewQuestions958
Exercises959
ResearchActivities960
Chapter31NetworkSecurity961
31.1SECURITYSERVICES 961
MessageConfidentiality962
MessageIntegrity962
MessageAuthentication962
MessageNonrepudiation962
EntityAuthentication962
31.2MESSAGECONFIDENTIALITY 962
ConfidentialitywithSymmetric-KeyCryptography963
ConfidentialitywithAsymmetric-KeyCryptography963
31.3MESSAGEINTEGRITY964
DocumentandFingerprint965
MessageandMessageDigest965
Difference965
CreatingandCheckingtheDigest966
HashFunctionCriteria966
HashAlgorithms:SHA-1967
31.4MESSAGEAUTHENTICATION 969
MAC969
31.5DIGITALSIGNATURE 971
Comparison97 I
NeedforKeys972
Process973
Services974
SignatureSchemes976
31.6ENTITYAUTHENTICATION 976
Passwords976
Challenge-Response978
31.7KEYMANAGEMENT 981
Symmetric-KeyDistribution 981
Public-KeyDistribution986
31.8RECOMMENDED READING 990
Books990
31.9KEYTERMS990
31.10SUMMARY
991
31.11PRACTICESET992
ReviewQuestions992
Exercises993
ResearchActivities994

CONTENTS xxvii
Chapter32 SecurityintheInternet:IPSec,SSUFLS, PGP,VPN,
andFirewalls995
32.1IPSecurity(lPSec)996
TwoModes996
TwoSecurityProtocols998
SecurityAssociation1002
InternetKeyExchange(IKE) 1004
VirtualPrivateNetwork1004
32.2SSLffLS1008
SSLServices1008
SecurityParameters1009
SessionsandConnections1011
FourProtocols
10 12
TransportLayerSecurity1013
32.3PGP1014
SecurityParameters1015
Services1015
AScenario1016
PGPAlgorithms1017
KeyRings1018
PGPCertificates
1019
32.4FIREWALLS 1021
Packet-FilterFirewall1022
ProxyFirewall1023
32.5RECOMMENDED READING 1024
Books1024
32.6KEYlERMS1024
32.7SUMMARY 1025
32.8PRACTICESET1026
ReviewQuestions1026
Exercises1026
AppendixA Unicode1029
A.lUNICODE 1029
Planes1030
BasicMultilingualPlane(BMP)1030
Supplementary MultilingualPlane (SMP)1032
SupplementaryIdeographicPlane(SIP)1032
SupplementarySpecialPlane(SSP)1032
PrivateUsePlanes(PUPs)1032
A.2ASCII1032
SomePropertiesofASCII1036
AppendixB NumberingSystems1037
B.lBASE10:DECIMAL 1037
Weights1038
B.2BASE 2:BINARY1038
Weights1038
Conversion1038

xxviiiCONTENTS
B.3BASE 16:HEXADECIMAL 1039
Weights1039
Conversion1039
AComparison1040
BA BASE256: IPADDRESSES 1040
Weights1040
Conversion1040
B.5OTHERCONVERSIONS 1041
BinaryandHexadecimal 1041
Base256andBinary1042
AppendixC Mathenwtical
Revietv1043
C.1TRIGONOMETRICFUNCTIONS 1043
SineWave1043
CosineWave1045
OtherTrigonometricFunctions1046
TrigonometricIdentities1046
C.2FOURIERANALYSIS1046
FourierSeries1046
FourierTransform1048
C.3EXPONENTANDLOGARITHM 1050
ExponentialFunction1050
LogarithmicFunction
1051
Appendix0 8B/6TCode1055
AppendixE TelephoneHistory1059
Before19841059
Between1984and19961059
After1996 1059
AppendixF ContactAddresses1061
AppendixG RFCs1063
AppendixH UDPandTCPPorts1065
Acronyms1067
Glossary1071
References1107
Index
1111

Datacommunicationsandnetworkingmaybethefastestgrowingtechnologiesinour
culturetoday.One
oftheramificationsofthatgrowthisadramaticincreaseinthenumber
ofprofessionswhereanunderstanding ofthesetechnologiesisessentialfor success­
andaproportionateincreaseinthenumberandtypes ofstudentstakingcoursestolearn
aboutthem.
FeaturesoftheBook
Severalfeatures ofthistextaredesigned tomakeitparticularlyeasyforstudentsto
understanddatacommunicationsandnetworking.
Structure
Wehaveusedthefive-layerInternetmodelastheframeworkforthetextnotonlybecause
athoroughunderstanding
ofthemodelisessential tounderstandingmostcurrentnetwork­
ingtheorybutalsobecauseitisbasedonastructure
ofinterdependencies:Eachlayer
buildsuponthelayerbeneathitandsupportsthelayerabove
it.Inthesame way,eachcon­
ceptintroducedinourtextbuildsupontheconceptsexaminedintheprevioussections.The
Internetmodelwaschosenbecauseitisaprotocolthatisfullyimplemented.
Thistextisdesignedforstudentswithlittleornobackgroundintelecommunica­
tions
ordatacommunications.Forthisreason,weuseabottom-upapproach.Withthis
approach,studentslearnfirstaboutdatacommunications(lowerlayers)beforelearning
aboutnetworking(upperlayers).
VisualApproach
Thebookpresentshighlytechnicalsubjectmatterwithoutcomplexformulasbyusinga
balance
oftextandfigures.Morethan700figuresaccompanyingthetextprovidea
visualandintuitiveopportunityforunderstandingthematerial.Figuresareparticularly
importantinexplainingnetworkingconcepts,whicharebasedonconnectionsand
transmission.Both
oftheseideasareeasytograspvisually.
HighlightedPoints
Weemphasizeimportantconceptsinhighlightedboxesforquickreferenceandimme­
diateattention.
xxix

xxx PREFACE
ExamplesandApplications
Whenappropriate,wehaveselectedexamples toreflecttrue-to-lifesituations.Forexam­
ple,inChapter6wehaveshownseveralcases
oftelecommunicationsincurrenttelephone
networks.
RecommendedReading
Eachchapterincludesalist ofbooksandsitesthatcanbeusedforfurtherreading.
KeyTerms
Eachchapterincludesalist ofkeytermsforthestudent.
Summary
Eachchapterendswithasummary ofthematerialcoveredinthatchapter.Thesum­
maryprovidesabriefoverview
ofalltheimportantpointsinthechapter.
PracticeSet
Eachchapterincludesapracticesetdesignedtoreinforceandapplysalientconcepts. It
consistsofthreeparts:reviewquestions,exercises,andresearchactivities(onlyfor
appropriatechapters).Reviewquestionsareintendedtotestthestudent'sfirst-levelunder­
standing
ofthematerialpresentedinthechapter.Exercisesrequiredeeperunderstanding
ofthemateriaLResearchactivitiesaredesignedtocreatemotivationforfurtherstudy.
Appendixes
Theappendixesareintendedtoprovidequickreferencematerialorareview ofmateri­
alsneededtounderstandtheconceptsdiscussedinthebook.
GlossaryandAcronyms
Thebookcontains anextensive glossaryandalist ofacronyms.
ChangesintheFourthEdition
TheFourthEditionhasmajorchangesfromtheThirdEdition,bothintheorganization
andinthecontents.
Organization
Thefollowingliststhechangesintheorganization ofthebook:
1.Chapter6nowcontainsmultiplexing aswellasspreading.
2.Chapter8isnowtotallydevotedtoswitching.
3.ThecontentsofChapter12aremovedtoChapter11.
4.Chapter
17coversSONETtechnology.
5.Chapter19discussesIPaddressing.
6.Chapter20isdevotedtotheInternetProtocol.
7.Chapter
21discussesthreeprotocols: ARP,ICMP,andIGMP.
8.Chapter28isnewanddevotedtonetworkmanagementintheInternet.
9.ThepreviousChapters29to
31arenowChapters30to32.

PREFACE xxxi
Contents
Wehaverevisedthecontents ofmanychaptersincludingthefollowing:
1.ThecontentsofChapters1to5arerevisedandaugmented.Examplesareaddedto
clarifythecontents.
2.Thecontents
ofChapter10arerevisedandaugmentedtoincludemethods oferror
detectionandcorrection.
3.Chapter11isrevisedtoincludeafulldiscussion ofseveralcontrollinkprotocols.
4.Delivery,forwarding,androuting
ofdatagramsareaddedtoChapter22.
5.Thenewtransportprotocol,SCTP,isaddedtoChapter23.
6.ThecontentsofChapters30, 31,and32arerevisedandaugmented toinclude
additionaldiscussionaboutsecurityissuesandtheInternet.
7.Newexamplesareaddedtoclarifytheunderstanding ofconcepts.
EndMaterials
1.Asectionisaddedtotheend ofeachchapterlistingadditionalsourcesforstudy.
2.Thereviewquestionsarechangedandupdated.
3.Themultiple-choicequestionsaremovedtothebooksitetoallowstudentstoself-test
theirknowledgeaboutthecontents
ofthechapterandreceiveimmediatefeedback.
4.Exercisesarerevisedandnewonesareaddedtotheappropriatechapters.
5.Somechapterscontainresearchactivities.
InstructionalMaterials
Instructionalmaterialsforboththestudentandtheteacherarerevisedandaugmented.
Thesolutionstoexercisescontainboththeexplanationandanswerincludingfullcol­
oredfiguresortableswhenneeded.ThePowerpoint presentationsaremorecompre­
hensiveandincludetextandfigures.
Contents
Thebookisdividedintosevenparts.Thefirstpartisanoverview;thelastpartconcerns
networksecurity.Themiddlefivepartsaredesignedtorepresentthefivelayers
ofthe
Internetmodel.Thefollowingsummarizesthecontents
ofeachpart.
PartOne:Overview
Thefirstpartgivesageneraloverview ofdatacommunicationsandnetworking.Chap­
ter1coversintroductoryconceptsneededfortherest
ofthebook.Chapter2introduces
theInternetmodel.
PartTwo:PhysicalLayer
Thesecondpartisadiscussion ofthephysicallayer oftheInternetmodel.Chapters3
to6discusstelecommunicationaspects ofthephysicallayer.Chapter7introducesthe
transmissionmedia,which,althoughnotpart
ofthephysicallayer,iscontrolled byit.
Chapter8isdevotedtoswitching,whichcanbeused
inseverallayers.Chapter9shows
howtwopublicnetworks,telephoneandcable
TV,canbeusedfordatatransfer.

xxxiiPREFACE
PartThree:Data LinkLayer
ThethirdpartisdevotedtothediscussionofthedatalinklayeroftheInternetmodel.
Chapter10coverserrordetectionandcorrection.Chapters11,
12discussissuesrelated
todatalinkcontrol.Chapters
13through16dealwithLANs.Chapters 17and]8are
aboutWANs.LANsandWANsareexamples
ofnetworksoperatinginthefirsttwolay­
ers
oftheInternetmodel.
PartFour:NetworkLayer
Thefourthpartisdevoted
tothediscussionofthenetworklayeroftheInternetmodel.
Chapter
19coversIPaddresses.Chapters20and 21aredevotedtothenetworklayer
protocolssuch
asIP,ARP,ICMP,andIGMP.Chapter22discussesdelivery,forwarding,
androutingofpacketsintheInternet.
PartFive:TransportLayer
Thefifthpartisdevotedtothediscussionofthetransportlayer
oftheInternetmodel.
Chapter23givesanoverviewofthetransportlayeranddiscussestheservicesand
dutiesofthislayer.
Italsointroducesthreetransport-layerprotocols: UDP,TCP,and
SCTP.Chapter24discussescongestioncontrolandqualityofservice,twoissues
relatedtothetransportlayerandtheprevioustwolayers.
PartSix:ApplicationLayer
Thesixthpart
isdevotedtothediscussionoftheapplicationlayeroftheInternetmodel.
Chapter
25isaboutDNS,theapplicationprogramthatisusedbyotherapplicationpro­
gramstomapapplicationlayeraddressestonetworklayeraddresses.Chapter26to29
discusssomecommonapplicationsprotocolsintheInternet.
PartSeven:Security
Theseventhpartisadiscussionofsecurity.
Itservesasapreludetofurtherstudyinthis
subject.Chapter30brieflydiscussescryptography.Chapter
31introducessecurity
aspects.Chapter32showshowdifferentsecurityaspectscanbeappliedtothreelayers
oftheInternetmodel.
OnlineLearningCenter
TheMcGraw-HillOnlineLearningCentercontainsmuchadditionalmaterial.Avail­
ableatwww.mhhe.com/forouzan.Asstudentsreadthrough
DataCommunicationsand
Networking,
theycangoonlinetotakeself-gradingquizzes.Theycanalsoaccesslec­
turematerialssuch
asPowerPointslides,andgetadditionalreviewfromanimatedfig­
uresfromthebook.Selectedsolutionsarealsoavailableoverthe
Web.Thesolutionsto
odd-numberedproblemsareprovidedtostudents,andinstructorscanuseapasswordto
accessthecompletesetofsolutions.
Additionally,McGraw-Hillmakesiteasytocreateawebsiteforyournetworking
coursewithanexclusiveMcGraw-HillproductcalledPageOut.
Itrequiresnoprior
knowledgeofHTML,
nolonghours,andnodesignskillsonyourpart.Instead,
Page:­
Outoffersaseries oftemplates.Simplyfillthemwithyourcourseinformationand

PREFACE xxxiii
clickonone of16designs.Theprocesstakesunder anhourandleavesyouwithapro­
fessionallydesignedwebsite.
AlthoughPageOutoffers"instant"development,thefinishedwebsiteprovidespow­
erfulfeatures.Aninteractivecoursesyllabusallowsyoutopostcontenttocoincidewith
yourlectures,
sowhenstudentsvisityourPageOutwebsite,yoursyllabuswilldirectthem
tocomponents
ofForouzan'sOnlineLearningCenter,orspecificmaterial ofyourown.
HowtoUsetheBook
Thisbookiswrittenforbothanacademicandaprofessionalaudience.Thebookcanbe
usedasaself-studyguideforinterestedprofessionals.Asatextbook,itcanbeusedfor
aone-semesterorone-quartercourse.Thefollowingaresomeguidelines.
oPartsonetothreearestronglyrecommended.
o
Partsfourtosixcanbecovered ifthereisnofollowingcoursein TCP/IPprotocol.
oPartsevenisrecommended ifthereisnofollowingcourseinnetworksecurity.
Acknowledgments
Itisobviousthatthedevelopment ofabookofthisscopeneedsthesupport ofmanypeople.
PeerReview
Themostimportantcontributiontothedevelopment
ofabooksuchasthiscomesfrom
peerreviews.Wecannotexpressourgratitudeinwordstothemanyreviewerswho
spentnumeroushoursreadingthemanuscriptandprovidinguswithhelpfulcomments
andideas.Wewouldespeciallyliketoacknowledgethecontributions
ofthefollowing
reviewersforthethirdandfourtheditions
ofthisbook.
FaridAhmed,CatholicUniversity
KavehAshenayi,University
ofTulsa
YorisAu,University
ofTexas,SanAntonio
EssieBakhtiar,ClaytonCollege
&StateUniversity
AnthonyBarnard,University
ofAlabama,Brimingham
A.T.Burrell,OklahomaStateUniversity
ScottCampbell,MiamiUniversity
TeresaCarrigan,BlackburnCollege
HwaChang,TuftsUniversity
EdwardChlebus,IllinoisInstitute
ofTechnology
PeterCooper,SamHoustonStateUniversity
RichardCoppins,VirginiaCommonwealthUniversity
HarpalDhillon,SouthwesternOklahomaStateUniversity
Hans-PeterDommel,SantaClaraUniversity
M.
BarryDumas,BaruchCollege, CUNY
WilliamFigg,DakotaStateUniversity
DaleFox,QuinnipiacUniversity
TerrenceFries,CoastalCarolinaUniversity
ErrinFulp,
WakeForestUniversity

xxxivPREFACE
SandeepGupta, ArizonaStateUniversity
GeorgeHamer, SouthDakotaStateUniversity
JamesHenson, CaliforniaStateUniversity,Fresno
TomHilton, UtahStateUniversity
AllenHolliday, CaliforniaStateUniversity,Fullerton
SeyedHosseinHosseini, UniversityofWisconsin,Milwaukee
GeraldIsaacs, CarrollCollege,Waukesha
HrishikeshJoshi, DeVryUniversity
E.S.Khosravi,SouthernUniversity
BobKinicki,WorcesterPolytechnicUniversity
KevinKwiat, HamiltonCollege
Ten-HwangLai, OhioStateUniversity
Chung-WeiLee, AuburnUniversity
Ka-CheongLeung, TexasTechUniversity
GertrudeLevine, FairleighDickinsonUniversity
AlvinSekSeeLim, AuburnUniversity
CharlesLiu, CaliforniaStateUniversity,LosAngeles
WenhangLiu, CaliforniaStateUniversity,LosAngeles
MarkLlewellyn, UniversityofCentralFlorida
SanchitaMal-Sarkar, ClevelandStateUniversity
LouisMarseille, HarfordCommunityCollege
KevinMcNeill, UniversityofArizona
ArnoldC.Meltzer, GeorgeWashingtonUniversity
RaymanMeservy, BrighamYoungUniversity
PrasantMohapatra, UniversityofCalifornia,Davis
HungZNgo, SUNY,Buffalo
LarryOwens, CaliforniaStateUniversity,Fresno
ArnoldPatton, BradleyUniversity
DollySamson, HawaiiPacificUniversity
JosephSherif, CaliforniaStateUniversity,Fullerton
RobertSimon, GeorgeMasonUniversity
Ronald1.Srodawa,OaklandUniversity
DanielTian, CaliforniaStateUniversity,MontereyBay
RichardTibbs, RadfordUniversity
ChristopheVeltsos, MinnesotaStateUniversity,Mankato
YangWang, UniversityofMaryland,CollegePark
SheraliZeadally, WayneStateUniversity
McGraw-Hill
Staff
Specialthanksgotothestaff ofMcGraw-Hill.AlanApt,ourpublisher,provedhowa
proficientpublishercanmaketheimpossiblepossible.RebeccaOlson,thedevelopmen­
taleditor,gaveushelpwheneverweneededit.SheilaFrank,
ourprojectmanager,
guidedusthroughtheproductionprocesswithenormousenthusiasm.Wealsothank
DavidHashindesign,KaraKudronowiczinproduction,andPattiScott,thecopyeditor.

Overview
Objectives
Part1providesageneralidea ofwhatwewillseeintherest ofthebook.Fourmajor
conceptsarediscussed:datacommunications,networking,protocolsandstandards,
andnetworkingmodels.
Networksexistsothatdatamaybesentfromoneplaceto
another-thebasiccon­
cept
ofdatacommunications. Tofullygraspthissubject,wemustunderstandthedata
communicationcomponents,howdifferenttypes
ofdatacanberepresented,andhow
tocreateadata
flow.
Datacommunicationsbetweenremotepartiescanbeachievedthroughaprocess
called
networking,involvingtheconnection ofcomputers,media,andnetworking
devices.Networksaredividedintotwomaincategories:localareanetworks(LANs)
andwideareanetworks(WANs).Thesetwotypes
ofnetworkshavedifferentcharac­
teristicsanddifferentfunctionalities.TheInternet,themainfocus
ofthebook,isa
collection
ofLANsandWANsheldtogetherbyinternetworkingdevices.
Protocolsandstandards arevitaltotheimplementation ofdatacommunications
andnetworking.Protocolsrefertotherules;astandardisaprotocolthathasbeen
adoptedbyvendorsandmanufacturers.
Networkmodels servetoorganize,unify,andcontrolthehardwareandsoftwarecom­
ponents
ofdatacommunicationsandnetworking.Althoughtheterm"networkmodel"
suggestsarelationshiptonetworking,themodelalsoencompassesdatacommunications.
Chapters
Thispartconsists oftwochapters:Chapter1andChapter 2.
Chapter1
InChapter1,weintroducetheconcepts ofdatacommunicationsandnetworking. Wedis­
cussdatacommunicationscomponents,datarepresentation,anddata
flow.Wethenmove
tothestructure
ofnetworksthatcarrydata. Wediscussnetworktopologies,categories
ofnetworks,andthegeneralideabehindtheInternet.Thesectiononprotocolsand
standardsgivesaquickoverviewoftheorganizationsthatsetstandardsindatacommuni­
cationsandnetworking.

Chapter2
ThetwodominantnetworkingmodelsaretheOpenSystemsInterconnection(OSI)and
theInternetmodel(TCP/IP).Thefirstisatheoreticalframework;thesecondisthe
actualmodelusedintoday'sdatacommunications.
InChapter2,wefirstdiscussthe
OSImodeltogiveageneralbackground.
WethenconcentrateontheInternetmodel,
whichisthefoundationfortherest
ofthebook.

CHAPTERl
Introduction
Datacommunicationsandnetworkingarechangingthewaywe dobusinessandtheway
welive.Businessdecisionshavetobemadeevermorequickly,andthedecisionmakers
requireimmediateaccesstoaccurateinformation.Whywaitaweekforthatreport
fromGermany
toarrivebymailwhenitcouldappearalmostinstantaneouslythrough
computernetworks?Businessestodayrelyoncomputernetworksandinternetworks.
Butbeforeweaskhowquickly
wecangethookedup,weneed toknowhownetworks
operate,whattypesoftechnologiesareavailable,andwhichdesignbestfillswhichset
ofneeds.
Thedevelopment
ofthepersonalcomputerbroughtabouttremendouschangesfor
business,industry,science,andeducation.Asimilarrevolutionisoccurringindata
communicationsandnetworking.Technologicaladvancesaremakingitpossiblefor
communicationslinkstocarrymoreandfastersignals.
Asaresult,servicesareevolving
toallowuse
ofthisexpandedcapacity.Forexample,establishedtelephoneservices
suchasconferencecalling,callwaiting,voicemail,andcaller
IDhavebeenextended.
Researchindatacommunicationsandnetworkinghasresultedinnewtechnolo­
gies.Onegoalistobeabletoexchangedatasuchastext,audio, andvideofromall
points
intheworld.WewanttoaccesstheInternettodownloadanduploadinformation
quicklyandaccuratelyandatanytime.
Thischapteraddressesfourissues:data communications,networks,theInternet,
andprotocolsandstandards.Firstwegiveabroaddefinitionofdatacommunications.
Thenwedefinenetworks
asahighwayonwhichdatacantravel.TheInternetisdis­
cussedasagoodexample
ofaninternetwork(i.e.,anetwork ofnetworks).Finally,we
discussdifferenttypes
ofprotocols,thedifferencebetweenprotocolsandstandards,
andtheorganizationsthatsetthosestandards.
1.1DATACOMMUNICATIONS
Whenwecommunicate,wearesharinginformation.Thissharingcanbelocalor
remote.Betweenindividuals,localcommunicationusuallyoccursfacetoface,while
remotecommunicationtakesplaceoverdistance.Theterm
telecommunication,which
3
I I
,I

4 CHAPTER1INTRODUCTION
includestelephony,telegraphy,andtelevision,meanscommunicationatadistance (tele
isGreekfor"far").
Theword
datareferstoinformation presentedinwhateverformisagreedupon by
thepartiescreatingandusingthedata.
Datacommunicationsaretheexchange ofdatabetween twodevicesviasome
form
oftransmissionmediumsuchasawirecable. Fordatacommunicationstooccur,
thecommunicatingdevicesmustbepart
ofacommunicationsystemmadeup ofacom­
bination
ofhardware(physicalequipment)andsoftware(programs). Theeffectiveness
ofadatacommunicationssystemdependsonfourfundamentalcharacteristics:deliv­
ery,accuracy,timeliness,andjitter.
I.Delivery.Thesystemmustdeliverdatatothecorrectdestination.Datamustbe
receivedbytheintendeddevice
oruserandonly bythatdeviceoruser.
7Accuracy.Thesystemmustdeliverthedataaccurately.Datathathavebeen
alteredintransmissionandleftuncorrectedareunusable.
3.Timeliness.Thesystemmustdeliverdatainatimelymanner.Datadeliveredlateare
useless.
Inthecaseofvideoandaudio,timelydeliverymeansdeliveringdataas
theyareproduced,inthesameorderthattheyareproduced,andwithoutsignifi­
cantdelay.Thiskind
ofdeliveryiscalled real-timetransmission.
-\..Jitter.Jitterreferstothevariationinthepacketarrivaltime. Itistheunevendelayin
thedelivery
ofaudioorvideopackets.Forexample,letusassumethatvideopackets
aresentevery
3Dms.Ifsomeofthepacketsarrivewith 3D-msdelayandotherswith
4D-msdelay,anunevenqualityinthevideoistheresult.
COinponents
Adatacommunicationssystemhasfivecomponents(seeFigure1.1).
Figure1.1Fivecomponents ofdatacommunication
Rule1:
Rule2:
Rulen:
Protocol
-1Messager
Medium
Protocol
Rule1:
Rule2:
Rulen:
I.Message.Themessageistheinformation(data)tobecommunicated.Popular
forms
ofinformationincludetext,numbers,pictures,audio,andvideo.
ISender.Thesenderisthedevicethatsendsthedatamessage.Itcan beacom­
puter,workstation,telephonehandset,videocamera,andsoon.
3.Receiver.Thereceiveristhedevicethatreceivesthemessage. Itcanbeacom­
puter,workstation,telephonehandset,television,andsoon.
-1..Transmissionmedium. Thetransmissionmedium isthephysicalpathbywhich
amessagetravelsfromsendertoreceiver.Someexamples
oftransmissionmedia
includetwisted-pairwire,coaxialcable,fiber-opticcable,andradiowaves.

SECTION1.1DATACOMMUNICATIONS 5
5.Protocol.Aprotocolisaset ofrulesthatgoverndatacommunications.Itrepre­
sentsanagreementbetweenthecommunicatingdevices.Withoutaprotocol,two
devicesmaybeconnectedbutnotcommunicating,just
asapersonspeakingFrench
cannotbeunderstoodbyapersonwhospeaksonlyJapanese.
DataRepresentation
Informationtodaycomesindifferentformssuch astext,numbers,images,audio,and
video.
Text
Indatacommunications,text isrepresentedasabitpattern,asequence ofbits(Osor
Is).Differentsets
ofbitpatternshavebeendesignedtorepresenttextsymbols.Eachset
iscalledacode,andtheprocessofrepresentingsymbols
iscalledcoding.Today,the
prevalentcodingsystem
iscalledUnicode,whichuses32bitstorepresentasymbolor
characterusedinanylanguageintheworld.The
AmericanStandardCodeforInfor­
mationInterchange(ASCII),developedsomedecadesagointheUnitedStates,now
constitutesthefirst
127charactersinUnicodeandisalsoreferredto asBasicLatin.
AppendixAincludespart oftheUnicode.
Numbers
Numbersarealsorepresentedbybitpatterns.However,acodesuch asASCIIisnotused
torepresentnumbers;thenumber
isdirectlyconvertedtoabinarynumber tosimplify
mathematicaloperations.AppendixBdiscussesseveraldifferentnumberingsystems.
Images
Imagesarealsorepresentedbybitpatterns. Initssimplestform,animageiscomposed
ofamatrixofpixels(pictureelements),whereeachpixel isasmalldot.Thesize ofthe
pixeldependsonthe
resolution.Forexample,animagecanbedividedinto1000pixels
or10,000pixels.
Inthesecondcase,thereisabetterrepresentation oftheimage(better
resolution),butmorememory
isneededtostoretheimage.
Afteranimage
isdividedintopixels,eachpixelisassignedabitpattern.Thesize
andthevalue
ofthepatterndependonthe image.Foranimagemade ofonlyblack­
and-whitedots(e.g.,achessboard),aI-bitpattern
isenoughtorepresentapixel.
Ifanimageisnotmade ofpurewhiteandpureblackpixels,youcanincreasethe
size
ofthebitpatterntoincludegrayscale.Forexample,toshowfourlevels ofgray
scale,youcanuse2-bitpatterns.Ablackpixelcanberepresentedby00,adarkgray
pixelby01,alightgraypixelby
10,andawhitepixelby 11.
Thereareseveralmethods torepresentcolorimages.Onemethod iscalledRGB,
socalledbecauseeachcolorismade
ofacombinationofthreeprimarycolors: red,
green,andblue.Theintensity ofeachcolorismeasured,andabitpatternisassignedto
it.Anothermethod
iscalledYCM,inwhichacolorismadeofacombinationofthree
otherprimarycolors:yellow,cyan,andmagenta.
Audio
Audioreferstotherecordingorbroadcastingofsoundormusic.Audioisbynature
differentfromtext,numbers,orimages.Itiscontinuous,notdiscrete.Evenwhenwe

6 CHAPTER 1INTRODUCTION
useamicrophonetochangevoiceormusictoanelectricsignal,wecreateacontinuous
signal.InChapters4and5,welearnhowtochangesoundormusictoadigitaloran
analogsignal.
Video
Videoreferstotherecording orbroadcastingofapictureormovie.Videocaneitherbe
producedasacontinuousentity(e.g.,bya
TVcamera),oritcanbeacombination of
images,eachadiscreteentity,arrangedtoconveythe ideaofmotion.Againwecan
changevideotoadigitalorananalogsignal,aswewillseeinChapters4and5.
DataFlow
Communicationbetweentwodevicescan besimplex,half-duplex, orfull-duplexas
showninFigure1.2.
Figure1.2Dataflow(simplex,half-duplex, andfull-duplex)
Mainframe
a.Simplex
b.Half-duplex
c.Full·duplex
Directionofdata
Direction
ofdataattimeI
~
Directionofdataattime2
Direction
ofdataallthetime
)
Monitor
Simplex
Insimplexmode,thecommunicationisunidirectional,asonaone-waystreet.Only one
ofthetwodevicesonalinkcantransmit;theothercan onlyreceive(seeFigure1.2a).
Keyboardsandtraditionalmonitorsareexamples
ofsimplexdevices. Thekey­
boardcanonlyintroduceinput;themonitorcanonlyacceptoutput.
Thesimplexmode
canusetheentirecapacity
ofthechanneltosenddatainonedirection.
Half-Duplex
Inhalf-duplexmode,eachstationcanbothtransmitandreceive,butnotatthesametime.:
Whenonedeviceissending,theothercanonlyreceive,andviceversa(seeFigure1.2b).

SECTION1.2NETWORKS 7
Thehalf-duplexmodeislikeaone-laneroadwithtrafficallowedinbothdirec­
tions.Whencarsaretravelinginonedirection,carsgoingtheotherwaymustwait.Ina
half-duplextransmission,theentirecapacity
ofachannelistakenoverbywhichever of
thetwodevicesistransmittingatthetime.Walkie-talkiesandCB(citizensband)radios
arebothhalf-duplexsystems.
Thehalf-duplexmodeisusedincaseswherethereisnoneedforcommunication
inbothdirectionsatthesametime;theentirecapacity
ofthechannelcanbeutilizedfor
eachdirection.
Full-Duplex
In
full-duplex
m.,lle(als@calledduplex),bothstationscantransmitandreceivesimul­
taneously(seeFigure1.2c).
Thefull-duplexmode
islikea
tW<D-waystreetwithtrafficflowinginbothdirec­
tionsatthesametime.Infull-duplexmode,si~nalsgoinginonedirectionsharethe
capacity
ofthelink:withsignalsgoingintheother
din~c~on. Thissharingcanoccurin
twoways:Eitherthelinkmustcontaintwophysicallyseparatet:nmsmissiIDnpaths,one
forsendingandtheotherforreceiving;orthecapacity
ofthe
ch:arillilelisdivided
betweensignalstravelinginbothdirections.
Onecommonexample
offull-duplexcommunicationisthetelephonenetwork.
Whentwopeoplearecommunicatingbyatelephoneline,bothcantalkandlistenatthe
sametime.
Thefull-duplexmodeisusedwhencommunicationinbothdirectionsisrequired
allthetime.Thecapacity
ofthechannel,however,mustbedividedbetweenthetwo
directions.
1.2NETWORKS
Anetworkisasetofdevices(oftenreferredtoasnodes)connectedbycommunication
links.Anodecanbeacomputer,printer,oranyotherdevicecapable
ofsendingand/or
receivingdatageneratedbyothernodesonthenetwork.
DistributedProcessing
Mostnetworksuse distributedprocessing, inwhichataskisdividedamongmultiple
computers.Insteadofonesinglelargemachinebeingresponsibleforallaspects
ofa
process,separatecomputers(usuallyapersonalcomputerorworkstation)handlea
subset.
NetworkCriteria
Anetworkmustbeabletomeetacertainnumber ofcriteria.Themost important of
theseareperformance,reliability,andsecurity.
Performance
Performancecanbemeasuredinmanyways,includingtransittimeandresponsetime.
Transittimeistheamount
oftimerequiredforamessagetotravelfromonedeviceto

8 CHAPTER1INTRODUCTION
another.Responsetimeistheelapsedtimebetweenaninquiryandaresponse.Theper­
formance
ofanetworkdependsonanumberoffactors,includingthenumber ofusers,
thetypeoftransmissionmedium,thecapabilitiesoftheconnectedhardware,andthe
efficiencyofthesoftware.
Performanceisoftenevaluatedbytwonetworkingmetrics:
throughputanddelay.
Weoftenneedmorethroughputandlessdelay.However,thesetwocriteriaareoften
contradictory.
Ifwetrytosendmoredatatothenetwork,wemayincreasethroughput
butweincreasethedelaybecause
oftrafficcongestioninthenetwork.
Reliability
Inadditiontoaccuracyofdelivery,networkreliabilityismeasuredbythefrequency of
failure,thetimeittakesalinktorecoverfromafailure,andthenetwork'srobustnessin
acatastrophe.
Security
Networksecurityissuesincludeprotectingdatafromunauthorizedaccess,protecting
datafromdamageanddevelopment,andimplementingpoliciesandproceduresfor
recoveryfrombreachesanddatalosses.
PhysicalStructures
Beforediscussingnetworks,weneed todefinesomenetworkattributes.
TypeofConnection
Anetworkistwoormoredevicesconnectedthroughlinks.Alinkisacommunications
pathwaythattransfersdatafromonedevicetoanother.Forvisualization purposes,itis
simplesttoimagineanylink
asalinedrawnbetweentwopoints.Forcommunicationto
occur,twodevicesmustbeconnectedinsomewaytothesamelinkatthesametime.
Therearetwopossibletypesofconnections:point-to-pointandmultipoint.
Point-to-PointApoint-to-pointconnectionprovidesadedicatedlinkbetweentwo
devices.Theentirecapacityofthelinkisreservedfortransmissionbetweenthosetwo
devices.Mostpoint-to-pointconnectionsuseanactuallength
ofwireorcable tocon­
nectthetwoends,butotheroptions,such
asmicrowaveorsatellitelinks,arealsopossi­
ble(seeFigure1.3a).Whenyouchangetelevisionchannels
byinfraredremotecontrol,
youareestablishingapoint-to-pointconnectionbetweentheremotecontrolandthe
television'scontrolsystem.
MultipointAmultipoint(alsocalledmultidrop)connection
isoneinwhichmore
thantwospecificdevicesshareasinglelink(seeFigure1.3b).
Inamultipointenvironment,thecapacity
ofthechannelisshared,eitherspatially
ortemporally.
Ifseveraldevicescanusethelinksimultaneously,itisa spatiallyshared
connection.Ifusersmust taketurns,itisa timesharedconnection.
PhysicalTopology
Thetermphysicaltopology referstothewayinwhichanetworkislaidoutphysically.:
1\voormoredevicesconnecttoalink;twoormorelinksformatopology.Thetopology

SECTION1.2NETWORKS 9
Figure1.3 Typesofconnections:point-to-point andmultipoint
Link
a.Point-to-point
Mainframe
Link
b.Multipoint
ofanetworkisthegeometricrepresentation oftherelationshipofallthelinksand
linkingdevices(usuallycalled
nodes)tooneanother.Therearefourbasictopologies
possible:mesh,star,bus,andring(seeFigure1.4).
Figure
1.4Categoriesoftopology
MeshInameshtopology, everydevicehasadedicatedpoint-to-pointlinktoevery
otherdevice.Theterm
dedicatedmeansthatthelinkcarriestrafficonlybetweenthe
twodevicesitconnects.
Tofindthenumber ofphysicallinksinafullyconnectedmesh
networkwith
nnodes,wefirstconsiderthateachnodemustbeconnectedtoevery
othernode.Node1mustbeconnectedto
n-Inodes,node2mustbeconnectedto n-1
nodes,andfinallynode
nmustbeconnectedto n-1nodes.Weneedn(n- 1)physical
links.However,
ifeachphysicallinkallowscommunicationinbothdirections(duplex
mode),wecandividethenumber
oflinksby 2.Inotherwords,wecansaythatina
meshtopology,weneed
n(n-1)/2
duplex-modelinks.
Toaccommodatethatmanylinks,everydeviceonthenetworkmusthave n-1
input/output
(VO)ports(seeFigure1.5)tobeconnectedtotheother n-1stations.

10 CHAPTER1INTRODUCTION
Figure1.5Afullyconnectedmeshtopology(fivedevices)
Ameshoffersseveraladvantagesoverothernetworktopologies.First,theuse of
dedicatedlinksguaranteesthateachconnectioncancarryitsowndataload,thuselimi­
natingthetrafficproblemsthatcanoccurwhenlinksmustbesharedbymultipledevices.
Second,ameshtopologyisrobust.
Ifonelinkbecomesunusable,itdoesnotincapaci­
tatetheentiresystem.Third,thereistheadvantage
ofprivacyorsecurity.Whenevery
messagetravelsalongadedicatedline,onlytheintendedrecipientseesit.Physical
boundariespreventotherusersfromgainingaccesstomessages.Finally,point-to-point
linksmakefaultidentificationandfaultisolationeasy.Trafficcanberoutedtoavoid
linkswithsuspectedproblems.Thisfacilityenablesthenetworkmanagertodiscoverthe
preciselocation
ofthefaultandaidsinfindingitscauseandsolution.
Themaindisadvantages
ofamesharerelatedtotheamount ofcablingandthe
number
ofI/Oportsrequired.First,becauseeverydevicemustbeconnectedtoevery
otherdevice,installationandreconnectionaredifficult.Second,thesheerbulk
ofthe
wiringcanbegreaterthantheavailablespace(inwalls,ceilings,orfloors)canaccom­
modate.Finally,thehardwarerequiredtoconnecteachlink(I/Oportsandcable)canbe
prohibitivelyexpensive.Forthesereasonsameshtopologyisusuallyimplementedina
limitedfashion,forexample,asabackboneconnectingthemaincomputers
ofahybrid
networkthatcanincludeseveralothertopologies.
Onepracticalexample
ofameshtopologyistheconnection oftelephoneregional
officesinwhicheachregionalofficeneeds to
beconnectedtoeveryotherregionaloffice.
StarTopologyIna startopology,eachdevicehasadedicatedpoint-to-pointlink
onlytoacentralcontroller,usuallycalledahub.Thedevicesarenotdirectlylinkedto
oneanother.Unlikeameshtopology,astartopologydoesnotallowdirecttraffic
betweendevices.Thecontrolleractsasanexchange:
Ifonedevicewantstosenddatato
another,itsendsthedatatothecontroller,whichthenrelaysthedatatotheothercon­
necteddevice(seeFigure1.6).
Astartopology
islessexpensivethanameshtopology.Inastar,eachdeviceneeds
onlyonelinkandoneI/Oporttoconnectittoanynumber
ofothers.Thisfactoralso
makesiteasytoinstallandreconfigure.Farlesscablingneedstobehoused,andaddi­
tions,moves,anddeletionsinvolveonlyoneconnection:betweenthatdeviceandthehub.
Otheradvantagesincluderobustness.
Ifonelinkfails,onlythatlinkisaffected.All
otherlinksremainactive.Thisfactoralsolendsitselftoeasyfaultidentificationand

SECTION1.2NETWORKS 11
Figure1.6 Astartopologyconnectingfourstations
Hub
faultisolation.Aslongasthehubisworking,itcanbeusedtomonitorlinkproblems
andbypassdefectivelinks.
Onebigdisadvantage
ofastartopologyisthedependency ofthewholetopology
ononesinglepoint,thehub.
Ifthehubgoesdown,thewholesystem isdead.
Althoughastarrequiresfarlesscablethanamesh,eachnodemustbelinkedtoa
centralhub.Forthisreason,oftenmorecablingisrequiredinastarthan
insomeother
topologies(suchasringorbus).
Thestartopologyisusedinlocal-areanetworks(LANs),aswewillsee
inChapter13.
High-speedLANsoftenuseastartopologywithacentralhub.
BusTopologyTheprecedingexamplesalldescribepoint-to-pointconnections.Abus
topology,ontheotherhand,ismultipoint.Onelongcableacts
asabackbonetolinkall
thedevicesinanetwork(seeFigure1.7).
Figure1.7
Abustopologyconnectingthreestations
Dropline Dropline Dropline
Cableend
11I-----1..-----..-----..----11Cableend
Tap Tap Tap
Nodesareconnectedtothebuscablebydroplinesandtaps.Adroplineisacon­
nectionrunningbetweenthedeviceandthemaincable.Atapisaconnectorthateither
splicesintothemaincable
orpuncturesthesheathing ofacabletocreateacontactwith
themetalliccore.Asasignaltravelsalongthebackbone,some
ofitsenergyistransformed
intoheat.Therefore,itbecomesweakerandweaker
asittravelsfartherandfarther.For
thisreasonthereisalimitonthenumber
oftapsabuscansupportandonthedistance
betweenthosetaps.
Advantages
ofabustopologyincludeease ofinstallation.Backbonecablecanbe
laidalongthemostefficientpath,thenconnectedtothenodesbydroplines
ofvarious
lengths.Inthisway,abususeslesscablingthanmeshorstartopologies.Inastar,for
example,fournetworkdevicesinthesameroomrequirefourlengths
ofcablereaching

12 CHAPTER1INTRODUCTION
allthewaytothehub.Inabus,thisredundancyiseliminated.Onlythebackbonecable
stretchesthroughtheentirefacility.Eachdroplinehastoreachonlyasfarasthenear­
estpointonthebackbone.
Disadvantagesincludedifficultreconnectionandfaultisolation.Abusisusually
designedtobeoptimallyefficientatinstallation.
Itcanthereforebedifficulttoaddnew
devices.Signalreflectionatthetapscancausedegradationinquality.Thisdegradation
canbecontrolledbylimitingthenumberandspacing
ofdevicesconnectedtoagiven
length
ofcable.Addingnewdevicesmaythereforerequiremodification orreplacement
ofthebackbone.
Inaddition,afaultorbreakinthebuscablestopsalltransmission,evenbetween
devicesonthesameside
oftheproblem.Thedamagedareareflectssignalsbackinthe
direction
oforigin,creatingnoiseinbothdirections.
Bustopologywastheone
ofthefirsttopologiesusedinthedesign ofearlylocal­
areanetworks.EthernetLANscanuseabustopology,buttheyarelesspopularnowfor
reasonswewilldiscussinChapter
13.
RingTopologyIna ringtopology,eachdevicehasadedicatedpoint-to-pointcon­
nectionwithonlythetwodevicesoneitherside
ofit.Asignalispassedalongthering
inonedirection,fromdevicetodevice,untilitreachesitsdestination.Eachdevicein
theringincorporatesarepeater.Whenadevicereceivesasignalintendedforanother
device,itsrepeaterregeneratesthebitsandpassesthemalong(seeFigure1.8).
Figure1.8Aringtopologyconnectingsixstations
Repeater
Repeater
Repeater
Repeater
Repeater
Repeater
Aringisrelativelyeasytoinstallandreconfigure.Eachdeviceislinkedtoonlyits
immediateneighbors(eitherphysicallyorlogically).Toadd
ordeleteadevice requires
changingonlytwoconnections.Theonlyconstraintsaremediaandtrafficconsider­
ations(maximumringlengthandnumber
ofdevices).Inaddition,faultisolationissim­
plified.Generallyinaring,asignaliscirculatingatalltimes.
Ifonedevicedoesnot
receiveasignalwithinaspecifiedperiod,itcanissueanalarm.Thealarmalertsthe
networkoperatortotheproblemanditslocation.
However,unidirectionaltrafficcanbeadisadvantage.Inasimplering,abreakin
thering(suchasadisabledstation)candisabletheentirenetwork.Thisweaknesscan
besolvedbyusingadualringoraswitchcapable
ofclosingoffthebreak.

SECTION1.2NETWORKS 13
RingtopologywasprevalentwhenIBMintroduceditslocal-area networkToken
Ring.Today,theneedforhigher-speedLANshasmadethistopologylesspopular.
HybridTopologyAnetworkcanbehybrid.Forexample,wecanhaveamainstartopol­
ogywitheachbranchconnectingseveralstationsinabustopologyasshown
inFigure1.9.
Figure1.9Ahybridtopology:astarbackbonewiththreebusnetworks
Hub
NetworkModels
Computernetworksarecreatedbydifferententities.Standardsareneededsothatthese
heterogeneousnetworkscancommunicatewithoneanother.Thetwobest-known
stan­
dardsaretheOSImodelandtheInternetmodel.InChapter2wediscussthesetwo
models.TheOSI(OpenSystemsInterconnection)modeldefinesaseven-layernet­
work;theInternetmodeldefinesafive-layernetwork.ThisbookisbasedontheInternet
modelwithoccasionalreferencestotheOSImodel.
CategoriesofNetworks
Todaywhenwespeak ofnetworks,wearegenerallyreferringtotwoprimarycatego­
ries:local-areanetworksandwide-areanetworks.Thecategoryintowhichanetwork
fallsisdeterminedbyitssize.ALANnormallycoversanarealessthan2mi;aWANcan
beworldwide.Networks
ofasizeinbetweenarenormallyreferredtoasmetropolitan­
areanetworksandspantens
ofmiles.
LocalAreaNetwork
Alocalareanetwork(LAN)isusuallyprivatelyownedandlinksthedevicesinasingle
office,building,orcampus(seeFigure1.10).Dependingontheneeds
ofanorganization
andthetypeoftechnologyused,aLANcanbeassimpleastwoPCsandaprinterin
someone'shomeoffice;oritcanextendthroughoutacompanyandincludeaudioand
videoperipherals.Currently,LANsize
islimitedtoafewkilometers.

14 CHAPTER1INTRODUCTION
Figure1.10AnisolatedIANconnecting12computerstoahubinacloset
Hub
LANsaredesignedtoallowresourcestobesharedbetweenpersonalcomputers or
workstations.Theresourcestobesharedcanincludehardware(e.g.,aprinter),software
(e.g.,anapplicationprogram),
ordata.Acommonexample ofaLAN,foundinmany
businessenvironments,linksaworkgroup
oftask-relatedcomputers,forexample,engi­
neeringworkstations
oraccountingPCs.One ofthecomputersmaybegivenalarge­
capacitydiskdriveandmaybecomeaservertoclients.Softwarecanbestoredonthis
centralserverandusedasneededbythewholegroup.Inthisexample,thesize
ofthe
LANmaybedeterminedbylicensingrestrictionsonthenumber
ofuserspercopy ofsoft­
ware,
orbyrestrictionsonthenumber ofuserslicensedtoaccesstheoperatingsystem.
Inadditiontosize,LANsaredistinguishedfromothertypes
ofnetworksbytheir
transmissionmediaandtopology.Ingeneral,agivenLANwilluseonlyonetype
of
transmissionmedium.Themostcommon LANtopologiesarebus,ring,andstar.
EarlyLANshaddataratesinthe4to16megabitspersecond(Mbps)range.Today,
however,speedsarenormally100
or1000Mbps. LANsarediscussedatlengthin
Chapters13, 14,and15.
Wireless
LANsarethenewestevolutionin LANtechnology.Wediscusswireless
LANsindetailinChapter14.
WideAreaNetwork
Awideareanetwork(WAN)provideslong-distancetransmission ofdata,image,audio,
andvideoinformationoverlargegeographicareasthatmaycompriseacountry,aconti­
nent,
oreventhewholeworld.InChapters 17and18wediscusswide-areanetworksin
greaterdetail.AWANcanbeascomplexasthebackbonesthatconnecttheInternetoras
simpleasadial-uplinethatconnectsahomecomputertotheInternet.Wenormallyrefer
tothefirstasaswitchedWANandtothesecondasapoint-to-pointWAN(Figure1.11).
TheswitchedWANconnectstheendsystems,whichusuallycomprisearouter(internet­
workingconnectingdevice)thatconnectstoanotherLAN
orWAN.Thepoint-to-point
WANisnormallyalineleasedfromatelephone
orcableTVproviderthatconnectsa
homecomputerorasmallLANtoanInternetserviceprovider(lSP).Thistype
ofWAN
isoftenusedtoprovideInternetaccess.

Computer
SECTION1.2NETWORKS
Figure1.11WANs:aswitchedWAN andapoint-to-pointWAN
a.SwitchedWAN
Point-te-point~d::_:
WAN .c' .-- cu::J::W
~
ii~~;-E=~~~· "",,~!j.,..;~,-, E::J
Modem Modem -
ISP
b.
Point-to-pointWAN
15
ii
I
Anearlyexample ofaswitchedWANisX.25,anetworkdesigned toprovide
con­
nectivitybetween endusers. AswewillseeinChapter18,X.25isbeinggradually
replacedbyahigh-speed,moreefficientnetworkcalledFrameRelay.Agoodexample
ofaswitchedWANistheasynchronoustransfermode(ATM)network,whichisa
net­
workwithfixed-sizedataunitpacketscalledcells.WewilldiscussATMinChapter18.
Anotherexample
ofWANsisthewirelessWANthatisbecomingmoreandmorepopu­
lar.WediscusswirelessWANsandtheirevolutioninChapter
16.
MetropolitanAreaNetworks
Ametropolitanareanetwork(MAN) isanetworkwithasizebetweena LANanda
WAN.Itnormallycoverstheareainsideatown
oracity.Itisdesignedforcustomers
whoneeda
high-speedconnectivity,normally totheInternet,andhaveendpoints
spreadoveracity
orpartofcity.Agoodexample ofaMANisthepart ofthetelephone
companynetworkthatcanprovideahigh-speed
DSLlinetothecustomer.Another
exampleisthecableTVnetworkthatoriginallywasdesignedforcable
TV,buttoday
canalso
beusedforhigh-speeddataconnectiontotheInternet.WediscussDSLlines
andcableTVnetworksinChapter
9.
InterconnectionofNetworks:Internetwork
Today,itisveryraretoseeaLAN,a MAN,oraLANinisolation;theyarecon­
nectedto
oneanother.Whentwoormorenetworksareconnected,they becomean
internetwork,orinternet.
Asanexample,assumethatanorganizationhastwooffices,oneontheeastcoast
andtheotheronthewestcoast.Theestablishedofficeonthewestcoasthasabustopology
LAN;thenewlyopenedoffice
ontheeastcoasthasastartopologyLAN.Thepresident of
thecompanylivessomewhereinthemiddleandneedstohavecontroloverthecompany

16 CHAPTER1INTRODUCTION
fromherhorne. TocreateabackboneWANforconnectingthesethreeentities(two
LANsandthepresident'scomputer),aswitched
WAN(operatedbyaserviceprovider
suchasatelecomcompany)hasbeenleased.
ToconnecttheLANstothisswitched
WAN,however,threepoint-to-pointWANsarerequired.Thesepoint-to-pointWANs
canbeahigh-speedDSLlineofferedbyatelephonecompanyoracablemodernline
offeredbyacableTVprovider
asshowninFigure1.12.
Figure1.12 Aheterogeneousnetworkmade offourWANsandtwoLANs
President1
_....
..,',Mod,m


Point-to-point:
WAN:

MOdem~~'

':,Point-to-point
':.WAN


~Point-to-point
~ WAN.
LAN
LAN
1.3THEINTERNET
TheInternethasrevolutionizedmanyaspects ofourdailylives. Ithasaffectedtheway
wedobusinessaswell
asthewaywespendourleisuretime.Countthewaysyou've
usedtheInternetrecently.Perhapsyou'vesentelectronicmail(e-mail)toabusiness
associate,paidautilitybill,readanewspaperfromadistantcity,orlookedupalocal
movie
schedule-allbyusingtheInternet.Ormaybeyouresearchedamedicaltopic,
bookedahotelreservation,chattedwithafellowTrekkie,orcomparison-shoppedfora
car.TheInternetisacommunicationsystemthathasbroughtawealth
ofinformationto
ourfingertipsandorganizeditforouruse.
TheInternet
isastructured,organizedsystem. Webeginwithabriefhistory ofthe
Internet.
Wefollowwithadescription oftheInternettoday.

SECTION1.3THEINTERNET 17
ABriefHistory
Anetworkisagroup ofconnectedcommunicatingdevicessuch ascomputersand
printers.Aninternet(notethelowercaseletter
i)istwoormorenetworksthatcancom­
municatewitheachother.Themostnotableinternet
iscalledthe Internet(uppercase
letter
I),acollaborationofmorethanhundredsofthousands ofinterconnectednet­
works.Privateindividualsaswell
asvariousorganizationssuch asgovernmentagen­
cies,schools,researchfacilities,corporations,andlibraries
inmorethan 100countries
usetheInternet.Millionsofpeopleareusers. Yetthisextraordinarycommunicationsys­
temonlycameintobeingin1969.
Inthemid-1960s,mainframecomputersinresearchorganizationswerestand­
alonedevices.Computersfromdifferentmanufacturerswereunabletocommunicate
withoneanother.TheAdvancedResearchProjectsAgency(ARPA)intheDepart­
mentofDefense(DoD)wasinterestedinfindingawaytoconnectcomputers
sothat
theresearcherstheyfundedcouldsharetheirfindings,therebyreducingcostsandelim­
inatingduplicationofeffort.
In1967,atanAssociationforComputingMachinery(ACM)meeting,ARPApre­
senteditsideasforARPANET,asmallnetworkofconnectedcomputers.Theideawas
thateachhostcomputer(notnecessarilyfromthesamemanufacturer)wouldbe
attachedtoaspecializedcomputer,called
an
inteifacemessageprocessor (IMP).The
IMPs,intum,wouldbeconnected
tooneanother.EachIMPhadtobeable tocommu­
nicatewithotherIMPs
aswellaswithitsownattachedhost.
By1969,ARPANETwasareality.Fournodes,attheUniversity
ofCaliforniaat
LosAngeles(UCLA),theUniversity
ofCaliforniaatSantaBarbara(UCSB),Stanford
ResearchInstitute(SRI),andtheUniversityofUtah,wereconnectedviatheIMPsto
formanetwork.Softwarecalledthe
NetworkControlProtocol (NCP)providedcom­
municationbetweenthehosts.
In1972,VintCerfandBobKahn,bothofwhomwerepartofthecoreARPANET
group,collaboratedonwhattheycalledthe
Internetting
Projec1.CerfandKahn'sland­
mark1973paperoutlinedtheprotocolstoachieveend-to-enddeliveryofpackets.This
paper
onTransmissionControlProtocol(TCP)includedconceptssuch asencapsula­
tion,thedatagram,andthefunctionsofagateway.
Shortlythereafter,authoritiesmadeadecisiontosplitTCPintotwoprotocols:
TransmissionControlProtocol(TCP)andInternetworkingProtocol(lP).IPwould
handledatagramroutingwhileTCPwouldberesponsibleforhigher-level functions
such
assegmentation,reassembly,anderrordetection.Theinternetworkingprotocol
becameknown
asTCPIIP.
TheInternetToday
TheInternethascomealongwaysincethe1960s.TheInternettodayisnotasimple
hierarchicalstructure.
Itismadeupofmanywide-andlocal-areanetworksjoined by
connectingdevicesandswitchingstations. Itisdifficulttogive anaccuraterepresen­
tation
oftheInternetbecauseitiscontinually changing-newnetworksarebeing
added,existingnetworksareaddingaddresses,andnetworksofdefunctcompaniesare
beingremoved.TodaymostenduserswhowantInternetconnectionusetheservices
of
Internetserviceproviders(lSPs).Thereareinternationalserviceproviders,national

18 CHAPTER1INTRODUCTION
serviceproviders,regionalserviceproviders,andlocalserviceproviders.TheInternet
todayisrunbyprivatecompanies,notthegovernment.Figure1.13showsaconceptual
(notgeographic)viewoftheInternet.
Figure1.13
Hierarchicalorganization oftheInternet
National
ISP
a.StructureofanationalISP
National
ISP
National
ISP
b.InterconnectionofnationalISPs
InternationalInternetServiceProviders
Atthetop ofthehierarchyaretheinternationalserviceprovidersthatconnectnations
together.
NationalInternetServiceProviders
ThenationalInternetserviceprovidersarebackbonenetworkscreatedandmain­
tainedby specializedcompanies.TherearemanynationalISPsoperatinginNorth
America;some
ofthemostwellknownareSprintLink,PSINet,UUNetTechnology,
AGIS,andinternet
Mel.Toprovideconnectivitybetweentheendusers,theseback­
bonenetworksareconnectedbycomplexswitchingstations(normallyrunbyathird
party)called
networkaccesspoints(NAPs).SomenationalISPnetworksarealso
connectedtooneanotherbyprivateswitchingstationscalled
peeringpoints. These
normallyoperateatahighdatarate(upto600Mbps).

SECTION1.4PROTOCOLSANDSTANDARDS 19
RegionalInternetServiceProviders
Regionalinternetserviceprovidersor regionalISPs aresmallerISPsthatareconnected
tooneormorenationalISPs.Theyareatthethirdlevel
ofthehierarchywithasmaller
datarate.
LocalInternetServiceProviders
LocalInternetserviceproviders providedirectservicetotheendusers.Thelocal
ISPscanbeconnectedtoregionalISPsordirectlytonationalISPs.Mostendusersare
connectedtothelocalISPs.Notethatinthissense,alocalISPcanbeacompanythat
justprovidesInternetservices,acorporationwithanetworkthatsuppliesservicestoits
ownemployees,oranonprofitorganization,suchasacollegeorauniversity,thatruns
itsownnetwork.Each
oftheselocalISPscanbeconnectedtoaregionalornational
serviceprovider.
1.4PROTOCOLS ANDSTANDARDS
Inthissection,wedefinetwowidelyusedterms:protocolsandstandards.First,we
define
protocol,whichissynonymouswith rule.Thenwediscuss standards,whichare
agreed-uponrules.
Protocols
Incomputernetworks,communicationoccursbetweenentitiesindifferentsystems.An
entityisanythingcapableofsendingorreceivinginformation.However,twoentitiescan­
notsimplysendbitstreamstoeachotherandexpecttobeunderstood.Forcommunication
tooccur,theentitiesmustagreeonaprotocol.Aprotocolisasetofrulesthatgoverndata
communications.Aprotocoldefineswhat
iscommunicated,howitiscommunicated,and
whenit
iscommunicated.Thekeyelementsofaprotocolaresyntax,semantics,andtiming.
oSyntax.Thetermsyntaxreferstothestructureorformat ofthedata,meaningthe
orderinwhichtheyarepresented.Forexample,asimpleprotocolmightexpectthe
first8bits
ofdatatobetheaddress ofthesender,thesecond8bitstobetheaddress
ofthereceiver,andtherest ofthestreamtobethemessageitself.
oSemantics.Theword semanticsreferstothemeaning ofeachsection ofbits.
Howisaparticularpatterntobeinterpreted,andwhatactionistobetakenbased
onthatinterpretation?Forexample,doesanaddressidentifytheroutetobetaken
orthefinaldestination
ofthemessage?
oTiming.Theterm timingreferstotwocharacteristics:whendatashouldbesent
andhowfasttheycanbesent.Forexample,
ifasenderproducesdataat100Mbps
butthereceivercanprocessdataatonly1Mbps,thetransmissionwilloverloadthe
receiverandsomedatawillbelost.
Standards
Standardsareessentialincreatingandmaintaininganopenandcompetitivemarketfor
equipmentmanufacturersandinguaranteeingnationalandinternationalinteroperability
ofdataandtelecommunicationstechnologyandprocesses.Standardsprovideguidelines

20 CHAPTER1INTRODUCTION
tomanufacturers,vendors,governmentagencies,andotherserviceproviderstoensure
thekindofinterconnectivitynecessaryintoday'smarketplaceandininternationalcom­
munications.Datacommunicationstandardsfallintotwocategories:
defacto(meaning
"byfact"or"byconvention")and
dejure(meaning"bylaw"or"byregulation").
oDefacto.Standardsthathavenotbeenapproved byanorganizedbodybuthave
beenadopted
asstandardsthroughwidespreadusearedefacto standards.Defacto
standardsareoftenestablishedoriginally
bymanufacturerswhoseektodefinethe
functionality
ofanewproductortechnology.
oDejure.Thosestandardsthathavebeenlegislatedbyanofficiallyrecognizedbody
arede
jurestandards.
StandardsOrganizations
Standardsaredevelopedthroughthecooperation ofstandardscreationcommittees,
forums,andgovernmentregulatoryagencies.
StandardsCreationCommittees
Whilemanyorganizationsarededicatedtotheestablishmentofstandards,datatele­
communicationsinNorthAmericarelyprimarilyonthosepublishedbythefollowing:
oInternationalOrganizationforStandardization(ISO).TheISO isamultinational
bodywhosemembershipisdrawnmainlyfromthestandardscreationcommittees
ofvariousgovernmentsthroughouttheworld.TheISO isactiveindeveloping
cooperationintherealmsofscientific,technological,andeconomicactivity.
oInternationalTelecommunicationUnion-TelecommunicationStandards
Sector(ITU-T).Bytheearly1970s,anumberofcountriesweredefiningnational
standardsfortelecommunications,buttherewasstilllittleinternationalcompati­
bility.TheUnitedNationsrespondedbyforming,aspart
ofitsInternational
TelecommunicationUnion(ITU),acommittee,the
ConsultativeCommittee
forInternationalTelegraphyandTelephony(CCITT).Thiscommitteewas
devotedtotheresearchandestablishmentofstandardsfortelecommunicationsin
generalandforphoneanddatasystemsinparticular.OnMarch
1,1993,thename
ofthiscommitteewaschangedtotheInternationalTelecommunication Union­
TelecommunicationStandardsSector(ITU-T).
oAmericanNational StandardsInstitute(ANSI).Despiteitsname,theAmerican
NationalStandardsInstituteisacompletelyprivate,nonprofitcorporationnotaffili­
atedwiththeU.S.federalgovernment.However,allANSIactivitiesareundertaken
withthewelfareoftheUnitedStatesanditscitizensoccupyingprimaryimportance.
oInstituteofElectricalandElectronicsEngineers(IEEE).TheInstituteof
ElectricalandElectronicsEngineers
isthelargestprofessionalengineeringsocietyin
theworld.Internationalinscope,itaimstoadvancetheory,creativity,andproduct
qualityinthefieldsofelectricalengineering,electronics,andradio
aswellasinall
relatedbranchesofengineering.
Asoneofitsgoals,theIEEEoverseesthedevelop­
mentandadoptionofinternationalstandardsforcomputingandcommunications.
oElectronicIndustriesAssociation(EIA).AlignedwithANSI,theElectronic
IndustriesAssociationisanonprofitorganizationdevotedtothepromotion
of

SECTION1.5RECOMMENDED READING 21
electronicsmanufacturingconcerns.Itsactivitiesincludepublicawarenesseducation
andlobbyingeffortsinadditiontostandardsdevelopment.Inthefieldofinformation
technology,theEIAhasmadesignificant contributionsbydefiningphysicalconnec­
tioninterfacesandelectronicsignalingspecificationsfordatacommunication.
Forums
Telecommunicationstechnologydevelopmentismovingfasterthantheability ofstan­
dardscommitteestoratifystandards.Standardscommitteesareproceduralbodiesand
bynatureslow-moving.
Toaccommodatetheneedforworkingmodelsandagreements
andtofacilitatethestandardizationprocess,manyspecial-interestgroupshave
devel­
opedforumsmadeupofrepresentativesfrominterestedcorporations.Theforums
workwithuniversitiesanduserstotest,evaluate,andstandardizenewtechnologies.By
concentratingtheireffortsonaparticulartechnology,theforumsare abletospeed
acceptanceanduseofthosetechnologiesinthetelecommunicationscommunity.The
forumspresenttheirconclusionstothestandardsbodies.
RegulatoryAgencies
Allcommunicationstechnologyissubjecttoregulationbygovernmentagenciessuch
astheFederalCommunicationsCommission(FCC)intheUnitedStates.Thepur­
pose
oftheseagenciesistoprotectthepublicinterestbyregulatingradio,television,
andwire/cablecommunications.TheFCChasauthorityoverinterstateandinterna­
tionalcommerceasitrelatestocommunications.
InternetStandards
AnInternetstandardisathoroughlytestedspecificationthatisusefultoandadhered
tobythosewhoworkwiththeInternet.Itisaformalizedregulationthatmustbefol­
lowed.ThereisastrictprocedurebywhichaspecificationattainsInternetstandard
status. AspecificationbeginsasanInternetdraft.AnInternetdraftisaworkingdocu­
ment(aworkinprogress)with
noofficialstatusanda6-monthlifetime. Uponrecom­
mendationfromtheInternetauthorities,adraftmaybepublished
asaRequestfor
Comment(RFC).EachRFCisedited,assignedanumber,andmadeavailabletoall
interestedparties.RFCsgothroughmaturitylevelsandarecategorizedaccordingto
theirrequirementlevel.
1.5RECOMMENDED READING
Formoredetailsaboutsubjectsdiscussedinthischapter,werecommendthefollowing
booksandsites.Theitemsenclosedinbrackets[
...]refertothereferencelistattheend
ofthebook.
Books
Theintroductorymaterialscoveredinthischaptercanbefoundin[Sta04]and[PD03].
[Tan03]discussesstandardizationinSection
1.6.

22 CHAPTER 1INTRODUCTION
Sites
Thefollowingsitesarerelated totopicsdiscussedinthischapter.
owww.acm.org/sigcomm/sos.htmlThissitegivesthestatus ofvarililusnetworking
standards.
owww.ietf.org/TheInternetEngineeringTaskForce(IETF)homepage.
RFCs
ThefollowingsitelistsallRFCs,includingthoserelated toIPandTCP.Infuturechap­
terswecitetheRFCspertinenttothechaptermaterial.
owww.ietf.org/rfc.html
1.6KEYTERMS
AdvancedResearchProjects
Agency(ARPA)
AmericanNationalStandards
Institute(ANSI)
AmericanStandardCodefor
InformationInterchange(ASCII)
ARPANET
audio
backbone
BasicLatin
bustopology
code
ConsultativeCommitteefor
InternationalTelegraphy
andTelephony(CCITT)
data
datacommunications
defactostandards
dejurestandards
delay
distributedprocessing
ElectronicIndustriesAssociation(EIA)
entity
FederalCommunicationsCommission
(FCC)
forum
full-duplexmode,orduplex
half-duplexmode
hub
image
Institute
ofElectricalandElectronics
Engineers(IEEE)
InternationalOrganizationfor
Standardization(ISO)
International Telecommunication
Union-Telecommunication
StandardsSector(ITU-T)
Internet
Internetdraft
Internetserviceprovider(ISP)
Internetstandard
internetwork
orinternet
localareanetwork(LAN)
localInternetserviceproviders
meshtopology
message
metropolitanareanetwork(MAN)
multipointormultidropconnection
nationalInternetserviceprovider
network

networkaccesspoints(NAPs)
node
performance
physicaltopology
point-to-pointconnection
protocol
receiver
regionalISP
reliability
RequestforComment(RFC)
ROB
ringtopology
security
semantics
1.7SUMMARY
SECTION1.7SUMMARY 23
sender
simplexmode
startopology
syntax
telecommunication
throughput
timing
TransmissionControlProtocol!
InternetworkingProtocol(TCPIIP)
transmissionmedium
Unicode
video
wideareanetwork(WAN)
YCM
oDatacommunicationsarethetransfer ofdatafromonedevicetoanotherviasome
form
oftransmissionmedium.
oAdatacommunicationssystemmusttransmitdatatothecorrectdestinationin an
accurateandtimelymanner.
oThefivecomponentsthatmakeupadatacommunicationssystemarethemessage,
sender,receiver,medium,andprotocol.
oText,numbers,images,audio,andvideoaredifferentforms ofinformation.
oDataflowbetweentwodevicescanoccurinone ofthreeways:simplex,half-duplex,
orfull-duplex.
oAnetworkisaset ofcommunicationdevicesconnectedbymedialinks.
oInapoint-to-pointconnection,twoandonlytwodevicesareconnectedbya
dedicatedlink.Inamultipointconnection,threeormoredevicessharealink.
oTopology referstothephysicalorlogicalarrangement ofanetwork.Devicesmay
bearrangedinamesh,star,bus,orringtopology.
oAnetworkcanbecategorized asalocalareanetworkorawideareanetwork.
oALANisadatacommunicationsystemwithinabuilding,plant,orcampus,or
betweennearbybuildings.
oAWANisadatacommunicationsystemspanningstates,countries,orthewhole
world.
oAninternetisanetwork ofnetworks.
oTheInternetisacollection ofmanyseparatenetworks.
oTherearelocal,regional,national,andinternationalInternetserviceproviders.
oAprotocolisaset ofrulesthatgoverndatacommunication;thekeyelementsof
aprotocolaresyntax,semantics,andtiming.

24 CHAPTER 1INTRODUCTION
oStandardsarenecessarytoensurethatproductsfromdifferentmanufacturerscan
worktogetherasexpected.
oTheISO,ITD-T,ANSI,IEEE,andEIAaresome oftheorganizationsinvolved
instandardscreation.
oForumsarespecial-interestgroupsthatquicklyevaluateandstandardizenew
technologies.
oARequestforCommentisanidea orconceptthatisaprecursortoanInternet
standard.
1.8PRACTICESET
ReviewQuestions
1.Identifythefivecomponents ofadatacommunicationssystem.
2.Whataretheadvantages ofdistributedprocessing?
3.Whatarethethreecriterianecessaryfor aneffectiveandefficientnetwork?
4.Whataretheadvantages ofamultipointconnectionoverapoint-to-point
connection?
5.Whatarethetwotypes ofline configuration?
6.Categorizethefourbasictopologiesinterms oflineconfiguration.
7.Whatisthedifferencebetweenhalf-duplexandfull-duplextransmissionmodes?8.Namethefourbasicnetworktopologies,andciteanadvantage ofeachtype.
9.Forndevicesinanetwork,whatisthenumber ofcablelinksrequiredforamesh,
ring,bus,andstartopology?
10.Whataresome ofthefactorsthatdeterminewhetheracommunicationsystemisa
LANorWAN?
1
I.Whatisaninternet?WhatistheInternet?
12.Whyareprotocolsneeded?
13.Whyarestandardsneeded?
Exercises
14.Whatisthemaximumnumber ofcharactersorsymbolsthatcanberepresentedby
Unicode?
15.Acolorimageuses 16bitstorepresentapixel.Whatisthemaximumnumber of
differentcolorsthatcanberepresented?
16.Assumesixdevicesarearrangedinameshtopology.Howmanycablesareneeded?
Howmanyportsareneededforeachdevice?
17.Foreachofthefollowingfournetworks,discusstheconsequences ifaconnectionfails.
a.Fivedevicesarrangedinameshtopology
b.Fivedevicesarrangedinastartopology(notcountingthehub)
c.Fivedevicesarrangedinabustopology
d.Fivedevicesarrangedinaringtopology

SECTION1.8PRACTICESET 25
18.YouhavetwocomputersconnectedbyanEthernethubathome. IsthisaLAN,a
MAN,oraWAN?Explainyourreason.
19.IntheringtopologyinFigure1.8,whathappensifone ofthestationsisunplugged?
20.
InthebustopologyinFigure1.7,whathappensifone ofthestationsisunplugged?
21.Drawahybridtopologywithastarbackboneandthreeringnetworks.
22.Drawahybridtopologywitharingbackboneandtwobusnetworks.
23.Performanceisinverselyrelatedtodelay.WhenyouusetheInternet,which
ofthe
followingapplicationsaremoresensitivetodelay?
a.Sendingan
e-mail
b.Copyingafile
c.SurfingtheInternet
24.Whenapartymakesalocaltelephonecalltoanotherparty,isthisapoint-to-point
ormultipointconnection?Explainyouranswer.
25.ComparethetelephonenetworkandtheInternet.Whatarethesimilarities?What
arethedifferences?
ResearchActivities
26.Usingthesite\iww.cne.gmu.edu/modules/network/osi.html,discusstheOSImodel.
27.Usingthesitewww.ansi.org,discussANSI'sactivities.
28.Usingthesitewww.ieee.org,discussIEEE'sactivities.
29.Usingthesitewww.ietf.org/,discussthedifferenttypes
ofRFCs.

CHAPTER2
NetworkModels
Anetworkisacombinationofhardwareandsoftwarethatsendsdatafromonelocation
toanother.Thehardwareconsists
ofthephysicalequipmentthatcarriessignalsfrom
onepoint
ofthenetworktoanother.The softwareconsists ofinstructionsetsthatmake
possibletheservicesthatweexpectfromanetwork.
Wecancomparethetask ofnetworkingtothetask ofsolvingamathematicsproblem
withacomputer.Thefundamentaljob
ofsolvingtheproblemwithacomputerisdone
bycomputerhardware.However,thisisaverytedioustask
ifonlyhardwareisinvolved.
Wewouldneedswitchesforeverymemorylocationtostoreandmanipulatedata.The
taskismucheasier
ifsoftwareisavailable.Atthehighestlevel,aprogramcandirect
theproblem-solvingprocess;thedetails
ofhowthisisdonebytheactualhardware can
belefttothelayers
ofsoftwarethatarecalledbythehigherlevels.
Comparethistoaserviceprovidedbyacomputernetwork.Forexample,thetask
ofsendingane-mailfromonepointintheworldtoanothercanbebrokenintoseveral
tasks,eachperformedbyaseparatesoftwarepackage.Eachsoftwarepackageusesthe
services
ofanothersoftwarepackage.Atthelowestlayer,asignal,oraset ofsignals,is
sentfromthesourcecomputertothedestinationcomputer.
Inthischapter,wegiveageneralidea
ofthelayersofanetworkanddiscussthe
functions
ofeach.Detaileddescriptions oftheselayersfollowinlaterchapters.
2.1LAYEREDTASKS
Weusetheconcept oflayersin ourdailylife.Asanexample,letusconsidertwo
friendswhocommunicatethroughpostalmaiLTheprocess
ofsendingalettertoa
friendwouldbecomplex
iftherewerenoservicesavailablefromthepostoffice.Fig­
ure2.1showsthestepsinthistask.
27

28 CHAPTER 2NETWORKMODELS
Figure2.1Tasksinvolvedinsendingaletter
Sender
t
Receiver
t
I t
Theletteriswritten, Theletterispickedup,
putinanenvelope,and Higherlayers removedfromthe
droppedinamailbox. envelope,andread.
I
-,
Theletteriscarried Theletter iscarried
fromthemailbox Middlelayers fromthepostoffice
toapostoffice. tothemailbox.
I I
Theletterisdelivered Theletterisdelivered
toacarrierbythepost Lowerlayers fromthecarrier
office. tothepostoffice.•
II
Theparceliscarriedfrom
thesourcetothedestination.
Sender,Receiver, andCarrier
InFigure2.1wehaveasender,areceiver,and acarrierthattransportstheletter.There
isahierarchyoftasks.
AttheSellderSite
Letusfirstdescribe,inorder,theactivitiesthattakeplaceatthesendersite.
oHigherlayer.Thesenderwritestheletter,insertstheletterinanenvelope,writes
thesenderandreceiveraddresses,anddropstheletterinamailbox.
oMiddlelayer.Theletterispickedupbyalettercarrieranddeliveredtothepost
office.
oLowerlayer.Theletter issortedatthepostoffice;acarriertransportstheletter.
011theWay
Theletteristhenonitswaytotherecipient.Onthewaytotherecipient'slocalpost
office,thelettermayactuallygothroughacentraloffice.Inaddition,itmaybetrans­
portedbytruck,train,airplane,boat,oracombination
ofthese.
AttheReceiverSite
oLowerlayer.Thecarriertransportsthelettertothepostoffice.
oMiddlelayer.Theletterissortedanddeliveredtotherecipient'smailbox.
oHigherlayer.Thereceiverpicksuptheletter,openstheenvelope,andreadsit.

SECTION2.2THEOS!MODEL 29
Hierarchy
Accordingtoouranalysis,therearethreedifferentactivitiesatthesendersiteand
anotherthreeactivitiesatthereceiversite.Thetaskoftransportingtheletterbetween
thesenderandthereceiverisdonebythecarrier.Somethingthatisnotobvious
immediatelyisthatthetasksmustbedoneintheordergiveninthehierarchy.Atthe
sendersite,thelettermustbewrittenanddroppedinthemailboxbeforebeingpicked
upbythelettercarrieranddeliveredtothepostoffice.Atthereceiversite,theletter
mustbedroppedintherecipientmailboxbeforebeingpickedupandreadbythe
recipient.
Services
Eachlayeratthesendingsiteusestheservices
ofthelayerimmediatelybelowit.The
senderatthehigherlayerusestheservices
ofthemiddlelayer.Themiddlelayeruses
theservices
ofthelowerlayer.Thelowerlayerusestheservicesofthecarrier.
Thelayeredmodelthatdominateddatacommunicationsandnetworkingliterature
before1990wasthe
OpenSystemsInterconnection(OSI)model.Everyonebelieved
thattheOSImodelwouldbecometheultimatestandardfordatacommunications,but
thisdidnothappen.TheTCPIIPprotocolsuitebecamethedominantcommercialarchi­
tecturebecauseitwasusedandtestedextensivelyintheInternet;theOSImodelwas
neverfullyimplemented.
Inthischapter,firstwebrieflydiscusstheOSImodel,andthenweconcentrateon
TCPIIP
asaprotocolsuite.
2.2THEOSIMODEL
Establishedin1947,theInternationalStandardsOrganization(ISO)isamultinational
bodydedicatedtoworldwideagreementoninternationalstandards.AnISOstandard
thatcoversallaspects
ofnetworkcommunicationsistheOpenSystemsInterconnection
model.Itwasfirstintroducedinthelate1970s.Anopensystemisasetofprotocolsthat
allowsanytwodifferentsystemstocommunicateregardless
oftheirunderlyingarchi­
tecture.Thepurpose
oftheOSImodelistoshowhowtofacilitatecommunication
betweendifferentsystemswithoutrequiringchangestothelogicoftheunderlyinghard­
wareandsoftware.TheOSImodel
isnotaprotocol;itisamodelforunderstandingand
designinganetworkarchitecturethatisflexible,robust,andinteroperable.
ISOistheorganization.OSIisthemodel.
TheOSImodelisalayeredframeworkforthedesignofnetworksystemsthat
allowscommunicationbetweenalltypesofcomputersystems.Itconsists
ofsevensep­
aratebutrelatedlayers,each
ofwhichdefinesapartoftheprocessofmovinginformation
acrossanetwork(seeFigure2.2).Anunderstanding
ofthefundamentalsoftheOSI
modelprovidesasolidbasisforexploring datacommunications.

30 CHAPTER2NETWORKMODELS
Figure2.2Sevenlayers oftheOSImodel
71
Application
61
Presentation
51
Session
41
Transport
31
Network
21
Datalink
1I
Physical
LayeredArchitecture
TheOSImodeliscomposed ofsevenorderedlayers:physical(layer1),datalink(layer2),
network(layer3),transport(layer4),session(layer5),presentation(layer6), and
application(layer7).Figure2.3showsthelayersinvolvedwhenamessageissentfrom
deviceAtodeviceB.AsthemessagetravelsfromAtoB,itmaypassthroughmany
intermediatenodes.Theseintermediatenodesusuallyinvolveonlythefirstthreelayers
oftheOSImodel.
In
developingthemodel,thedesignersdistilledtheprocess oftransmittingdatato
itsmostfundamentalelements.Theyidentifiedwhichnetworkingfunctionshadrelated
usesandcollectedthosefunctionsintodiscretegroupsthatbecamethelayers.Each
layerdefinesafamily
offunctionsdistinctfromthose oftheotherlayers. Bydefining
andlocalizingfunctionalityinthisfashion,thedesignerscreatedanarchitecturethatis
bothcomprehensiveandflexible.
Mostimportantly,theOSImodelallowscomplete
interoperabilitybetweenotherwiseincompatiblesystems.
Withinasinglemachine,eachlayercallsupontheservices
ofthelayerjustbelow
it.Layer3,forexample,usestheservicesprovidedbylayer2andprovidesservicesfor
layer4.Betweenmachines,layerxononemachinecommunicateswithlayer xon
anothermachine.Thiscommunicationisgovernedbyanagreed-uponseries ofrules
andconventionscalledprotocols.Theprocessesoneachmachinethatcommunicateat
agivenlayerarecalled
peer-to-peerprocesses.Communicationbetweenmachinesis
thereforeapeer-to-peerprocessusingtheprotocolsappropriatetoagivenlayer.
Peer-to-PeerProcesses
Atthephysicallayer,communicationisdirect:InFigure2.3,deviceAsendsastream
ofbitstodeviceB(throughintermediatenodes). Atthehigherlayers,however,com­
municationmustmovedownthroughthelayersondeviceA,overtodeviceB,andthen

SECTION2.2THEOSIMODEL 31
Figure2.3 Theinteractionbetweenlayersinthe OSImodel
Device
A
Device
B
Intermediate
node
Intermediate
node
Peer-to-peerprotocol
Othlayer)
7 Application
------------------------
Application 7
7-6interface 7-6interface
Peer-to-peerprotocol(6thlayer)
6 Presentation
------------------------Presentation 6
6-5interface 6-5interface
Peer-to-peerprotocol(5thlayer)
5 Session
------------------------
Session 5
5-4interface
Peer-to-peerprotocol(4thlayer)
5-4interface
4 Transport
------------------------Transport 4
4-3interface 4-3interface
3 Network Network 3
3-2interface
3-2interface
2 Datalink Datalink 2
2-1interface 2-1interface
Physical Physical
Physicalcommunication
backupthroughthelayers.Eachlayerinthesendingdeviceaddsitsowninformation
tothemessageitreceivesfromthelayerjustaboveitandpassesthewholepackageto
thelayerjustbelowit.
AtlayerItheentirepackageisconvertedtoaformthatcanbetransmittedtothe
receivingdevice.Atthereceivingmachine,themessageisunwrappedlayerbylayer,
witheachprocessreceivingandremovingthedatameantforit.Forexample,layer2
removesthedatameantforit,thenpassestherest
tolayer3.Layer3thenremovesthe
datameantforitandpassestheresttolayer4,andsoon.
InterfacesBetweenLayers
Thepassingofthedataandnetworkinformationdownthroughthelayersofthesend­
ingdeviceandbackupthroughthelayersofthereceivingdeviceismadepossibleby
aninterfacebetweeneachpair
ofadjacentlayers.Eachinterfacedefinestheinforma­
tionandservicesalayermustprovideforthelayeraboveit.Well-definedinterfacesand
layerfunctionsprovidemodularity
toanetwork.Aslongasalayerprovidesthe
expectedservicestothelayeraboveit,thespecificimplementation
ofitsfunctionscan
bemodifiedorreplacedwithoutrequiringchangestothesurroundinglayers.
OrganizationoftheLayers
Thesevenlayerscanbethoughtofasbelongingtothreesubgroups.LayersI, 2,and
3-physical,datalink,and network-arethenetworksupportlayers;theydealwith

32 CHAPTER2 NETWORKMODELS
thephysicalaspects ofmovingdatafromonedevicetoanother(suchaselectrical
specifications,physicalconnections,physicaladdressing,andtransporttimingand
reliability).Layers5,6,and
7-session,presentation,and application-canbe
thought
ofastheusersupportlayers;theyallowinteroperabilityamongunrelated
softwaresystems.Layer4,thetransportlayer,linksthetwosubgroupsandensures
thatwhatthelowerlayershavetransmittedisinaformthattheupperlayerscanuse.
TheupperOSIlayersarealmostalwaysimplementedinsoftware;lowerlayersarea
combination
ofhardwareandsoftware,except forthephysicallayer,whichismostly
hardware.
InFigure2.4,whichgivesanoverallviewoftheOSIlayers,
D7meansthedata
unitatlayer
7,D6meansthedataunitatlayer6,andsoon.Theprocessstartsatlayer
7(theapplicationlayer),thenmovesfromlayertolayerindescending,sequential
order.Ateachlayer,a
header,orpossiblya trailer,canbeaddedtothedataunit.
Commonly,thetrailerisaddedonlyatlayer
2.Whentheformatteddataunitpasses
throughthephysicallayer(layer1),itischangedintoanelectromagneticsignaland
transportedalongaphysicallink.
Figure2.4 Anexchangeusingthe OS!model
:HiiD7l
t---~
~~§J D6I
:Hs-
1
D5I
r-_J
:H4j D4I
r---.------
:-Hi
l
D3 I
r--J---=-=----
:HiJ D2 ~.j!
1-- - .10--1
:_~i§j010101010101101010000010000I
Trn",m;"io"=dium1
~
~ D6I
~ D5I
~ D4I
~ D3I
~ D2 •
@IQj010101010101101010000010000I
L...
Uponreachingitsdestination,thesignalpassesintolayer1andistransformed
backintodigitalform.ThedataunitsthenmovebackupthroughtheOSIlayers.As
eachblock
ofdatareachesthenexthigherlayer,theheadersandtrailersattachedtoitat
thecorrespondingsendinglayerareremoved,andactionsappropriatetothatlayerare
taken.By thetimeitreacheslayer7,themessageisagaininaformappropriatetothe
applicationandismadeavailabletotherecipient.

SECTION2.3LAYERSINTHEOSIMODEL 33
Encapsulation
Figure2.3revealsanotheraspect ofdatacommunicationsintheOSImodel:encapsula­
tion.Apacket(headeranddata)atlevel7isencapsulatedinapacketatlevel6.The
wholepacketatlevel6isencapsulatedinapacketatlevel5,andsoon.
Inotherwords,thedataportion ofapacketatlevel N-1carriesthewholepacket
(dataandheaderandmaybetrailer)fromlevel
N.Theconceptiscalledencapsulation;
level
N-1isnotaware ofwhichpart oftheencapsulatedpacketisdataandwhichpart
istheheaderortrailer.Forlevel
N-1,thewholepacketcomingfromlevel Nistreated
asoneintegralunit.
2.3LAYERS INTHEOSIMODEL
Inthissectionwebrieflydescribethefunctions ofeachlayerintheOSImodel.
PhysicalLayer
Thephysicallayer coordinatesthefunctionsrequiredtocarryabitstreamoveraphysi­
calmedium.
Itdealswiththemechanicalandelectricalspecifications oftheinterfaceand
transmissionmedium.
Italsodefinestheproceduresandfunctionsthatphysicaldevices
andinterfaceshavetoperformfortransmissionto
Occur.Figure2.5showstheposition of
thephysicallayerwithrespecttothetransmissionmediumandthedatalinklayer.
Figure2.5 Physicallayer
Fromdatalinklayer Todatalinklayer
Physical
layer
Physical
layer
Transmissionmedium
Thephysicallayer isresponsibleformovements of
individualbitsfromonehop(node)tothenext.
Thephysicallayerisalsoconcernedwiththefollowing:
oPhysicalcharacteristics ofinterfacesandmedium.Thephysicallayerdefines
thecharacteristics
oftheinterfacebetweenthedevicesandthetransmission
medium.
Italsodefinesthetype oftransmissionmedium.
oRepresentationofbits.Thephysicallayerdataconsists ofastreamofbits
(sequenceofOsor1s)withnointerpretation.Tobetransmitted,bitsmustbe

34 CHAPTER2NETWORKMODELS
encodedintosignals--electricaloroptical.Thephysicallayerdefinesthetype of
encoding(how OsandIsarechangedtosignals).
oDatarate.Thetransmissionrate-thenumberofbitssenteach second-isalso
definedbythephysicallayer.Inotherwords,thephysicallayerdefinesthedura­
tion
ofabit,whichishowlongitlasts.
oSynchronizationofbits.Thesenderandreceivernotonlymustusethesamebit
ratebutalsomustbesynchronized
atthebitlevel.Inotherwords,thesenderand
thereceiverclocksmustbesynchronized.
oLineconfiguration.Thephysicallayerisconcernedwiththeconnection of
devicestothemedia.Inapoint-to-pointconfiguration,twodevicesareconnected
throughadedicatedlink.Inamultipointconfiguration,alinkissharedamong
severaldevices.
oPhysicaltopology.Thephysicaltopologydefineshowdevicesareconnectedto
makeanetwork.Devicescanbeconnectedbyusingameshtopology(everydevice
isconnectedtoeveryotherdevice), astartopology(devicesareconnectedthrough
acentraldevice),aringtopology(eachdeviceisconnectedtothenext,forminga
ring),abustopology(everydeviceisonacommonlink),
orahybridtopology(this
isacombinationoftwoormoretopologies).
oTransmissionmode.Thephysicallayeralso definesthedirection oftransmission
betweentwodevices:simplex,half-duplex,orfull-duplex.
Insimplexmode,only
onedevicecansend;theothercanonlyreceive.Thesimplexmodeisaone-way
communication.Inthehalf-duplex
mode,twodevicescansendandreceive,but
notatthesametime.Inafull-duplex(orsimplyduplex)mode,twodevicescan
sendandreceiveatthesametime.
DataLinkLayer
Thedatalinklayertransformsthephysicallayer,arawtransmissionfacility,toareli­
ablelink.
Itmakesthephysicallayerappearerror-freetotheupperlayer(network
layer).Figure
2.6showstherelationshipofthedatalinklayertothenetworkandphys­
icallayers.
Figure2.6
Datalinklayer
Fromnetworklayer
Datalinklayer
Tophysicallayer
H2
Tonetworklayer
Datalinklayer
Fromphysicallayer

SECTION2.3LAYERSINTHEOSIMODEL 35
Thedatalinklayerisresponsibleformovingframesfromonehop(node)tothenext.
Otherresponsibilitiesofthedatalinklayerincludethefollowing:
[IFraming.Thedatalinklayerdividesthestream ofbitsreceivedfromthenetwork
layerintomanageabledataunitscalled
frames.
oPhysicaladdressing. Ifframesare tobedistributedtodifferentsystemsonthe
network,thedatalinklayeraddsaheader
totheframetodefinethesenderand/or
receiver
oftheframe.Iftheframe isintendedforasystemoutsidethesender's
network,thereceiveraddressistheaddress
ofthedevicethatconnectsthenetwork
tothenextone.
DFlowcontrol. Iftherateatwhichthedataareabsorbedbythereceiver islessthan
therateatwhichdataareproducedinthesender,thedatalinklayerimposesa
flow
controlmechanismtoavoidoverwhelmingthereceiver.
oErrorcontrol.Thedatalinklayeraddsreliabilitytothephysicallayerbyadding
mechanismstodetectandretransmitdamagedorlostframes.
Italsousesamecha­
nism
torecognizeduplicateframes.Errorcontrol isnormallyachievedthrougha
traileradded
totheendoftheframe.
DAccesscontrol. Whentwoormoredevicesareconnectedtothesamelink,data
linklayerprotocolsarenecessarytodeterminewhichdevicehascontroloverthe
linkatanygiventime.
Figure2.7illustrates
hop-to-hop(node-to-node)delivery bythedatalinklayer.
Figure2.7
Hop-fa-hopdelivery
End
system
r
Link
Link
A
End
system
r
End
system
E
F
Hop-ta-hopdeliveryHop-to-hopdeliveryHop-to-hopdelivery
A B E F
Datalink Datalink Datalink
Physical Physical Physical
Hop-to-hopdeliveryHop-to-hopdeliveryHop-to-hopdelivery
Asthefigureshows,communicationatthedatalinklayer occursbetweentwo
adjacentnodes.
TosenddatafromAto F,threepartialdeliveriesaremade.First,the
datalinklayeratAsendsaframetothedatalinklayeratB(arouter).Second,thedata

36 CHAPTER 2NETWORKMODELS
linklayeratBsendsanewframetothedatalinklayeratE.Finally,thedatalinklayer
atEsendsanewframetothedatalinklayerat
F.Notethattheframesthatare
exchangedbetweenthethreenodeshavedifferentvaluesintheheaders.Theframefrom
AtoBhasB
asthedestinationaddressandA asthesourceaddress.TheframefromB to
EhasEasthedestinationaddressandB asthesourceaddress.TheframefromEtoF
hasF
asthedestinationaddressandE asthesourceaddress.Thevaluesofthetrailers
canalsobedifferentiferrorcheckingincludestheheader
oftheframe.
NetworkLayer
Thenetworklayerisresponsibleforthesource-to-destinationdelivery ofapacket,
possiblyacrossmultiplenetworks(links).Whereasthedatalinklayeroverseesthe
deliveryofthepacket betweentwosystems
onthesamenetwork(links),thenetwork
layerensuresthateachpacketgetsfromitspoint
oforigintoitsfinaldestination.
Iftwosystemsareconnected tothesamelink,thereisusually noneedforanet­
worklayer.However,
ifthetwosystemsareattachedtodifferentnetworks(links)with
connectingdevicesbetweenthenetworks(links),thereisoftenaneedforthenetwork
layer
toaccomplishsource-to-destinationdelivery.Figure2.8showstherelationshipof
thenetworklayer
tothedatalinkandtransportlayers.
Figure2.8Networklayer
Fromtransportlayer
I
1
-,,-_1
~: Data .1Packet
I I
Totransportlayer
...
I
',,---H-3--_]1...jI
.Data,.Packet
i------'-----'-------1
Network
layer
...,
Todatalinklayer
Network
layer
Fromdatalinklayer
Thenetworklayerisresponsibleforthedelivery ofindividual
packetsfromthesourcehosttothedestinationhost.
Otherresponsibilitiesofthenetworklayerincludethefollowing:
oLogicaladdressing.Thephysicaladdressingimplementedbythedatalinklayer
handlestheaddressingproblemlocally.
Ifapacketpassesthenetworkboundary,
weneedanotheraddressingsystemtohelpdistinguishthesourceanddestination
systems.Thenetworklayeraddsaheader
tothepacketcomingfromtheupper
layerthat,amongotherthings,includesthelogicaladdresses
ofthesenderand
receiver.
Wediscusslogicaladdresseslaterinthischapter.
oRouting.Whenindependentnetworksorlinksareconnected tocreateintemetworks
(networkofnetworks)oralargenetwork,theconnectingdevices(called routers

SECTION2.3LAYERSINTHEOSIMODEL 37
orswitches)routeorswitchthepacketstotheirfinaldestination.Oneofthefunc­
tionsofthenetworklayeristoprovidethismechanism.
Figure2.9illustratesend-to-enddeliverybythenetworklayer.
Figure2.9
Source-to-destinationdelivery
End
system
r
Link
Intermediate
system
A
End
system
r
End
system
r
E
F
HOP-lO-hopdeliveryHop-to-hopdeliveryHOp-lO-hopdelivery
Source-to-destinationdelivery
A B E F
Network-
Network-
Network
Datalink Datalink Datalink
Physical Physical Physical
I.
Source-to-destinationdelivery ,I
Asthefigureshows,nowweneedasource-to-destinationdelivery.Thenetworklayer
atAsendsthepackettothenetworklayeratB.WhenthepacketarrivesatrouterB,the
routermakesadecisionbasedonthefinaldestination(F)
ofthepacket.Aswewillsee
inlaterchapters,routerBusesitsroutingtabletofindthatthenexthopisrouter
E.The
networklayeratB,therefore,sendsthepackettothenetworklayerat
E.Thenetwork
layerat
E,intum,sendsthepackettothenetworklayerat F.
TransportLayer
Thetransportlayerisresponsibleforprocess-to-processdeliveryoftheentiremes­
sage.Aprocessisanapplicationprogramrunningonahost.Whereasthenetworklayer
overseessource-to-destinationdeliveryofindividualpackets,itdoesnotrecognize
anyrelationshipbetweenthosepackets.
Ittreatseachoneindependently,asthough
eachpiecebelongedtoaseparatemessage,whetherornotitdoes.Thetransportlayer,
ontheotherhand,ensuresthatthewholemessagearrivesintactandinorder,overseeing
botherrorcontroland
flowcontrolatthesource-to-destinationlevel.Figure2.10shows
therelationshipofthetransportlayertothenetworkandsessionlayers.

38 CHAPTER 2NETWORKMODELS
Figure2.10Transportlayer
Fromsessionlayer Tosessionlayer
\
\
\
\
Transport
layer
Segments
Fromnetworklayer
/
/CH!lDataI
I I
Tonetworklayer
/ / I I \ \
IH4(DatarIH4fDatarIH4)Data1
I II II I
Segments
Transport
layer
Thetransportlayer isresponsibleforthedeliveryofamessagefromoneprocesstoanother.
Otherresponsibilitiesofthetransportlayerincludethefollowing:
oService-pointaddressing. Computersoftenrunseveralprogramsatthesame
time.Forthisreason,source-to-destinationdeliverymeansdeliverynotonlyfrom
onecomputer
tothenextbutalsofromaspecificprocess(runningprogram)on
onecomputertoaspecificprocess(runningprogram)ontheother.Thetransport
layerheadermustthereforeincludeatype
ofaddresscalleda service-point
address(orportaddress).Thenetworklayergetseachpackettothecorrect
computer;thetransportlayergetstheentiremessagetothecorrectprocesson
thatcomputer.
oSegmentationandreassembly.Amessageisdividedintotransmittablesegments,
witheachsegmentcontainingasequencenumber.Thesenumbersenablethetrans­
portlayertoreassemblethemessagecorrectlyuponarrivingatthedestinationand
toidentifyandreplacepacketsthatwerelostintransmission.
oConnectioncontrol. Thetransportlayercanbeeitherconnectionlessorconnection­
oriented.Aconnectionlesstransportlayertreatseachsegmentasanindependent
packetanddeliversit
tothetransportlayeratthedestinationmachine.Aconnection­
orientedtransportlayermakesaconnectionwiththetransportlayeratthedestina­
tionmachinefirstbeforedeliveringthepackets.Afterallthedataaretransferred,
theconnection
isterminated.
oFlowcontrol. Likethedatalinklayer,thetransportlayerisresponsiblefor flow
control.
However,flowcontrolatthislayerisperformedendtoendratherthan
acrossasingle
link.
oErrorcontrol.Likethedatalinklayer,thetransportlayerisresponsiblefor
errorcontrol.However,errorcontrolatthislayerisperformedprocess-to­
processratherthanacrossasinglelink.Thesendingtransportlayermakessure
thattheentiremessagearrivesatthereceivingtransportlayerwithout
error
(damage,loss,orduplication).Errorcorrectionisusuallyachievedthrough
retransmission.

SECTION2.3LAYERSINTHEOSIMODEL 39
Figure2.11illustratesprocess-to-processdeliverybythetransportlayer.
Figure2.11
Reliableprocess-to-processdelivery ofamessage
Processes Processes
\
\
\
\
\
\
)-----~~~~'C)\\
\
\
\
\
\
\
\
~
Aninternet
I
I
I
,
,
,,/~~~~,....-----<
, I I
/ I I
,I-.I.----------------------.J.I
/ I Networklayer I
, Host-to-hostdelivery
L
Transportlayer
Process-to-processdelivery
SessionLayer
Theservicesprovidedbythefirstthreelayers(physical,datalink,andnetwork)are
notsufficientforsomeprocesses.Thesession
layeristhenetwork dialogcontroller.
Itestablishes,maintains,andsynchronizestheinteractionamongcommunicating
systems.
Thesessionlayerisresponsiblefordialogcontrol andsynchronization.
Specificresponsibilitiesofthesessionlayerincludethefollowing:
oDialogcontrol.Thesessionlayerallowstwosystemstoenterintoadialog. It
allowsthecommunicationbetweentwoprocessestotakeplaceineitherhalf­
duplex(onewayatatime)orfull-duplex(twowaysatatime)mode.
oSynchronization.Thesessionlayerallowsaprocesstoaddcheckpoints,orsyn­
Chronizationpoints,toastream
ofdata.Forexample, ifasystemissendingafile
of2000pages,it
isadvisabletoinsertcheckpointsafterevery100pages toensure
thateach100-pageunitisreceivedandacknowledgedindependently.Inthiscase,
ifacrashhappensduringthetransmissionofpage523,theonlypagesthatneedto
beresentaftersystemrecoveryarepages
501to523.Pagespreviousto501need
notberesent.Figure2.12illustratestherelationship
ofthesessionlayertothe
transportandpresentationlayers.
PresentationLayer
Thepresentationlayerisconcernedwiththesyntaxandsemantics oftheinformation
exchangedbetweentwosystems.Figure2.13showstherelationshipbetweenthepre­
sentationlayerandtheapplicationandsessionlayers.

40 CHAPTER2 NETWORKMODELS
Figure2.12Sessionlayer
I
III
1/
II I
I I II I

,
I
I
~')~:{~ ~,
r'~"''' 9~,
I
syn syn syn
I
Topresentationlayer
~i1-,
I
I
I
I
I
I
I
I
I
Frompresentationlayer
1
I
/ ;f t
/ I~ II
~.•.l
syn syn syn
1
Session
layer
Session
layer
Totransportlayer Fromtransportlayer
Figure2.13Presentationlayer
Fromapplicationlayer
I
Toapplicationlayer..
I
;.......,.1 --1
~l ...,i "J)8,tfi~~. ,.J
I I
Presentation
layer
...
Tosessionlayer
Presentation
layer
Fromsessionlayer
Thepresentationlayerisresponsiblefortranslation,compression, andencryption.
Specificresponsibilities ofthepresentationlayerincludethefollowing:
oTranslation.Theprocesses(runningprograms)intwosystemsareusuallyexchang­
inginformationintheform
ofcharacterstrings,numbers,andsoon.Theinfonna­
tionmustbechangedtobitstreamsbeforebeingtransmitted.Becausedifferent
computersusedifferentencodingsystems,thepresentationlayerisresponsiblefor
interoperabilitybetweenthesedifferentencodingmethods.Thepresentationlayer
atthe
senderchanges theinformationfromitssender-dependentformatintoa
commonformat.Thepresentation layerat thereceivingmachinechangesthe
commonformatintoitsreceiver-dependentformat.
oEncryption.Tocarrysensitiveinformation,asystemmustbeabletoensure
privacy.Encryptionmeansthatthesendertransformstheoriginalinformationto

SECTION2.3LAYERSINTHEOSIMODEL 41
anotherformandsendstheresultingmessageoutoverthenetwork.Decryption
reversestheoriginalprocess
totransformthemessageback toitsoriginalform.
oCompression.Datacompressionreducesthenumber ofbitscontainedinthe
information.Datacompressionbecomesparticularlyimportantinthetransmission
ofmultimediasuch astext,audio,andvideo.
ApplicationLayer
Theapplicationlayerenablestheuser,whetherhumanorsoftware, toaccessthenet­
work.Itprovidesuserinterfacesandsupportforservicessuchaselectronicmail,
remotefileaccessandtransfer,shareddatabasemanagement,andothertypesofdistrib­
utedinformationservices.
Figure2.14showstherelationship
oftheapplicationlayer totheuserandthepre­
sentationlayer.
Ofthemanyapplicationservicesavailable,thefigureshowsonlythree:
XAOO(message-handlingservices),X.500(directoryservices),andfiletransfer,
access,andmanagement(FTAM).Theuserinthisexampleemploys
XAOOtosendan
e-mailmessage.
Figure2.14
Applicationlayer
Data'~:.
User
(humanorprogram)
Application
layer
Topresentationlayer
User
(humanorprogram)
Application
layer
Frompresentationlayer
Theapplicationlayerisresponsibleforprovidingservicestotheuser.
Specificservicesprovidedbytheapplicationlayerincludethefollowing:
oNetworkvirtualterminal.Anetworkvirtualterminalisasoftwareversion of
aphysicalterminal,anditallowsauser tologontoaremotehost. Todoso,the
applicationcreatesasoftwareemulation
ofaterminalattheremotehost.The
user'scomputertalkstothesoftwareterminalwhich,inturn,talkstothehost,
andviceversa.Theremotehostbelievesitiscommunicatingwithone
ofitsown
terminalsandallowstheusertologon.

42 CHAPTER2 NETWORKMODELS
oFiletransfer,access, andmanagement.Thisapplicationallowsausertoaccess
filesinaremotehost(tomakechangesorreaddata),toretrievefilesfromaremote
computerforuse
inthelocalcomputer,andtomanageorcontrolfiles inaremote
computerlocally.
oMailservices.Thisapplicationprovidesthebasisfore-mailforwardingand
storage.
oDirectoryservices.Thisapplicationprovidesdistributeddatabasesourcesand
accessforglobalinformationaboutvariousobjectsandservices.
SummaryofLayers
Figure2.15showsasummary ofdutiesforeachlayer.
Figure
2.15Summaryoflayers
Totranslate,encrypt,and
compress data
Toprovidereliableprocess-to­
processmessagedeliveryand
errorrecovery
Toorganizebitsintoframes;
toprovidehop-to-hopdelivery
Application
Presentation
Session
Transport
Network
Datalink
Physical
Toallowaccesstonetwork
resources
Toestablish,manage,and
terminatesessions
Tomovepacketsfromsource
todestination;toprovide
internetworking
Totransmitbitsoveramedium;
toprovidemechanicaland
electricalspecifications
2.4TCP/IPPROTOCOLSUITE
TheTCPIIPprotocolsuitewasdevelopedpriortotheOSImodel.Therefore,thelay­
ersintheTCP/IPprotocolsuitedonotexactlymatchthoseintheOSImodel.The
originalTCP/IPprotocolsuitewasdefined
ashavingfourlayers:host-to-network,
internet,transport,andapplication.However,whenTCP/IPiscomparedtoOSI,wecan
saythatthehost-to-networklayer
isequivalenttothecombination ofthephysicaland
datalinklayers.Theinternetlayerisequivalenttothenetworklayer,andtheapplica­
tionlayerisroughlydoingthejob
ofthesession,presentation,andapplicationlayers
withthetransportlayerinTCPIIPtakingcare
ofpartofthedutiesofthesessionlayer.
Sointhisbook,weassumethattheTCPIIPprotocolsuiteismade
offivelayers:physi­
cal,datalink,network,transport,andapplication.Thefirstfourlayersprovidephysical
standards,networkinterfaces,internetworking,andtransportfunctionsthatcorrespond
tothefirstfourlayers
oftheOSImodel.ThethreetopmostlayersintheOSImodel,
however,arerepresentedinTCPIIPbyasinglelayercalledthe
applicationlayer (see
Figure2.16).

SECTION2.4TCPIIPPROTOCOLSUITE 43
Figure2.16 TCPIIPand OSImodel
IApplication
Applications
J
8GB8GB
IPresentation ...]
ISession 1
ITransport___SC_TP__!IL-.-__TC_P__II UD_P__II
IICMPIIIGMPI
Network
IP
(internet)
IRARPII
ARPI
IDatalink
IPhysical
Protocolsdefined by
theunderlyingnetworks
(host-to-network)
J
1
TCP/IPisahierarchicalprotocolmade upofinteractivemodules,eachofwhich
providesaspecificfunctionality;however,themodulesarenotnecessarilyinterdepen­
dent.WhereastheOSImodelspecifieswhichfunctionsbelongtoeach
ofitslayers,
thelayers
oftheTCP/IPprotocolsuitecontainrelativelyindependentprotocolsthat
canbemixedandmatcheddependingontheneedsofthesystem.Theterm
hierarchi­
cal
meansthateachupper-levelprotocolissupportedbyoneormorelower-level
protocols.
Atthetransportlayer,
TCP/IPdefinesthreeprotocols:TransmissionControl
Protocol(TCP),UserDatagramProtocol(UDP),andStreamControlTransmission
Protocol(SCTP).Atthenetworklayer,themainprotocoldefinedbyTCP/IPisthe
InternetworkingProtocol(IP);therearealsosomeotherprotocolsthatsupportdata
movementinthislayer.
PhysicalandDataLinkLayers
Atthephysicalanddatalinklayers, TCPIIPdoesnotdefineanyspecificprotocol.It
supportsallthestandardandproprietaryprotocols.Anetworkina
TCPIIPinternetwork
canbealocal-areanetworkorawide-areanetwork.
NetworkLayer
Atthenetworklayer(or,moreaccurately,theinternetworklayer), TCP/IPsupports
theInternetworkingProtocol.
IP,inturn,usesfoursupportingprotocols:ARP,
RARP,ICMP,andIGMP.Each
oftheseprotocolsisdescribedingreaterdetailinlater
chapters.

44 CHAPTER2NETWORKMODELS
InternetworkingProtocol(IP)
TheInternetworkingProtocol(IP)isthetransmissionmechanismusedbytheTCP/IP
protocols.Itisanunreliableandconnectionless
protocol-abest-effortdeliveryservice.
ThetermbesteffortmeansthatIPprovidesnoerrorchecking
ortracking.IPassumes
theunreliability
oftheunderlyinglayersanddoesitsbesttogetatransmissionthrough
toitsdestination,butwithnoguarantees.
IPtransportsdatainpacketscalleddatagrams,each
ofwhichistransportedsepa­
rately.Datagramscantravelalongdifferentroutesandcanarrive
outofsequenceorbe
duplicated.IPdoesnotkeeptrack
oftheroutesandhasnofacilityforreorderingdata­
gramsoncetheyarriveattheirdestination.
Thelimitedfunctionality
ofIPshouldnotbeconsideredaweakness,however.IP
providesbare-bonestransmissionfunctionsthatfreetheusertoaddonlythosefacilities
necessaryforagivenapplicationandtherebyallowsformaximumefficiency.IPisdis­
cussedinChapter20.
AddressResolutionProtocol
TheAddressResolutionProtocol(ARP)isusedtoassociatealogicaladdresswitha
physicaladdress.Onatypicalphysicalnetwork,suchasaLAN,eachdeviceonalink
isidentifiedbyaphysicalorstationaddress,usually imprintedonthenetworkinterface
card(NIC).ARPisusedtofindthephysicaladdress
ofthenodewhenitsInternet
address
isknown.ARP isdiscussedinChapter21.
ReverseAddressResolutionProtocol
TheReverse AddressResolutionProtocol(RARP)allowsahosttodiscoveritsInter­
netaddresswhen
itknowsonlyitsphysicaladdress.Itisusedwhenacomputer iscon­
nectedtoanetworkforthefirsttime
orwhenadisklesscomputerisbooted. Wediscuss
RARPinChapter21.
InternetControlMessageProtocol
TheInternetControlMessageProtocol(ICMP)isamechanismusedbyhostsand
gatewaystosendnotification
ofdatagramproblemsbacktothesender.ICMPsends
queryanderrorreportingmessages.
WediscussICMPinChapter21.
InternetGroupMessageProtocol
TheInternetGroupMessageProtocol(IGMP)isusedtofacilitatethesimultaneous
transmission
ofamessagetoagroup ofrecipients.WediscussIGMPinChapter22.
TransportLayer
Traditionallythetransportlayerwasrepresentedin TCP/IPbytwoprotocols:TCPand
UDP.
IPisahost-to-hostprotocol,meaningthat itcandelivera packetfromone
physicaldevicetoanother.UDPandTCPare
transportlevelprotocolsresponsible
fordelivery
ofamessagefromaprocess(runningprogram)toanotherprocess.Anew
transportlayerprotocol,SCTP,hasbeendevisedto
meettheneedsofsomenewer
applications.

SECTION2.5ADDRESSING 45
UserDatagramProtocol
TheUserDatagramProtocol(UDP) isthesimpler ofthetwostandardTCPIIPtransport
protocols.
Itisaprocess-to-processprotocolthataddsonlyportaddresses,checksum
errorcontrol,andlengthinformation
tothedatafromtheupperlayer.UDP isdiscussed
inChapter23.
TransmissionControlProtocol
The
TransmissionControlProtocol(TCP) providesfulltransport-layerservices to
applications.TCPisareliablestreamtransportprotocol.Theterm stream,inthiscon­
text,meansconnection-oriented:Aconnectionmustbeestablishedbetweenbothends
ofatransmissionbeforeeithercantransmitdata.
Atthesendingendofeachtransmission,TCPdividesastreamofdataintosmaller
unitscalled
segments.Eachsegmentincludesasequencenumberforreorderingafter
receipt,togetherwithanacknowledgmentnumberforthesegmentsreceived.Segments
arecarriedacrosstheinternetinsideofIPdatagrams.Atthereceivingend,TCPcol­
lectseachdatagram
asitcomesinandreordersthetransmissionbasedonsequence
numbers.TCPisdiscussedinChapter23.
StreamControlTransmissionProtocol
TheStreamControlTransmissionProtocol(SCTP) providessupportfornewer
applicationssuch
asvoiceovertheInternet. Itisatransportlayerprotocolthatcom­
binesthebestfeaturesofUDPand
TCP.WediscussSCTPinChapter23.
ApplicationLayer
Theapplicationlayer inTCPIIPisequivalenttothecombinedsession,presentation,
andapplicationlayersintheOSImodeLManyprotocolsaredefinedatthislayer.
We
covermany ofthestandardprotocolsinlaterchapters.
2.5ADDRESSING
Fourlevels ofaddressesareusedin aninternetemployingthe TCP/IPprotocols:
physical(link)addresses,logical (IP)addresses,portaddresses,andspecific
addresses(seeFigure2.17).
Figure2.17
AddressesinTCPIIP
Addresses
I
I
I I I
Physical Logical Port Specific
addresses addresses addresses addresses

46 CHAPTER2 NETWORKMODELS
Eachaddress isrelatedtoaspecificlayerintheTCPIIParchitecture,asshownin
Figure2.18.
Figure2.18RelationshipoflayersandaddressesinTCPIIP
Physical
addresses

Specific
addresses

Port
addresses
..
Logical
addresses
II
IPand
otherprotocols
Underlying~
physical ~
networks
Physicallayer
Appli"tio"
I,,",II p=,= 11-----.-'---..I
T""portI,,",IEJG [j~1-----.-'---..I
Networklayer
Datalinklayer
PhysicalAddresses
Thephysicaladdress,alsoknownasthelinkaddress, istheaddressofanodeasdefined
byitsLANorWAN.
Itisincludedintheframeusedbythedatalinklayer. Itisthe
lowest-leveladdress.
Thephysicaladdresseshaveauthorityoverthenetwork(LANorWAN).Thesize
andformat
oftheseaddressesvarydependingonthenetwork.Forexample,Ethernet
usesa6-byte(48-bit)physicaladdressthatisimprintedonthenetworkinterfacecard
(NIC).LocalTalk(Apple),however,hasaI-bytedynamicaddressthatchangeseach
timethestationcomesup.
Example2.1
InFigure2.19anodewithphysicaladdress10sendsaframetoanodewithphysicaladdress87.
Thetwonodesareconnectedbyalink(bustopologyLAN).
Atthedatalinklayer,thisframe
containsphysical(link)addressesintheheader.Thesearetheonlyaddressesneeded.Therest
of
theheadercontainsotherinformationneededatthislevel.Thetrailerusuallycontainsextrabits
neededforerrordetection.Asthefigureshows,thecomputerwithphysicaladdress
lOisthe
sender,andthecomputerwithphysicaladdress87isthereceiver.
Thedatalinklayeratthe
senderreceivesdatafromanupperlayer.
Itencapsulatesthedatainaframe,addingaheaderand
atrailer.Theheader,amongotherpieces
ofinformation,carriesthereceiverandthesenderphys­
ical(link)addresses.Notethatinmostdatalinkprotocols,thedestinationaddress,87inthis
case,comesbeforethesourceaddress(10inthiscase).
WehaveshownabustopologyforanisolatedLAN.Inabustopology,theframeispropa­
gatedinbothdirections(leftandright).Theframepropagatedtotheleftdieswhenitreachesthe
end
ofthecableifthecableendisterminatedappropriately.Theframepropagatedtotherightis

SECTION2.5ADDRESSING 47
Figure2.19Physicaladdresses
53__
Sender
__28
Destinationaddressdoes
notmatch;thepacketis
dropped
•••
LAN
"
Receiver
senttoeverystationonthenetwork.Eachstationwithaphysicaladdressesotherthan87drops
theframebecausethedestinationaddress
intheframedoesnotmatchitsownphysicaladdress.
Theintendeddestinationcomputer,however,findsamatchbetweenthedestinationaddressinthe
frameanditsownphysicaladdress.Theframeischecked,theheaderandtraileraredropped,and
thedatapartisdecapsulatedanddeliveredtotheupperlayer.
Example2.2
AswewillseeinChapter 13,mostlocal-areanetworksusea48-bit(6-byte)physicaladdress
written
as12hexadecimaldigits;everybyte(2hexadecimaldigits)isseparatedbyacolon, as
shownbelow:
07:01:02:01:2C:4B
A6-byte(12hexadecimaldigits)physicaladdress
LogicalAddresses
Logicaladdressesarenecessaryforuniversalcommunicationsthatareindependent of
underlyingphysicalnetworks.Physicaladdressesarenotadequateinaninternetwork
environmentwheredifferentnetworkscanhavedifferent addressformats.Auniversal
addressingsystemisneededinwhicheachhostcanbeidentifieduniquely,regardless
oftheunderlyingphysicalnetwork.
Thelogicaladdressesaredesignedforthispurpose.AlogicaladdressintheInternet
iscurrentlya32-bitaddressthatcanuniquelydefineahost connectedtotheInternet.No
twopubliclyaddressedandvisiblehostsontheInternetcanhavethesameIPaddress.
Example2.3
Figure2.20showsapart ofaninternetwithtworoutersconnectingthreeLANs.Eachdevice
(computerorrouter)hasapair
ofaddresses(logicalandphysical)foreachconnection.Inthis
case,eachcomputerisconnected
toonlyonelinkandthereforehasonlyonepair ofaddresses.
Eachrouter,however,isconnected
tothreenetworks(onlytwoareshowninthefigure).Soeach
routerhasthreepairs
ofaddresses,oneforeachconnection.Althoughitmayobviousthateach
routermusthaveaseparatephysicaladdressforeachconnection,itmaynotbeobviouswhyit
needsalogicaladdressforeachconnection.
Wediscusstheseissues inChapter22whenwedis­
cussrouting.

48 CHAPTER2 NETWORKMODELS
Figure2.20IPaddresses
AI10
LAN2
Toanother
networkY/55
ToanotherXJ44
network
Ph)sical
addl'esscs
changed
LAN3
-~~_~I~I JRouterll
~tE]
LAN1
P/95
ThecomputerwithlogicaladdressAandphysicaladdress10needstosenda
packettothecomputerwithlogicaladdressPandphysicaladdress95.
Weuselettersto
showthelogicaladdressesandnumbersforphysicaladdresses,butnotethatbothare
actuallynumbers,aswewillseelaterinthechapter.
Thesenderencapsulatesitsdatainapacketatthenetworklayerandaddstwological
addresses(AandP).Notethatinmostprotocols,thelogicalsourceaddresscomesbefore
thelogicaldestinationaddress(contrarytotheorderofphysicaladdresses).Thenetwork
layer,however,needs
tofindthephysicaladdress ofthenexthopbeforethepacketcanbe
delivered.Thenetworklayerconsultsitsroutingtable(seeChapter22)andfindsthe
logicaladdress
ofthenexthop(routerI) tobeF.TheARPdiscussedpreviouslyfinds
thephysicaladdress
ofrouter1thatcorrespondstothelogicaladdress of20.Nowthe
networklayerpassesthisaddresstothedata
linklayer,whichintum,encapsulatesthe
packetwithphysicaldestinationaddress20andphysicalsourceaddress10.
Theframeisreceivedbyeverydevice
onLAN1,butisdiscardedbyallexcept
router
1,whichfindsthatthedestinationphysicaladdressintheframematcheswithits
ownphysicaladdress.Therouterdecapsulatesthepacketfromtheframetoreadthelog­
icaldestinationaddress
P.Sincethelogicaldestinationaddressdoesnotmatchthe
router'slogicaladdress,therouterknowsthatthepacketneedstobeforwarded.The

SECTION2.5ADDRESSING 49
routerconsultsitsroutingtableandARPtofindthephysicaldestinationaddress ofthe
nexthop(router2),createsanewframe,encapsulatesthepacket,andsendsittorouter
2.
Notethephysicaladdressesintheframe.Thesourcephysicaladdresschanges
from10to99.Thedestinationphysicaladdresschangesfrom20(router1physical
address)to
33(router2physicaladdress).Thelogicalsourceanddestinationaddresses
mustremainthesame;otherwisethepacketwillbelost.
Atrouter2wehaveasimilarscenario.Thephysicaladdressesarechanged,anda
newframeissenttothedestinationcomputer.Whentheframereachesthedestination,
thepacketisdecapsulated.ThedestinationlogicaladdressPmatchesthelogicaladdress
ofthecomputer.Thedataaredecapsulatedfromthepacketanddeliveredtotheupper
layer.Notethatalthoughphysicaladdresseswillchangefromhoptohop,logical
addressesremainthesamefromthesourcetodestination.Therearesomeexceptionsto
thisrulethatwediscoverlaterinthebook.
Thephysicaladdresses willchangefrom hoptohop,
butthelogicaladdressesusually remainthesame.
PortAddresses
TheIPaddressandthephysicaladdressarenecessaryforaquantity ofdatatotravel
fromasourcetothedestinationhost.However,arrivalatthedestinationhostisnotthe
finalobjective
ofdatacommunicationsontheInternet.Asystemthatsendsnothingbut
datafromonecomputertoanotherisnotcomplete.Today,computersaredevicesthat
canrunmultipleprocessesatthesametime.TheendobjectiveofInternetcommunica­
tionisaprocesscommunicatingwithanotherprocess.Forexample,computerAcan
communicatewithcomputerCbyusingTELNET.Atthesametime,computerAcom­
municateswithcomputerBbyusingtheFileTransferProtocol(FTP).Forthesepro­
cessestoreceivedatasimultaneously,weneedamethodtolabelthedifferentprocesses.
Inotherwords,theyneedaddresses.IntheTCPIIParchitecture,thelabelassignedtoa
processiscalledaportaddress.AportaddressinTCPIIPis16bitsinlength.
Example2.4
Figure2.21showstwocomputerscommunicatingviatheInternet.Thesendingcomputerisrun­
ningthreeprocessesatthistime withportaddresses
a,b,andc.Thereceivingcomputerisrunning
twoprocessesatthistimewithportaddresses
jandk.Processainthesendingcomputerneedsto
communicatewithprocess
jinthereceivingcomputer.Notethatalthoughbothcomputersare
usingthesameapplication,
FTP,forexample,theportaddressesaredifferentbecauseoneisaclient
programandtheotherisaserverprogram,
aswewillseeinChapter23. Toshowthatdatafrom
processaneedtobedeliveredto process
j,andnotk,thetransportlayerencapsulatesdatafrom
theapplicationlayerinapacketandaddstwoportaddresses(aand
j),sourceanddestination.The
packetfromthetransportlayeristhenencapsulatedinanotherpacketatthenetworklayerwith
logicalsourceanddestinationaddresses(AandP).Finally,thispacket
isencapsulatedinaframe
withthephysical sourceanddestinationaddresses
ofthenexthop.Wehavenotshownthephysi­
caladdressesbecausetheychangefromhoptohopinsidetheclouddesignated
astheInternet.
Notethatalthoughphysicaladdresseschangefromhoptohop,logicalandportaddressesremain
thesamefromthesourcetodestination.Therearesomeexceptionstothisrulethat
wediscuss
laterinthebook.

50 CHAPTER 2NETWORKMODELS
Figure2.21 Portaddresses
abc
DD
- - - -Datalinklayer- - --
Internet
j k
DD
Thephysicaladdresseschangefromhoptohop,
butthelogicalandportaddressesusuallyremainthesame.
Example2.5
AswewillseeinChapter23,aportaddressisa16-bitaddressrepresentedbyonedecimalnum­
herasshown.
753
A16-bitportaddressrepresentedasonesinglenumber
SpecificAddresses
Someapplicationshaveuser-friendlyaddressesthataredesignedforthatspecificaddress.
Examplesincludethee-mailaddress(forexample,[email protected])andtheUniversal
ResourceLocator(URL)(forexample,www.mhhe.com).Thefirstdefinestherecipient
of
ane-mail(seeChapter26);thesecondisusedtofindadocumentontheWorldWideWeb
(seeChapter27).Theseaddresses,however,getchangedtothecorrespondingportand
logicaladdressesbythesendingcomputer,aswewillseeinChapter25.
2.6RECOMMENDED READING
Formoredetailsaboutsubjectsdiscussedinthischapter,werecommendthefollowing
booksandsites.Theitemsenclosedinbrackets,[
...]refertothereferencelistatthe
end
ofthetext.

SECTION2.7KEYTERMS 51
Books
NetworkmodelsarediscussedinSection 1.3of[Tan03],Chapter2 of[For06],Chapter2
of[Sta04],Sections2.2and2.3 of[GW04],Section1.3 of[PD03],andSection1.7 of
[KR05].AgooddiscussionaboutaddressescanbefoundinSection1.7 of[Ste94].
Sites
Thefollowingsite isrelatedtotopicsdiscussedinthischapter.
owww.osi.org!Informationabout OS1.
RFCs
ThefollowingsitelistsallRFCs,includingthoserelatedtoIPandportaddresses.
owww.ietLorg/rfc.html
2.7KEYTERMS
accesscontrol
AddressResolutionProtocol(ARP)
applicationlayer
best-effortdelivery
bits
connectioncontrol
datalinklayer
encoding
error
errorcontrol
flowcontrol
frame
header
hop-to-hopdelivery
host-to-hostprotocol
interface
InternetControlMessageProtocol
(ICMP)
InternetGroupMessageProtocol(IGMP)
logicaladdressing
mailservice
networklayer
node-to-nodedelivery
opensystem
OpenSystemsInterconnection(OSI)
model
peer-to-peerprocess
physicaladdressing
physicallayer
portaddress
presentationlayer
process-to-processdelivery
ReverseAddressResolutionProtocol
(RARP)
routing
segmentation
sessionlayer
source-to-destinationdelivery
StreamControlTransmissionProtocol
(SCTP)
synchronizationpoint
TCPIIPprotocolsuite
trailer
TransmissionControlProtocol(TCP)
transmissionrate
transportlayer
transportlevelprotocols
UserDatagramProtocol(UDP)

52 CHAPTER2 NETWORKMODELS
2.8SUMMARY
oTheInternationalStandardsOrganizationcreatedamodelcalledtheOpenSystems
Interconnection,whichallows diversesystemstocommunicate.
UTheseven-layerOSImodelprovidesguidelinesforthedevelopment ofuniversally
compatiblenetworkingprotocols.
oThephysical,datalink,andnetworklayersarethenetworksupportlayers.
oThesession,presentation,andapplicationlayersaretheusersupportlayers.
DThetransportlayerlinksthenetworksupportlayersandtheusersupportlayers.
oThephysicallayercoordinatesthefunctionsrequired totransmitabitstreamover
aphysicalmedium.
oThedatalinklayerisresponsiblefordeliveringdataunitsfromonestation tothe
nextwithouterrors.
oThenetworklayerisresponsibleforthesource-to-destinationdeliveryofapacket
acrossmultiplenetworklinks.
[JThetransportlayerisresponsiblefortheprocess-to-processdelivery oftheentire
message.
DThesessionlayerestablishes,maintains,andsynchronizestheinteractionsbetween
communicatingdevices.
UThepresentationlayerensuresinteroperabilitybetweencommunicatingdevices
throughtransformation
ofdataintoamutuallyagreeduponformat.
oTheapplicationlayerenablestheusers toaccessthenetwork.
oTCP/IPisafive-layerhierarchicalprotocolsuitedevelopedbeforetheOSImodel.
UTheTCP/IPapplicationlayer isequivalenttothecombinedsession,presentation,
andapplicationlayers
oftheOSImodel.
UFourlevelsofaddressesareusedinaninternetfollowingtheTCP/IPprotocols:phys­
ical(link)addresses,logical(IP)addresses,portaddresses,andspecificaddresses.
oThephysicaladdress,alsoknown asthelinkaddress,istheaddress ofanodeas
definedbyitsLANorWAN.
L,JTheIPaddressuniquelydefinesahostontheInternet.
UTheportaddressidentifiesaprocessonahost.
oAspecificaddressisauser-friendlyaddress.
2.9PRACTICESET
ReviewQuestions
I.Listthelayers oftheInternetmodel.
2.WhichlayersintheInternetmodelarethenetworksupportlayers?
3.WhichlayerintheInternetmodelistheusersupportlayer?
4.Whatisthedifferencebetweennetworklayerdeliveryandtransportlayerdelivery?

SECTION2.9PRACTICESET 53
5.Whatisapeer-to-peerprocess?
6.HowdoesinformationgetpassedfromonelayertothenextintheInternet
model?
7.Whatareheadersandtrailers,andhowdotheygetaddedandremoved?X.Whataretheconcerns ofthephysicallayer intheInternetmodel?
9.Whataretheresponsibilities ofthedatalinklayerintheInternetmodel?
10.Whataretheresponsibilities ofthenetworklayerintheInternetmodel?
II.Whataretheresponsibilities ofthetransportlayerintheInternetmodel?
12.Whatisthedifferencebetweenaportaddress,alogicaladdress,andaphysical
address?
13.NamesomeservicesprovidedbytheapplicationlayerintheInternetmodel.
14.Howdothelayers oftheInternetmodelcorrelatetothelayers oftheOSImodel?
Exercises
15.HowareOSIandISOrelatedtoeachother?
16.Matchthefollowingtooneormorelayers oftheOSImodel:
a.Routedetermination
b.Flowcontrol
c.Interfacetotransmissionmedia
d.Providesaccessfortheenduser
I7.Matchthefollowingtooneormorelayers oftheOSImodel:
a.Reliableprocess-to-processmessagedelivery
b.Routeselection
c.Definesframes
d.Providesuserservicessuchase-mailand filetransfer
e.Transmissionofbitstreamacrossphysicalmedium
\8.Matchthefollowingtooneormorelayersofthe OSlmodel:
a.Communicatesdirectlywithuser'sapplicationprogram
b.Errorcorrectionandretransmission
c.Mechanical,electrical,andfunctionalinterface
d.Responsibilityforcarryingframesbetweenadjacentnodes
I9.Matchthefollowing tooneormorelayersoftheOSImodel:
a.Formatandcodeconversionservices
b.Establishes,manages,andterminatessessions
c.Ensuresreliabletransmissionofdata
d.Log-inandlog-outprocedures
e.Providesindependencefromdifferencesindatarepresentation
20.InFigure2.22,computerAsendsamessagetocomputerDvia LANl,routerRl,
andLAN2.Showthecontents ofthepacketsandframesatthenetworkanddata
linklayerforeachhopinterface.

54 CHAPTER 2NETWORKMODELS
Figure2.22 Exercise20
Sender 8/42
LAN1
Rl
LAN2Sender
21.InFigure2.22,assumethatthecommunicationisbetweenaprocessrunningat
computerAwithportaddressiandaprocessrunningatcomputerDwithport
address
j.Showthecontents ofpacketsandframesatthenetwork,datalink,and
transportlayerforeachhop.
22.SupposeacomputersendsaframetoanothercomputeronabustopologyLAN.
Thephysicaldestinationaddress
oftheframeiscorruptedduringthetransmission.
Whathappenstotheframe?Howcanthesenderbeinformedaboutthesituation?
23.Supposeacomputersendsapacketatthenetworklayertoanothercomputer
somewhereintheInternet.Thelogicaldestinationaddress
ofthepacketiscor­
rupted.Whathappenstothepacket?Howcanthesourcecomputerbeinformed
of
thesituation?
24.Supposeacomputersendsapacketatthetransportlayertoanothercomputer
somewhere
intheInternet.Thereis noprocesswiththedestinationportaddress
runningatthedestinationcomputer.Whatwillhappen?
25.Ifthedatalinklayercandetecterrorsbetweenhops,whydoyouthinkweneed
anothercheckingmechanismatthetransportlayer?
ResearchActivities
26.Givesomeadvantagesanddisadvantages ofcombiningthe session,presentation,
andapplicationlayerintheOSImodelintoonesingleapplicationlayerinthe
Internetmodel.
27.Dialogcontrolandsynchronizationaretworesponsibilitiesofthesessionlayerin
theOSImodel.Whichlayerdoyouthinkisresponsibleforthesedutiesinthe
Internetmodel?Explainyouranswer.
28.Translation,encryption,andcompressionaresomeoftheduties
ofthepresentation
layerintheOSImodel.Whichlayerdoyouthink
isresponsibleforthesedutiesin
theInternetmodel?Explainyouranswer.
29.ThereareseveraltransportlayermodelsproposedintheOSImodel.Findall
of
them.Explainthedifferencesbetweenthem.
30.ThereareseveralnetworklayermodelsproposedintheOSImodel.Findall
of
them.Explainthedifferencesbetweenthem.

PhysicalLayer
andMedia
Objectives
Westartthediscussion oftheInternetmodelwiththebottom-mostlayer,thephysical
layer.Itisthelayerthatactuallyinteractswiththetransmissionmedia,thephysicalpart
ofthenetworkthatconnectsnetworkcomponentstogether.Thislayerisinvolvedin
physicallycarryinginformationfromonenodeinthenetworktothenext.
Thephysicallayerhascomplextaskstoperform.Onemajortaskistoprovide
servicesforthedatalinklayer.Thedatainthedatalinklayerconsists
ofOsandIsorga­
nizedintoframesthatarereadytobesentacrossthetransmissionmedium.Thisstream
ofOsandIsmustfirstbeconvertedintoanotherentity:signals.One oftheservicespro­
videdbythephysicallayeristocreateasignalthatrepresentsthisstream
ofbits.
Thephysicallayermustalsotakecare
ofthephysicalnetwork,thetransmission
medium.
Thetransmissionmediumisapassiveentity;ithasnointernalprogramor
logicforcontrollikeotherlayers.Thetransmissionmediummustbecontrolledbythe
physicallayer.Thephysicallayerdecidesonthedirections
ofdataflow.Thephysical
layerdecidesonthenumber
oflogicalchannelsfortransportingdatacomingfrom
differentsources.
InPart2
ofthebook,wediscussissuesrelatedtothephysicallayerandthetrans­
missionmediumthatiscontrolledbythephysicallayer.Inthelastchapter
ofPart2,we
discussthestructureandthephysicallayers
ofthetelephonenetworkandthecable
network.
Part2ofthebookisdevotedtothephysicallayer
andthetransmissionmedia.

Chapters
Thispartconsists ofsevenchapters:Chapters3to 9.
Chapter3
Chapter3discussestherelationshipbetweendata,whicharecreatedbyadevice,and
electromagneticsignals,whicharetransmittedoveramedium.
Chapter4
Chapter4dealswithdigitaltransmission. Wediscusshowwecancovertdigital or
analogdatatodigitalsignals.
Chapter5
Chapter5dealswithanalogtransmission.Wediscusshowwecancovertdigital or
analogdatatoanalogsignals.
Chapter6
Chapter6showshowwecanusetheavailablebandwidthefficiently. Wediscusstwo
separate,butrelatedtopics,multiplexingandspreading.
Chapter7
Afterexplainingsomeideasaboutdataandsignalsandhowwecanusethemeffi­
ciently,we
discussthecharacteristicsoftransmissionmedia,bothguidedand
unguided,inthischapter.Although transmissionmediaoperatesunderthephysical
layer,theyarecontrolledbythephysicallayer.
Chapter8
Althoughthepreviouschaptersinthispartareissuesrelatedtothephysicallayeror
transmissionmedia,Chapter8discussesswitching,atopicthatcanberelatedtoseveral
layers.
Wehaveincludedthistopicinthispart ofthebooktoavoidrepeatingthedis­
cussionforeachlayer.
Chapter9
Chapter9showshowtheissuesdiscussedinthepreviouschapterscanbeusedinactual
networks.Inthischapter,wefirstdiscussthetelephonenetwork
asdesignedtocarry
voice.Wethenshowhowitcanbeusedtocarrydata.Second,wediscussthecable
net­
workasatelevisionnetwork. Wethenshowhowitcanalsobeusedtocarrydata.

CHAPTER3
DataandSignals
Oneofthemajorfunctions ofthephysicallayeristomovedataintheform ofelectro­
magneticsignalsacrossatransmissionmedium.Whetheryouarecollectingnumerical
statisticsfromanothercomputer,sendinganimatedpicturesfromadesignworkstation,
orcausingabelltoringatadistantcontrolcenter,youareworkingwiththetransmis­
sion
ofdataacrossnetworkconnections.
Generally,thedatausabletoapersonorapplicationarenotinaformthatcanbe
transmittedoveranetwork.Forexample,aphotographmustfirstbechangedtoaform
thattransmissionmediacanaccept.Transmissionmediaworkbyconducting energy
alongaphysicalpath.
Tobetransmitted,datamust betransformedtoelectromagneticsignals.
3.1ANALOGANDDIGITAL
Bothdataandthesignalsthatrepresentthemcanbeeitheranalog ordigitalinform.
AnalogandDigitalData
Datacanbeanalogordigital.Thetermanalogdatareferstoinformationthatiscontin­
uous;digitaldatareferstoinformationthathasdiscretestates.Forexample,ananalog
clockthathashour,minute,andsecondhandsgivesinformationinacontinuousform;
themovements
ofthehandsarecontinuous.Ontheotherhand,adigitalclockthat
reportsthehoursandtheminuteswillchangesuddenlyfrom8:05to8:06.
Analogdata,such
asthesoundsmadebyahumanvoice,takeoncontinuousvalues.
Whensomeonespeaks,ananalogwaveiscreatedinthe
air.Thiscanbecapturedbya
microphoneandconvertedtoananalogsignalorsampledandconvertedtoadigital
signal.
Digitaldatatake
ondiscretevalues. Forexample,dataarestored incomputer
memoryintheform
ofOsand1s.Theycanbeconvertedtoadigitalsignalormodu­
latedintoananalogsignalfortransmissionacrossamedium.
57

58 CHAPTER 3DATAANDSIGNALS
Datacanbeanalog ordigital.Analog dataarecontinuousandtakecontinuousvalues.
Digital
datahavediscretestates andtakediscretevalues.
AnalogandDigitalSignals
Likethedatatheyrepresent,signalscan beeitheranalogordigital.An analogsignal
hasinfinitelymanylevels
ofintensityoveraperiod oftime.Asthewavemovesfrom
value
AtovalueB,itpassesthroughandincludesaninfinitenumber ofvaluesalongits
path.A
digitalsignal,ontheotherhand,canhaveonlyalimitednumber ofdefined
values.Althougheachvaluecanbeanynumber,itisoftenassimpleas
1andO.
Thesimplestwaytoshowsignalsisbyplottingthemonapair ofperpendicular
axes.Theverticalaxisrepresentsthevalueorstrength
ofasignal.Thehorizontalaxis
representstime.Figure
3.1illustratesananalogsignalandadigitalsignal.Thecurve
representingtheanalogsignalpassesthroughaninfinitenumber
ofpoints.Thevertical
lines
ofthedigitalsignal,however,demonstratethesudden jumpthatthesignalmakes
fromvaluetovalue.
Signalscanbeanalog ordigital.Analogsignalscanhave aninfinitenumberof
valuesinarange;digitalsignalscanhaveonlyalimited
numberofvalues.
Figure3.1Comparisonofanaloganddigitalsignals
Value Value
Time
-
Tim
'----
e
a.Analogsignal b.Digitalsignal
PeriodicandNonperiodicSignals
Bothanaloganddigitalsignalscantakeone oftwoforms: periodicornonperiodic
(sometimesrefertoas aperiodic,becausetheprefix ainGreekmeans"non").
A
periodicsignalcompletesapatternwithinameasurabletimeframe,calleda
period,andrepeatsthatpatternoversubsequentidenticalperiods.Thecompletion of
onefullpatterniscalledacycle.Anonperiodicsignalchangeswithoutexhibitingapat­
ternorcyclethatrepeatsovertime.
Bothanaloganddigitalsignalscanbeperiodicornonperiodic.Indatacommuni­
cations,wecommonlyuseperiodicanalogsignals(becausetheyneedlessbandwidth,

SECTION3.2PERIODICANALOGSIGNALS 59
aswewillseeinChapter5)andnonperiodicdigitalsignals(becausetheycanrepresent
variationindata,
aswewillseeinChapter6).
Indatacommunications,wecommonlyuseperiodic
analogsignalsandnonperiodicdigitalsignals.
3.2PERIODICANALOGSIGNALS
Periodicanalogsignalscanbeclassified assimpleorcomposite.Asimpleperiodic
analogsignal,asinewave,cannotbedecomposedintosimplersignals.Acomposite
periodicanalogsignaliscomposed
ofmultiplesinewaves.
SineWave
Thesinewaveisthemostfundamentalform ofaperiodicanalogsignal.Whenwe
visualizeit
asasimpleoscillatingcurve,itschangeoverthecourseofacycleissmooth
andconsistent,acontinuous,rolling
flow.Figure3.2showsasinewave.Eachcycle
consists
ofasinglearcabovethetimeaxisfollowedbyasinglearcbelowit.
Figure3.2
Asinewave
Value
Time
Wediscussamathematicalapproachtosinewaves inAppendixC.
Asinewavecanberepresentedbythreeparameters:the peakamplitude,thefre­
quency,
andthephase.Thesethreeparametersfullydescribeasinewave.
PeakAmplitude
Thepeakamplitudeofasignalistheabsolutevalueofitshighestintensity,propor­
tionaltotheenergyitcarries.Forelectricsignals,peakamplitudeisnormallymeasured
in
volts.Figure3.3showstwo signalsandtheirpeakamplitudes.
Example3.1
Thepowerinyourhousecanberepresentedbyasinewavewithapeakamplitudeof 155to170
V.
However,it iscommonknowledgethatthevoltage ofthepowerinU.S.homesis110to120V.

60 CHAPTER 3DATAANDSIGNALS
Figure3.3 Twosignalswiththesame phaseandfrequency,butdifferentamplitudes
Amplitude
Peakamplitude
Time
a.Asignalwithhigh peakamplitude
Amplitude
Time
b.Asignalwithlow peakamplitude
Thisdiscrepancyisduetothefactthatthesearerootmeansquare(rms)values.Thesignalis
squaredandthentheaverageamplitudeiscalculated.Thepeakvalueisequalto2
112
xrms
value.
Example3.2
Thevoltageofbatteryisaconstant;thisconstantvaluecanbeconsideredasinewave,aswewill
seelater.Forexample,thepeakvalue
ofanAAbatteryisnormally 1.5V.
PeriodandFrequency
Periodreferstotheamount oftime,inseconds,asignalneedstocomplete1cycle.
Frequencyreferstothenumber ofperiodsin Is.Notethatperiodandfrequencyarejust
onecharacteristicdefinedintwoways.Periodistheinverse
offrequency,andfrequency
istheinverse
ofperiod,asthefollowingformulasshow.
1
f=­
T
and
1
T=-
f
Frequencyandperiodaretheinverseofeachother.
Figure3.4showstwosignalsandtheirfrequencies.

SECTION3.2PERIODICANALOGSIGNALS 61
Figure3.4 Twosignalswiththesameamplitude andphase,butdifferentfrequencies
Amplitude
12periodsinIs-----+-Frequencyis12Hz
1s
Time
Period:ns
a.Asignal
withafrequencyof12Hz
Amplitude
6periodsin
Is-----+-Frequencyis6Hz
1s
I•••
Time
T
Period:ts
b.Asignalwithafrequency
of6Hz
Periodisformallyexpressedinseconds.Frequencyisformallyexpressedin
Hertz(Hz),whichiscyclepersecond.Unitsofperiodandfrequencyareshownin
Table3.1.
Table3.1
Unitsofperiodandfrequency
Unit Equivalent Unit Equivalent
Seconds(s) 1 s Hertz(Hz) 1Hz
Milliseconds(ms) 10-
3
s Kilohertz(kHz) 10
3
Hz
Microseconds
(Ils) 10-6s Megahertz(MHz) 10
6
Hz
Nanoseconds(ns)
10-
9s Gigahertz(GHz) 10
9
Hz
Picoseconds(ps) 10-
12
s Terahertz(THz) 10
12
Hz
Example3.3
Thepowerweuseathomehasafrequency of60Hz(50HzinEurope).Theperiod ofthissine
wavecanbe determinedasfollows:
T=
1=6
1
0=0.0166s=0.0166x10
3
ms=16.6illS
Thismeansthattheperiod ofthepowerforourlightsathomeis0.0116s,or16.6ms.Our
eyesarenotsensitiveenoughtodistinguishtheserapidchangesinamplitude.

62 CHAPTER 3DATAANDSIGNALS
Example3.4
Expressaperiod of100msinmicroseconds.
Solution
FromTable 3.1wefindtheequivalents of1ms(lmsis10-
3
s)and1 s (1sis106118).Wemake
thefollowingsubstitutions:
100
ms:;;::;100X10-
3
s:;;::;100X10-
3
X
10
6JlS:;;::;10
2
X
10-
3
X
10
6
JlS::::::10
5
JlS
Example3.5
Theperiodofasignalis100ms.Whatisitsfrequencyinkilohertz?
Solution
Firstwechange lOOmstoseconds, andthenwecalculatethefrequencyfromtheperiod (1Hz=
10-
3
kHz).
100ms =100X10-
3
S
=10-
1
S
f=
1.=_1_Hz=10Hz=10X10-
3
kHz=10-
2
kHz
T10-
1
MoreAboutFrequency
Wealreadyknowthatfrequency istherelationshipofasignaltotimeandthatthefrequency
ofawaveisthenumber ofcyclesitcompletesin1 s.Butanotherway tolookatfrequency
isasameasurement
oftherateofchange.Electromagneticsignalsareoscillatingwave­
forms;thatis,theyfluctuatecontinuouslyandpredictablyaboveandbelowameanenergy
level.A40-Hzsignalhasone-halfthefrequency
ofan80-Hzsignal;itcompletes1cycle in
twicethetime ofthe80-Hzsignal,soeachcyclealsotakestwiceaslongtochangefromits
lowesttoitshighestvoltagelevels.Frequency,therefore,thoughdescribedincyclespersec­
ond(hertz),isageneralmeasurement
oftherateofchange ofasignalwithrespecttotime.
Frequencyistherateofchangewithrespecttotime.Change inashortspanoftime
meanshighfrequency.Changeoveralong
spanoftimemeanslowfrequency.
Ifthevalueofasignalchangesoveraveryshortspan oftime,itsfrequencyis
high.
Ifitchangesoveralongspan oftime,itsfrequencyislow.
TwoExtremes
Whatifasignaldoesnotchangeatall?What ifitmaintainsaconstantvoltagelevelforthe
entiretimeitisactive?Insuchacase,itsfrequencyiszero.Conceptually,thisidea
isasim­
pleone.
Ifasignaldoesnotchangeatall,itnevercompletesacycle,soitsfrequencyis aHz.
Butwhatifasignalchangesinstantaneously?What ifitjumpsfromonelevelto
anotherinnotime?Thenitsfrequencyisinfinite.Inotherwords,whenasignalchanges
instantaneously,itsperiodiszero;sincefrequencyistheinverse
ofperiod,inthiscase,
thefrequencyis1/0,orinfinite(unbounded).

SECTION3.2PERiODICANALOGSIGNALS 63
Ifasignaldoes notchangeatall,itsfrequencyiszero.
Ifasignalchangesinstantaneously,itsfrequencyisinfinite.
Phase
Thetermphasedescribestheposition ofthewaveformrelativetotime O.Ifwethinkof
thewaveassomethingthatcanbeshiftedbackward orforwardalongthetimeaxis,
phasedescribestheamount
ofthatshift.Itindicatesthestatus ofthefirstcycle.
Phasedescribesthepositionofthewaveformrelativetotime O.
Phaseismeasuredindegreesorradians[360° is2nrad;1°is 2n/360rad,and1rad
is
360/(2n)].Aphaseshift of360°correspondstoashift ofacomplete period;aphase
shift
of180°corresponds toashiftofone-halfofaperiod;andaphaseshift of90°cor­
respondstoashift
ofone-quarterofaperiod(seeFigure3.5).
Figure3.5Threesinewaveswiththesameamplitudeandfrequency,butdifferentphases
a.0degrees*AAL
1!4TO\J~
b.90degrees
c.180degrees

Time
~
Time
)I
Time
LookingatFigure3.5,wecansaythat
I.Asinewavewithaphase of0°startsattime0withazeroamplitude.The
amplitudeisincreasing.
2.Asinewavewithaphase of90°startsattime0withapeakamplitude.The
amplitudeisdecreasing.

64 CHAPTER 3DATAANDSIGNALS
3.Asinewavewithaphase of180°startsattime0withazeroamplitude.The
amplitudeisdecreasing.
Anotherwaytolookatthephase
isintermsofshiftoroffset. Wecansaythat
1.Asinewavewithaphase of0°isnotshifted.
2.Asinewavewithaphase of90°isshiftedtotheleftby
!cycle.However,note
4
thatthesignaldoesnotreallyexistbeforetime O.
3.Asinewavewithaphase of180°isshiftedtotheleftby~cycle.However,note
thatthesignaldoesnotreallyexistbeforetime
O.
Example3.6
Asinewaveisoffset
~cyclewithrespecttotime O.Whatisitsphaseindegreesandradians?
Solution
Weknowthat1completecycle is360°.Therefore,icycleis
!x360;::;60° =60x2ntad;::;~fad;::;1.046rad
6 360 3
Wavelength
Wavelengthisanothercharacteristic ofasignaltravelingthroughatransmission
medium.Wavelengthbindstheperiodorthefrequency
ofasimplesinewavetothe
propagationspeedofthemedium(seeFigure3.6).
Figure3.6Wavelengthandperiod
Wavelength""" :. ':Transmissionmedium /'-~ /'-
Directionof
propagation
Whilethefrequency ofasignalisindependent ofthemedium,thewavelength
dependsonboththefrequencyandthemedium.Wavelengthisaproperty
ofanytype
ofsignal.Indatacommunications,weoftenusewavelengthtodescribethetransmis­
sion
oflightinanopticalfiber.Thewavelength isthedistanceasimplesignalcantravel
inoneperiod.
Wavelengthcanbecalculated
ifoneisgiventhepropagationspeed(thespeed of
light)andtheperiod ofthesignal.However,sinceperiodandfrequencyarerelatedto
eachother,
ifwerepresentwavelengthby
A,propagationspeedbyc(speed oflight),and
frequencyby
1,weget
. •propagation
speed
Wavelength=propagatJonspeedxperJod;::;{\
requency

SECTION3.2PERIODICANALOGSIGNALS 6S
Thepropagationspeed ofelectromagneticsignalsdepends onthemediumandon
thefrequency
ofthesignal.Forexample,inavacuum,lightispropagatedwithaspeed
of3 x10
8
mls.Thatspeedislowerinairandevenlowerincable.
Thewavelengthisnormallymeasuredinmicrometers(microns)instead
ofmeters.
Forexample,thewavelength
ofredlight(frequency =4 x10
14
)inairis
8
c3xlO
-6
A=- = =0.75x 10m=0.75!J.m
f4x10
14
Inacoaxialorfiber-opticcable,however,thewavelengthisshorter(0.5!Jm)becausethe
propagationspeedinthecableisdecreased.
TimeandFrequencyDomains
Asinewaveiscomprehensivelydefinedbyitsamplitude,frequency,andphase.We
havebeenshowingasinewave
byusingwhatiscalleda time-domainplot.The
time-domainplotshowschangesinsignalamplitudewithrespecttotime(itisan
amplitude-versus-timeplot).Phaseisnotexplicitlyshownonatime-domainplot.
Toshowtherelationshipbetweenamplitudeandfrequency,wecanusewhatis
calleda
frequency-domainplot.Afrequency-domainplotisconcernedwithonlythe
peakvalueandthefrequency.Changes
ofamplitudeduringoneperiodarenotshown.
Figure3.7showsasignalinboththetimeandfrequencydomains.
Figure3.7 Thetime-domainandfrequency-domainplots ofasinewave
Amplitude
Frequency:
6Hz
Peakvalue: 5 V
5
----------
Time
(s)
a.Asinewaveinthetimedomain(peakvalue:5 V,frequency:6Hz)
Amplitude
r
Peakvalue:5 V
5--;-1-1--;--1--1'--+-1-----111--+1-----111--+1-+-1-+1-+-1 ~.
1 2 3 4 5 6 7 8 9 1011121314 Frequency
(Hz)
b.Thesamesinewaveinthefrequencydomain(peakvalue:5V,frequency:6Hz)

66 CHAPTER 3DATAANDSIGNALS
Itisobviousthatthefrequencydomainiseasytoplotandconveystheinformation
thatonecanfindinatimedomainplot.Theadvantage
ofthefrequencydomainisthat
wecanimmediatelyseethevalues
ofthefrequencyandpeakamplitude.Acomplete
sinewaveisrepresentedbyonespike.Theposition
ofthespikeshowsthefrequency;
itsheightshowsthepeakamplitude.
Acompletesinewaveinthetimedomaincanberepresented
byonesinglespikeinthefrequencydomain.
Example3.7
Thefrequencydomain ismorecompactandusefulwhenwearedealingwithmorethanonesine
wave.Forexample,Figure 3.8showsthreesine waves,eachwithdifferentamplitudeand fre­
quency.Allcanberepresentedbythreespikesinthefrequencydomain.
Figure3.8Thetimedomain andfrequencydomain ofthreesinewaves
Amplitude
15-
10-
I
5-
o 8 16 Frequency
a.Time-domainrepresentationofthreesinewaveswith
frequencies
0,8,and16
b.Frequency-domainrepresentationof
thesamethreesignals
---------------------------------------
CompositeSignals
Sofar,wehavefocusedonsimplesinewaves.Simplesinewaveshavemanyapplica­
tionsindailylife.Wecansendasinglesinewavetocarryelectricenergyfromone
placetoanother.Forexample,thepowercompanysendsasinglesinewavewithafre­
quency
of60Hztodistributeelectricenergy tohousesandbusinesses.Asanother
example,wecanuseasinglesinewavetosendanalarmtoasecuritycenterwhena
burglaropensadoororwindowinthehouse.Inthefirstcase,thesinewaveiscarrying
energy;inthesecond,thesinewaveisasignal
ofdanger.
Ifwehadonlyonesinglesinewavetoconveyaconversationoverthephone,it
wouldmakenosenseandcarrynoinformation.Wewould
justhearabuzz.Aswewill
seeinChapters4and5,weneedtosendacompositesignaltocommunicatedata.A
compositesignalismade
ofmanysimplesinewaves.
A
singleafrequencysinewaveisnotuseful indatacommunications;
weneedtosendacompositesignal,asignal
madeofmanysimplesinewaves.

SECTION3.2PERIODICANALOGSIGNALS 67
Intheearly1900s,theFrenchmathematicianJean-BaptisteFouriershowedthat
anycompositesignalisactuallyacombination
ofsimplesinewaveswithdifferentfre­
quencies,amplitudes,andphases.
Fourieranalysisisdiscussed inAppendixC;forour
purposes,
wejustpresenttheconcept.
Accordingto Fourieranalysis,anycompositesignalisacombination of
simplesinewaveswithdifferentfrequencies,amplitudes, andphases.
Fourieranalysisisdiscussed inAppendixC.
Acompositesignalcanbeperiodicornonperiodic.Aperiodiccompositesignal
canbedecomposedintoaseries
ofsimplesinewaveswithdiscrete frequencies­
frequenciesthathaveintegervalues (1,2,3,and soon).Anonperiodiccompositesig­
nalcanbedecomposedintoacombinationofaninfinitenumber
ofsimplesinewaves
withcontinuousfrequencies,frequenciesthathaverealvalues.
Ifthecompositesignalisperiodic,thedecompositiongivesaseries ofsignalswith
discretefrequencies;
ifthecompositesignalisnonperiodic,thedecomposition
givesacombination
ofsinewaveswithcontinuousfrequencies.
Example3.8
Figure3.9showsaperiodiccompositesignalwithfrequency fThistype ofsignalisnottypical
ofthosefoundindatacommunications.Wecanconsiderittobethreealarmsystems,eachwitha
differentfrequency.Theanalysis
ofthissignalcangiveusagoodunderstanding ofhowto
decomposesignals.
Figure3.9Acompositeperiodicsignal
...
Time
Itisverydifficulttomanuallydecomposethissignalintoaseries ofsimplesinewaves.
However,therearetools,bothhardwareandsoftware,thatcanhelpusdothejob.
Wearenotcon­
cernedabouthow
itisdone;weareonlyinterested intheresult.Figure3.10showstheresult of
decomposingtheabovesignalinboththetimeandfrequencydomains.
Theamplitude
ofthesinewavewithfrequency fisalmostthesame asthepeakamplitude of
thecompositesignal.Theamplitude ofthesinewavewithfrequency 3fisone-thirdofthatofthe
first,andtheamplitude
ofthesinewavewithfrequency 9fisone-ninthofthefirst.Thefrequency

68 CHAPTER3DATAANDSIGNALS
Figure3.10 Decompositionofacompositeperiodicsignalinthetime andfrequencydomains
Amplitude
a.Time-domaindecompositionofacompositesignal
-Frequency1
-Frequency 31
-Frequency 91
Time
Amplitude
WL...-----'3~L...-------9L-'!---------T~i~e
b.Frequency-domaindecompositionofthecompositesignal
ofthesinewavewithfrequency fisthesameasthefrequency ofthecompositesignal;itiscalled
the
fundamentalfrequency, orfirstharmonic.Thesinewavewithfrequency 3fhasafrequency
of3timesthefundamentalfrequency;itiscalledthethirdharmonic.Thethirdsinewavewithfre­
quency
9fhasafrequencyof9timesthefundamentalfrequency;itiscalledtheninthharmonic.
Notethatthefrequencydecomposition
ofthesignalisdiscrete;ithasfrequenciesf, 3f,and
9fBecausefisanintegralnumber, 3fand9farealsointegralnumbers.Therearenofrequencies
suchas
1.2for2.6fThefrequencydomain ofaperiodiccompositesignalisalwaysmade ofdis­
cretespikes.
Example3.9
Figure3.11showsanonperiodiccompositesignal. Itcanbethesignalcreated byamicrophoneora
telephonesetwhenaword
ortwoispronounced.Inthiscase,thecompositesignalcannotbeperi­
odic,becausethatimpliesthatwearerepeatingthesamewordorwordswithexactlythesametone.
Figure3.11 Thetimeandfrequencydomainsofanonperiodicsignal
Amplitude Amplitude
Amplitudeforsine
wave
offrequency1
IA IA
a.Timedomain
,
v
Time 1
b.Frequencydomain
4kHz Frequency

SECTION3.2PERIODICANALOGSIGNALS 69
Inatime-domainrepresentation ofthiscompositesignal,thereareaninfinitenum­
berofsimplesinefrequencies.Althoughthenumber offrequenciesinahumanvoiceis
infinite,therangeislimited.Anormalhumanbeingcancreateacontinuousrange
of
frequenciesbetween0and4kHz.
Notethatthefrequencydecomposition
ofthesignalyieldsacontinuouscurve.
Thereareaninfinitenumber
offrequenciesbetween0.0and4000.0(realvalues). Tofind
theamplituderelatedtofrequency
J,wedrawaverticalline atftointersecttheenvelope
curve.Theheight
oftheverticallineistheamplitude ofthecorrespondingfrequency.
Bandwidth
Therange offrequenciescontainedinacompositesignalisits bandwidth.Theband­
widthisnormallyadifferencebetweentwonumbers.
Forexample,ifacompositesignal
containsfrequenciesbetween1000and5000,itsbandwidth
is5000-1000, or4000.
Thebandwidthofacompositesignalisthedifferencebetweenthe
highestandthelowestfrequenciescontainedin
thatsignal.
Figure3.12showsthe
conceptofbandwidth.Thefiguredepictstwocomposite
signals,oneperiodicandtheothernonperiodic.Thebandwidth
oftheperiodicsignal
containsallintegerfrequenciesbetween1000and5000(1000,100I,1002,
...).The
band­
widthofthenonperiodicsignalshasthesamerange,butthefrequenciesarecontinuous.
Figure3.12Thebandwidthofperiodicandnonperiodiccompositesignals
Amplitude
1000

Bandwidth=5000-1000 =4000Hz
5000Frequency
·1
a.Bandwidthofaperiodicsignal
Amplitude
1000

Bandwidth=5000-1000 =4000Hz
5000Frequency
·1
b.Bandwidthofanonperiodicsignal

70 CHAPTER 3DATAANDSIGNALS
Example3.10
Ifaperiodic signalisdecomposedintofivesinewaveswithfrequencies of100,300,500,700,
and900Hz,whatisitsbandwidth?Drawthespectrum,assuming
allcomponentshaveamaxi­
mumamplitude
of10V.
Solution
Letfhbethehighestfrequency,
flthelowestfrequency,and Bthebandwidth.Then
B=fh-it=900-100=800Hz
Thespectrumhasonlyfivespikes,at100,300,500,700,and900Hz(seeFigure3.13).
Figure3.13 ThebandwidthforExample3.10
Amplitude
10+-----]
Bandwidth=900-100 =800Hz
100
I,
300 500 700 900
-I
Frequency
Example3.11
Aperiodic signalhasabandwidth of20Hz.Thehighestfrequency is60Hz.What isthelowest
frequency?Drawthespectrum
ifthesignalcontainsallfrequencies ofthesameamplitude.
Solution
Letfhbethehighestfrequency,fzthelowestfrequency,and Bthebandwidth.Then
B=fh-
fz:::::}20=60-it=}.ft=60-20=40Hz
Thespectrumcontainsallintegerfrequencies.
Weshowthisbyaseries ofspikes(seeFigure3.14).
Figure3.14 ThebandwidthforExample3.11
III
404142
I,
Bandwidth=60-40 =20Hz
585960
·1
Frequency
(Hz)
Example3.12
Anonperiodiccompositesignalhasa bandwidthof200kHz,withamiddlefrequency of
140kHzandpeakamplitude of20V.Thetwoextremefrequencieshaveanamplitude of0.Draw
thefrequencydomainofthesignal.

SECT/ON3.3DIGITALSIGNALS 71
Solution
Thelowestfrequencymustbeat40kHzandthehighestat240kHz.Figure3.15showsthefre­
quencydomainandthebandwidth.
Figure3.15ThebandwidthforExample3.12
Amplitude
40kHz
140kHz 240kHz
Frequency
Example3.J3
Anexampleofanonperiodiccompositesignal isthesignalpropagated byanAMradiostation,In
theUnitedStates,eachAMradiostation
isassignedalO-kHzbandwidth.Thetotalbandwidthded­
icated
toAMradiorangesfrom530to1700kHz. WewillshowtherationalebehindthislO-kHz
bandwidth
inChapter5.
Example3.J4
Anotherexample ofanonperiodiccompositesignalisthesignalpropagatedbyanFMradiosta­
tion.IntheUnitedStates,each
FMradiostationisassigneda200-kHzbandwidth.Thetotal
bandwidthdedicatedtoFMradiorangesfrom
88to108MHz. Wewillshowtherationalebehind
this200-kHzbandwidthinChapter5.
Example3./5
Anotherexample ofanonperiodiccompositesignalisthesignalreceivedbyanold-fashioned
analogblack-and-white
TV.ATVscreen ismadeup ofpixels(pictureelements)witheachpixel
beingeitherwhiteorblack.Thescreenisscanned30timespersecond.(Scanningisactually
60timespersecond,butoddlinesarescanned
inoneroundandevenlinesinthenextandthen
interleaved.)
Ifweassumearesolution of525x700(525verticallinesand700horizontallines),
whichisaratio
of3:4,wehave367,500pixelsperscreen. Ifwescanthescreen30timespersec­
ond,thisis367,500x30
=11,025,000pixelspersecond.Theworst-casescenarioisalternating
blackandwhitepixels.Inthiscase,weneed
torepresentonecolorbytheminimumamplitude
andtheothercolorbythemaximumamplitude.
Wecansend2pixelspercycle.Therefore, we
need11,025,000/2=5,512,500cyclespersecond,or Hz.Thebandwidthneeded is5.5124MHz.
Thisworst-casescenariohassuchalowprobability
ofoccurrencethattheassumptionisthatwe
needonly70percent
ofthisbandwidth,whichis3.85MHz.Sinceaudioandsynchronizationsig­
nalsarealsoneeded,a4-MHzbandwidthhasbeensetasideforeachblackandwhiteTVchan­
nel.
AnanalogcolorTVchannelhasa6-MHzbandwidth.
3.3DIGITALSIGNALS
Inadditiontobeingrepresentedbyananalogsignal,informationcanalsoberepre­
sented
byadigitalsignal.Forexample,a Icanbeencoded asapositivevoltageanda 0
aszerovoltage.Adigitalsignalcanhavemorethantwolevels.Inthiscase, wecan

72 CHAPTER 3DATAANDSIGNALS
sendmorethan1bitforeachlevel.Figure3.16showstwosignals,onewithtwolevels
andtheotherwith
four.
Figure3.16 Twodigitalsignals:onewithtwosignallevels andtheotherwith foursignallevels
Amplitude 8bitssentin Is,
Levell
Levell
Bitrate
=8bps
1
I0 I1 II I0 I0 I0 I1 I
I I I I I I I I
I
I
I
I I
I
I I
I I I
I
I I ...
I I I I I I I
Is
I I I I I I I Tim
I I I I I I I
e
a.Adigitalsignalwithtwolevels
e
6b""1IItssent
IIIs,
Bitrate=16bps
III10 I01
[01 I00 00
[00 I10 I
I I
I I I I I
el4
,
I I I I I I
I
I I I I I I
I I I I I I
el3 [ I I
I...
I I I [
I I I I
Is
I I I I Tim
ell I
I
I
I I
[ [
ell
I I [ I
I I
I
[ I I I I I
Lev
Amplitude
Lev
Lev
Lev
b.Adigitalsignalwithfourlevels
Wesend1bitperlevelinparta ofthefigureand2bitsperlevelinpartb ofthe
figure.Ingeneral,
ifasignalhas Llevels,eachlevelneeds log2Lbits.
AppendixCreviewsinformationaboutexponentialandlogarithmicfunctions.
Example3.16
Adigitalsignalhaseightlevels.Howmanybitsareneededperlevel?Wecalculatethenumber
ofbitsfromtheformula
Number
ofbitsperlevel
=log28=3
Eachsignallevelisrepresentedby3bits.
Example3.17
Adigitalsignalhasninelevels.Howmanybitsareneededperlevel?Wecalculatethenumber of
bitsbyusingtheformula.Eachsignal levelisrepresentedby3.17bits.However,thisansweris
notrealistic.Thenumber
ofbitssentperlevelneedstobeaninteger aswellasapower of2.For
thisexample,4bitscanrepresentonelevel.

SECTION3.3DIGITALSIGNALS 73
BitRate
Mostdigitalsignalsarenonperiodic,andthusperiodandfrequencyarenotappropri­
atecharacteristics.Another
term-bitrate(insteadofjrequency)-isusedtodescribe
digitalsignals.The
bitrateisthenumber ofbitssentinIs,expressedin bitsper
second(bps). Figure3.16showsthebitratefortwosignals.
Example3.18
Assumeweneed todownloadtextdocumentsattherate of100pagesperminute.Whatisthe
requiredbitrate
ofthechannel?
Solution
Apageisanaverage of24lineswith80charactersineachline. Ifweassumethatonecharacter
requires8bits,thebitrate
is
100x24x80x8=1,636,000bps =1.636Mbps
Example3.19
Adigitizedvoicechannel, aswewillseeinChapter4, ismadebydigitizinga4-kHzbandwidth
analogvoicesignal.
Weneedtosamplethesignal attwicethehighestfrequency(twosamples
perhertz).
Weassumethateachsamplerequires8bits.Whatistherequiredbitrate?
Solution
Thebitratecanbecalculated as
2x4000x8=64,000bps =64kbps
Example3.20
Whatisthebitrateforhigh-definitionTV(HDTV)?
Solution
HDTVusesdigitalsignals tobroadcasthighqualityvideosignals.TheHDTVScreen isnormally
aratio
of16: 9(incontrastto4 : 3forregularTV),whichmeansthescreeniswider.Thereare
1920by1080pixelsperscreen,andthescreen
isrenewed30timespersecond.Twenty-fourbits
representsonecolorpixel.
Wecancalculatethebitrate as
1920x1080x30x24=1,492,992,000or1.5Gbps
TheTVstationsreducethisrate
to20to40Mbpsthroughcompression.
BitLength
Wediscussedtheconceptofthewavelengthforananalogsignal:thedistanceonecycle
occupiesonthetransmissionmedium.
Wecandefinesomethingsimilarforadigital
signal:thebitlength.The
bitlengthisthedistanceonebitoccupiesonthetransmis­
sionmedium.
Bitlength
=propagationspeedx bitduration

74 CHAPTER 3DATAANDSIGNALS
DigitalSignalasaCompositeAnalogSignal
BasedonFourieranalysis,adigitalsignalisacompositeanalogsignal. Thebandwidth
isinfinite,asyoumayhaveguessed.Wecanintuitivelycorneupwiththisconceptwhen
weconsideradigitalsignal.Adigitalsignal,inthetimedomain,comprisesconnected
verticalandhorizontallinesegments.Averticallineinthetimedomainmeansafre­
quency
ofinfinity(suddenchangeintime);ahorizontallineinthetimedomainmeansa
frequency
ofzero(nochangeintime).Goingfromafrequency ofzerotoafrequencyof
infinity(andviceversa)impliesallfrequenciesinbetweenarepart ofthedomain.
Fourieranalysiscan
beusedtodecomposeadigitalsignal. Ifthedigitalsignalis
periodic,whichisrareindatacommunications,thedecomposedsignalhasafrequency­
domainrepresentationwithaninfinitebandwidthanddiscretefrequencies.
Ifthedigital
signalisnonperiodic, thedecomposedsignalstillhasaninfinitebandwidth,butthefre­
quenciesarecontinuous.Figure3.17showsaperiodicandanonperiodicdigitalsignal
andtheirbandwidths.
Figure3.17Thetimeandfrequencydomains ofperiodicandnonperiodicdigitalsignals
----------------
-
.---.---
Lu...
I I I I...
..
Time/3/5f7f9fIlfI3f Frequency
'---'---'---
a.Timeandfrequencydomains ofperIodicdigitalsignal
o
b~)
Time~~~-----=------+-.
Frequency
b.Timeandfrequencydomains ofnonperiodicdigitalsignal
Notethatbothbandwidthsareinfinite, buttheperiodicsignalhasdiscretefrequen­
cieswhilethenonperiodicsignalhascontinuousfrequencies.
TransmissionofDigitalSignals
Thepreviousdiscussionassertsthatadigitalsignal,periodic ornonperiodic,isacom­
positeanalogsignalwithfrequenciesbetweenzeroandinfinity.Fortheremainder
of
thediscussion,letusconsiderthecase ofanonperiodicdigitalsignal,similartothe
ones
weencounterin datacommunications.Thefundamentalquestionis,How canwe
sendadigitalsignalfrompoint AtopointB?Wecantransmitadigitalsignal byusing
oneoftwodifferentapproaches: basebandtransmissionorbroadbandtransmission
(usingmodulation).

SECTION3.3DIGITALSIGNALS 75
BasebandTransmission
Basebandtransmissionmeanssendingadigitalsignaloverachannelwithoutchanging
thedigitalsignaltoananalogsignal.Figure3.18shows
basebandtransmission.
Figure3.18Basebandtransmission
-----D •
Digitalsignal
&i;;~;;;;_;;;~a
Channel
Adigitalsignalisacompositeanalogsignalwith aninfinitebandwidth.
Basebandtransmissionrequiresthatwehavealow-passchannel,achannelwitha
bandwidththatstartsfromzero.Thisisthecase
ifwehaveadedicatedmediumwitha
bandwidthconstitutingonlyonechannel.Forexample,theentirebandwidth
ofacable
connectingtwocomputersisonesinglechannel.Asanotherexample,wemayconnect
severalcomputerstoabus,butnotallowmorethantwostationstocommunicateata
time.Againwehavealow-passchannel,andwecanuseitforbasebandcommunication.
Figure3.19showstwolow-passchannels:onewithanarrowbandwidthandtheother
withawidebandwidth.
Weneedtorememberthatalow-passchannelwithinfiniteband­
widthisideal,butwecannothavesuchachannelinreallife.However,wecangetclose.
Figure3.19Bandwidthsoftwolow-passchannels
o
a.Low-passchannel,widebandwidth
o
b.Low-passchannel, narrowbandwidth
Letusstudytwocases ofabasebandcommunication:alow-passchannelwitha
widebandwidthandonewithalimitedbandwidth.

76 CHAPTER 3DATAANDSIGNALS
Case1:Low-Pass ChannelwithWideBandwidth
If
wewanttopreservetheexactformofanonperiodicdigitalsignalwithverticalseg­
mentsverticalandhorizontalsegmentshorizontal,weneedtosendtheentirespectrum,
thecontinuousrangeoffrequenciesbetweenzeroandinfinity.Thisispossible
ifwe
haveadedicatedmediumwithaninfinitebandwidthbetweenthesenderandreceiver
thatpreservestheexactamplitude
ofeachcomponentofthecompositesignal.
Althoughthismaybepossibleinsideacomputer(e.g.,betweenCPUandmemory),it
isnotpossiblebetweentwodevices.Fortunately,theamplitudes ofthefrequenciesat
theborderofthebandwidthare
sosmallthattheycanbeignored.Thismeansthatifwe
haveamedium,such
asacoaxialcableorfiberoptic,withaverywidebandwidth,two
stationscancommunicatebyusingdigitalsignalswithverygoodaccuracy,asshownin
Figure3.20.Note
that!iisclosetozero, andhisveryhigh.
Figure3.20
Basebandtransmissionusingadedicatedmedium
Inputsignalbandwidth
,<::;S>:,:,,...-,:.">~
o
Inputsignal
Bandwidthsupportedbymedium
Jw_,,",L
~.~:~''",,"...'-.;:.~ "
Wide-bandwidthchannel
Outputsignalbandwidth
_C
c:~::.:.~.•.•..c<l
II h
Outputsignal
Althoughtheoutputsignalisnotanexactreplica oftheoriginalsignal,thedata
canstillbededucedfromthereceivedsignal.Notethatalthoughsomeofthefrequen­
ciesareblockedbythemedium,theyarenotcritical.
Basebandtransmission ofadigitalsignal thatpreservestheshapeofthedigitalsignalis
possibleonly
ifwehavealow-passchannelwith aninfiniteorverywidebandwidth.
Example3.21
Anexampleofadedicatedchannelwheretheentirebandwidth ofthemediumisused asonesingle
channelisaLAN.AlmosteverywiredLANtodayusesadedicatedchannelfortwostationscom­
municatingwitheachother.Inabustopology
LANwithmultipointconnections,onlytwostations
cancommunicatewitheachotherateachmomentintime(timesharing);theotherstationsneedto
refrainfromsendingdata.InastartopologyLAN,theentirechannelbetweeneachstationandthe
hubisusedforcommunicationbetweenthesetwoentities.
WestudyLANsinChapter 14.
Case2:Low-PassChannelwithLimited Bandwidth
Inalow-passchannelwithlimitedbandwidth, weapproximatethedigitalsignalwith
ananalogsignal.Thelevelofapproximationdependsonthebandwidthavailable.
RoughApproximationLetusassumethatwehaveadigitalsignalofbitrate
N.Ifwe
wanttosendanalogsignals toroughlysimulatethissignal, weneedtoconsidertheworst
case,amaximumnumberofchangesinthedigitalsignal.Thishappenswhenthesignal

SECTION3.3DIGITALSIGNALS 77
carriesthesequence01010101 ...orthesequence10101010· ...Tosimulatethesetwo
cases,weneedananalogsignal
offrequencyf=N12.Let1bethepositivepeakvalueand
obethenegativepeakvalue.Wesend2bitsineachcycle;thefrequency oftheanalog
signalis
one-halfofthebitrate,or N12.However,justthisonefrequencycannotmakeall
patterns;weneedmorecomponents.Themaximumfrequencyis
NI2.Asanexample of
thisconcept,letusseehowadigital signalwitha3-bitpatterncanbesimulatedbyusing
analogsignals.Figure
3.21showstheidea.Thetwosimilarcases(000and111)aresimu­
latedwithasignalwithfrequency
f=0andaphase of180°for000andaphase of0°for
111.Thetwoworstcases(010and101)aresimulatedwithananalogsignalwithfre­
quency
f=NI2andphasesof180°and0°.Theotherfourcasescanonlybesimulatedwith
ananalogsignalwith
f=NI4andphasesof180°,270°,90°,and0°.Inotherwords,we
needachannelthatcanhandlefrequencies0,
N14,andNI2.Thisroughapproximationis
referred
toasusingthefirstharmonic (NI2)frequency.Therequiredbandwidth is
Bandwidth=
lJ.-0=lJ.
2 2
Figure3.21
Roughapproximation ofadigitalsignalusingthefirstharmonic forworstcase
Amplitude
Bandwidth
==
~
o N/4 N/2 Frequency
Digital:bitrate N
1°10
I
0
1
I 1 I 1
I
1 I 1
I 1
!!, ,
1 1 I 1
1 I
I 1
i
i iI
II.,
, ,, ,
Analog:f=0,p=180
Digital:bitrate N
1IIo101
-A=±i: • ~ 1
1I I I
~
1~
,.,,
Analog:f=N/4,p=90
Digital:bitrate
N
I01
o~
I 1
::
,, , ,
I I I I
I In
~l I
, ,,.
Analog:f==N/4,p=180
Digital:bitrate N
I1Io11I
-R=R-
AA
IM I
,,.,
Analog:j==N/2,P =0
Digital:bitrateN
~
I I
-I--
I 1
J I I I
1
{"'\j:1
MM
, , , ,
Analog:j==N/2,p ==180
Digital:bitrate N
1
1
I
1
I°I
:
,
8-
I
1 I
, ,
I I j I
~II
:~N
J,
J,
Analog:f=N/4,p==0
Digital:bitrate N
*
I I
, ,,
I~I I I I
~~~
,,, ,
Analog:j==N/4,p==270
Digital: bitrate
N
I1
1I
II
1
i
i I i
I I I I
I
1 I 1
, , , ,
I
! 1,
II I I
I I i I
I 1 I I
,, , ,
Analog:j==0,p=0
BetterApproximation Tomaketheshape oftheanalogsignallookmorelikethat
ofadigitalsignal,weneedtoaddmoreharmonics ofthefrequencies.Weneedto
increasethebandwidth.Wecanincreasethebandwidthto
3N12,5N12,7NI2,andsoon.
Figure3.22showstheeffect
ofthisincreaseforone oftheworstcases,thepattern010.

78 CHAPTER3DATAANDSIGNALS
Figure3.22Simulatingadigitalsignalwiththreefirstharmonics
I1 ..
5N/4 5N12FrequencyoN/4NI2W_I I'---~
3N/4 3N12
Amplitude 5N
Bandwidth=T
Digital:bitrate N Analog:/=NI2and3N12
0 1
I
0
I I I
I I
I I
I I
I I
I I
I I
I
I I I
I
v=s
.\2:V
I
I
cf':
.U~U__
I
I
ft
.~ ~-
1
Analog:!=N/2 Analog:!=N12,3N12,and5NI2
Notethat wehaveshownonlythehighestfrequencyforeachhannonic.Weusethefirst,
third,andfifthhannonics.
Therequiredbandwidth isnow5NJ2,thedifferencebetweenthe
lowestfrequency
0andthehighestfrequency 5NJ2.Asweemphasizedbefore,weneed
torememberthattherequiredbandwidthisproportionaltothebitrate.
Inbasebandtransmission,therequiredbandwidth isproportionaltothebitrate;
ifweneedtosendbitsfaster,weneedmorebandwidth.
Byusingthismethod,Table
3.2showshowmuchbandwidthweneedtosenddata
atdifferentrates.
Table3.2Bandwidthrequirements
Bit Harmonic Harmonics Harmonics
Rate
1 1,3 1,3,5
n=1kbps B=500Hz B=1.5kHz B=2.5kHz
n
=10kbps B=5kHz B=15kHz B=25kHz
n
=100kbps B=50kHz B=150kHz B=250kHz
Example3.22
Whatistherequiredbandwidth ofalow-passchannel ifweneedtosend 1Mbpsbyusingbase­
bandtransmission?

Bandpasschannel
SECTION3.3DIGITALSIGNALS 79
Solution
Theanswerdependsontheaccuracydesired.
a.Theminimumbandwidth,aroughapproximation, isB=:bitrate/2,or500kHz. Weneed
alow-passchannelwithfrequenciesbetween0and500kHz.
b.Abetterresultcanbeachievedbyusingthefirstandthethirdharmonicswiththerequired
bandwidth
B
=:3x500kHz=:1.5MHz.
c.Stillabetterresultcanbeachievedbyusingthe first,third,andfifthharmonicswith
B=:5 x500kHz=02.5MHz.
Example3.23
Wehavealow-passchannelwithbandwidth100kHz.Whatisthemaximumbitrate ofthis
channel?
Solution
Themaximumbitratecanbeachieved ifweusethefirstharmonic.Thebitrateis2timesthe
availablebandwidth,or200kbps.
BroadbandTransmission(UsingModulation)
Broadbandtransmissionormodulationmeanschangingthedigitalsignaltoananalog
signalfortransmission.Modulationallowsustousea
bandpasschannel-achannelwith
abandwidththatdoesnotstartfromzero.Thistype
ofchannelismoreavailablethana
low-passchannel.Figure3.23showsabandpasschannel.
Figure3.23Bandwidthofabandpasschannel
Amplitude
1_~~.
Frequency
Notethatalow-passchannelcanbeconsideredabandpasschannelwiththelower
frequencystartingatzero.
Figure3.24showsthemodulationofadigitalsignal.Inthefigure,adigitalsignalis
convertedtoacompositeanalogsignal.
Wehaveusedasingle-frequencyanalogsignal
(calledacarrier);theamplitude
ofthecarrierhasbeenchanged tolooklikethedigital
signal.Theresult,however,isnotasingle-frequencysignal;itisacompositesignal,
as
wewillseeinChapter 5.Atthereceiver,thereceivedanalogsignalisconvertedtodigital,
andtheresult
isareplicaofwhathasbeensent.
Iftheavailablechannelisabandpass
channel~ wecannotsendthedigitalsignaldirectlyto
thechannel;
weneedtoconvertthedigitalsignalto ananalogsignalbeforetransmission.

80 CHAPTER3DATAANDSIGNALS
Figure3.24 Modulationofadigitalsignal fortransmissiononabandpasschannel
0_
D'-- ~.
Inputdigitalsignal Outputdigitalsignal
Inputanalogsignalbandwidth
L"
Outputanalogsignalbandwidth
/ -,>:~,;:>~
Analog/digital
convertert--~'>'''''''--
Availablebandwidth
DigitaUanalog
converter
-
-I
Bandpasschannel
Inputanalogsignal Inputanalogsignal
Example3.24
Anexampleofbroadbandtransmissionusingmodulationisthesending ofcomputerdatathrough
atelephonesubscriberline,thelineconnectingaresidenttothecentraltelephoneoffice.These
lines,installedmanyyearsago,aredesignedtocarryvoice(analogsignal)withalimitedband­
width(frequenciesbetween0and4kHz).Althoughthischannelcanbeusedasalow-passchan­
nel,itisnormallyconsideredabandpasschannel.Onereasonisthatthebandwidth
issonarrow
(4kHz)that
ifwetreatthechannelaslow-passanduseitforbasebandtransmission,themaximum
bitratecanbeonly8kbps.Thesolutionistoconsiderthechannelabandpasschannel,convertthe
digitalsignalfromthecomputertoananalogsignal,andsendtheanalogsignal.
Wecaninstalltwo
converterstochangethedigitalsignaltoanalogandviceversaatthereceivingend.Theconverter,
inthiscase,iscalleda
modem(modulator/demodulator),whichwediscussindetailinChapter 5.
Example3.25
Asecondexampleisthedigitalcellulartelephone.Forbetterreception,digitalcellularphones
converttheanalogvoicesignaltoadigitalsignal(seeChapter16).Althoughthebandwidthallo­
catedtoacompanyprovidingdigitalcellularphoneservice
isverywide,westillcannotsendthe
digitalsignalwithoutconversion.Thereasonisthatweonlyhaveabandpasschannelavailable
betweencallerandcallee.Forexample,
iftheavailablebandwidthis WandweallowlOOOcou­
plestotalksimultaneously,thismeanstheavailablechannelis
WIlOOO,justpartoftheentire
bandwidth.Weneedtoconvertthedigitizedvoicetoacompositeanalogsignalbeforesending.
Thedigitalcellularphonesconverttheanalogaudiosignaltodigitaland thenconvertitagainto
analogfortransmissionoverabandpasschannel.
3.4TRANSMISSION IMPAIRMENT
Signalstravelthroughtransmissionmedia,whicharenotpetfect.Theimpetfectioncauses
signalimpairment.Thismeansthatthesignalatthebeginning
ofthemediumisnotthe
sameasthesignalattheend
ofthemedium.Whatissentisnotwhatisreceived.Three
causes
ofimpairmentareattenuation,distortion,andnoise(seeFigure3.25).

SECTION3.4TRANSMISSIONIMPAIRMENT 81
Figure3.25Causesofimpairment
Attenuation
Attenuationmeansaloss ofenergy.Whenasignal,simpleorcomposite,travels
throughamedium,itlosessome
ofitsenergyinovercomingtheresistance ofthe
medium.Thatiswhyawirecarryingelectricsignalsgetswarm,
ifnothot,aftera
while.Some
oftheelectricalenergyinthesignal isconvertedtoheat.Tocompensate
forthisloss,amplifiersareusedtoamplifythesignal.Figure3.26showstheeffect
of
attenuationandamplification.
Figure3.26Attenuation
Original Attenuated Amplified-Affi
Point1
Transmissionmedium
Point 2 Point3
Decibel
Toshowthatasignalhaslostorgainedstrength,engineersusetheunit ofthedecibel.
Thedecibel(dB)measurestherelativestrengths
oftwosignalsoronesignalattwodif­
ferentpoints.Notethatthedecibelisnegative
ifasignalisattenuatedandpositive ifa
signal
isamplified.
Variables
PIandP
2arethepowers ofasignalatpoints1and 2,respectively.Notethat
someengineeringbooksdefinethedecibelinterms
ofvoltageinsteadofpower.Inthis
case,becausepowerisproportionaltothesquare
ofthevoltage,theformulais dB=
20log10(V
2
IV
1
).
Inthistext,weexpress dBintermsofpower.

82 CHAPTER 3DATAANDSIGNALS
Example3.26
Supposeasignaltravelsthroughatransmissionmediumanditspowerisreducedtoone-half.
Thismeansthat
P
2
=
~PI'Inthiscase,theattenuation(loss ofpower)canbecalculatedas
Pz 0.5PI
1010glO- =1010gl0--=10Ioglo0.5=10(-0.3)= -3dB
PI PI
A lossof3dB(-3dB)isequivalenttolosingone-halfthepower.
Example3.27
Asignaltravelsthroughanamplifier,anditspower isincreased10times.Thismeansthat Pz=
1OPI'Inthiscase,theamplification(gain ofpower)canbecalculatedas
Example3.28
Onereasonthatengineersusethedecibeltomeasurethechangesinthestrength ofasignalisthat
decibelnumberscanbeadded(orsubtracted)whenwearemeasuringseveralpoints(cascading)
insteadofjusttwo.InFigure3.27asignaltravelsfrompoint1topoint
4.Thesignalisattenuated
bythetimeitreachespoint
2.Betweenpoints2and3,thesignalisamplified.Again,between
points3and4,thesignalisattenuated.
Wecanfindtheresultantdecibelvalueforthesignaljust
byaddingthedecibelmeasurementsbetweeneachset ofpoints.
Figure3.27 DecibelsforExample3.28
IdB
:1
7dB
'I'
-3dB
Point3
TransmissionPoint4
medium
Point2
Transmission
medium
Point1
1_:_---'--'-=-.3dB__•
1
•----'----
Inthiscase,thedecibelvaluecanbecalculatedas
dB=-3+7-3=+1
Thesignalhasgained inpower.
Example3.29
Sometimesthedecibelisusedtomeasuresignalpowerinmilliwatts.Inthiscase, itisreferredto
as
dB
m
andiscalculated asdB
m=10loglOPm'wherePmisthepowerinmilliwatts.Calculate
thepower
ofasignalifitsdB
m=-30.

SECTION3.4TRANSMISSIONIMPAIRMENT 83
Solution
Wecancalculatethepowerinthesignal as
dB
m
=10log10Pm=-30
loglOPm:=-3 Pm=10-
3
rnW
Example3.30
Thelossinacableisusuallydefinedindecibelsperkilometer(dB/km). Ifthesignalatthe
beginning
ofacablewith -0.3dBlkmhasapower of2mW,whatisthepowerofthesignal
at5km?
Solution
Thelossinthecableindecibelsis 5x
(-0.3):::-1.5dB.Wecancalculatethepower as
Distortion
Distortionmeansthatthesignalchangesitsformorshape.Distortioncanoccurina
compositesignalmade
ofdifferentfrequencies.Eachsignalcomponenthasitsown
propagationspeed(seethenextsection)throughamediumand,therefore,itsown
delayinarrivingatthefinaldestination.Differencesindelaymaycreateadifferencein
phaseifthedelayisnotexactlythesame
astheperiodduration.Inotherwords,signal
componentsatthereceiverhavephasesdifferentfromwhattheyhadatthesender.The
shape
ofthecompositesignalisthereforenotthesame.Figure3.28showstheeffectof
distortiononacompositesignal.
Figure
3.28Distortion
Compositesignal
sent
Atthesender
Components,
inphase
Compositesignal
received
Components,
out
ofphase
Atthereceiver

84 CHAPTER 3DATAANDSIGNALS
Noise
Noiseisanothercause ofimpairment.Severaltypes ofnoise,suchasthermalnoise,
inducednoise,crosstalk,andimpulsenoise,maycorruptthesignal.Thermalnoiseis
therandommotion ofelectronsinawirewhich createsanextrasignalnotoriginally
sentbythetransmitter.Inducednoisecomes fromsourcessuchasmotorsandappli­
ances.Thesedevicesactasasendingantenna,andthetransmissionmediumactsasthe
receivingantenna.Crosstalkistheeffect
ofonewire ontheother.Onewireactsasa
sendingantenna
andtheotherasthereceivingantenna.Impulsenoiseisaspike(asig­
nalwithhighenergyinaveryshorttime)thatcomes frompowerlines,lightning,andso
on.Figure3.29showstheeffect
ofnoiseonasignal. WediscusserrorinChapter10.
Figure3.29Noise
Transmitted
I
I
I

Point1
Noise
Transmissionmedium
I
I
I

Point2
Signal-to-NoiseRatio(SNR)
Aswewillseelater,tofindthetheoreticalbitratelimit, weneedtoknowtheratio of
thesignalpowertothenoisepower.Thesignal-to-noise ratioisdefinedas
SNR
=average
signalpower
averagenoisepower
Weneedtoconsidertheaveragesignal powerandtheaveragenoisepowerbecause
thesemaychangewithtime.Figure3.30showstheidea
ofSNR.
SNRisactuallytheratio ofwhatiswanted(signal)towhat
isnotwanted(noise).
Ahigh
SNRmeansthesignalislesscorrupted bynoise;alow SNRmeansthesignalis
morecorrupted
bynoise.
BecauseSNRistheratio oftwopowers,itisoftendescribed indecibelunits,
SNR
dB
,
definedas
SNRcm=lOlogloSNR
Example3.31
Thepower ofasignalis 10mWandthepower ofthenoiseis1/lW;whatarethevalues ofSNR
andSNR
dB
?

SECTION3.5DATARATELIMITS 85
Figure3.30TwocasesofSNR:ahighSNR andalowSNR
Signal
-
a.LargeSNR
b.SmallSNR
Noise
Noise Signal
+noise
Solution
ThevaluesofSNRand
SN~Bcanbecalculatedasfollows:
SNR=10.000flW=10000
ImW '
SNR
dB=10loglO10,000 =10loglO10
4
=40
Example3.32
ThevaluesofSNRandSNR
dB
foranoiselesschannelare
SNR=signalpower=<>0
o
SNRdB=10loglO00=<>0
Wecanneverachievethisratioinreallife;itisanideal.
3.5DATARATELIMITS
Averyimportantconsiderationindatacommunications ishowfastwecansenddata,in
bitspersecond.overachannel.Dataratedependsonthreefactors:
1.Thebandwidthavailable
2.Thelevelofthesignalsweuse
3.Thequalityofthechannel(thelevel ofnoise)
Twotheoreticalformulasweredevelopedtocalculatethedatarate:onebyNyquistfor
anoiseless
channel.anotherbyShannonforanoisychannel.

86 CHAPTER 3DATAANDSIGNALS
NoiselessChannel:NyquistBitRate
Foranoiselesschannel,the Nyquistbitrateformuladefinesthetheoreticalmaximum
bitrate
BitRate=2xbandwidthx 10g2L
Inthisformula,bandwidthisthebandwidth ofthechannel,Lis thenumber ofsignal
levelsusedtorepresentdata,andBitRateisthebitrateinbitspersecond.
Accordingtotheformula,wemightthinkthat,givenaspecificbandwidth,wecan
haveanybitratewewantbyincreasingthenumber
ofsigna11eve1s.Althoughtheidea
istheoreticallycorrect,practicallythereisalimit.Whenweincreasethenumber
ofsig­
nal1eve1s,weimposeaburdenonthereceiver.
Ifthenumberoflevelsinasignalisjust2,
thereceivercaneasilydistinguishbetweena 0anda
1.Ifthelevelofasignalis64,the
receivermustbeverysophisticatedtodistinguishbetween64differentlevels.Inother
words,increasingthelevelsofasignalreducesthereliability
ofthesystem.
Increasingthelevelsofasignalmayreducethereliabilityofthesystem.
Example3.33
DoestheNyquisttheorembitrateagreewiththeintuitivebitratedescribedinbaseband
transmission?
Solution
Theymatchwhen wehaveonlytwolevels.Wesaid,inbasebandtransmission,thebitrateis 2
timesthebandwidth ifweuseonlythefirstharmonicintheworstcase.However,theNyquist
formulaismoregeneralthanwhatwederivedintuitively;itcanbeappliedtobasebandtransmis­
sionandmodulation.Also,itcan
beappliedwhenwehavetwoormorelevels ofsignals.
Example3.34
Consideranoiselesschannelwithabandwidth of3000Hztransmittingasignalwithtwosignal
levels.Themaximumbitratecanbecalculated
as
BitRate=2 x3000xlog22 =6000bps
Example3.35
Considerthesamenoiselesschanneltransmittingasignalwithfoursignallevels(foreachlevel,
wesend2bits).
Themaximumbitratecan becalculatedas
BitRate
=2 x3000Xlog24=12,000bps
Example3.36
Weneedtosend265kbpsoveranoiselesschannelwithabandwidth of20kHz.Howmanysig­
nallevelsdoweneed?

SECTION3.5DATARATELIMITS 87
Solution
WecanusetheNyquistformulaasshown:
265,000
=2X20,000XlogzL
log2L=6.625L=2
6
.625
=98.7levels
Sincethisresultisnotapower
of2,weneedtoeitherincreasethenumber oflevelsorreduce
thebitrate.
Ifwehave128levels,thebitrateis280kbps. Ifwehave64levels,the bitrateis
240kbps.
NoisyChannel:ShannonCapacity
Inreality,wecannothaveanoiselesschannel;thechannelisalwaysnoisy.In1944,
ClaudeShannonintroducedaformula,calledthe
Shannoncapacity,todeterminethe
theoreticalhighestdatarateforanoisychannel:
Capacity
=bandwidthXlog2(1+SNR)
Inthisformula,bandwidthisthebandwidth ofthechannel,SNRisthesignal-to­
noiseratio,andcapacityisthecapacity
ofthechannelinbitspersecond.Notethatinthe
Shannonformulathereisnoindication
ofthesignallevel,whichmeansthatnomatter
howmanylevelswehave,wecannotachieveadataratehigherthanthecapacity
ofthe
channel.
Inotherwords,theformuladefinesacharacteristicofthechannel,notthemethod
oftransmission.
Example3.37
Consideranextremelynoisychannelinwhichthevalue ofthesignal-to-noiseratioisalmost
zero.
Inotherwords,thenoiseissostrongthatthesignalisfaint.ForthischannelthecapacityC
iscalculated
as
C=Blog2(1+SNR)=B10g
z
(l+0)=Blog21
::;;:Bx0:;;;;0
Thismeansthatthecapacity
ofthischanneliszeroregardless ofthebandwidth.Inother
words,wecannotreceiveanydatathroughthischannel.
Example3.38
Wecancalculatethetheoreticalhighestbitrate ofaregulartelephoneline. Atelephonelinenor­
mallyhasabandwidth
of3000Hz(300to3300Hz)assignedfordatacommunications.Thesig­
nal-to-noiseratioisusually3162.Forthischannelthecapacityiscalculated
as
C=Blog2(1+SNR)=3000log2(l+3162)=3000log23163
::::::3000x11.62=34,860bps
Thismeansthatthehighestbitrateforatelephonelineis34.860kbps.
Ifwewanttosend
datafasterthanthis,wecaneitherincreasethebandwidth
ofthelineorimprovethesignal-to­
noiseratio.

88 CHAPTER3DATAANDSIGNALS
Example3.39
Thesignal-to-noiseratioisoftengivenindecibels.AssumethatSN~B =36andthechannel
bandwidthis2MHz.Thetheoreticalchannelcapacitycanbecalculated
as
SNR
dB
=10loglOSNR
...SNR=lOSNRoB/10...SNR::;10
3
.
6=3981
C
=Blog2(1+SNR)= 2X10
6
X
log23982 =24Mbps
Example3.40
Forpracticalpurposes,whentheSNR isveryhigh,wecanassumethatSNR +Iisalmostthe
same
asSNR.Inthesecases,thetheoreticalchannelcapacitycanbesimplified to
SNR
dB
C=BX--=
3
Forexample,wecancalculatethetheoreticalcapacity ofthepreviousexample as
36
C=2MHzX - =24Mbps
3
UsingBothLimits
Inpractice,weneedtousebothmethodstofindthelimitsandsignallevels.Letusshow
thiswithanexample.
Example3.41
WehaveachannelwithaI-MHzbandwidth.TheSNRforthischannel is63.Whataretheappro­
priatebitrateandsignallevel?
Solution
First,weusetheShannonformulatofindtheupperlimit.
C
=Blog2(l+SNR)=10
6
log2(1+63)=10
6
10g264=6Mbps
TheShannonformulagives
us6Mbps,theupperlimit.Forbetterperformancewechoose
somethinglower,4Mbps,forexample.ThenweusetheNyquistformulatofindthenumber
of
signallevels.
4Mbps=2x1MHzxlog
2
L
...L=4
TheShannoncapacitygivesus theupperlimit;
theNyquistformulatellsushow manysignallevelsweneed.

SECTION3.6PERFORMANCE 89
3.6PERFORMANCE
Uptonow,wehavediscussedthetools oftransmittingdata(signals)overanetwork
andhowthedatabehave.Oneimportantissueinnetworkingistheperformance
ofthe
network-howgoodisit? Wediscussquality ofservice,anoverallmeasurement of
networkperformance,ingreaterdetailinChapter24.Inthissection,weintroduce
termsthatweneedforfuturechapters.
Bandwidth
Onecharacteristicthatmeasuresnetworkperformanceisbandwidth.However,theterm
canbeusedintwodifferentcontextswithtwodifferentmeasuringvalues:bandwidthin
hertzandbandwidthinbitspersecond.
BandwidthinHertz
Wehavediscussedthisconcept.Bandwidthinhertz istherangeoffrequenciescon­
tainedinacompositesignalortherange
offrequenciesachannelcanpass.Forexam­
ple,wecansaythebandwidthofasubscribertelephoneline
is4kHz.
BandwidthinBits perSeconds
Theterm bandwidthcanalsorefertothenumber ofbitspersecondthatachannel,a
link,orevenanetworkcantransmit.Forexample,onecansaythebandwidth
ofaFast
Ethernetnetwork(orthelinksinthisnetwork)isamaximum
of100Mbps.Thismeans
thatthisnetworkcansend
100Mbps.
Relationship
Thereisanexplicitrelationshipbetweenthebandwidthinhertzandbandwidthinbits
perseconds.Basically,anincreaseinbandwidthinhertzmeans
anincreaseinbandwidth
inbitspersecond.Therelationshipdependsonwhetherwehavebasebandtransmission
ortransmissionwithmodulation.
WediscussthisrelationshipinChapters 4and5.
Innetworking,weusetheterm bandwidthintwocontexts.
oThefirst,bandwidthinhertz, referstotherange offrequenciesinacomposite
signalortherange
offrequenciesthatachannelcanpass.
oThesecond,bandwidthinbits persecond,referstothespeed ofbittransmis­
sioninachannelorlink.
Example3.42
Thebandwidthofasubscriberlineis4kHzforvoiceordata.Thebandwidth ofthislinefordatatrans­
missioncanbeupto56,000bpsusingasophisticatedmodemtochangethedigitalsignaltoanalog.
Example3.43
Ifthetelephonecompanyimprovesthequality ofthelineandincreasesthebandwidthto8kHz,
wecansend112,000bps
byusingthesametechnologyasmentionedinExample3.42.

90 CHAPTER3DATAANDSIGNALS
Throughput
Thethroughputisameasureofhowfastwecanactuallysenddatathroughanetwork.
Although,atfirstglance,bandwidthinbitspersecondandthroughputseemthesame,
theyaredifferent.Alinkmayhaveabandwidth ofBbps,butwecanonlysend Tbps
throughthislinkwith
Talwayslessthan B.Inotherwords,thebandwidthisapotential
measurement
ofalink;thethroughputisanactualmeasurement ofhowfastwecan
senddata.Forexample,wemayhavealinkwithabandwidth
of1
Mbps,butthe
devicesconnectedtotheend
ofthelinkmayhandleonly200kbps.Thismeansthatwe
cannotsendmorethan200kbpsthroughthislink.
Imagineahighway designedtotransmit1000cars
perminutefromonepoint
toanother.However,
ifthereiscongestionontheroad,thisfiguremaybereducedto
100carsperminute.Thebandwidthis1000carsperminute;thethroughputis100cars
perminute.
Example3.44
Anetworkwithbandwidth of10Mbpscanpass onlyanaverage of
12,000framesperminute
witheachframecarrying
anaverageof10,000bits.Whatisthethroughput ofthisnetwork?
Solution
Wecancalculatethethroughput as
Throughput=12,000
x10,000=2Mbps
60
Thethroughputisalmostone-fifth ofthebandwidthinthiscase.
Latency(Delay)
Thelatencyordelaydefineshowlong ittakesforanentiremessagetocompletely
arriveatthedestinationfromthetimethefirstbitissentoutfromthesource.
Wecan
saythat latency
ismadeoffourcomponents: propagationtime,transmissiontime,
queuingtime
andprocessingdelay.
Latency=propagationtime +transmissiontime +queuingtime +processingdelay
PropagationTime
Propagationtimemeasuresthetimerequiredforabittotravelfromthesourcetothe
destination.Thepropagationtimeiscalculatedbydividingthedistancebythepropaga­
tionspeed.
Propagationtime =
Dist:m
ce
Propagationspeed
Thepropagationspeedofelectromagneticsignalsdependsonthemediumandon
thefrequencyofthesignaLForexample,inavacuum,lightispropagatedwithaspeed
of3 x10
8
mfs.Itislowerinair;itismuchlowerincable.

SECTION3.6PERFORMANCE 91
Example3.45
Whatisthepropagationtime ifthedistancebetweenthetwopointsis12,000km?Assumethe
propagationspeed
tobe2.4x 10
8
mlsincable.
Solution
Wecancalculatethepropagationtime as
..12000x1000
Propagation
tIme= ' =50ms
2.4x
10
8
TheexampleshowsthatabitcangoovertheAtlanticOceaninonly50ms ifthereisadirect
cablebetweenthesourceandthedestination.
Tra/lsmissio/lTime
Indatacommunicationswe don'tsendjust1bit,wesendamessage.Thefirstbitmay
takeatimeequaltothepropagationtimetoreachitsdestination;thelastbitalsomay
takethesameamount
oftime.However,thereisatimebetweenthefirstbitleavingthe
senderandthelastbitarrivingatthereceiver.Thefirstbitleavesearlierandarrivesear­
lier;thelastbitleaveslaterandarriveslater.Thetimerequiredfortransmission
ofa
messagedependsonthesize
ofthemessageandthebandwidth ofthechannel.
Transmissiontime =Message
size
Bandwidth
Example3.46
Whatarethepropagationtimeandthetransmissiontimefora2.5-kbytemessage(ane-mail) if
thebandwidthofthenetworkis1Gbps?Assumethatthedistancebetweenthesenderandthe
receiver
is12,000kmandthatlighttravelsat2.4 x10
8
mls.
Solution
Wecancalculatethepropagationandtransmissiontimeas
..12000
x1000
PropagatIonHme= ~.4x10
8=50ms
T
...2500x 80020
ranSIlllSSlOntIme= 9=.ms
10
Notethat inthiscase,becausethemessageisshortandthebandwidthishigh,the
dominantfactoristhepropagationtime,notthetransmissiontime.Thetransmission
timecanbeignored.
Example3.47
Whatarethepropagationtimeandthetransmissiontimefora5-Mbytemessage(animage) ifthe
bandwidth
ofthenetworkis1Mbps?Assumethatthedistancebetweenthesenderandthe
receiveris12,000kmandthatlighttravelsat2.4x
10
8
mls.

92 CHAPTER 3DATAANDSIGNALS
Solution
Wecancalculatethepropagationandtransmissiontimesas
.,12000X1000
PropagatIontIme::::'8::::50ms
2.4x10
T
... 5,000,000x840
ranSffilSSlOntIme:::: 6 ::::S
10
Notethatinthiscase,becausethemessage isverylongandthebandwidthisnotvery
high,thedominantfactoristhetransmissiontime,notthepropagationtime.Thepropa­
gationtimecanbeignored.
QueuingTime
Thethirdcomponentinlatencyisthequeuingtime,thetimeneededforeachinterme­
diateorenddevicetoholdthemessagebeforeitcanbeprocessed.Thequeuingtime
is
notafixedfactor; itchangeswiththeloadimposedonthenetwork.Whenthere is
heavytrafficonthenetwork,thequeuingtimeincreases.Anintermediatedevice,such
asarouter,queuesthearrivedmessagesandprocessesthemonebyone.
Ifthereare
manymessages,eachmessagewillhavetowait.
Bandwidth-DelayProduct
Bandwidthanddelayaretwoperformancemetrics ofalink.However, aswewillseein
thischapterandfuturechapters,what
isveryimportantindatacommunications isthe
product
ofthetwo,thebandwidth-delayproduct.Letuselaborateonthisissue,using
twohypotheticalcasesasexamples.
oCase1.Figure3.31showscase 1.
Figure3.31Fillingthelinkwithbits forcase1
Sender Receiver
1s
Bandwidth:1bpsDelay:5 s
Bandwidth
xdelay=5bits
1stbit
~
_...
1stbit
1s
LetUSassumethatwehavealinkwithabandwidth of1bps(unrealistic,butgood
fordemonstrationpurposes).
Wealsoassumethatthedelay ofthelinkis5 s(also
unrealistic).
Wewanttoseewhatthebandwidth-delayproductmeansinthiscase.

SECTION3.6PERFORMANCE 93
Lookingatfigure,wecansaythatthisproduct1 x 5isthemaximumnumber of
bitsthatcanfillthelink.Therecanbenomorethan5bitsatanytimeonthelink.
oCase2.Nowassumewehaveabandwidth of4bps.Figure3.32showsthatthere
canbemaximum4 x 5=20bitsontheline.Thereasonisthat,ateachsecond,
thereare4bitsontheline;theduration
ofeachbitis0.25 s.
Figure3.32
Fillingthelinkwithbitsincase2
Bandwidth:4bps Delay:5 s
Bandwidth
xdelay=20bits
After
1s
I---'-----'----.l..-.L-l
After2 s
After4 s
1s 1s 1s 1s 1s
Receiver
r
Theabovetwocasesshowthattheproduct ofbandwidthanddelay isthenumberof
bitsthatcanfillthelink.Thismeasurement isimportantifweneedtosenddatainbursts
andwaitfortheacknowledgment
ofeachburstbeforesendingthenextone. Tousethe
maximumcapability
ofthelink,weneedtomakethesize ofourburst2timestheproduct
ofbandwidthanddelay;weneedto fillupthefull-duplexchannel(twodirections).The
sendershouldsendaburst
ofdataof(2xbandwidthxdelay)bits.Thesenderthenwaits
forreceiveracknowledgmentforpart
oftheburstbeforesendinganotherburst.The
amount2 xbandwidthxdelay
isthenumberofbitsthatcanbeintransitionatanytime.
The
bandwidth~delay productdefinesthe numberofbitsthatcanrdlthelink.
Example3.48
Wecanthinkaboutthelinkbetweentwopoints asapipe.Thecrosssection ofthepiperepresents
thebandwidth,andthelength
ofthepiperepresentsthedelay. Wecansaythevolume ofthepipe
definesthebandwidth-delayproduct,asshowninFigure3.33.
Figure3.33Conceptofbandwidth-delayproduct
Length:delay
Crosssection:bandwidth

94 CHAPTER 3DATAANDSIGNALS
Jitter
Anotherperformanceissuethatisrelatedtodelay isjitter.Wecanroughlysaythatjitter
isaproblem
ifdifferentpackets ofdataencounterdifferentdelaysandtheapplication
usingthedata
atthe receiversiteistime-sensitive(audioandvideodata,forexample).
Ifthedelayforthefirstpacket is20ms,forthesecondis45ms,andforthethirdis
40ms,thenthereal-timeapplicationthatusesthepacketsenduresjitter.
Wediscussjitter
ingreaterdetailinChapter29.
3.7RECOMMENDED READING
Formoredetailsaboutsubjectsdiscussedinthischapter,werecommendthefollowing
books.Theitemsinbrackets[
...]refertothereferencelistattheend ofthetext.
Books
DataandsignalsareelegantlydiscussedinChapters1to6 of[Pea92].[CouOl]gives
anexcellentcoverageaboutsignalsinChapter
2.Moreadvancedmaterialscanbe
foundin[Ber96].[Hsu03]givesagoodmathematicalapproach
tosignaling.Complete
coverage
ofFourierAnalysiscanbefound in[Spi74].Dataand signalsarediscussedin
Chapter3
of[Sta04]andSection 2.1of[Tan03].
3.8KEYTERMS
analog
analogdata
analogsignal
attenuation
bandpasschannel
bandwidth
basebandtransmission
bitrate
bitspersecond(bps)
broadbandtransmission
compositesignal
cycle
decibel(dB)
digital
digitaldata
digitalsignal
distortion
Fourieranalysis
frequency
frequency-domain
fundamentalfrequency
harmonic
Hertz(Hz)
jitter
low-passchannel
noise
nonperiodicsignal
Nyquistbitrate
peakamplitude
period
periodicsignal
phase
processingdelay
propagationspeed

propagationtime
queuingtime
Shannoncapacity
signal
signal-to-noiseratio(SNR)
SECTION3.9SUMMARY 95
sinewave
throughput
time-domain
transmissiontime
wavelength
3.9SUMMARY
oDatamustbetransformedtoelectromagneticsignalstobetransmitted.
oDatacanbeanalogordigital.Analogdataarecontinuousandtakecontinuous
values.Digitaldatahavediscretestatesandtakediscretevalues.
oSignalscanbeanalogordigital.Analogsignalscanhaveaninfinitenumber of
valuesinarange;digital,signalscanhaveonlyalimitednumber ofvalues.
oIndatacommunications,wecommonlyuseperiodicanalogsignalsandnonperi-
odicdigitalsignals.
oFrequencyandperiodaretheinverseofeachother.
oFrequencyistherate ofchangewithrespect totime.
oPhasedescribestheposition ofthewaveformrelative totimeO.
oAcompletesinewaveinthetimedomaincanberepresentedbyonesinglespikein
thefrequencydomain.
oAsingle-frequencysinewave isnotusefulindatacommunications;weneedto
sendacompositesignal,asignalmade
ofmanysimplesinewaves.
oAccordingtoFourieranalysis,anycompositesignalisacombinationofsimple
sinewaveswithdifferentfrequencies,amplitudes,andphases.
oThebandwidth ofacompositesignal isthedifferencebetweenthehighestandthe
lowestfrequenciescontainedinthatsignal.
oAdigitalsignalisacompositeanalogsignalwithaninfinitebandwidth.
oBasebandtransmission ofadigitalsignalthatpreservestheshape ofthedigital
signalispossibleonly
ifwehavealow-passchannelwithaninfiniteorverywide
bandwidth.
oIftheavailablechannel isabandpasschannel,wecannotsendadigitalsignal
directlytothechannel;weneedtoconvertthedigitalsignaltoananalogsignal
beforetransmission.
oForanoiselesschannel,theNyquistbitrateformuladefinesthetheoreticalmaxi­
mumbitrate.Foranoisychannel,weneed
tousetheShannoncapacity tofindthe
maximumbitrate.
oAttenuation,distortion,andnoisecanimpairasignal.
oAttenuationisthelossofasignal'senergydue totheresistanceofthemedium.
oDistortionisthealteration ofasignalduetothedifferingpropagationspeedsof
each
ofthefrequenciesthatmakeupasignal.
oNoiseistheexternalenergythatcorruptsasignal.
oThebandwidth-delayproductdefinesthenumber ofbits thatcanfillthelink.

96 CHAPTER 3DATAANDSIGNALS
3.10PRACTICESET
ReviewQuestions
1.Whatistherelationshipbetweenperiodandfrequency?
2.
Whatdoestheamplitude ofasignalmeasure? Whatdoesthefrequency ofasignal
measure?
Whatdoesthephase ofasignalmeasure?
3.Howcanacompositesignalbedecomposedintoitsindividualfrequencies?
4.Namethreetypes oftransmissionimpairment.
5.Distinguishbetweenbasebandtransmissionandbroadbandtransmission.
6.Distinguishbetweenalow-passchannelandaband-passchannel.
7.
WhatdoestheNyquisttheoremhavetodowithcommunications?
8.WhatdoestheShannoncapacityhavetodowithcommunications?
9.Whydoopticalsignalsusedinfiberopticcableshaveaveryshortwavelength?
10.Canwesayifasignalisperiodicor nonperiodicby justlookingatitsfrequency
domainplot?How?
11.Isthefrequencydomainplot
ofavoicesignaldiscrete orcontinuous?
12.Isthefrequencydomainplot ofanalarmsystemdiscreteorcontinuous?
13.Wesendavoicesignalfromamicrophone toarecorder.Isthisbaseband orbroad­
bandtransmission?
14.Wesendadigitalsignal fromonestationonaLANtoanotherstation.Isthisbase­
bandorbroadbandtransmission?
15.Wemodulateseveralvoicesignalsandsend themthroughtheair.Isthisbaseband
orbroadbandtransmission?
Exercises
16.Giventhefrequencieslistedbelow,calculatethecorrespondingperiods.
a.24Hz
b.8MHz
c.140KHz
17.Giventhefollowingperiods,calculatethecorrespondingfrequencies.
a.5s
b.12
Jls
c.220ns
18.
WhatisthephaseshiftforthefoIlowing?
a.Asinewavewiththe maximumamplitudeattimezero
b.Asinewavewith maximumamplitudeafter1/4cycle
c.Asinewavewithzeroamplitudeafter3/4cycleandincreasing
19.
Whatisthebandwidth ofasignalthatcan bedecomposedintofivesinewaves
with frequencies
at0,20,50,100,and 200Hz?All peakamplitudesarethesame.
Drawthebandwidth.

SECTION3.10PRACTICESET 97
20.Aperiodiccompositesignalwithabandwidth of2000Hziscomposed oftwosine
waves.Thefirstonehasafrequencyof100Hzwithamaximumamplitude
of20V;
thesecondonehasamaximumamplitude of5V.Drawthebandwidth.
21.Whichsignalhasawiderbandwidth,asinewavewithafrequency of100Hzora
sine wavewithafrequency
of200Hz?
22.Whatisthebitrateforeach
ofthefollowingsignals?
a.Asignalinwhich1bitlasts0.001s
b.Asignalinwhich1bitlasts2ms
c.Asignalinwhich10bitslast20
J-ls
23.Adeviceissendingoutdataattherateof1000bps.
a.Howlongdoesittaketosendout 10bits?
b.Howlongdoesittaketosendoutasinglecharacter (8bits)?
c.Howlongdoesittaketosendafile of100,000characters?
24.WhatisthebitrateforthesignalinFigure3.34?
Figure3.34Exercise24
16ns
---t=:i--J~-...;..---+-.....;.--.;....-d ...~
1 TI~
25.Whatisthefrequency ofthesignalinFigure3.35?
Figure3.35
Exercise25
Time
\TVVVVVV~
I, 4ms .1
1 I
V\f\f\f\f\f\f\f\:...
26.Whatisthebandwidth ofthecompositesignalshowninFigure3.36.
Figure3.36
Exercise26
Frequency
5 5 5 5
5I

9S CHAPTER3DATAANDSIGNALS
27.Aperiodiccompositesignalcontainsfrequenciesfrom 10to30KHz,eachwith an
amplitudeof10V.Drawthefrequencyspectrum.
2K.Anon-periodiccompositesignalcontainsfrequenciesfrom 10to30KHz.The
peakamplitude
is10Vforthelowestandthehighestsignalsand is30Vforthe
20-KHzsignal.Assumingthattheamplitudeschangegraduallyfromtheminimum
tothemaximum,drawthefrequencyspectrum.
20.ATVchannelhasabandwidth of6MHz.Ifwesendadigitalsignalusingone
channel,whatarethedatarates
ifweuseoneharmonic,threeharmonics,and
five
harmonics?
30.AsignaltravelsfrompointAtopointB.AtpointA,thesignalpoweris100 W.At
pointB,thepoweris90
W.Whatistheattenuationindecibels?
31.Theattenuationofasignal is-10dB.Whatisthefinalsignalpower ifitwasorigi­
nally5W?
32.Asignalhaspassedthroughthreecascadedamplifiers,eachwitha 4 dBgain.
Whatisthetotalgain?Howmuchisthesignalamplified?
33.Ifthebandwidthofthechannelis5Kbps,howlongdoesittaketosendaframe of
100,000bitsout ofthisdevice?
3cf.Thelightofthesuntakesapproximatelyeightminutestoreachtheearth.Whatis
thedistancebetweenthesunandtheearth?
35.Asignalhasawavelength of111minair.Howfarcanthefront ofthewavetravel
during1000periods?
36.Alinehasasignal-to-noiseratio of1000andabandwidth of4000KHz.Whatis
themaximumdataratesupportedbythisline?
37.Wemeasuretheperformance ofatelephoneline(4KHzofbandwidth).Whenthe
signalis
10V,thenoiseis5 m V.Whatisthemaximumdataratesupportedbythis
telephoneline?
3X.Afilecontains2millionbytes.Howlongdoesittaketodownloadthisfileusinga
56-Kbpschannel?1-Mbpschannel?
39.Acomputermonitorhasaresolution of1200by1000pixels. Ifeachpixeluses
1024colors,howmanybitsareneededtosendthecompletecontents
ofascreen?
40.Asignalwith200milliwattspowerpassesthrough 10devices,eachwithanaverage
noise
of2microwatts.WhatistheSNR?WhatistheSNR
dB
?
4
I.Ifthepeakvoltagevalueofasignalis20timesthepeakvoltagevalue ofthenoise,
whatistheSNR?WhatistheSNR
dB
?
42.Whatisthetheoreticalcapacityofachannelineach ofthefollowingcases:
a.Bandwidth:20KHz SNR
dB=40
b.Bandwidth:200KHzSNR
dB=4
c.Bandwidth:1MHz SNR
dB=20
43.Weneedtoupgradeachanneltoahigherbandwidth.Answerthefollowing
questions:
a.Howistherateimprovedifwedoublethebandwidth?
b.HowistherateimprovedifwedoubletheSNR?

SECTION3.10PRACTICESET 99
44.Wehaveachannelwith4KHzbandwidth. Ifwewanttosenddataat100Kbps,
whatistheminimumSNR
dB
?WhatisSNR?45.Whatisthetransmissiontime ofapacketsentbyastation ifthelengthofthe
packetis1millionbytesandthebandwidth
ofthechannelis200Kbps?
46.Whatisthelength
ofabitinachannelwithapropagationspeed of2 x10
8
mlsif
thechannel bandwidth
is
a.1Mbps?
h.10Mbps?
c.100Mbps?
-1-7.Howmanybitscanfitonalinkwitha 2msdelay ifthebandwidthofthelinkis
a.1Mbps?
h.10Mbps?
c.100Mbps?
-1-X.Whatisthetotaldelay(latency)foraframe ofsize5millionbitsthat isbeingsent
onalinkwith10routerseachhavingaqueuingtime
of2
Ilsandaprocessingtime
of1Ils.Thelengthofthelinkis2000Km.Thespeed oflightinsidethelinkis2 x
10
8
mls.Thelinkhasabandwidth of5Mbps.Whichcomponent ofthetotaldelay
isdominant?Whichoneisnegligible?

CHAPTER4
DigitalTransmission
Acomputernetwork isdesignedtosendinformationfromonepointtoanother.This
informationneedstobeconvertedtoeitheradigitalsignalorananalogsignalfortrans­
mission.Inthischapter,wediscussthefirstchoice,conversiontodigitalsignals;in
Chapter
5,wediscussthesecondchoice,conversiontoanalogsignals.
Wediscussedtheadvantagesanddisadvantages ofdigitaltransmissionoveranalog
transmissioninChapter
3.Inthischapter,weshowtheschemesandtechniquesthat
weusetotransmitdatadigitally.First,wediscussdigital-to-digitalconversiontech­
niques,methodswhichconvertdigitaldatatodigitalsignals.Second,wediscussanalog­
to-digitalconversiontechniques,methodswhichchangeananalogsignaltoadigital
signaLFinally,wediscuss
transmissionmodes.
4.1
DIGITAL~TO~DIGITAL CONVERSION
InChapter3,wediscusseddataandsignals. Wesaidthatdatacanbeeitherdigitalor
analog.
Wealsosaidthatsignalsthatrepresentdatacanalsobedigitaloranalog.Inthis
section,weseehowwecanrepresentdigitaldatabyusingdigitalsignals.Theconver­
sioninvolvesthreetechniques:linecoding,blockcoding,andscrambling.Linecoding
isalways
needed~blockcodingandscrambling mayormaynotbeneeded.
LineCoding
Linecodingistheprocess ofconvertingdigitaldatatodigitalsignals. Weassumethat
data,intheform
oftext,numbers,graphicalimages,audio,orvideo,arestoredincom­
putermemoryassequences
ofbits(seeChapter 1).Linecodingconvertsasequence of
bitstoadigitalsignal.Atthesender,digitaldataareencodedintoadigitalsignal;atthe
receiver,thedigitaldataarerecreatedbydecodingthedigitalsignal.Figure
4.1shows
theprocess.
Characteristics
Beforediscussingdifferentline codingschemes,weaddresstheircommoncharacteristics.
101

102 CHAPTER 4DIGITALTRANSMISSION
Figure4.1 Linecoding anddecoding
Sender Receiver
Digitaldata
1°101".1011
Digitalsignal
Digitaldata
1°101
••'1011
SignalElementVersus DataElementLetusdistinguishbetweena dataelement
andasignalelement.Indatacommunications,ourgoalistosenddataelements.A
dataelementisthesmallestentitythatcanrepresentapiece
ofinformation:thisisthe
bit.Indigitaldata communications,asignalelementcarriesdataelements.Asignal
elementistheshortestunit(timewise)
ofadigitalsignal.Inotherwords,dataelements
arewhatweneedtosend;signalelementsarewhatwecansend.Dataelementsare
beingcarried;signalelementsarethecarriers.
Wedefinearatio rwhichisthenumber ofdataelementscarriedbyeachsignalele­
ment.Figure4.2showsseveralsituationswithdifferentvalues
ofr.
Figure4.2 Signalelementversusdataelement
Idataelement Idataelement
o o
~-
element 2signal
elements
a.Onedataelementperonesignal
element
(r
=1)
b.Onedataelementpertwosignal
elements
(r=
t)
2dataelements 4dataelements
1101
---16_­
3signal
elements
Isignal
element
III01 II
I
---' -l=:F
c.Twodataelementsperonesignal
element
(r
=2)
d.
Fourdataelementsperthreesignal
elements
(r=1)
Inparta ofthefigure,onedataelementiscarriedbyonesignalelement (r=1).In
partb
ofthefigure,weneedtwosignalelements(twotransitions)tocarryeachdata

SECTION4.1DIGITAL-TO-DIGITALCONVERSION 103
element(r=!).Wewillseelaterthattheextrasignalelementisneededtoguarantee
2
synchronization.Inpartc ofthefigure,asignalelementcarriestwodataelements (r=2).
Finally,inpart
d,agroupof4bitsisbeingcarriedbyagroupofthreesignalelements
(r=
~).Foreverylinecodingschemewediscuss,wewillgivethevalue ofr.
3 .
Ananalogymayhelphere.Supposeeachdataelement ISapersonwhoneedstobe
carriedfromoneplacetoanother.
Wecanthinkofasignalelement asavehiclethatcan
carrypeople.When
r=1,itmeanseachpersonisdrivingavehicle.When r>1,it
meansmorethanonepersonistravellinginavehicle(acarpool,forexample).
Wecan
alsohavethecasewhereoneperson
isdrivingacarandatrailer (r=
~).
DataRateVersusSignal RateThedataratedefinesthenumber ofdataelements
(bits)sentinIs.Theunitisbitspersecond(bps).Thesignal
rateisthenumber ofsig­
nalelementssentinIs.Theunitisthebaud.Thereareseveralcommonterminologies
usedintheliterature.Thedatarateissometimescalledthe
bitrate;thesignalrate is
sometimescalledthepulse rate,themodulationrate,orthebaudrate.
Onegoalindatacommunicationsistoincreasethedataratewhile decreasingthe
signalrate.Increasingthedatarateincreasesthespeed
oftransmission;decreasingthe
signalratedecreasesthebandwidthrequirement.Inourvehicle-peopleanalogy,we
needtocarrymorepeopleinfewervehiclestopreventtrafficjams.
Wehavealimited
bandwidthinourtransportationsystem.
Wenowneedtoconsidertherelationshipbetweendatarateandsignalrate(bitrate
andbaudrate).Thisrelationship,
ofcourse,dependsonthevalue ofr.Italsodepends
onthedatapattern.Ifwehaveadatapattern
ofall1sorall Os,thesignalratemaybe
differentfromadatapattern
ofalternatingOsandIs.Toderiveaformulafortherela­
tionship,weneed
todefinethreecases:theworst,best,andaverage.Theworstcaseis
whenweneedthemaximumsignalrate;thebestcaseiswhenweneedtheminimum.
Indatacommunications,weareusuallyinterestedintheaveragecase.
Wecanformu­
latetherelationshipbetweendatarateandsignalrateas
1
S=cxNx- baud
r
whereNisthedatarate(bps);cisthecasefactor,whichvariesforeachcase;Sisthe
number
ofsignalelements;and risthepreviouslydefinedfactor.
Example4.1
Asignaliscarryingdatain whichonedataelement isencodedasonesignalelement (r=1).If
thebitrateis100kbps,whatistheaveragevalue ofthebaudrate ifcisbetween0and l?
Solution
Weassumethattheaveragevalue ofcis
~.Thebaudrate isthen
111
S=cxNx -= -x100,000x -1=50,000=50kbaud
r 2
BandwidthWediscussedinChapter3thatadigitalsignalthatcarriesinfonnationis
nonperiodic.
Wealsoshowedthatthebandwidthofanonperiodicsignaliscontinuous
withaninfiniterange.However,mostdigitalsignalsweencounterinreallifehavea

104 CHAPTER 4DIGITALTRANSMISSION
bandwidthwithfinitevalues.Inotherwords,thebandwidthistheoreticallyinfinite,but
many
ofthecomponentshavesuchasmallamplitudethattheycanbeignored.The
effectivebandwidthisfinite.Fromnowon,whenwetalkaboutthebandwidth
ofadig­
italsignal,weneedtorememberthatwearetalkingaboutthiseffectivebandwidth.
Althoughtheactualbandwidth ofadigitalsignalisinfinite, theeffectivebandwidthisfinite.
Wecansaythatthebaudrate,notthebitrate,determinestherequiredbandwidth
foradigitalsignal.
IfweusethetranspOltationanalogy,thenumber ofvehiclesaffects
thetraffic,notthenumber
ofpeoplebeingcarried.Morechangesinthesignalmean
injectingmorefrequenciesintothesignal.(Recallthatfrequencymeanschangeand
changemeansfrequency.)Thebandwidthreflectstherange
offrequenciesweneed.
There
isarelationshipbetweenthebaudrate(signalrate)andthebandwidth.Band­
width
isacomplexidea.Whenwetalkaboutthebandwidth,wenormallydefinea
range
offrequencies.Weneedtoknowwherethisrangeislocatedaswell asthevalues
ofthelowestandthehighestfrequencies.Inaddition,theamplitude(ifnotthephase)
ofeachcomponentisanimpOltantissue.Inotherwords,weneedmoreinformation
aboutthebandwidththanjustitsvalue;weneedadiagram
ofthebandwidth.Wewill
showthebandwidthformostschemeswediscussinthechapter.Forthemoment,we
cansaythatthebandwidth(range
offrequencies)isproportionaltothesignalrate
(baudrate).Theminimumbandwidthcanbegiven
as
1
B
min
=:c><N><­
r
Wecansolveforthemaximumdatarate ifthebandwidthofthechannelisgiven.
1
N
max
=-xBxr
c
Example4.2
Themaximumdatarate ofachannel(seeChapter3) isN
max
=2><B><log2L(definedbythe
Nyquistformula).Doesthisagreewiththepreviousformulafor
N
max
?
Solution
Asignalwith Llevelsactuallycancarrylog2 Lbitsperlevel. Ifeachlevelcorrespondstoonesig­
nalelementandweassumetheaveragecase
(c=
~),thenwehave
BaselineWanderingIndecodingadigitalsignal,thereceivercalculatesarunning
average
ofthereceivedsignalpower.Thisaverageiscalledthe baseline.Theincoming
signalpowerisevaluatedagainstthisbaselinetodeterminethevalue
ofthedataele­
ment.Alongstring
ofOsor1scancauseadriftinthebaseline(baseline wandering)
andmakeitdifficultforthereceivertodecodecorrectly.Agoodlinecodingscheme
needstopreventbaselinewandering.

SECTION4.1DIGITAL-TO-DIGITALCONVERSION 105
DCComponentsWhenthevoltagelevelinadigitalsignalis constantforawhile,
the
spectrumcreatesverylowfrequencies(results ofFourieranalysis).Thesefre­
quenciesaroundzero,called
DC(direct-current)components,presentproblemsfora
systemthatcannotpasslowfrequenciesorasystemthatuseselectricalcoupling
(viaatransformer).Forexample,atelephonelinecannotpassfrequenciesbelow
200Hz.Alsoalong-distancelinkmayuseoneormoretransformerstoisolate
differentparts ofthelineelectrically. Forthesesystems, weneedaschemewithno
DCcomponent.
Self-synchronizationTocorrectlyinterpretthesignalsreceivedfromthesender,
thereceiver'sbitintervalsmustcorrespondexactlytothe
sender'sbitintervals.Ifthe
receiverclockisfaster
orslower,thebitintervalsarenotmatchedandthereceivermight
misinterpretthesignals.Figure4.3showsasituationinwhichthereceiverhasashorter
bitduration.Thesendersends
10110001,whilethereceiverreceives 110111000011.
Figure4.3Effectoflackofsynchronization
a.Sent
J
oI
I
I o
J I
o :0 :
J I
I
1""'"----;
I
Time
I
I
1I
I
b.Received
I
I
1I1 0 0 0 0
I
I
I
1I1
I
Time
Aself-synchronizingdigitalsignalincludestiminginformationinthedatabeing
transmitted.This
canbeachievediftherearetransitions inthesignalthatalertthe
receivertothebeginning,middle,
orendofthepulse.Ifthereceiver'sclockisout of
synchronization,thesepointscanresettheclock.
Example4.3
Inadigitaltransmission,thereceiverclockis0.1percentfasterthanthesenderclock. Howmany
extrabits
perseconddoesthereceiverreceive ifthedatarateis1kbps?Howmany ifthedata
rate
is1Mbps?
Solution
At1kbps,thereceiverreceives 1001bpsinsteadof1000bps.
1000bitssent 1001bitsreceived 1extrabps

106 CHAPTER 4DIGITALTRANSMISSION
At1Mbps,thereceiverreceives1,001,000bpsinstead of1,000,000bps.
1,000,000bitssent 1,001,000bitsreceived 1000extrabps
Built-inErrorDetectionIt isdesirabletohaveabuilt-inerror-detectingcapability
inthegeneratedcodetodetectsome
oforalltheerrorsthatoccurredduringtransmis­
sion.Someencodingschemesthatwewilldiscusshavethiscapabilitytosomeextent.
ImmunitytoNoiseandInterferenceAnotherdesirablecodecharacteristicisacode I
thatisimmunetonoiseandotherinterferences.Someencodingschemesthatwewill
discusshavethiscapability.
ComplexityAcomplexscheme
ismorecostlytoimplementthanasimpleone.For
example,aschemethatusesfoursignallevels
ismoredifficulttointerpretthanonethat
usesonlytwolevels.
LineCodingSchemes
Wecanroughlydividelinecodingschemesintofivebroadcategories,asshownin
Figure4.4.
Figure4.4Linecodingschemes
Multitransition--MLT-3
Multilevel
--2B/IQ,8B/6T,and4U-PAM5
Linecoding
Unipolar
Polar
Bipolar--NRZ
NRZ,
RZ,andbiphase(Manchester.
anddifferentialManchester)
--AMIandpseudoternary
Thereareseveralschemes ineachcategory.We needtobefamiliarwithall
schemesdiscussedinthissectiontounderstandtherest
ofthebook.Thissectioncanbe
used
asareferenceforschemesencounteredlater.
UnipolarScheme
Inaunipolarscheme,allthesignallevelsareononeside
ofthetimeaxis,eitherabove
orbelow.
NRZ(Non-Return-to-Zero)Traditionally,aunipolarschemewasdesignedasa
non-return-to-zero(NRZ)schemeinwhichthepositivevoltagedefinesbitIandthe
zerovoltagedefinesbit
O.ItiscalledNRZbecausethesignaldoesnotreturntozeroat
themiddle
ofthebit.Figure4.5showaunipolarNRZscheme.

SECTION4.1DIGITAL-TO-DIGITALCONVERSION 107
Figure4.5 UnipolarNRZscheme
Amplitude
v
1 f0
f
: 1
I0
I
o1------'1---1---1--+---.--__
ITime
Nonnalizedpower
Comparedwithitspolarcounterpart(seethenextsection),thisschemeisvery
costly.Aswewillseeshortly,thenormalizedpower(powerneededtosend1bitper
unitlineresistance)isdoublethatforpolarNRZ.Forthisreason,thisscheme
isnor­
mallynotusedindatacommunicationstoday.
PolarSchemes
Inpolarschemes,thevoltagesareonthebothsides ofthetimeaxis.Forexample,the
voltagelevelfor0canbepositiveandthevoltagelevelforIcanbenegative.
Non-Return-to-Zero(NRZ)In
polarNRZencoding,weusetwolevels ofvoltage
amplitude.
WecanhavetwoversionsofpolarNRZ:NRZ- LandNRZ-I,asshownin
Figure4.6.Thefigurealsoshowsthevalue
ofr,theaveragebaudrate,andtheband­
width.
Inthefirstvariation,NRZ-L(NRZ-Level),thelevel ofthevoltagedetermines
thevalueofthebit.Inthesecondvariation,NRZ-I(NRZ-Invert),thechangeorlack
of
changeinthelevel ofthevoltagedeterminesthevalue ofthebit.Ifthereisnochange,
thebitis
0;ifthereisachange,thebitis 1.
Figure4.6 Polar
NRZ-LandNRZ-Ischemes
T=:=1 Save"'NIl
p
0:~illdWidth
oG""Iil""""'~I=-=-"""'r' -----'l..~
o I 2fIN
Time
Time
1 : 1 0
I
I
011
I
I
NRZ-I
f-----I----J---I---+--+--+----+----'--~
NRZ-Lf--+--1---I---+--I---1------t----'--~
oNoinversion:Nextbit is0 •Inversion:Nextbitis1
InNRZ-Lthelevelofthevoltagedeterminesthevalue ofthebit.InNRZ-I
theinversion
orthelackofinversiondeterminesthevalueofthebit.
Letuscomparethesetwoschemesbasedonthecriteriawepreviouslydefined.
Althoughbaselinewanderingisaproblemforbothvariations,itistwiceasseverein
NRZ-
L.Ifthereisalongsequence ofOsorIsinNRZ-L,theaveragesignalpower

108 CHAPTER 4DIGITALTRANSMISSION
becomesskewed. Thereceivermighthavedifficultydiscerningthe bitvalue.In NRZ-I
thisproblemoccursonly foralongsequence
ofas.Ifsomehowwe caneliminatethe
longsequence
ofas,wecanavoidbaselinewandering.Wewillseeshortlyhowthis can
bedone.
Thesynchronizationproblem(senderandreceiver clocksarenotsynchronized)
also
existsinbothschemes.Again,this problemismoreseriousinNRZ-Lthanin
NRZ-I.Whilealongsequenceofascancauseaprobleminbothschemes,along
sequenceof1saffectsonly NRZ-L.
Anotherproblemwith
NRZ-Loccurswhenthereisasudden changeofpolarityin
thesystem.
Forexample,iftwisted-paircableisthemedium,a changeinthepolarity of
thewireresults inallasinterpretedasIsandallIsinterpretedasas. NRZ-Idoesnot
havethisproblem.
Bothschemeshaveanaveragesignalrate ofNI2Bd.
NRZ-L
andNRZ-Jbothhave anaveragesignal rateofNI2Bd.
Letusdiscussthebandwidth.Figure4.6alsoshowsthenormalizedbandwidthfor
bothvariations.Theverticalaxisshowsthe powerdensity(the powerforeachI Hzof
bandwidth);thehorizontalaxisshowsthefrequency. Thebandwidthrevealsa very
seriousproblemforthistype ofencoding.ThevalueofthepowerdensityisvelY high
aroundfrequenciesclosetozero.Thismeansthatthereare DCcomponentsthatcarrya
highlevel
ofenergy.Asamatter offact,mostoftheenergyisconcentratedinfrequen­
ciesbetweenaand
NIl.Thismeansthatalthoughtheaverage ofthesignalrateis N12,
theenergyisnotdistributedevenlybetweenthetwohalves.
NRZ-LandNRZ-Jbothhavea
DCcomponentproblem.
Example4.4
AsystemisusingNRZ-Itotransfer10-Mbps data.Whataretheaveragesignalrateandmini­
mumbandwidth?
Solution
Theaveragesignalrate isS=NI2=500kbaud.Theminimumbandwidth forthisaveragebaud
rate
is
B
nlin
=S=500kHz.
ReturntoZero(RZ)ThemainproblemwithNRZencodingoccurs whenthesender
andreceiverclocksarenotsynchronized.
Thereceiverdoesnotknow whenonebithas
endedandthenext bitisstarting.Onesolutionisthe return-to-zero(RZ)scheme,
whichusesthreevalues:positive,negative, andzero.InRZ,thesignal changesnot
betweenbitsbutduringthebit.InFigure4.7 weseethatthesignalgoesto 0inthemid­
dle
ofeachbit.Itremainsthereuntilthebeginning ofthenextbit. Themaindisadvan­
tage
ofRZencodingisthatitrequirestwosignalchangestoencodea bitandtherefore
occupiesgreaterbandwidth.Thesameproblemwementioned,asuddenchangeof
polarityresulting inallasinterpretedas1sandall1sinterpretedasas,stillexisthere,
butthereisno DCcomponentproblem.Anotherproblemisthecomplexity: RZuses
threelevels
ofvoltage,whichis morecomplextocreateanddiscern.Asaresult ofall
thesedeficiencies,the
schemeisnotusedtoday.Instead,ithas beenreplacedbythe
better-performingManchesteranddifferentialManchesterschemes(discussednext).

SECTION4.1DIGITAL-TO-DIGITALCONVERSION 109
Figure4.7PolarRZscheme
Amplitude
ol
l
l 1 l
1
l
Time
p
o:lL
o I ~
o 1 2 fiN
Biphase:ManchesterandDifferentialManchesterTheidea ofRZ(transitionat
themiddle
ofthebit)andtheidea ofNRZ-Larecombinedintothe Manchesterscheme.
InManchesterencoding,theduration
ofthebitisdividedintotwohalves.Thevoltage
remainsatonelevelduringthefirsthalfandmovestotheotherlevelinthesecondhalf.
Thetransitionatthemiddle
ofthebitprovidessynchronization.DifferentialManchester,
ontheotherhand,combinestheideas
ofRZandNRZ-I.Thereisalwaysatransitionat
the middleofthebit,butthebitvaluesaredeterminedatthebeginning
ofthebit.Ifthe
nextbitis
0,thereisatransition; ifthenextbitis 1,thereisnone.Figure 4.8shows
bothManchesteranddifferentialManchesterencoding.
Figure4.8Polarbiphase:Manchester anddifferentialManchesterschemes
(
OisL lisS)
0
I
1
I
0
I
0
I
1
I
1
I
I I I I I I
I I I
I I I.....
I
r+-
1,...-
I_,
--4I 1
I I
I I
Manchester
I I I I
Timel..+-
I
-I-+-
I-
I
I I
I I
l I I Ir¢-
I,....1,...-
I
rt-
I
I I
Differential
I I I
Manchester I I I I
Time
1L...¢-
I I
~
1
~-
I
1
I I I I I
oNoinversion:Nextbitis1•Inversion:Nextbitis0
p
11
Bandwidth
O.~~~
o 1
)0
2fiN
InManchesteranddifferentialManchesterencoding,thetransition
atthemiddleofthebitisusedforsynchronization.
TheManchesterschemeovercomesseveralproblemsassociatedwithNRZ-L,and
differentialManchesterovercomesseveralproblemsassociatedwith
NRZ-I.First,there
isnobaselinewandering.There
isnoDCcomponentbecauseeachbithasapositiveand

110 CHAPTER4DIGITALTRANSMISSION
negativevoltagecontribution.Theonlydrawbackisthesignalrate.Thesignalratefor
ManchesteranddifferentialManchester
isdoublethatforNRZ.Thereason isthatthereis
alwaysonetransitionatthemiddleofthebitandmaybeonetransitionattheend ofeach
bit.Figure4.8showsbothManchesteranddifferentialManchesterencodingschemes.
NotethatManchesteranddifferentialManchesterschemesarealsocalled
biphase
schemes.
Theminimumbandwidth ofManchesteranddifferentialManchester is2timesthatofNRZ.
BipolarSchemes
Inbipolarencoding(sometimescalled multilevelbinary), therearethreevoltagelev­
els:positive,negative,andzero.Thevoltagelevelforonedataelementisatzero,while
thevoltagelevelfortheotherelementalternatesbetweenpositiveandnegative.
Inbipolarencoding,weusethreelevels:positive,zero, andnegative.
AMIandPseudoternaryFigure4.9showstwovariations ofbipolarencoding:AMI
andpseudoternary.Acommonbipolarencodingscheme
iscalledbipolar alternate
markinversion(AMI).Intheterm alternatemarkinversion, theword markcomes
fromtelegraphyandmeans
1.SoAMImeansalternateI inversion. Aneutralzerovolt­
agerepresentsbinary
O.BinaryIsarerepresentedbyalternatingpositiveandnegative
voltages.Avariation
ofAMIencodingiscalled pseudoternaryinwhichthe 1bitis
encodedasazerovoltageandthe0bitisencodedasalternatingpositiveandnegative
voltages.
Figure4.9Bipolarschemes: AMIandpseudoternary
Amplitude
oI
I
I
(I
I
oI
I
I
I
:(I
I
I
r=1
p
Time
Time
AMIr--~-~--1--+----+---;-+
PseudoternaryI-----+--~----If----t--...,....-____r--+
ThebipolarschemewasdevelopedasanalternativetoNRZ.Thebipolarscheme
hasthesamesignalrate
asNRZ,butthere isnoDCcomponent.TheNRZschemehas
most
ofitsenergyconcentratednearzerofrequency,whichmakesitunsuitablefor
transmissionoverchannelswithpoorperformancearoundthisfrequency.Theconcen­
tration
oftheenergyinbipolarencoding isaroundfrequency N12.Figure4.9showsthe
typicalenergyconcentrationforabipolarscheme.

SECTION4.1DIGITAL-TO-DIGITALCONVERSION 111
Onemayaskwhywedonothave DCcomponentinbipolarencoding. Wecan
answerthisquestionbyusingtheFouriertransform,butwecanalsothinkaboutitintu­
itively.
Ifwehavealongsequence of1s,thevoltagelevelalternatesbetweenpositive
andnegative;itisnotconstant.Therefore,thereisno
DCcomponent.Foralong
sequence
ofOs,thevoltageremainsconstant,butitsamplitudeiszero,whichisthe
same
ashavingno DCcomponent.Inotherwords,asequencethatcreatesaconstant
zerovoltagedoesnothavea
DCcomponent.
AMIiscommonlyusedforlong-distancecommunication,butithasasynchroniza­
tionproblemwhenalongsequence
ofOsispresentinthedata.Laterinthechapter,we
willseehowascramblingtechniquecansolvethisproblem.
MultilevelSchemes
Thedesiretoincreasethedataspeedordecreasetherequiredbandwidthhasresultedin
thecreation
ofmanyschemes.Thegoalistoincreasethenumber ofbitsperbaudby
encodingapattern
ofmdataelementsintoapattern ofnsignalelements. Weonlyhave
twotypes
ofdataelements (OsandIs),whichmeansthatagroup ofmdataelements
canproduceacombination
of2
m
datapatterns.Wecanhavedifferenttypes ofsignal
elementsbyallowingdifferentsignallevels.
IfwehaveLdifferentlevels,thenwecan
produce
Lncombinationsofsignalpatterns. If2
m
=Ln,theneachdatapatternis
encodedintoonesignalpattern.
If2
m
<L
n
,
data patternsoccupyonlyasubset ofsignal
patterns.Thesubsetcanbecarefullydesignedtopreventbaselinewandering,topro­
videsynchronization,andtodetecterrorsthatoccurredduringdatatransmission.Data
encodingisnotpossible
if2
m
>L
n
becausesome ofthedatapatternscannot be
encoded.
Thecodedesignershaveclassifiedthesetypes
ofcodingasmBnL,wheremisthe
length
ofthebinarypattern, Bmeansbinarydata, nisthelength ofthesignalpattern,
and
Listhenumber oflevelsinthesignaling.Aletterisoftenusedinplace ofL:B
(binary)for L=2,T(ternary)for L=3,andQ(quaternary)for L=4.Notethatthefirst
twolettersdefinethedatapattern,andthesecondtwodefinethesignalpattern.
InmBnLschemes,a patternofmdataelementsisencodedasa patternofnsignal
elementsinwhich
2
m
::::;Ln.
2BIQThefirstmBnLschemewediscuss, twobinary,one quaternary(2BIQ),uses
datapatterns
ofsize2andencodesthe2-bitpatternsasonesignalelementbelonging
toafour-levelsignal.Inthistype
ofencodingm=2,n=1,andL=4(quatemary).Fig­
ure4.10showsanexample
ofa2B1Qsignal.
Theaveragesignalrate
of2BlQisS=N/4.Thismeansthatusing2BIQ,wecan
senddata2timesfasterthanbyusingNRZ-L.However,
2BlQusesfourdifferentsig­
nallevels,whichmeansthereceiverhastodiscernfourdifferentthresholds.The
reducedbandwidthcomeswithaprice.Therearenoredundantsignalpatternsinthis
schemebecause2
2
=4
1
.
AswewillseeinChapter 9,2BIQisusedinDSL(DigitalSubscriberLine)tech­
nology
toprovideahigh-speedconnectiontotheInternetbyusingsubscribertelephone
lines.

112 CHAPTER 4DIGITALTRANSMISSION
Figure4.10Multilevel:2B1Qscheme
Previouslevel:Previouslevel:
positive negative
Next Next Next
bits level level
00 +1 -I
01 +3 -3
10 -I +1
II -3 +3
Transitiontable
2fiN
Save=N14
o1/2
p
1 \ Bandwidth
0.5
o
-
me
00
I
II 0]IHI
I0]
I I I
I
I
I I
I I
I I
I
TiI
I
I
I
I I I
I I I
,
~1
+3
-3
+1
Assumingpositiveoriginallevel
8B6TAveryinterestingschemeis eightbinary, sixternary(8B6T).Thiscodeisused
with100BASE-4Tcable,aswewillseeinChapter
13.Theideaistoencodeapattern of
8bitsasapatternof6signalelements,wherethesignalhasthreelevels(ternary).Inthis
typeofscheme,wecanhave2
8
=256differentdatapatternsand3
6
=478differentsignal
patterns.ThemappingtableisshowninAppendixD.Thereare478-256
=222redundant
signalelementsthatprovidesynchronizationanderrordetection.Part
oftheredundancyis
alsousedtoprovide
DCbalance.Eachsignalpatternhasaweightof0or+1 DCvalues.This
meansthatthereisnopatternwiththeweight
-1.TomakethewholestreamDc-balanced,
thesenderkeepstrackoftheweight.
Iftwogroupsofweight1areencounteredoneafter
another,thefirstone
issentasis,whilethenextoneistotallyinvertedtogiveaweight of-1.
Figure4.11showsanexample ofthreedatapatternsencodedasthreesignalpat­
terns.Thethreepossiblesignallevelsarerepresentedas
-,0,and+.Thefirst8-bit
pat­
tern00010001isencodedasthesignalpattern -0-0++withweight0;thesecond8-bit
pattern01010011isencodedas- + - + + 0withweight+
1.Thethirdbitpatternshould
beencodedas+ - - + 0 +withweight +1.TocreateDCbalance,thesenderinvertsthe
actualsignal.Thereceivercaneasilyrecognizethatthisisaninvertedpatternbecause
theweightis
-1.Thepatternisinvertedbeforedecoding.
Figure4.11Multilevel:8B6Tscheme
Time
01()10011
OOOIO()O( O!OIOO()() I
I
Inverted:
pattern:
o+----.--,--..,.....---l---I-+--I--I----L---r--t-----..--r-----It---r----..
+v
-v
-0-0++ -+-++0 +--+0+

SECTION4.1DIGITAL-TO-DIGITALCONVERSION 113
Theaveragesignalrate oftheschemeistheoretically Save=!XNX§;inpractice
theminimumbandwidthisverycloseto
6N18. 2 8
4D-PAMS Thelastsignalingschemewediscussinthiscategoryiscalledfour­
dimensionalfive-levelpulseamplitudemodulation(4D-PAM5).The4Dmeansthatdata
issentoverfourwiresatthesametime.
Itusesfivevoltagelevels,suchas -2,
-1,0,1,and2.
However,onelevel,level0,isusedonlyforforwarderrordetection(discussed inChap­
ter10).
Ifweassumethatthecodeisjustone-dimensional,thefourlevelscreatesomething
similar
to8B4Q.Inotherwords,an8-bitwordistranslatedtoasignalelement offourdiffer­
entlevels.Theworstsignalrateforthisimaginaryone-dimensionalversionis
NX4/8,orN12.
Thetechniqueisdesignedtosenddataoverfourchannels(fourwires).Thismeans
thesignalratecanbereducedto
N18,asignificantachievement.All8bitscan befedintoa
wiresimultaneouslyandsentbyusingonesignalelement.Thepointhereisthatthefour
signalelementscomprisingonesignalgrouparesentsimultaneously
inafour-dimensional
setting.Figure4.12showstheimaginaryone-dimensionalandtheactualfour-dimensional
implementation.GigabitLANs(seeChapter
13)usethistechniquetosend1-Gbpsdata
overfourcoppercablesthatcanhandle125Mbaud.Thisschemehasalot
ofredundancy
inthesignalpatternbecause2
8
datapatternsarematchedto4
4
=256signalpatterns.The
extrasignalpatternscanbeusedforotherpurposessuchaserrordetection.
Figure4.12Multilevel:4D-PAM5scheme
00011110 1Gbps
250Mbps
Wire1(125MBd)
250Mbps
Wire2(125MBd)
+2
+1
250Mbps
Wire3(125MBd)
-1
-2
250Mbps
Wire4(125MBd)
MultilineTransmission:MLT-3
NRZ-IanddifferentialManchesterareclassifiedasdifferentialencodingbutusetwotransi­
tionrulestoencodebinarydata(noinversion,inversion).
Ifwehaveasignalwithmorethan
twolevels,wecandesignadifferentialencodingschemewithmorethantwotransition
rules.MLT-3
isoneofthem.Themultiline transmission,threelevel(MLT-3)scheme
usesthreelevels
(+v,0,and-V)andthreetransitionrulestomovebetweenthelevels.
1.Ifthenextbitis0,thereisnotransition.
2.Ifthenextbitis1andthecurrentlevelisnot0,thenextlevelis 0.
3.Ifthenextbitis1andthecutTentlevelis0,thenextlevelistheopposite ofthelast
nonzerolevel.

114 CHAPTER 4DIGITALTRANSMISSION
ThebehaviorofMLT-3canbest bedescribedbythestatediagramshowninFigure4.13.
Thethreevoltagelevels (-V,0,and+V)areshownbythreestates(ovals).Thetransition
fromonestate(level)
toanotheris shownbytheconnectinglines. Figure4.13also
showstwoexamples
ofanMLT-3signal.
Figure4.13Multitransition:MLT-3scheme
Last
non-zeronon-zero
Nextbit:0level:
+Vlevel:- VNextbit:0
Nextbit:0
Nextbit:
1
c.Transitionstates
:Time
1
I
01110111101111
1 I I I I 1
+V I I
I I
I I
OV
r--__---t---t--+-------j--___+_~
1
OVl----+O---i--r--
+v
-v
-v
b.Worsecase
a.Typicalcase
Onemightwonderwhy weneedtouseMLT-3,aschemethatmapsonebittoone
signalelement.
Thesignalrateisthesameasthatfor NRZ-I, butwithgreatercomplexity
(threelevelsandcomplextransitionrules).Itturnsoutthattheshape
ofthesignalinthis
schemehelpstoreducetherequiredbandwidth.Letuslookattheworst-casescenario,a
sequence
ofIs.Inthiscase,thesignalelementpattern +VO-VOisrepeatedevery 4bits.
Anonperiodicsignalhaschangedtoaperiodicsignalwiththeperiodequalto 4timesthe
bitduration.Thisworst-casesituationcan
besimulatedasananalogsignalwithafre­
quencyone-fourth
ofthebitrate.Inotherwords,thesignalrateforMLT-3isone-fourth
thebitrate.ThismakesMLT-3asuitablechoicewhen
weneedtosend100Mbpsona
copperwirethatcannotsupportmorethan32
MHz(frequenciesabovethislevelcreate
electromagneticemissions).MLT-3andLANsarediscussedinChapter13.
SummaryofLineCodingSchemes
WesummarizeinTable4.1thecharacteristics ofthedifferentschemesdiscussed.
Table4.1Summaryoflinecodingschemes
Bandwidth
Category Scheme (average) Characteristics
Unipolar NRZ B=N/2 Costly,noself-synchronization iflongOsorIs,DC
NRZ-L B=N/2 Noself-synchronizationiflongOsor1s,DC
Unipolar NRZ-I B=N/2 Noself-synchronizationforlong aS,DC
BiphaseB=N Self-synchronization,no DC,highbandwidth

SECTION4.1DIGITAL-TO-DIGITALCONVERSION 115
Table4.1Summaryoflinecodingschemes(continued)
Bandwidth
Category Scheme (average) Characteristics
Bipolar AMI B=NI2 Noself-synchronizationforlong OS,DC
2BIQ B=N/4 Noself-synchronizationforlongsamedoublebits
Multilevel 8B6T
B=3N/4 Self-synchronization,no DC
4D-PAM5 B=N/8 Self-synchronization,no DC
Multiline MLT-3 B=N/3 Noself-synchronizationforlong Os
BlockCoding
Weneedredundancytoensuresynchronizationandtoprovidesomekind ofinherent
errordetecting.Blockcodingcangiveusthisredundancyandimprovetheperfor­
mance
oflinecoding.Ingeneral,blockcodingchangesablock ofmbitsintoablock
ofnbits,where nislargerthan m.Blockcodingisreferredtoasan mB/nBencoding
technique.
Blockcoding isnormallyreferredtoasmBlnBcoding;
itreplaceseach
m~bitgroupwithann~bitgroup.
Theslashinblockencoding(forexample,4B/5B)distinguishesblockencoding
frommultilevelencoding(forexample,8B6T),whichiswrittenwithoutaslash.Block
codingnormallyinvolvesthreesteps:division,substitution,andcombination.
Inthe
divisionstep,asequence
ofbitsisdividedintogroups ofmbits.Forexample, in4B/5B
encoding,theoriginalbitsequenceisdividedinto4-bitgroups.Theheart
ofblockcod­
ing
isthesubstitutionstep.Inthisstep,wesubstituteanm-bitgroupforann-bitgroup.
Forexample,in4B/5Bencodingwesubstitutea4-bitcodefora5-bitgroup.Finally,
then-bitgroupsarecombinedtogethertoformastream.Thenewstreamhasmorebits
thantheoriginalbits.Figure4.14showstheprocedure.
Figure4.14Blockcodingconcept
Divisionofastreamintom-bitgroups
mbits mbits mbits
[110"'111000'''11•••1010'''11
11
m&-to-nB
substitution
Jl
1010"'10111000'''0011...1°11''.1111
nbits nbits nbits
Combiningn-bitgroupsintoastream

116 CHAPTER 4DIGITALTRANSMISSION
4B/5B
Thefourbinary/fivebinary(4B/5B)codingschemewasdesignedtobeusedincom­
binationwithNRZ-I.RecallthatNRZ-Ihasagoodsignalrate,one-halfthat
ofthe
biphase,butithasasynchronizationproblem.Alongsequence
ofascanmakethe
receiverclocklosesynchronization.Onesolutionistochangethebitstream,priorto
encodingwithNRZ-I,
sothatitdoesnothavealongstream ofas.The4B/5Bscheme
achievesthisgoal.Theblock-codedstreamdoesnothavemore thatthreeconsecutive
as,aswewillseelater.
Atthereceiver,the NRZ-Iencodeddigitalsignalisfirst
decodedintoastream
ofbitsandthendecodedtoremovetheredundancy.Figure4.15
showstheidea.
Figure4.15Usingblockcoding4B/5BwithNRZ-Ilinecodingscheme
Sender Receiver
Digitalsignal
--::Ft:F-
Link
In4B/5B,the5-bitoutputthatreplacesthe4-bitinputhasnomorethanoneleading
zero(leftbit)andnomorethantwotrailingzeros(rightbits).Sowhendifferentgroups
arecombinedtomakeanewsequence,therearenevermorethanthreeconsecutive
as.
(NotethatNRZ-Ihasnoproblemwithsequences ofIs.)Table4.2showsthecorre­
spondingpairsusedin4B/5Bencoding.Notethatthefirsttwocolumnspaira4-bit
groupwitha5-bitgroup.Agroup
of4bitscanhaveonly 16differentcombinations
whileagroup
of5bitscanhave32differentcombinations.Thismeansthatthereare 16
groupsthatarenotusedfor4B/5Bencoding.Some oftheseunusedgroupsareusedfor
controlpurposes;theothersarenotusedatall.Thelatterprovideakind
oferrordetec­
tion.
Ifa5-bitgrouparrivesthatbelongstotheunusedportion ofthetable,thereceiver
knowsthatthereisanerrorinthetransmission.
Table4.2
4B/5Bmappingcodes
DataSequenceEncodedSequence ControlSequence EncodedSequence
0000 11110 Q(Quiet) 00000
0001 01001
I(Idle) 11111
0010 10100
H(Halt) 00100
0011 10101
J(Startdelimiter) 11000
0100 01010
K(Startdelimiter) 10001
0101 01011
T(Enddelimiter) 01101

SECTION4.1DIGITAL-TO-DIGITALCONVERSION 117
Table4.2 4B/5Bmappingcodes(continued)
DataSequenceEncodedSequence ControlSequence EncodedSequence
0110 01110 S(Set) 11001
0111 01111 R(Reset) 00111
1000 10010
1001 10011
1010 10110
1011 10111
1100
11010
1101 11011
1110 11100
1111 11101
Figure4.16showsanexample ofsubstitutionin 4B/5Bcoding.4B/5Bencoding
solvestheproblem
ofsynchronizationandovercomesone ofthedeficienciesofNRZ-1.
However,weneedtorememberthatitincreasesthesignalrate ofNRZ-1.Theredun­
dantbitsadd20percentmorebaud.Still,theresultislessthanthebiphasescheme
whichhasasignalrate
of2timesthat ofNRZ-1.However,4B/5Bblockencodingdoes
notsolvethe
DCcomponentproblem ofNRZ-1.IfaDCcomponentisunacceptable,we
needtousebiphase
orbipolarencoding.
Figure4.16Substitutionin48/5Bblockcoding
4-bitblocks
I1
111I•••I000III00001
I
11111 ~l 11110
I
LI11101
': "0'
I
oooo~r
5-bitblocks
Example4.5
Weneedtosenddataata1-Mbpsrate.Whatistheminimumrequiredbandwidth,usingacombi­
nation
of4B/5BandNRZ-IorManchestercoding?
Solution
First4B/5Bblockcodingincreasesthebitrateto1.25Mbps.Theminimumbandwidthusing
NRZ-I
isNI2or625kHz.TheManchesterschemeneedsaminimumbandwidth of1MHz.The
firstchoiceneedsalowerbandwidth,buthasa
DCcomponentproblem;thesecondchoiceneeds
ahigherbandwidth,butdoesnothavea
DCcomponentproblem.

118 CHAPTER 4DIGITALTRANSMISSION
8RIlOR
Theeightbinary/tenbinary(SBIlOB)encodingissimilarto4B/5Bencodingexcept
thatagroup
of8bitsofdataisnowsubstitutedbyalO-bitcode. Itprovidesgreater
errordetectioncapabilitythan4B/5B.The8BIlOBblockcodingisactuallyacombina­
tion
of5B/6Band3B/4Bencoding,asshowninFigure4.17.
Figure4.178B/lOBblockencoding
8B/IOBencoder
8-bitblock
&-+--+-IO-bitblock
Themostfivesignificantbitsofa10-bitblockisfedintothe5B/6Bencoder;the
least3significantbitsisfedintoa3B/4Bencoder.Thesplitisdonetosimplifythe
mappingtable.
Topreventalongrun ofconsecutiveOsorIs,thecodeusesadisparity
controllerwhichkeepstrack
ofexcessOsoverIs(orIsover Os).Ifthebitsinthecur­
rentblockcreateadisparitythatcontributes
tothepreviousdisparity(eitherdirection),
theneachbitinthecode
iscomplemented(a0ischanged toa 1anda 1 ischangedtoa0).
Thecodinghas2
10
-2
8
=768redundantgroupsthatcanbeusedfordisparitychecking
anderrordetection.Ingeneral,thetechniqueissuperiorto4B/5Bbecause
ofbetter
built-inerror-checkingcapabilityandbettersynchronization.
Scramblin~
Biphaseschemesthataresuitable fordedicatedlinksbetweenstationsinaLANarenot
suitableforlong-distancecommunicationbecause
oftheirwidebandwidthrequirement.
Thecombination
ofblockcodingandNRZlinecodingisnotsuitableforlong-distance
encodingeither,because
oftheDCcomponent.BipolarAMIencoding,ontheother
hand,hasanarrowbandwidthanddoesnotcreatea
DCcomponent.However,along
sequence
ofOsupsetsthesynchronization. Ifwecanfindaway toavoidalongsequence
ofOsintheoriginalstream,wecanusebipolarAMIforlong distances. Wearelooking
foratechniquethatdoesnotincreasethenumberofbitsanddoesprovidesynchroniza­
tion.
Wearelookingforasolutionthatsubstituteslongzero-levelpulseswithacombi­
nation
ofotherlevelstoprovidesynchronization.Onesolution iscalledscrambling. We
modifypart oftheAMIruletoincludescrambling,asshowninFigure4.18.Notethat
scrambling,asopposed
toblockcoding,isdoneatthesametimeasencoding.The
systemneeds
toinserttherequiredpulsesbasedonthedefinedscramblingrules.Two
commonscramblingtechniquesareB8ZSandHDB3.
R8ZS
BipolarwithS-zerosubstitution(BSZS)iscommonlyusedinNorthAmerica.In
thistechnique,eightconsecutivezero-levelvoltagesarereplacedbythesequence

SECTION4.1DIGITAL-TO-DIGITALCONVERSION 119
Figure4.18AMIusedwithscrambling
Sender Receiver
Violateddigitalsignal
--=ftF-
OOOVBOVB.TheVinthesequencedenotes violation;thisisanonzerovoltagethat
breaksanAMIrule
ofencoding(oppositepolarityfromtheprevious).TheBinthe
sequencedenotes
bipolm;whichmeansanonzerolevelvoltageinaccordancewiththe
AMIrule.Therearetwocases,asshowninFigure4.19.
Figure4.19TwocasesofB8ZSscramblingtechnique
I
0000000 ~
:i:::~ ~i,'":
t"jtI'tj1 1
1 t I IBI IVI':1
I{II 1
1010101 0 I
a.Previouslevelispositive. b.Previouslevelisnegative.
Notethatthescramblinginthiscasedoesnotchangethebitrate.Also,thetech­
niquebalancesthepositiveandnegativevoltagelevels(twopositivesandtwonega­
tives),whichmeansthatthe
DCbalanceismaintained.Notethatthesubstitutionmay
changethepolarityofa 1because,afterthesubstitution,AMIneedstofollowitsrules.
B8ZSsubstituteseightconsecutivezeros withOOOVBOVB.
Onemorepointisworthmentioning.TheletterV(violation)orB(bipolar) hereis
relative.TheVmeansthesamepolarityasthepolarity
ofthepreviousnonzero pulse;B
meansthepolarityoppositetothepolarity
ofthepreviousnonzeropulse.
HDB3
High-densitybipolar3-zero(HDB3) iscommonlyusedoutside ofNorthAmerica.Inthis
technique,which
ismoreconservativethanB8ZS,fourconsecutivezero-levelvoltagesare
replacedwithasequence
ofOOOVor
BOO\:Thereasonfortwodifferentsubstitutions isto

120 CHAPTER 4DIGITALTRANSMISSION
maintaintheevennumber ofnonzeropulsesaftereachsubstitution.Thetworulescanbe
stated
asfollows:
1.Ifthenumber ofnonzeropulsesafterthelastsubstitution isodd,thesubstitution
patternwillbe
OOOV,whichmakesthetotalnumber ofnonzeropulseseven.
2.Ifthenumberofnonzeropulsesafterthelastsubstitutioniseven,thesubstitution
patternwillbe
BOOV,whichmakesthetotalnumber ofnonzeropulseseven.
Figure4.20showsanexample.
Figure4.20DifferentsituationsinHDB3scramblingtechnique
First
substitution
Second Third
substitution substitution
t
Even
t t
EvenOdd Even Even
Thereareseveralpointsweneedtomentionhere.First,beforethefirstsubstitu­
tion,thenumber
ofnonzeropulses iseven,sothefirstsubstitution isBODY.Afterthis
substitution,thepolarity
ofthe1bitischangedbecausetheAMIscheme,aftereach
substitution,mustfollowitsownrule.Afterthisbit,weneedanothersubstitution,
which
isOOOVbecausewehaveonlyonenonzeropulse(odd)afterthelastsubstitution.
Thethirdsubstitutionis
BOOVbecausetherearenononzeropulsesafterthesecond
substitution(even).
HDB3substitutesfourconsecutivezeroswith OOOVorBOOVdepending
onthenumberofnonzeropulses afterthelastsubstitution.
4.2ANALOG-TO-DIGITALCONVERSION
ThetechniquesdescribedinSection4.1convertdigitaldata todigitalsignals.Some­
times,however,wehaveananalogsignalsuchasonecreatedbyamicrophoneorcam­
era.
WehaveseeninChapter3thatadigitalsignalissuperiortoananalogsignal.The
tendencytodayistochangeananalogsignaltodigitaldata.Inthissectionwedescribe
twotechniques,pulsecodemodulationanddeltamodulation.Afterthedigitaldataare
created(digitization),wecanuseone
ofthetechniquesdescribedinSection4.1tocon­
vertthedigitaldatatoadigitalsignal.

SECTION4.2ANALOG-TO-DIGITALCONVERSION 121
PulseCodeModulation(PCM)
Themostcommontechnique tochangeananalogsignaltodigitaldata(digitization)
iscalledpulsecodemodulation(PCM).APCMencoderhasthreeprocesses,
asshown
inFigure4.21.
Figure4.21
ComponentsofPCMencoder
Quantizedsignal
~'-'-T
!.•··1······:ti~'i
t=lJl::I::=t=J;.:;=~,
peMencoder
~.
HSampling;IQuantizingJ- EncodingJ411"'11°°1
Digitaldata
Analogsignal
tuLI.II.,
PAMsignal
1.Theanalogsignalissampled.
2.Thesampledsignalisquantized.
3.Thequantizedvaluesareencoded asstreamsofbits.
Sampling
ThefirststepinPCMissampling.Theanalogsignalissampledevery T
s
s,whereT
s
is
thesampleintervalorperiod.Theinverse
ofthesamplingintervaliscalledthesam­
pling
rateorsamplingfrequencyanddenotedby is,whereis=IITs'Therearethree
sampling
methods-ideal,natural,and flat-top-asshowninFigure4.22.
Inideal sampling,pulsesfromtheanalogsignalaresampled.Thisis
anidealsam­
plingmethodandcannotbeeasilyimplemented.Innaturalsampling,ahigh-speed
switchisturnedonforonlythesmallperiod
oftimewhenthesamplingoccurs.The
result
isasequenceofsamplesthatretainstheshape oftheanalogsignal.Themost
commonsamplingmethod,calledsample
andhold,however,createsflat-topsamples
byusingacircuit.
Thesamplingprocessissometimesreferredtoaspulse
amplitudemodulation
(PAM).Weneedtoremember,however,thattheresultisstill ananalogsignalwith
nonintegralvalues.
SamplingRateOneimportantconsiderationisthesamplingrateorfrequency.What
aretherestrictionson
T
s
?ThisquestionwaselegantlyansweredbyNyquist.According
totheNyquisttheorem,
toreproducetheoriginalanalogsignal,onenecessarycondition
isthatthesampling
ratebeatleasttwicethehighestfrequencyintheoriginalsignal.

122 CHAPTER 4DIGITALTRANSMISSION
Figure4.22Threedifferentsamplingmethods forPCM
Amplitude Amplitude
,~Analog signal
...
"~
s
a.Idealsampling
Amplitude
c.Flat-topsampling
Time
b.
Naturalsampling
/Analogsignal
...
AccordingtotheNyquisttheorem,thesamplingratemustbe
atleast2timesthehighestfrequencycontained inthesignal.
Weneedtoelaborateonthetheorematthispoint.First,wecansampleasignal
only
ifthesignalisband-limited.Inotherwords,asignalwithaninfinitebandwidth
cannotbesampled.Second,thesamplingratemustbeatleast2timesthehighestfre­
quency,notthebandwidth.
Iftheanalogsignalislow-pass,thebandwidthandthe
highestfrequencyarethesamevalue.
Iftheanalogsignalisbandpass,thebandwidth
value
islowerthanthevalue ofthemaximumfrequency.Figure4.23showsthevalue
ofthesamplingratefortwotypes ofsignals.
Figure4.23Nyquistsamplingrate forlow-passandbandpasssignals
-------------------------------------
Amplitude
Nyquistrate
=2 xfm"x
Low-passsignal
frnin
Amplitude
o
Nyquistrate =2 xfmax
Bandpasssignal
fmin
f
maxFrequency
Frequency

SECTION4.2ANALOG-TO-DIGITAL CONVERSION 123
Example4.6
Foranintuitiveexample oftheNyquisttheorem,letussampleasimplesinewaveatthreesam­
plingrates:
fs=4f(2timestheNyquistrate )'/s=2f(Nyquistrate),and f
s=f(one-halfthe
Nyquistrate).Figure4.24showsthesamplingandthesubsequentrecovery
ofthesignal.
Figure4.24Recoveryofasampledsinewave fordifferentsamplingrates
,
,,
,,.,
¥
,
,,
,,
'".'
a.Nyquistratesampling:f
s
=2f
b.Oversampling:f
s
=4f

,.
,.
,.
,..
,.,
,.
,,
, '
•,.
,.
,.
,.
,.
"
,.
;,
,,

,.
,.
,.
,.
,

,,
,,
,,
,,
c.Undersampling:f
s=f
.....,
"
'....
.'
ItcanbeseenthatsamplingattheNyquistratecancreateagoodapproximation oftheorig­
inalsinewave(parta).Oversamplinginpartbcanalsocreatethesameapproximation,butit
is
redundantandunnecessary.SamplingbelowtheNyquistrate(partc)doesnotproduceasignal
thatlooksliketheoriginalsinewave.
Example4.7
Asaninterestingexample,let usseewhathappens ifwesampleaperiodiceventsuch astherevolu­
tion
ofahandofaclock.Thesecondhand ofaclockhasaperiod of60s.AccordingtotheNyquist
theorem,weneedtosamplethehand(takeandsendapicture)every30s
(T
s=
~Torf
s=2f).In
Figure4.25a,thesamplepoints,inorder,are12,
6,12,6,12,and6.Thereceiverofthesamples
cannottell
iftheclockismovingforwardorbackward.Inpart b,wesampleatdoubletheNyquist
rate(every
15s).Thesamplepoints,inorder,are 12,3,6,9,and12.Theclockismovingforward.
Inpart
c,wesamplebelowtheNyquistrate (T
s=
~Torfs=~f).Thesamplepoints,inorder,are 12,
9,6,3,and12.Althoughtheclockismovingforward,thereceiverthinksthattheclockismoving
backward.

124 CHAPTER 4DIGITALTRANSMISSION
Figure4.25 Samplingofaclockwithonlyonehand
a.SamplingatNyquistrate:T
s
=!T
rnG2~~rn
U9:-3\JY~U
b.Oversampling(aboveNyquistrate): T
s
=~T
rn~~~rn
ug\J)~U
c.Undersampling(belowNyquistrate): T
s=~T
Samplescanmeanthat
theclockismoving
eitherforward
or
backward.
(12-6-12-6-12)
Samplesshowclock
ismovingforward.
(12·3-6-9-12)
Samplesshowclock
ismovingbackward.
(12-9-6-3-12)
Example4.8
AnexamplerelatedtoExample4.7 istheseeminglybackwardrotationofthewheels ofaforward­
movingcarinamovie.Thiscanbeexplainedbyundersampling.Amovie
isfilmedat24frames
persecond.
Ifawheelisrotatingmorethan 12timespersecond,theundersamplingcreatesthe
impression
ofabackwardrotation.
Example4.9
Telephonecompaniesdigitizevoicebyassumingamaximumfrequency of4000Hz.The
sam­
plingratethereforeis8000samplespersecond.
Example4.10
Acomplexlow-passsignalhasabandwidthof200kHz.Whatistheminimumsamplingratefor
thissignal?
Solution
Thebandwidthofalow-passsignalisbetween0 andj,wherefisthemaximumfrequencyinthe
signal.Therefore,wecansamplethissignalat2timesthehighestfrequency(200kHz).Thesam­
plingrateistherefore400,000samplespersecond.
Example4.1J
Acomplexbandpasssignalhasabandwidth of200kHz.Whatistheminimumsamplingratefor
thissignal?

SECTION4.2ANALOG-TO-DIGITAL CONVERSION 125
Solution
Wecannotfindtheminimumsamplingrateinthiscasebecausewedonotknowwheretheband­
widthstartsorends.
Wedonotknowthemaximumfrequency inthesignal.
Quantization
Theresult
ofsamplingisaseriesofpulseswithamplitudevaluesbetweenthemaxi­
mumandminimumamplitudes
ofthesignal.Theset ofamplitudescanbeinfinitewith
nonintegralvaluesbetweenthetwolimits.Thesevaluescannotbeusedintheencoding
process.Thefollowingarethestepsinquantization:
1.Weassumethattheoriginalanalogsignalhasinstantaneousamplitudesbetween
V
minandV max'
2.Wedividetherangeinto Lzones,each ofheight
~(delta).
V
max
-V
rnin
~=-==-:::--=
L
3.Weassignquantizedvalues of0toL-Itothemidpointofeachzone.
4.Weapproximatethevalue ofthesampleamplitudetothequantizedvalues.
Asasimpleexample,assumethatwehaveasampledsignalandthesampleampli­
tudesarebetween
-20and+20V.Wedecidetohaveeightlevels (L=8).Thismeans
that
~=5V.Figure4.26showsthisexample.
Figure4.26Quantizationandencodingofasampledsignal
QuantizationNormalized
codes amplitude
7
46.
19.7
36.
5
26.
7.5
11.0
-5.5
Ol--------L...---L...------lL...-----''------,,---,-----,-----,_
1
,1Time
-6,0
-9.4
-11.3'
-6.-6.1
-26.
2
-36.
-4.11
Normalized -1.22
PAMvalues
Normalized
-1.50
quantizedvalues
1.50
3.24 3.94 2.20-1.10-2.26-1.88
-1.20
1.50 3.50 3.50 2.50 -1.50-2.50-1.50-1.50
Normalized -0.38
error
o +0.26-0.44+0.30-0.40-0.24+0.38-0.30
Quantizationcode 2 5 7 7 6 2 2 2
Encodedwords 010 101 111 111 110 010 001 010 ow

126 CHAPTER 4DIGITALTRANSMISSION
Wehaveshownonlyninesamplesusingidealsampling(forsimplicity).The
valueatthetop
ofeachsampleinthegraphshowstheactualamplitude.Inthechart,
thefirstrowisthenormalizedvalueforeachsample(actual
amplitude/.:1).Thequan­
tizationprocessselectsthequantizationvaluefromthemiddle
ofeachzone.This
meansthatthenormalizedquantizedvalues(secondrow)aredifferentfromthenor­
malizedamplitudes.Thedifferenceiscalledthe
normalizederror (thirdrow).The
fourthrowisthequantizationcodeforeachsamplebasedonthequantizationlevels
attheleft
ofthegraph.Theencodedwords(fifthrow)arethefinalproductsofthe
conversion.
QuantizationLevelsInthepreviousexample,weshowedeightquantizationlevels.
Thechoice
ofL,thenumberoflevels,dependsontherange oftheamplitudesofthe
analogsignalandhowaccuratelyweneedtorecoverthesignal.
Iftheamplitudeofa
signalfluctuatesbetweentwovaluesonly,weneedonlytwolevels;
ifthesignal,like
voice,hasmanyamplitudevalues,weneedmorequantizationlevels.Inaudiodigitiz­
ing,
Lisnormallychosentobe256;invideo itisnormallythousands.Choosing
lowervalues
ofLincreasesthequantizationerror ifthereisalot offluctuationinthe
signal.
Quantization
ErrorOneimportantissue istheerrorcreatedinthequantizationpro­
cess.(Later,wewillseehowthisaffectshigh-speedmodems.)Quantizationisan
approximationprocess.Theinputvalues
tothequantizeraretherealvalues;theoutput
valuesaretheapproximatedvalues.Theoutputvaluesarechosen
tobethemiddle
valueinthezone.
Iftheinputvalue isalsoatthemiddle ofthezone,thereisnoquanti­
zationerror;otherwise,thereisanerror.Inthepreviousexample,thenormalized
amplitude
ofthethirdsampleis3.24,butthenormalizedquantizedvalueis3.50.This
meansthatthere
isanerrorof+0.26.Thevalueoftheerrorforanysampleislessthan
.:112.Inotherwords,wehave-.:112-::;;error-::;;.:112.
Thequantizationerrorchangesthesignal-to-noiseratio ofthesignal,whichinturn
reducestheupperlimitcapacityaccording
toShannon.
Itcanbeproventhatthecontribution
ofthequantizationerrortotheSNR
dB
of
thesignaldependsonthenumber ofquantizationlevels L,orthebitspersample nb'as
showninthefollowingformula:
SNR
dB=6.02nb+1.76dB
Example4.12
WhatistheSNR
dB
intheexample ofFigure4.26?
Solution
Wecanusetheformulatofindthequantization. Wehaveeightlevelsand3bitspersample,so
SNR
dB=6.02(3)+1.76=19.82dB.Increasingthenumber oflevelsincreasestheSNR.
Example4.13
Atelephonesubscriberlinemusthavean
SN~Babove40.What istheminimumnumber ofbits
persample?

SECTION4.2ANALOG-TO-DIGITAL CONVERSION 127
Solution
Wecancalculatethenumber ofbitsas
SN~:::: 6.02nb+1.76::::40.....n::::6.35
Telephonecompaniesusuallyassign7or8bitspersample.
UniformVersusNonuniformQuantizationFormanyapplications,thedistribu­
tion
oftheinstantaneousamplitudesintheanalogsignal isnotuniform.Changesin
amplitudeoftenoccurmorefrequentlyintheloweramplitudesthaninthehigher
ones.Forthesetypes
ofapplicationsitisbettertousenonuniformzones.Inother
words,theheight
of
~isnotfixed;itisgreaterneartheloweramplitudesandless
nearthehigheramplitudes.Nonuniformquantizationcanalsobeachievedbyusinga
processcalled
compandingandexpanding.Thesignaliscompandedatthesender
beforeconversion;itisexpandedatthereceiverafterconversion.Compandingmeans
reducingtheinstantaneousvoltageamplitudeforlargevalues;expandingistheoppo­
siteprocess.Compandinggivesgreaterweighttostrongsignalsandlessweightto
weakones.Ithasbeenprovedthatnonuniformquantizationeffectivelyreducesthe
SNR
dBofquantization.
Encoding
ThelaststepinPCMisencoding.Aftereachsampleisquantizedandthenumber of
bitspersampleisdecided,eachsamplecanbechangedtoanllb-bitcodeword.InFig­
ure4.26theencodedwordsareshowninthelastrow.Aquantizationcode
of2is
encoded
as010;5isencoded as101;andsoon.Note thatthenumber ofbitsforeach
sample
isdeterminedfromthenumber ofquantizationlevels. Ifthenumberofquanti­
zationlevelsis
L,thenumber ofbitsis llb=log2L.Inourexample Lis8and llbis
therefore
3.Thebitratecanbefoundfromtheformula
Bitrate::::samplingratexnumberofbitspersample::::
isxnb
Example4.14
Wewanttodigitizethehumanvoice.What isthebitrate,assuming8bitspersample?
Solution
Thehumanvoicenormallycontainsfrequenciesfrom0to4000Hz.Sothesamplingrateandbit
ratearecalculated
asfollows:
Samplingrate
::::4000x 2 ::::8000samples/s
Bitrate
==8000x 8 ::::64,000bps==64kbps
OriginalSignalRecovery
TherecoveryoftheoriginalsignalrequiresthePCMdecoder. Thedecoderfirstuses
circuitrytoconvertthecodewordsintoapulsethatholdstheamplitudeuntilthenext
pulse.Afterthestaircasesignaliscompleted,itispassedthroughalow-passfilter
to

128 CHAPTER 4DIGITALTRANSMISSION
smooththestaircasesignalintoananalogsignal.Thefilterhasthesamecutofffre­
quencyastheoriginalsignalatthesender.
Ifthesignalhasbeensampledat(or
greaterthan)theNyquistsamplingrateand
ifthereareenoughquantizationlevels,
theoriginalsignalwillberecreated.Notethatthemaximumandminimumvalues
of
theoriginalsignalcanbeachievedbyusingamplification.Figure4.27showsthe
simplifiedprocess.
Figure4.27ComponentsofaPCMdecoder
Amplitude
~TI~'
PCMdecoder
Amplitude
Analogsignal
"
%'
Makeand
.........,
!lloool100r-
'.
-+
Low-pass '.
connect " ,
Time
filter
' ,
samples
, .
Digitaldata , ,
,..',
-.-
..,
PCMBandwidth
Supposewearegiventhebandwidthofalow-passanalogsignal. Ifwethendigitizethe
signal,whatisthenewminimumbandwidthofthechannelthatcanpassthisdigitized
signal?
Wehavesaidthattheminimumbandwidthofaline-encodedsignalis B
min=ex
Nx(lIr).Wesubstitutethevalue ofNinthisformula:
111
B
min=cxNx -=cXnb
xisx -=c xnbx 2 xBanalogx -
r r r
WhenlIr=I(foraNRZorbipolarsignal)andc =(12)(theaveragesituation),the
minimumbandwidthis
Thismeanstheminimumbandwidth
ofthedigitalsignalis nbtimesgreaterthanthe
bandwidth
oftheanalogsignal.Thisistheprice wepayfordigitization.
Example4.15
Wehavealow-passanalog signal of4kHz.Ifwesendtheanalogsignal,weneedachannelwith
aminimumbandwidth
of4kHz.Ifwedigitizethesignalandsend8bitspersample,weneeda
channelwithaminimumbandwidth
of8X4kHz=32kHz.

SECTION4.2ANALOG-TO-DIGITALCONVERSION 129
MaximumDataRateofaChannel
InChapter3,wediscussedtheNyquisttheoremwhichgivesthedatarate ofachannel
as
N
max=2 xBxlog
2
L.WecandeducethisratefromtheNyquistsamplingtheorem
byusingthefollowingarguments.
1.Weassumethattheavailablechannelislow-passwithbandwidth B.
2.Weassumethatthedigitalsignalwewanttosendhas Llevels,whereeachlevelis
asignalelement.Thismeans
r=1/10g
2
L.
3.Wefirstpassthedigitalsignalthroughalow-passfiltertocutoffthefrequencies
above
BHz.
4.Wetreattheresultingsignalasananalogsignalandsampleitat2 x Bsamplesper
secondandquantizeitusingLlevels.Additionalquantizationlevelsareuseless
becausethesignaloriginallyhad
Llevels.
S.Theresultingbitrateis N=fsxnb=2 xBxlog2L.Thisisthemaximumband­
width;
ifthecasefactor cincreases,thedatarateisreduced.
N
max
:::::2xBxlogzLbps
MinimumRequiredBandwidth
Thepreviousargument cangiveustheminimumbandwidth ifthedatarateandthe
number
ofsignallevelsarefixed.Wecansay
B.=N
Hz
mm2xlog
z
L
DeltaModulation (DM)
PCMisaverycomplextechnique.Othertechniqueshavebeendevelopedtoreduce
thecomplexity
ofPCM.Thesimplestis deltamodulation. PCMfindsthevalue ofthe
signalamplitudeforeachsample;
DMfindsthechangefromtheprevioussample.Fig­
ure4.28showstheprocess.Notethattherearenocodewordshere;bitsaresentone
afteranother.
Figure4.28Theprocessofdeltamodulation
Amplitude
~.
o
T
?enerated1_~_1 1_1Time
bmarydata. 0 0 0 0 0 0 .

130 CHAPTER4DIGITALTRANSMISSION
Modulator
Themodulatorisusedatthesendersitetocreateastream ofbitsfromananalogsignal.
Theprocessrecordsthesmallpositiveornegativechanges,calleddeltaO.Ifthedeltais
positive,theprocessrecordsaI;
ifitisnegative,theprocessrecordsa O.However,the
processneedsabaseagainstwhichtheanalogsignaliscompared.
Themodulator
buildsasecondsignalthatresemblesastaircase.Findingthechangeisthenreducedto
comparingtheinputsignalwiththegraduallymadestaircasesignal.Figure4.29shows
adiagram
oftheprocess.
Figure4.29 Deltamodulationcomponents
OMmodulator
Digitaldata
Analogsignal
t
~ I---+---~c at...-----.-+-~ I I•..I100
~.. ompraor
Themodulator,ateachsamplinginterval,comparesthevalue oftheanalogsignal
withthelastvalue
ofthestaircasesignal. Iftheamplitudeoftheanalogsignalislarger,
thenextbitinthedigitaldatais
1;otherwise,itis O.Theoutputofthecomparator,how­
ever,alsomakesthestaircaseitself.
IfthenextbitisI,thestaircasemakermovesthe
lastpoint
ofthestaircasesignal
0up;itthenextbitis0,itmovesit0down.Notethatwe
needadelayunittoholdthestaircasefunctionforaperiodbetweentwocomparisons.
Demodulator
Thedemodulatortakesthedigitaldataand,usingthestaircasemakerandthedelay
unit,createstheanalogsignal.
Thecreatedanalogsignal,however,needstopass
throughalow-passfilterforsmoothing.Figure4.30showstheschematicdiagram.
Figure4.30 Deltademodulationcomponents
OMdemodulator
11"'1100
Digitaldata
Analogsignal

SECTION4.3TRANSMISSIONMODES 131
AdaptiveDA1
Abetterperformancecanbeachieved ifthevalueof0isnotfixed.In adaptivedelta
modulation,
thevalueof
0changesaccordingtotheamplitude oftheanalogsignal.
QuantizationError
ItisobviousthatDM isnotperfect.Quantizationerrorisalwaysintroducedinthepro­
cess.Thequantizationerror
ofDM,however,ismuchlessthanthatforPCM.
4.3TRANSMISSION MODES
Ofprimaryconcernwhenweareconsideringthetransmission ofdatafromonedevice
toanother
isthewiring,and ofprimaryconcernwhenweareconsideringthewiringis
thedatastream.Dowesend1bitatatime;ordowegroupbitsintolargergroupsand,
ifso,how?Thetransmission ofbinarydataacrossalinkcanbeaccomplishedineither
parallelorserialmode.Inparallelmode,multiplebitsaresentwitheachclocktick.
Inserialmode,1bit
issentwitheachclocktick.Whilethereisonlyonewaytosend
paralleldata,therearethreesubclasses
ofserialtransmission:asynchronous,synchro­
nous,andisochronous(seeFigure4.31).
Figure4.31Datatransmissionandmodes
Datatransmission
ParallelTransmission
Binarydata,consisting ofIsandOs,maybeorganizedintogroups ofnbitseach.
Computersproduceandconsumedataingroups
ofbitsmuch asweconceiveofanduse
spokenlanguageintheform
ofwordsratherthanletters.Bygrouping,wecansend
data
nbitsatatimeinstead of1.Thisiscalled paralleltransmission.
Themechanismforparalleltransmissionisaconceptuallysimpleone:Use nwires
tosend
nbitsatonetime.Thatwayeachbithasitsownwire,andall nbitsofone
groupcanbetransmittedwitheachclocktickfromonedevicetoanother.Figure4.32
showshowparalleltransmissionworksfor
n=8.Typically,theeightwiresarebundled
inacablewithaconnectorateachend.
Theadvantage
ofparalleltransmissionisspeed.Allelsebeingequal,parallel
transmissioncanincreasethetransferspeedbyafactor
ofnoverserialtransmission.

132 CHAPTER 4DIGITALTRANSMISSION
Figure4.32Paralleltransmission
The8bitsaresenttogether
,--"j/ ,/'-,.
Iv
\ I\
f
<
I \
1
<
1
I
Sender
I
v
I Receiver
I
v
j
v
I
\\<
I A'\/\
'::///"-J
Weneedeightlines
Butthereisasignificantdisadvantage:cost.Paralleltransmissionrequires ncommuni­
cationlines(wiresintheexample)
justtotransmitthedatastream.Becausethisis
expensive,paralleltransmissionisusuallylimitedtoshortdistances.
SerialTransmission
Inserialtransmission onebitfollowsanother,soweneedonlyonecommunica­
tionchannelratherthan
ntotransmitdatabetweentwocommunicatingdevices(see
Figure4.33).
Figure4.33Serialtransmission
Weneedonly
one
line(wire).
o
1
1
Sender0
o
o
1
o
The8bitsaresent
oneafter
another.
o
1
o00010
1
-1-----------+1gReceiver
o
1
o
Parallel/serial
converter
Serial/parallel
converter
Theadvantageofserialoverparalleltransmission isthatwithonlyonecommuni­
cationchannel,serialtransmissionreducesthecost
oftransmissionoverparallelby
roughlyafactor
ofn.
Sincecommunicationwithindevicesisparallel,conversiondevicesarerequiredat
theinterfacebetweenthesenderandtheline(parallel-to-serial)andbetweentheline
andthereceiver(serial-to-parallel).
Serialtransmissionoccursinone
ofthreeways:asynchronous,synchronous,and
isochronous.

SECTION4.3TRANSMISSIONMODES 133
AsynchronousTransmission
Asynchronoustransmission issonamedbecausethetimingofasignalisunimportant.
Instead,informationisreceivedandtranslatedbyagreeduponpatterns.Aslong
asthose
patternsarefollowed,thereceivingdevicecanretrievetheinformationwithoutregard
totherhythminwhichitissent.Patternsarebasedongroupingthebitstreaminto
bytes.Eachgroup,usually8bits,
issentalongthelink asaunit.Thesendingsystem
handleseachgroupindependently,relayingittothelinkwheneverready,withoutregard
toatimer.
Withoutsynchronization,thereceivercannotusetimingtopredictwhenthenext
groupwillarrive.
Toalertthereceivertothearrival ofanewgroup,therefore,anextra
bitisaddedtothebeginningofeachbyte.Thisbit,usuallya
0,iscalledthe startbit.
Toletthereceiverknowthatthebyteisfinished,1ormoreadditionalbitsareappended
totheendofthebyte.Thesebits,usually
Is,arecalledstopbits.Bythismethod,each
byteisincreasedinsizetoatleast
10bits,ofwhich8bitsisinformationand2bitsor
morearesignalstothereceiver.Inaddition,thetransmissionofeachbytemaythenbe
followedbyagapofvaryingduration.Thisgapcanberepresentedeitherbyanidle
channelorbyastreamofadditionalstopbits.
Inasynchronoustransmission,wesend1 startbit(0)atthebeginningand1ormore
stopbits(Is)
attheendofeachbyte.Theremaybeagapbetween eachbyte.
Thestartandstopbitsandthegapalertthereceivertothebeginningandendof
eachbyteandallowittosynchronizewiththedatastream.Thismechanismiscalled
asynchronousbecause,atthebytelevel,thesenderandreceiverdonothavetobesyn­
chronized.Butwithineachbyte,thereceivermust stillbesynchronized withthe
incomingbitstream.Thatis,somesynchronizationisrequired,butonlyforthe
dura­
tionofasinglebyte.Thereceivingdeviceresynchronizesattheonset ofeachnewbyte.
Whenthereceiverdetectsastartbit,itsetsatimerandbeginscountingbits
asthey
come
in.Afternbits,thereceiverlooksforastopbit.Assoon asitdetectsthestopbit,
itwaitsuntilitdetectsthenextstartbit.
Asynchronousheremeans"asynchronous atthebyte
level;'
butthebitsarestillsynchronized;theirdurationsarethesame.
Figure4.34 isaschematicillustrationofasynchronoustransmission.Inthisexam­
ple,thestartbitsareas,thestopbitsare1
s,andthegapisrepresentedbyanidleline
ratherthanbyadditionalstopbits.
Theadditionofstopandstartbitsandtheinsertion
ofgapsintothebitstream
makeasynchronoustransmissionslowerthanformsoftransmissionthatcanoperate
withouttheaddition
ofcontrolinformation.Butitischeapandeffective,twoadvan­
tagesthatmakeitanattractivechoiceforsituationssuchaslow-speedcommunication.
Forexample,theconnection
ofakeyboardtoacomputer isanaturalapplicationfor
asynchronoustransmission.Ausertypesonlyonecharacteratatime,typesextremely
slowly
indataprocessingterms,andleavesunpredictablegapsoftimebetweeneach
character.

134 CHAPTER 4DIGITALTRANSMISSION
Figure4.34Asynchronoustransmission
Directionofflow
"or~n",~rtbit
~1'_111l1011 0
Sender
01101I0I@j111110110W00010111011111
~~ r~~
Gapsbetween
dataunits
Receiver
SynchronousTransmission
Insynchronoustransmission, thebitstreamiscombinedintolonger"frames,"which
maycontainmultiplebytes.Eachbyte,however,isintroducedontothetransmission
linkwithoutagapbetweenitandthenextone.
Itislefttothereceivertoseparatethe
bitstreamintobytesfordecodingpurposes.Inotherwords,dataaretransmittedasan
unbrokenstring
of1s andOs,andthereceiverseparatesthatstringintothebytes,or
characters,itneedstoreconstructtheinformation.
Insynchronoustransmission, wesendbitsoneafteranotherwithout startorstop
bits
orgaps.Itistheresponsibilityofthereceivertogroupthebits.
Figure4.35givesaschematicillustration ofsynchronoustransmission. Wehave
drawninthedivisionsbetweenbytes.Inreality,thosedivisionsdonotexist;thesender
putsitsdataontothelineasonelongstring.
Ifthesenderwishestosenddatainseparate
bursts,thegapsbetweenburstsmustbefilledwithaspecialsequence
ofOsandIsthat
meansidle.Thereceivercountsthebits
astheyarriveandgroupsthemin8-bitunits.
Figure4.35Synchronoustransmission
Directionofflow
Sender1
101III
Frame
111111011111110110I···j111101111
Frame
1,----tReceiver
11111
Withoutgapsandstartandstopbits,thereisnobuilt-inmechanismtohelpthe
receivingdeviceadjustitsbitsynchronizationmidstream.Timingbecomesveryimpor­
tant,therefore,becausetheaccuracy
ofthereceivedinformationiscompletelydependent
ontheability
ofthereceivingdevicetokeepanaccuratecount ofthebitsastheycomein.

SECTION4.5KEYTERMS 135
Theadvantageofsynchronoustransmission isspeed.Withnoextrabitsorgapsto
introduceatthesendingendandremoveatthereceivingend,and,byextension,with
fewerbitstomove acrossthelink,synchronoustransmission
isfasterthan
asynchro­
noustransmission.Forthisreason,itismoreusefulforhigh-speedapplicationssuchas
thetransmission
ofdatafromonecomputertoanother.Bytesynchronizationisaccom­
plishedinthedatalinklayer.
Weneedtoemphasizeonepointhere.Althoughthere isnogapbetweencharacters
insynchronousserialtransmission,theremaybeunevengapsbetweenframes.
Isochronous
Inreal-timeaudioandvideo,inwhichunevendelaysbetweenframesarenotaccept­
able,synchronoustransmissionfails.Forexample,TVimagesarebroadcastattherate
of30imagespersecond;theymustbeviewedatthesamerate. Ifeachimageissent
byusingoneormoreframes,thereshouldbenodelaysbetweenframes.Forthistype
ofapplication,synchronizationbetweencharacters isnotenough;theentirestream of
bitsmustbesynchronized.The isochronoustransmissionguaranteesthatthedata
arriveatafixedrate.
4.4RECOMMENDED READING
Formoredetailsaboutsubjectsdiscussedinthischapter,werecommendthefollowing
books.Theitemsinbrackets[
...]refertothereferencelistattheend ofthetext.
Books
Digitaltodigitalconversionis discussedinChapter7 of[Pea92],Chapter3 of
[CouOl],andSection 5.1of[Sta04].SamplingisdiscussedinChapters15, 16, 17,and
18of[Pea92],Chapter3 of[CouO!],andSection5.3 of[Sta04].[Hsu03]givesagood
mathematicalapproachtomodulationandsampling.Moreadvancedmaterialscanbe
foundin[Ber96].
4.5KEYTERMS
adaptivedeltamodulation
alternatemarkinversion(AMI)
analog-to-digitalconversion
asynchronoustransmission
baseline
baselinewandering
baudrate
biphase
bipolar
bipolarwith8-zerosubstitution(B8ZS)
bitrate
blockcoding
compandingandexpanding
dataelement
datarate
DCcomponent
deltamodulation(DM)
differentialManchester
digital-to-digitalconversion
digitization

136 CHAPTER4DIGITALTRANSMISSION
eightbinary/tenbinary(8B/lOB)
eight-binary,six-ternary(8B6T)
fourbinary/fivebinary(4B/5B)
fourdimensional,five-levelpulse
amplitudemodulation(4D-PAM5)
high-densitybipolar3-zero(HDB3)
isochronoustransmission
linecoding
Manchester
modulationrate
multilevelbinary
multilinetransmission,3level(MLT-3)
nonreturntozero(NRZ)
nonreturntozero,invert(NRZ-I)
nonreturntozero,level(NRZ-L)
Nyquisttheorem
paralleltransmission
polar
pseudoternary
pulseamplitudemodulation(PAM)
pulsecodemodulation(PCM)
pulserate
quantization
quantizationerror
returntozero(RZ)
sampling
samplingrate
scrambling
self-synchronizing
serialtransmission
signalelement
signalrate
startbit
stopbit
synchronoustransmission
transmissionmode
two-binary,onequaternary(2B
IQ)
unipolar
4.6SUMMARY
oDigital-to-digitalconversioninvolvesthreetechniques:linecoding,blockcoding,
andscrambling.
oLinecodingistheprocess ofconvertingdigitaldatatoadigitalsignal.
oWecanroughlydividelinecodingschemesintofivebroadcategories:unipolar,
polar,bipolar,multilevel,andmultitransition.
oBlockcodingprovidesredundancytoensuresynchronizationandinherenterror
detection.Blockcodingisnormallyreferredtoas
mB/nBcoding;itreplaceseach
m-bitgroupwithann-bit
group.
oScramblingprovidessynchronizationwithoutincreasingthenumber ofbits.Two
commonscramblingtechniquesareB8ZSandHDB3.
oThemostcommontechniquetochangeananalogsignaltodigitaldata(digitiza­
tion)iscalledpulsecodemodulation(PCM).
oThefirststepinPCM issampling.Theanalogsignalissampledevery Tss,whereTs
isthesampleintervalorperiod.Theinverse ofthesamplingintervaliscalledthe
samplingrate orsamplingfrequency anddenotedbyfs,wherefs=lITs.Thereare
threesampling
methods-ideal,natural,andflat-top.
oAccordingtothe Nyquisttheorem, toreproducetheoriginalanalogsignal,one
necessaryconditionisthatthe
samplingrate beatleasttwicethehighestfrequency
intheoriginalsignal.

SECTION4.7PRACTICESET 137
oOthersamplingtechniqueshavebeendevelopedtoreducethecomplexity ofPCM.
Thesimplestis
deltamodulation. PCMfindsthevalue ofthesignalamplitudefor
eachsample;DMfindsthechangefromtheprevioussample.
oWhilethereisonlyonewaytosendparalleldata,therearethreesubclasses of
serialtransmission:asynchronous,synchronous,andisochronous.
oInasynchronoustransmission,wesend1startbit(0)atthebeginningand1or
morestopbits
(1s)attheend ofeachbyte.
oInsynchronoustransmission,wesendbitsoneafteranotherwithoutstartorstop
bitsorgaps.
Itistheresponsibilityofthereceivertogroupthebits.
oTheisochronousmodeprovidessynchronizedfortheentirestream ofbitsmust.In
otherwords,itguaranteesthatthedataarriveatafixedrate.
4.7PRACTICESET
ReviewQuestions
1.Listthreetechniques ofdigital-to-digitalconversion.
2.Distinguishbetweenasignalelementandadataelement.
3.Distinguishbetweendatarateandsignalrate.
4.Definebaselinewanderinganditseffectondigitaltransmission.
5.DefineaDCcomponentanditseffectondigitaltransmission.
6.Definethecharacteristics ofaself-synchronizingsignal.
7.Listfivelinecodingschemesdiscussedinthisbook.
8.Defineblockcodingandgiveitspurpose.
9.Definescramblingandgiveitspurpose.
10.CompareandcontrastPCMandDM.
11.Whatarethedifferencesbetweenparallelandserialtransmission?
12.Listthreedifferenttechniquesinserialtransmissionandexplainthedifferences.
Exercises
13.Calculatethevalue ofthesignalrateforeachcaseinFigure4.2 ifthedatarateis
1Mbpsandc
=1/2.
14.Inadigitaltransmission,thesenderclockis0.2percentfasterthanthereceiverclock.
Howmanyextrabitsperseconddoesthesendersend
ifthedatarateis1Mbps?
15.Drawthegraph oftheNRZ-Lschemeusingeach ofthefollowingdatastreams,
assumingthatthelastsigna11evelhasbeenpositive.
Fromthegraphs,guessthe
bandwidthforthisschemeusingtheaveragenumber
ofchangesinthesignallevel.
Compareyourguesswiththecorresp.ondingentryinTable4.1.
a.00000000
b.11111111
c.01010101
d.00110011

138 CHAPTER4DIGITALTRANSMISSION
16.RepeatExercise 15fortheNRZ-Ischeme.
17.RepeatExercise 15fortheManchesterscheme.
18.RepeatExercise 15forthedifferentialManchesterscheme.
19.RepeatExercise 15forthe2B1Qscheme,butusethefollowingdatastreams.
a.0000000000000000
b.1111111111111111
c.0101010101010101
d.0011001100110011
20.RepeatExercise
15fortheMLT-3scheme,butusethefollowingdatastreams.
a.00000000
b.11111111
c.01010101
d.00011000
21.Findthe8-bitdatastreamforeachcasedepictedinFigure4.36.
Figure4.36
Exercise21
t
Time
a.NRZ-I
Time
b.differentialManchester
Time
c.AMI
22.AnNRZ-Isignalhasadatarate of100Kbps.UsingFigure4.6,calculatethevalue
ofthenormalizedenergy(P)forfrequenciesat0Hz,50KHz,and100KHz.
23.AManchestersignalhasadatarate of100Kbps.UsingFigure4.8,calculatethe
value
ofthenormalizedenergy(P)forfrequenciesat0Hz,50KHz,100KHz.

SECTION4.7PRACTICESET 139
24.Theinputstreamtoa4B/5Bblockencoderis01000000000000000000 OOOI.
Answerthefollowingquestions:
a.Whatistheoutputstream?
b.Whatisthelength ofthelongestconsecutivesequence ofOsintheinput?
c.Whatisthelength ofthelongestconsecutivesequence ofOsintheoutput?
25.Howmanyinvalid(unused)codesequencescanwehavein5B/6Bencoding?How
manyin3B/4Bencoding?
26.Whatistheresult
ofscramblingthesequence11100000000000usingone ofthe
followingscramblingtechniques?Assumethatthelastnon-zerosignallevelhas
beenpositive.
a.B8ZS
b.HDB3(Thenumber ofnonzeropulesisoddafterthelastsubstitution)
27.WhatistheNyquistsamplingrateforeach ofthefollowingsignals?
a.Alow-passsignalwithbandwidth of200KHz?
b.Aband-passsignalwithbandwidth of200KHz ifthelowestfrequencyis
100KHz?
28.Wehavesampledalow-passsignalwithabandwidth of200KHzusing1024levels
ofquantization.
a.Calculatethebitrate ofthedigitizedsignal.
b.CalculatetheSNR
dB
forthissignal.
c.CalculatethePCMbandwidth ofthissignal.
29.Whatisthemaximumdatarate
ofachannelwithabandwidth of200KHz ifwe
usefourlevels
ofdigitalsignaling.
30.Ananalogsignalhasabandwidth
of20KHz.Ifwesamplethissignalandsendit
througha30KbpschannelwhatistheSNR
dB?
31.WehaveabasebandchannelwithaI-MHzbandwidth.Whatisthedataratefor
thischannel
ifweuseone ofthefollowinglinecodingschemes?
a.NRZ-L
b.Manchester
c.MLT-3
d.2B1Q
32.Wewanttotransmit1000characterswitheachcharacterencodedas8bits.
a.Findthenumber oftransmittedbitsforsynchronoustransmission.
b.Findthenumber oftransmittedbitsforasynchronoustransmission.
c.Findtheredundancypercentineachcase.

CHAPTERS
AnalogTransmission
InChapter3,wediscussedtheadvantagesanddisadvantages ofdigitalandanalogtrans­
mission.
Wesawthatwhiledigitaltransmissionisverydesirable,alow-passchannelis
needed.
Wealsosawthatanalogtransmissionistheonlychoice ifwehaveabandpass
channel.DigitaltransmissionwasdiscussedinChapter4;wediscussanalogtransmis­
sioninthischapter.
Convertingdigitaldata
toabandpassanalogsignal.istraditionallycalleddigital­
to-analogconversion.Convertingalow-passanalogsignaltoabandpassanalogsignal
istraditionallycalledanalog-to-analogconversion.Inthischapter,wediscussthesetwo
types
ofconversions.
5.1DIGITAL-TO-ANALOG CONVERSION
Digital-to-analogconversion istheprocess ofchangingone ofthecharacteristicsof
ananalogsignalbasedontheinformationindigitaldata.Figure5.1showstherela­
tionshipbetweenthedigitalinformation,thedigital-to-analogmodulatingprocess,
andtheresultant analogsignal.
Figure5.1Digital-to-analogconversion
Digitaldata
Sender
Analogsignal
Link
Receiver
Digitaldata
1°101
...1011
141

142 CHAPTER 5ANALOGTRANSMISSION
AsdiscussedinChapter3,asinewaveisdefinedbythreecharacteristics:amplitude,
frequency,andphase.Whenwevary
anyoneofthesecharacteristics,wecreateadiffer­
entversion
ofthatwave.So,bychangingonecharacteristic ofasimpleelectricsignal,we
canuseittorepresentdigitaldata.Any
ofthethreecharacteristicscan bealteredinthis
way,givingusatleastthreemechanismsformodulatingdigitaldataintoananalogsignal:
amplitudeshiftkeying(ASK),frequencyshiftkeying(FSK),and phaseshiftkeying
(PSK).
Inaddition,thereisafourth(andbetter)mechanismthatcombineschangingboth
theamplitudeandphase,called
quadratureamplitudemodulation(QAM).QAM
isthemostefficient oftheseoptionsandisthemechanismcommonlyusedtoday(see
Figure5.2).
Figure5.2Typesofdigital-to-analogconversion
"'------
Digital-to-analog
conversion
Quadratureamplitudemodulation
(QAM)
AspectsofDigital-to-AnalogConversion
Beforewediscussspecificmethods ofdigital-to-analogmodulation,twobasicissues
mustbereviewed:bitandbaudratesandthecarriersignal.
DataElementVersusSignalElement
InChapter4,wediscussedtheconcept ofthedataelementversusthesignalelement.
Wedefinedadataelementasthesmallestpiece
ofinformationtobeexchanged,the
bit.
Wealsodefinedasignalelementasthesmallestunit ofasignalthatisconstant.
Althoughwecontinuetousethesametermsinthischapter,wewillseethatthenature
ofthesignalelementisalittlebitdifferent inanalogtransmission.
DataRateVersusSignalRate
Wecandefinethedatarate(bitrate)andthesignalrate(baudrate)aswedidfordigital
transmission.Therelationshipbetweenthem
is
S=Nx!baud
r
whereNisthedatarate(bps)and risthenumber ofdataelementscarriedinonesignal
element.
Thevalueofrinanalogtransmissionis r=log2L,whereListhetype ofsig­
nalelement,notthelevel.Thesamenomenclatureisusedtosimplifythecomparisons.

SECTION5.1DIGITAL-TO-ANALOG CONVERSION 143
Bitrateisthenumberofbitspersecond.Baudrateisthenumberofsignal
elements
persecond.Intheanalogtransmissionofdigitaldata,
the
baudrateislessthanorequalto thebitrate.
ThesameanalogyweusedinChapter4forbitrateandbaudrateapplieshere.In
transportation,abaudisanalogoustoavehicle,andabitisanalogoustoapassenger.
Weneedtomaximizethenumberofpeoplepercartoreducethetraffic.
Example5.1
Ananalogsignalcarries4bitspersignalelement. If1000signalelementsaresentpersecond,
findthebitrate.
Solution
Inthiscase, r=4,S=1000,and Nisunknown.Wecanfindthevalue ofNfrom
S=Nx!
r
orN=Sxr=1000x4=4000bps
Example5.2
Ananalogsignalhasabitrate of8000bpsandabaudrate of1000baud.Howmanydataelements
arecarriedbyeachsignalelement?Howmanysignalelementsdoweneed?
Solution
Inthisexample, S=1000,N=8000,and randLareunknown.Wefindfirstthevalue ofrand
thenthevalue ofL.
1
S=Nx­
r
r=logzL
N8000 .
r= -=--=8bltslbaud
S1000
L=
y=2
8
=256
Bandwidth
Therequiredbandwidthforanalogtransmission ofdigitaldataisproportionaltothe
signalrateexceptforFSK,inwhichthedifferencebetweenthecarriersignalsneedsto
beadded.
Wediscussthebandwidthforeachtechnique.
CarrierSignal
Inanalogtransmission,thesendingdeviceproducesahigh-frequencysignalthatacts
asabasefortheinformationsignal.Thisbasesignaliscalledthe carriersignalorcar­
rierfrequency.Thereceivingdeviceistunedtothefrequency
ofthecarriersignalthatit
expectsfromthesender.Digitalinformationthenchangesthecarriersignalbymodify­
ingoneormore
ofitscharacteristics(amplitude,frequency,orphase).Thiskind of
modificationiscalledmodulation(shiftkeying).
AmplitudeShiftKeying
Inamplitudeshiftkeying,theamplitudeofthecarriersignal isvariedtocreatesignal
elements.Bothfrequencyandphaseremainconstantwhiletheamplitudechanges.

144 CHAPTER 5ANALOGTRANSMISSION
BinaryASK(BASK)
Althoughwecanhaveseverallevels(kinds)ofsignalelements,eachwithadifferent
amplitude,ASKisnormallyimplementedusingonlytwolevels.Thisisreferred
toas
binaryamplitudeshiftkeyingor on-offkeying(OOK).Thepeakamplitudeofonesig­
nallevelis
0;theotheristhesameastheamplitudeofthecarrierfrequency.Figure5.3
givesaconceptualviewofbinaryASK.
Figure5.3
Binmyamplitudeshiftkeying
Amplitude Bitrate:5
1signal
element
o
1signal
element
1
Isignal
element
1s
Baudrate:5
Isignal
element
o
Isignal
element
I
I
Time
I
I
I
I
r=:=1S=N B=(I+d)S
BandwidthforASKFigure5.3alsoshowsthebandwidthforASK.Althoughthe
carriersignalisonlyonesimplesinewave,theprocess
ofmodulationproducesa
nonperiodiccompositesignal.Thissignal,aswasdiscussedinChapter3,hasacontin­
uousset
offrequencies.Asweexpect,thebandwidth isproportionaltothesignalrate
(baudrate).However,thereisnormallyanotherfactorinvolved,called
d,which
dependsonthemodulationandfilteringprocess.Thevalueof
disbetween0and 1.This
meansthatthebandwidthcanbeexpressed
asshown,where5 isthesignalrateandthe B
isthebandwidth.
B=(1+d)xS
Theformulashowsthattherequiredbandwidthhasaminimumvalueof5anda
maximumvalueof25.Themostimportantpointhere
isthelocationofthebandwidth.
Themiddleofthebandwidth
iswhereIethecarrierfrequency,islocated.Thismeans if
wehaveabandpasschannelavailable,wecanchooseour Iesothatthemodulated
signaloccupiesthatbandwidth.Thisisinfactthemostimportantadvantageofdigital­
to-analogconversion.
Wecanshifttheresultingbandwidthtomatchwhatisavailable.
ImplementationThecompletediscussion ofASKimplementationisbeyondthe
scopeofthisbook.However,thesimpleideasbehindtheimplementationmayhelpus
tobetterunderstandtheconceptitself.Figure5.4showshowwecansimplyimplement
binaryASK.
IfdigitaldataarepresentedasaunipolarNRZ(seeChapter4)digitalsignalwitha
highvoltage
ofIVandalowvoltage of0V,theimplementationcanachievedby
multiplyingtheNRZdigitalsignalbythecarriersignalcomingfromanoscillator.
Whentheamplitude
oftheNRZsignalis 1,theamplitudeofthecarrierfrequencyis

SECTION5.1DIGITAL-TO-ANALOG CONVERSION 145
Figure5.4ImplementationofbinaryASK
o
Carriersignal
I
I0
I
held;whentheamplitude oftheNRZsignal is0,theamplitude ofthecarrierfrequency
ISzero.
Example5.3
Wehaveanavailablebandwidth of100kHzwhichspansfrom200to300kHz. Whatarethecar­
rierfrequencyandthebitrate
ifwemodulatedourdatabyusing ASKwithd=I?
Solution
Themiddle ofthebandwidthislocatedat250kHz.Thismeansthatourcarrierfrequencycanbe
atfe=250kHz. Wecanusetheformulaforbandwidthtofindthebitrate(with d=1andr=1).
B=(l+d)xS=2xN
X!=2XN=100kHz...... N=50kbps
r
Example5.4
Indatacommunications,wenormallyusefull-duplexlinkswithcommunicationinbothdirec­
tions.Weneedtodividethebandwidthintotwowithtwocarrierfrequencies,asshowninFig­
ure5.5.
Thefigureshows thepositionsoftwocarrierfrequenciesandthebandwidths. The
availablebandwidthforeachdirectionisnow50kHz,whichleavesuswithadatarate of25kbps
ineachdirection.
Figure5.5Bandwidthoffull-duplexASKusedinExample5.4
I'
B=50kHz'11B=50kHz'I
~"~~~ ~,~Jf:L
200(225) (275)300
MultilevelASK
Theabovediscussionusesonlytwoamplitudelevels. WecanhavemultilevelASKin
whichtherearemorethantwolevels.
Wecanuse4,8,16,ormoredifferentamplitudes
forthesignalandmodulatethedatausing
2,3,4,ormorebitsatatime.Inthesecases,

146 CHAPTER5ANALOGTRANSMISSION
r=2,r=3,r=4,andsoon.AlthoughthisisnotimplementedwithpureASK,itis
implementedwithQAM(as
wewillseelater).
FrequencyShiftKeying
Infrequencyshiftkeying,thefrequency ofthecarriersignalisvariedtorepresentdata.
Thefrequency
ofthemodulatedsignalisconstantfortheduration ofonesignalele­
ment,butchangesforthenextsignalelement
ifthedataelementchanges.Bothpeak
amplitudeandphaseremainconstantforallsignalelements.
BinaryFSK(BFSK)
OnewaytothinkaboutbinaryFSK(orBFSK)istoconsidertwocarrierfrequencies.In
Figure5.6,wehaveselectedtwocarrierfrequencies,f}
and12.Weusethefirstcarrier if
thedataelementis 0;weusethesecondifthedataelementis 1.However,notethatthis
isanunrealisticexampleusedonlyfordemonstrationpurposes.Normallythecarrier
frequenciesareveryhigh,andthedifferencebetweenthem
isverysmall.
Figure5.6Binaryfrequencyshiftkeying
Amplitude
Bitrate:5
r=lS=N
B=(1+d)S+2t-.j
1signal1signal1signal1signal1signal
elementelementelementelement element
Is
It h
I'21-.!-I
o+-~--1-L....JL..--l--..I...-_
o
IlIl1
Baudrate:5
AsFigure5.6shows,themiddle ofonebandwidthisJIandthemiddle oftheother
ish.BothJIand12areil/apartfromthemidpointbetweenthetwobands.Thediffer­
encebetweenthetwo frequenciesis211f
BandwidthforBFSKFigure5.6alsoshowsthebandwidth ofFSK.Againthecar­
riersignalsareonlysimplesinewaves,butthemodulationcreatesanonperiodiccom­
positesignalwithcontinuousfrequencies.Wecanthink
ofFSKastwoASKsignals,
eachwithitsowncarrierfrequency
Cilor
h).Ifthedifferencebetweenthetwofre­
quenciesis211j,thentherequiredbandwidth is
B=(l+d)xS+2iij
Whatshouldbetheminimumvalue of211/?InFigure5.6,wehavechosenavalue
greaterthan
(l+d)S.ItcanbeshownthattheminimumvalueshouldbeatleastSfor
theproperoperation
ofmodulationanddemodulation.

SECTION5.1DIGITAL-TO-ANALOG CONVERSION 147
Example5.5
Wehaveanavailablebandwidth of100kHzwhichspansfrom200to300kHz.Whatshouldbe
thecarrierfrequencyandthebitrate
ifwemodulatedourdatabyusingFSKwith d=1?
Solution
ThisproblemissimilartoExample5.3,butwearemodulatingbyusingFSK.Themidpoint of
thebandis at250kHz. Wechoose
2~ftobe50kHz;thismeans
B=(1+d)x S+28f=100-.2S=50kHzS=25kbaud N;;;;25kbps
ComparedtoExample5.3,wecanseethebitrateforASKis50kbpswhilethebitrateforFSK
is
25kbps.
ImplementationTherearetwoimplementations ofBFSK:noncoherentandcoher­
ent.InnoncoherentBFSK,theremay
bediscontinuityinthephasewhenonesignal
elementendsandthenextbegins.IncoherentBFSK,thephasecontinuesthroughthe
boundary
oftwosignalelements.NoncoherentBFSKcanbeimplementedbytreating
BFSKastwo
ASKmodulationsandusingtwocarrierfrequencies.CoherentBFSKcan
beimplementedbyusingone
voltage-controlledoscillator (VeO)thatchangesitsfre­
quencyaccordingtotheinputvoltage.Figure5.7showsthesimplifiedideabehindthe
secondimplementation.TheinputtotheoscillatoristheunipolarNRZsignal.When
theamplitude
ofNRZiszero,theoscillatorkeepsitsregularfrequency;whenthe
amplitudeispositive,thefrequencyisincreased.
Figure5.7ImplementationofBFSK
1 o 1 o
_lD1_I_I_I_-;"~1 veoI~
Voltage-controlled
oscillator
MultilevelFSK
Multilevelmodulation(MFSK)isnotuncommonwiththeFSKmethod. Wecanuse
morethantwofrequencies.Forexample,wecanusefourdifferent
frequenciesfIJ2,!3,
and14tosend2bitsatatime. Tosend3bitsatatime,wecanuseeightfrequencies.
Andsoon.However,weneedtorememberthatthefrequenciesneedtobe2~1apart.
Fortheproperoperation
ofthemodulatoranddemodulator,itcanbeshownthatthe
minimumvalue
of
2~lneeds tobeS.Wecanshowthatthebandwidthwith d=0is
B;;;;(l+d)xS+(L-1)24{-.B=LxS

148 CHAPTER 5ANALOGTRANSMISSION
Example5.6
Weneedto senddata3bitsatatimeata bitrateof3Mbps.The carrierfrequencyis
10MHz.
Calculatethenumberoflevels(differentfrequencies),the baudrate,andthe
bandwidth.
Solution
WecanhaveL=2
3
=8.Thebaudrate isS=3MHz/3=1000Mbaud.Thismeansthatthecarrier
frequenciesmustbe1MHzapart
(211f=1MHz).Thebandwidthis B=8 x1000=8000.Figure 5.8
showstheallocation offrequenciesandbandwidth.
Figure5.8BandwidthofMFSKusedinExample 5.6
'I
r~~'¥'::L
is
13.5
MHz
Ih
12.5
MHz
Bandwidth=8MHz
II
6.5
MHz
I'
-(.-----.."--,,I~~~lf5~~1I:I--Ji~~l~;~r'·' ·t':~
h h 14 j~ 15 16
7.5 8.5 9.5HI10.5 11.5
MHz MHz MHz MHzMHz MHz
PhaseShiftKeying
Inphaseshiftkeying,thephase ofthecarrierisvariedtorepresenttwoormorediffer­
entsignalelements.Bothpeakamplitudeandfrequencyremainconstant
asthephase
changes.Today,
PSKismorecommonthanASKorFSK.However,wewillsee
Sh0l1lythatQAM,whichcombinesASKandPSK,isthedominantmethod ofdigital­
to-analogmodulation.
BinaryPSK(BPSK)
ThesimplestPSK isbinaryPSK,inwhichwehaveonlytwosignalelements,onewith
aphase
of0°,andtheotherwithaphase of180°.Figure5.9givesaconceptualview
ofPSK.BinaryPSK isassimpleasbinaryASKwithonebig advantage-itisless
Figure5.9Binaryphaseshiftkeying
Amplitude Bitrate:5
o 1 I) r=1 S=N
B={I+d)S
IsignalIsignalIsignalIsignalIsignal
element element elementelementelement
I
s
Baudrate:5

SECTION5.1DIGITAL-TO-ANALOG CONVERSION 149
susceptibletonoise.InASK,thecriterionforbitdetectionistheamplitude ofthesig­
nal;inPSK,it isthephase.Noisecanchangetheamplitudeeasierthanitcanchange
thephase.Inotherwords,PSKislesssusceptibletonoisethanASK.PSKissuperiorto
FSKbecausewedonotneedtwocarriersignals.
BandwidthFigure5.9alsoshowsthebandwidthforBPSK.Thebandwidthisthe
same
asthatforbinaryASK,butlessthanthatforBFSK.Nobandwidthiswastedfor
separatingtwocarriersignals.
ImplementationTheimplementationofBPSKis assimpleasthatforASK.Therea­
sonisthatthesignalelementwithphase
180°canbeseenasthecomplement ofthesig­
nalelementwithphase
0°.ThisgivesusaclueonhowtoimplementBPSK.Weuse
thesameideaweusedforASKbutwithapolarNRZsignalinstead
ofaunipolarNRZ
signal,asshowninFigure5.10.ThepolarNRZsignal
ismultipliedbythecarrierfre­
quency;the
1bit(positivevoltage)isrepresentedbyaphasestartingat 0°;theabit
(negativevoltage)isrepresentedbyaphasestartingat
180°.
Figure5.10ImplementationofBASK
o 1
I
I
Carrie~signal
o
-=t:f=ttMultiplier~
------.tX I---'-;';';"";";"':":"';";';'~
*f
c
QuadraturePSK(QPSK)
Thesimplicity
ofBPSKenticeddesignerstouse2bitsatatimeineachsignalelement,
therebydecreasingthebaudrateandeventuallytherequiredbandwidth.Thescheme
is
calledquadraturePSKorQPSKbecauseitusestwoseparateBPSKmodulations;one
isin-phase,theotherquadrature(out-of-phase).Theincomingbitsarefirstpassed
throughaserial-to-parallelconversionthatsendsonebittoonemodulatorandthenext
bittotheothermodulator.
Ifthedurationofeachbitintheincomingsignalis T,the
duration
ofeachbitsenttothecorrespondingBPSKsignalis 2T.Thismeansthatthe
bittoeachBPSKsignalhasone-halfthefrequency
oftheoriginalsignal.Figure5.11
showstheidea.
Thetwocompositesignalscreatedbyeachmultiplieraresinewaveswiththe
samefrequency,butdifferentphases.
Whentheyareadded,theresultisanother sine
wave,withone
offourpossiblephases: 45°,-45°, 135°,and-135°.Therearefour
kinds
ofsignalelementsintheoutputsignal (L=4),sowecansend2bitspersignal
element
(r=2).

150 CHAPTER5ANALOGTRANSMISSION
Figure5.11 QPSKanditsimplementation
00
o
1 U
1
01
o
1 I
1
I I I
I I I
·p·,J\-:/YfAf\f~-tPtj'}/f'J\-lllJ~
I I I I
I I I I
I I I I
o:0 I I I
I
-135 -45 135 45
Example5.7
Findthebandwidthforasignaltransmittingat12MbpsforQPSK.Thevalue ofd=O.
Solution
ForQPSK,2bitsiscarriedbyonesignalelement.Thismeansthat r=2.Sothesignalrate(baud
rate)isS
=Nx(lIr)=6Mbaud.Withavalueof d=0,wehaveB=S=6MHz.
ConstellationDiagram
Aconstellationdiagram canhelpusdefinetheamplitudeandphase ofasignalelement,
particularlywhenweareusingtwocarriers(onein-phaseandonequadrature),The
diagramisusefulwhenwearedealingwithmultilevelASK,PSK,orQAM(seenext
section).Inaconstellationdiagram,asignalelementtypeisrepresentedasa dot.The
bitorcombination
ofbitsitcancarryisoftenwrittennexttoit.
Thediagramhastwoaxes.ThehorizontalXaxisisrelatedtothein-phasecarrier;
thevertical
Yaxisisrelatedtothequadraturecarrier.Foreachpointonthediagram,
fourpieces
ofinformationcan bededuced.Theprojection ofthepointontheXaxis
definesthepeakamplitude
ofthein-phasecomponent;theprojection ofthepointon
the
Yaxisdefinesthepeakamplitude ofthequadraturecomponent.Thelength ofthe
line(vector)thatconnectsthepointtotheoriginisthepeakamplitude
ofthesignal
element(combination
oftheXand Ycomponents);theanglethelinemakeswiththe
Xaxisis thephaseofthesignalelement.Alltheinformationweneed,caneasilybefound
onaconstellationdiagram.Figure5.12showsaconstellationdiagram.

SECTION5.1DIGITAL-TO-ANALOG CONVERSION 151
Figure5.12 Conceptofaconstellationdiagram
Y(Quadraturecarrier)
-----------~
,
, I
f+-<--' ~e.~~ I
ol=: •..:S5~ I
~ ~ ?f" I
B8.. ~<$'/ I
:.:::E ., I
0..0 #1"', I
E0 ~:<::>,' I
«C)l V, I
" Angle:phase I
, I
__---L+_-----.J'---- ---'--~ X(In-phasecarrier)
Amplitude
of
Icomponent
Example5.8
Showtheconstellationdiagramsfor anASK(OOK),BPSK,andQPSKsignals.
Solution
Figure5.13showsthethreeconstellationdiagrams.
Figure5.13 Threeconstellationdiagrams
~--,
01'-.11
/ \
-. -. .-
1 \
0---
\
I 0 1 \
I
00.
,
__~1O
a.ASK(OOK) b.BPSK c.QPSK
Letusanalyzeeachcaseseparately:
a.ForASK,weareusingonly anin-phasecarrier.Therefore,thetwopointsshouldbeonthe
Xaxis.Binary0has
anamplitudeof0V;binary1hasanamplitude of1 V(forexample).
Thepointsarelocatedattheoriginandat1unit.h.BPSKalsousesonly anin-phasecarrier.However,weuseapolarNRZsignalformodu­
lation.
Itcreatestwotypes ofsignalelements,onewithamplitude1andtheotherwith
amplitude
-1.Thiscanbestatedinotherwords:BPSKcreatestwodifferentsignalelements,
onewithamplitudeI Vandinphaseandtheotherwithamplitude1Vand
1800outofphase.
c.QPSKusestwocarriers,onein-phaseandtheotherquadrature.Thepointrepresenting 11is
made
oftwocombinedsignalelements,bothwith anamplitudeof1V.Oneelementisrep­
resentedbyanin-phasecarrier,theotherelementbyaquadraturecarrier.Theamplitude
of
thefinalsignalelementsentforthis2-bitdataelementis2
112
,andthephase is45°.The
argument
issimilarfortheotherthreepoints.Allsignalelementshaveanamplitude of2
112
,
buttheirphasesaredifferent (45°,135°,-135°,and-45°).Ofcourse,wecouldhavechosen
theamplitude
ofthecarriertobe1/(21/2)tomakethefinalamplitudes1 V.

152 CHAPTER 5ANALOGTRANSMISSION
QuadratureAmplitudeModulation
PSKislimitedbytheabilityoftheequipmenttodistinguishsmalldifferences inphase.
Thisfactorlimitsitspotentialbitrate.So
far,wehavebeenalteringonlyoneofthe
threecharacteristicsofasinewave
atatime;butwhat ifwealtertwo?Whynotcom­
bineASKandPSK?Theideaofusingtwocarriers,onein-phaseandtheotherquadra­
ture,withdifferentamplitudelevelsforeachcarrieristheconceptbehind
quadrature
amplitudemodulation(QAM).
Quadratureamplitudemodulationisacombination ofASKandPSK.
ThepossiblevariationsofQAMarenumerous.Figure5.14showssomeofthese
schemes.Figure5.14ashowsthesimplest4-QAMscheme(fourdifferentsignal ele­
menttypes)usingaunipolarNRZsignaltomodulateeachcarrier.Thisisthesame
mechanismweusedforASK(OOK).Partbshowsanother4-QAMusingpolarNRZ,
butthisisexactlythesameasQPSK.PartcshowsanotherQAM-4inwhich
weuseda
signalwithtwopositivelevelstomodulateeachofthetwocarriers.Finally,Figure5.14d
showsa16-QAMconstellation
ofasignalwitheightlevels,fourpositiveandfour
negative.
Figure5.14
Constellationdiagrams forsomeQAMs
t• • • •• ••• •
L
•• • •••••
I~ • •••
• • • •••
a.4·QAM b.4-QAM c.4.QAM d.16·QAM
BandwidthforQAM
TheminimumbandwidthrequiredforQAMtransmissionisthesame asthatrequired
forASKandPSKtransmission.QAMhasthesameadvantages
asPSKoverASK.
5.2ANALOG-TO-ANALOG CONVERSION
Analog-to-analogconversion,oranalogmodulation,istherepresentationofanalog
informationby
ananalogsignal.Onemayaskwhy weneedtomodulate ananalogsig­
nal;it
isalreadyanalog.Modulationisneededifthemediumisbandpassinnatureorif
onlyabandpasschannelisavailableto
us.Anexampleisradio.Thegovernmentassigns
anarrowbandwidthtoeachradiostation.Theanalogsignalproducedbyeachstationis
alow-passsignal,allinthesamerange.
Tobeabletolistentodifferentstations,the
low-passsignalsneedtobeshifted,eachtoadifferentrange.

SECTION5.2ANALOG-TO-ANALOG CONVERSION 153
Analog-to-analogconversion canbeaccomplishedinthreeways: amplitude
modulation(AM),frequencymodulation(FM), andphasemodulation(PM). FM
andPMareusuallycategorizedtogether.SeeFigure5.15.
Figure5.15Typesofanalog-to-analogmodulation
Analog-lo-analog
conversion
Frequencymodulation
AmplitudeModulation
InAMtransmission,thecarriersignal ismodulatedsothatitsamplitudevarieswiththe
changingamplitudes
ofthemodulatingsignal.Thefrequencyandphase ofthecarrier
remainthesame;onlytheamplitudechangestofollowvariationsintheinformation.Fig­
ure5.16showshowthisconceptworks.Themodulatingsignal
istheenvelopeofthecarrier.
Figure5.16Amplitudemodulation
Jj
BAM=2B
:L
o I
1;
AsFigure5.16shows, AMisnormallyimplementedbyusingasimplemultiplier
becausetheamplitude
ofthecarriersignalneedstobechangedaccordingtotheampli­
tudeofthemodulatingsignal.
AMBandwidth
Figure5.16alsoshowsthebandwidth
ofanAMsignal.Themodulationcreatesaband­
widththatistwicethebandwidth
ofthemodulatingsignalandcoversarangecentered
onthecarrierfrequency.However,thesignalcomponentsaboveandbelowthecarrier

154 CHAPTER 5ANALOGTRANSMISSION
frequencycarryexactlythesameinformation.Forthisreason,someimplementations
discardone-halfofthesignalsandcutthebandwidthinhalf.
ThetotalbandwIdth requiredforAMcanbedetermined
from
thebandwidthoftheaudiosignal: BAM=2B.
------------------_~-~,~_-
StalldardBalldwidthAllocatioll forAiHl(adio
Thebandwidthofanaudiosignal(speechandmusic) isusually5kHz.Therefore,an
AMradiostationneedsabandwidthof
10kHz.Infact,theFederalCommunications
Commission(FCC)allows
10kHzforeachAMstation.
AMstationsareallowedcarrierfrequenciesanywherebetween530and1700kHz
(1.7MHz).However,eachstation'scarrierfrequencymustbeseparatedfromthoseon
eithersideof
itbyatleast10kHz(oneAMbandwidth)toavoidinterference. Ifone
stationusesacarrierfrequencyof1100kHz,thenextstation'scarrierfrequencycannot
belowerthan1110kHz(seeFigure5.17).
Figure5.17AMbandallocation
__*_*_*
_....I....-.....t-'"....=u.;[IJ
530 I' ,I 1700
kHz
10kHz kHz
FrequencyModulation
InFMtransmission,thefrequencyofthecarriersignalismodulatedtofollowthechang­
ingvoltagelevel(amplitude)ofthemodulatingsignal.Thepeakamplitudeandphaseof
thecarriersignalremainconstant,but
astheamplitudeoftheinformationsignal
changes,thefrequency
ofthecarrierchangescorrespondingly.Figure5.18showsthe
relationshipsofthemodulatingsignal,thecarriersignal,andtheresultantFMsignal.
AsFigure5.18shows,FMisnOimalIyimplementedbyusingavoltage-controlled
oscillator
aswithFSK.Thefrequencyoftheoscillatorchangesaccordingtotheinput
voltagewhichistheamplitudeofthemodulatingsignal.
FiHBalldwidth
Figure5.18alsoshowsthebandwidthofanFMsignal.Theactualbandwidthisdiffi­
culttodetermineexactly,butitcanbeshownempiricallythatitisseveraltimesthat
oftheanalogsignalor 2(1+
~)Bwhere~isafactordependsonmodulationtechnique
withacommonvalueof4.
ThetotalbandwidthrequiredforFMcanbedeterminedfrom
the
bandwidthoftheaudiosignal: B
FM=2(1+
j3)B.

SECTION5.2ANALOG-TO-ANALOG CONVERSION 155
:Figure5.1gFrequencymodulation
----------------------
Amplitude
Modulatingsignal(audio)
D
B,"=2(1+filR
:L
o I
Ie
C".II~
___"0-----,J~~veo .-
VOltage-controlled
oscillator
Time
Time
Time
FMsignal
n!
------------_._-----------------
,c.,'twllhm!BandwidthA.llo('((tiOllforF,Radio
Thebandwidth ofanaudiosignal(speechandmusic)broadcastinstereo isalmost
15kHz.TheFCCallows200kHz(0.2MHz)foreachstation.Thismean~=4with
someextraguardband.FMstationsareallowedcarrierfrequenciesanywherebetween
88and108MHz.Stationsmustbeseparatedbyatleast200kHztokeeptheirband­
widthsfromoverlapping.
Tocreateevenmoreprivacy,theFCCrequiresthatinagiven
area,onlyalternatebandwidthallocationsmaybeused.Theothersremainunusedtopre­
ventanypossibility
oftwostationsinterferingwitheachother.Given 88to108MHz as
arange,thereare100potential PMbandwidthsinanarea, ofwhich50canoperateat
anyonetime.Figure5.19illustratesthisconcept.
Figure5.19FMbandallocation
,--_t,-e_I st~~on
88
MHz
Ie
t
I-200kHz,I
...
Ie
t
------_.__._--
No
station
108
MHz
Phast',\loduiation
InPMtransmission,thephase ofthecarriersignal ismodulatedtofollowthechanging
voltagelevel(amplitude)
ofthemodulatingsignal.Thepeakamplitudeandfrequency
ofthecarriersignalremainconstant,but astheamplitudeoftheinformationsignal
changes,thephase
ofthecarrierchangescorrespondingly.Itcanprovedmathemati­
cally(seeAppendixC)thatPMisthesameasFMwithonedifference.InFM,the
instantaneouschangeinthecarrierfrequencyisproportionaltotheamplitude
ofthe

156 CHAPTER5ANALOGTRANSMISSION
modulatingsignal;inPMtheinstantaneouschangeinthecarrierfrequencyispropor­
tionaltothederivative
oftheamplitudeofthemodulatingsignal.Figure5.20showsthe
relationships
ofthemodulatingsignal,thecarriersignal,andtheresultantPMsignal.
Figure5.20 Phasemodulation
Amplitude
Modulating
signal(audio)
PMsignal
Time
Time
Time
VCOI~
I r
~I
'J1
dldtI1
AsFigure5.20shows,PMisnormallyimplementedbyusingavoltage-controlled
oscillatoralongwithaderivative.Thefrequency
oftheoscillatorchangesaccordingto
thederivative
oftheinputvoltagewhichistheamplitude ofthemodulatingsignal.
PMBandwidth
Figure5.20alsoshowsthebandwidth
ofaPMsignal.Theactualbandwidthisdifficult
todetermineexactly,butitcanbeshownempiricallythatitisseveraltimesthat
ofthe
analogsignal.Although,theformulashowsthesamebandwidthforFMandPM,the
value
of
~islowerinthecase ofPM(around1fornarrowbandand3forwideband).
Thetotalbandwidthrequiredfor PMcanbedeterminedfromthebandwidthand
maximumamplitude
ofthemodulatingsignal:B pM=2(1+
~)B.
5.3RECOMMENDED READING
Formoredetailsaboutsubjectsdiscussedinthischapter,werecommendthefollowing
books.Theitemsinbrackets[
...]refertothereferencelistattheend ofthetext.
Books
Digital-to-analogconversionisdiscussedin Chapter14of[Pea92],Chapter5 of
[CouOl],andSection5.2 of[Sta04].Analog-to-analogconversionisdiscussedin
Chapters8to
13of[Pea92],Chapter5 of[CouOl],andSection5.4 of[Sta04].[Hsu03]

SECTION5.5SUMMARY 157
givesagoodmathematicalapproachtoallmaterialsdiscussedinthischapter.More
advancedmaterialscanbefoundin[Ber96].
5.4KEYTERMS
amplitudemodulation(AM)
amplitudeshiftkeying(ASK)
analog-to-analogconversion
carriersignal
constellationdiagram
digital-to-analogconversion
frequencymodulation(PM)
frequencyshiftkeying(FSK)
phasemodulation(PM)
phaseshiftkeying(PSK)
quadratureamplitudemodulation
(QAM)
5.5SUMMARY
oDigital-to-analogconversionistheprocess ofchangingone ofthecharacteristics
ofananalogsignalbasedontheinformationinthedigitaldata.
oDigital-to-analogconversioncanbeaccomplishedinseveralways:amplitudeshift
keying(ASK),frequencyshiftkeying(FSK),and
phaseshiftkeying(PSK).
Quadratureamplitudemodulation(QAM)combinesASKandPSK.
oInamplitudeshiftkeying,theamplitude ofthecarriersignalisvariedtocreatesignal
elements.Bothfrequencyandphaseremainconstantwhiletheamplitudechanges.
oInfrequencyshiftkeying,thefrequency ofthecarriersignal isvariedtorepresent
data.Thefrequency
ofthemodulatedsignalisconstantfortheduration ofonesig­
nalelement,butchangesforthenextsignalelement
ifthedataelementchanges.
Bothpeakamplitudeandphaseremainconstantforallsignalelements.
oInphaseshiftkeying,thephase ofthecarrierisvariedtorepresenttwoormoredif­
ferentsignalelements.Bothpeakamplitudeandfrequencyremainconstantasthe
phasechanges.
oAconstellationdiagramshowsustheamplitudeandphase ofasignalelement,
particularlywhenweareusingtwocarriers(onein-phaseandonequadrature).
oQuadratureamplitudemodulation(QAM) isacombinationofASKandPSK.
QAMusestwocarriers,onein-phaseandtheotherquadrature,withdifferent
amplitudelevelsforeachcarrier.
oAnalog-to-analogconversionistherepresentation ofanaloginformationbyan
analogsignal.Conversion
isneededifthemediumisbandpassinnatureor ifonly
abandpassbandwidthisavailabletous.
oAnalog-to-analogconversioncanbeaccomplishedinthreeways:amplitudemodu­
lation(AM),frequencymodulation(FM),andphasemodulation(PM).
oInAMtransmission,thecarriersignal ismodulatedsothatitsamplitudevarieswiththe
changingamplitudes
ofthemodulatingsignal.Thefrequencyandphase ofthecarrier
remainthesame;onlytheamplitudechanges
tofollowvariationsintheinformation.
oInPMtransmission,thefrequency ofthecarriersignalismodulatedtofollowthe
changingvoltagelevel(amplitude)
ofthemodulatingsignal.Thepeakamplitude

158 CHAPTER 5ANALOGTRANSMISSION
andphase ofthecarriersignalremainconstant,butastheamplitude oftheinfor­
mationsignalchanges,thefrequency
ofthecarrierchangescorrespondingly.
oInPMtransmission,thephase ofthecarriersignalismodulatedtofollowthe
changingvoltagelevel(amplitude)
ofthemodulatingsignal. Thepeakamplitude
andfrequency
ofthecarriersignalremainconstant, butastheamplitude ofthe
informationsignalchanges,thephase ofthecarrierchangescorrespondingly.
5.6PRACTICESET
ReviewQuestions
1.Defineanalogtransmission.
2.Definecarriersignalanditsrole inanalogtransmission.
3.Definedigital-to-analogconversion.
4.Whichcharacteristicsofananalogsignalarechangedtorepresentthedigitalsignal
ineachofthefollowingdigital-to-analogconversion?
a.ASK
b.FSK
c.PSK
d.QAM
5.Which ofthefourdigital-to-analogconversiontechniques(ASK,FSK, PSKor
QAM)isthemostsusceptibletonoise?Defendyouranswer.
6.Defineconstellationdiagramanditsroleinanalogtransmission.
7.
Whatarethetwocomponents ofasignalwhenthesignalisrepresented onacon-.
stellationdiagram?
Whichcomponentisshown onthehorizontalaxis? Whichis
shown
ontheverticalaxis?
8.Defineanalog-to-analogconversion?
9.Whichcharacteristicsofananalogsignalarechangedtorepresentthelowpassanalog
signal
ineachofthefollowinganalog-to-analogconversions?
a.AM
b.FM
c.PM
]0.Whichofthethreeanalog-to-analogconversiontechniques(AM,FM, orPM)is
themostsusceptibletonoise?Defend
youranswer.
Exercises
11.Calculatethebaudrateforthegivenbitrateandtype ofmodulation.
a.2000bps, FSK
b.4000bps, ASK
c.6000bps, QPSK
d.36,000bps, 64-QAM

SECTION5.6PRACTICESET 159
12.Calculatethebitrateforthegivenbaudrateandtype ofmodulation.
a.1000baud,FSK
b.1000baud,ASK
c.1000baud,BPSK
d.1000baud,16-QAM
13.Whatisthenumberofbitsperbaudforthefollowingtechniques?
a.ASKwithfourdifferentamplitudes
b.FSKwith 8differentfrequencies
c.PSKwithfourdifferentphases
d.QAMwithaconstellation of128points.
14.Drawtheconstellationdiagramforthefollowing:
a.ASK,withpeakamplitudevalues of1and3
b.BPSK,withapeakamplitudevalue of2
c.QPSK,withapeakamplitudevalue of3
d.8-QAMwithtwodifferentpeakamplitudevalues, Iand3,andfourdifferent
phases.
15.Drawtheconstellationdiagramforthefollowingcases.Findthepeakamplitude
valueforeachcaseanddefinethetype
ofmodulation(ASK,FSK,PSK,orQAM).
Thenumbersinparenthesesdefinethevalues
ofIandQrespectively.
a.Twopointsat(2,0)and (3,0).
b.Twopointsat(3,0)and (-3,0).
c.Fourpointsat(2,2), (-2,2),(-2,-2),and(2,-2).
d.Twopointsat(0,2)and(0, -2).
16.Howmanybitsperbaudcanwesendineach ofthefollowingcases ifthesignal
constellationhasone
ofthefollowingnumber ofpoints?
a.2
b.4
c.16
d.1024
17.Whatistherequiredbandwidthforthefollowingcases
ifweneedtosend4000bps?
Let
d=1.
a.ASK
b.FSKwith
2~f=4KHz
c.QPSK
d.16-QAM
18.Thetelephonelinehas4KHzbandwidth.Whatisthemaximumnumber ofbitswe
cansendusingeach
ofthefollowingtechniques?Letd =O.
a.ASK
b.QPSK
c.16-QAM
d.64-QAM

160 CHAPTER 5ANALOGTRANSMISSION
19.Acorporationhasamediumwitha I-MHzbandwidth(lowpass).Thecorporation
needstocreate
10separateindependentchannelseachcapable ofsendingatleast
10Mbps.Thecompanyhasdecidedtouse QAMtechnology.Whatisthemini­
mumnumberofbitsper baudforeachchannel? Whatisthenumber ofpointsin
theconstellationdiagramforeachchannel?Letd
=O.
20.Acablecompanyusesone ofthecableTVchannels(withabandwidth of6MHz)
toprovidedigitalcommunicationforeachresident.
Whatistheavailabledatarate
foreachresident
ifthecompanyusesa64-QAMtechnique?
21.Findthebandwidthforthefollowingsituations ifweneedtomodulatea5-KHz
voice.
a.AM
b.PM(set
~=5)
c.PM(set~=1)
22.Findthetotalnumber ofchannelsinthecorrespondingbandallocatedbyFCC.
a.AM
b.FM

CHAPTER6
BandwidthUtilization:
Multiplexing
andSpreading
Inreallife,wehavelinkswithlimitedbandwidths.Thewiseuse ofthesebandwidths
hasbeen,andwillbe,one
ofthemainchallenges ofelectroniccommunications.How­
ever,themeaning
ofwisemaydependontheapplication.Sometimesweneedtocombine
severallow-bandwidthchannelstomakeuse
ofonechannelwithalargerbandwidth.
Sometimesweneedtoexpandthebandwidth
ofachanneltoachievegoalssuchas
privacyandantijamming.Inthischapter,weexplorethesetwobroadcategories
of
bandwidthutilization:multiplexingandspreading.Inmultiplexing, ourgoaliseffi­
ciency;wecombineseveralchannelsintoone.Inspreading,
ourgoalsareprivacyand
antijamming;weexpandthebandwidth
ofachanneltoinsertredundancy,whichis
necessarytoachievethesegoals.
Bandwidthutilizationis thewiseuse ofavailablebandwidthtoachievespecificgoals.
Efficiency
canbeachievedbymultiplexing;
privacy
andantijammingcanbeachievedbyspreading.
6.1MULTIPLEXING
Wheneverthebandwidth ofamediumlinkingtwodevicesisgreaterthantheband­
widthneeds
ofthedevices,thelinkcanbeshared.Multiplexingis theset oftechniques
thatallowsthesimultaneoustransmission
ofmultiplesignalsacrossasingledatalink.
Asdataandtelecommunicationsuseincreases,sodoestraffic.
Wecanaccommodate
thisincreasebycontinuingtoaddindividuallinkseachtimeanewchannelisneeded;
orwecaninstallhigher-bandwidthlinksanduseeachtocarrymultiplesignals.As
describedinChapter7,today'stechnologyincludeshigh-bandwidthmediasuchas
opticalfiberandterrestrialandsatellitemicrowaves.Eachhasabandwidthfarinexcess
ofthatneededfortheaveragetransmissionsignal. Ifthebandwidthofalinkisgreater
thanthebandwidthneeds
ofthedevicesconnectedtoit,thebandwidthiswasted.An
efficientsystem maximizestheutilization
ofallresources;bandwidthisone ofthe
mostpreciousresourceswehaveindatacommunications.
161

162 CHAPTER 6BANDWIDTH UTILIZATION:MULTIPLEXING ANDSPREADING
Inamultiplexedsystem, nlinessharethebandwidth ofonelink.Figure 6.1shows
thebasicformatofamultiplexedsystem.Thelinesontheleftdirecttheirtransmission
streamstoamultiplexer(MUX),whichcombinesthemintoasinglestream(many-to­
one).Atthereceivingend,thatstream
isfedintoa demultiplexer(DEMUX),which
separates
thestreambackintoits componenttransmissions(one-to-many)and
directsthemtotheircorrespondinglines.Inthefigure,theword
linkreferstothe
physicalpath.Theword
channelreferstotheportion ofalinkthatcarriesatransmis­
sionbetweenagivenpair
oflines.Onelinkcanhavemany (n)channels.
Figure
6.1Dividingalinkintochannels
nInput
lines
~MUX:Multiplexer /
DEMUX:Demultiplexer D
M E

U
,
M
·
·
X U·· X·Ilink,11channels
/ ~
nOutput
lines
Therearethreebasicmultiplexingtechniques:frequency-divisionmultiplexing,
wavelength-divisionmultiplexing,andtime-divisionmultiplexing.Thefirsttwoare
techniquesdesignedforanalogsignals,thethird,fordigitalsignals(seeFigure6.2).
Figure6.2
Categoriesofmultiplexing
Multiplexing
I
I I I
Frequency-division
I
Wavelength-division Time-division
multiplexing multiplexing multiplexing
Analog Analog Digital
Althoughsometextbooksconsider carrierdivisionmultipleaccess (COMA)asa
fourthmultiplexingcategory,wediscussCOMA
asanaccessmethod(seeChapter12).
Frequency-DivisionMultiplexing
Frequency-divisionmultiplexing(FDM) isananalogtechniquethatcanbeapplied
whenthebandwidthofalink(inhertz)
isgreaterthanthecombinedbandwidthsof
thesignalstobetransmitted.InFOM,signalsgenerated
byeachsendingdevice modu­
latedifferentcarrierfrequencies.Thesemodulatedsignalsarethencombinedintoasingle
compositesignalthatcanbetransported
bythelink.Carrierfrequenciesareseparatedby
sufficientbandwidthtoaccommodatethemodulatedsignal.Thesebandwidthrangesare
thechannelsthroughwhichthevarioussignalstravel.Channelscanbeseparated
by

SECTION6.1MULTIPLEXING 163
stripsofunusedbandwidth-guardbands-topreventsignalsfromoverlapping.In
addition,carrierfrequenciesmustnotinterferewiththeoriginaldatafrequencies.
Figure6.3givesaconceptualview
ofFDM.Inthisillustration,thetransmissionpath
isdividedintothreeparts,eachrepresentingachannelthatcarriesonetransmission.
Figure6.3Frequency-divisionmultiplexing
D
M
ChannelJ E
Input
U Chanllel2 M
Output
lines Jines
X U
X
WeconsiderFDMtobeananalogmultiplexingtechnique;however,thisdoesnot
meanthatFDMcannotbeusedtocombinesourcessendingdigitalsignals.Adigital
signalcanbeconvertedtoananalogsignal(withthetechniquesdiscussedinChapter5)
beforeFDM
isusedtomultiplexthem.
FDMis ananalogmultiplexingtechnique thatcombinesanalogsignals.
MultiplexingProcess
Figure6.4isaconceptualillustration ofthemultiplexingprocess.Eachsourcegener­
atesasignalofasimilarfrequencyrange.Insidethemultiplexer,thesesimilarsignals
modulatesdifferentcarrierfrequencies
(/1,12,andh).Theresultingmodulatedsignals
arethencombinedintoasinglecompositesignalthat
issentoutoveramedialinkthat
hasenoughbandwidthtoaccommodate
it.
Figure6.4FDMprocess
Modulator
U!UUUUA!!!A
mvmvmnm
Carrierh
Modulator
flOflflflflflfl
VVlJl)l)VVV
Carrierh
Baseband
analogsignals
Modulator
/\/\/\/\
V\TV)
Carrier!1

164 CHAPTER 6BANDWIDTHUTILIZATION:MULTIPLEXING ANDSPREADING
DemultiplexingProcess
Thedemultiplexerusesaseries offilterstodecomposethemultiplexedsignalintoits
constituentcomponentsignals.Theindividualsignalsarethenpassed
toademodulator
thatseparatesthemfromtheircarriersandpassesthemtotheoutputlines.Figure6.5is
aconceptualillustration
ofdemultiplexingprocess.
Figure6.5FDMdemultiplexingexample
Demodulator
AAAA
VVVV
Carrier!l
Baseband
analogsignals
Demodulator
AA!!AAAAAAAAAA!!
mvmvmmn
Carrierh
~
/-- ,
\ '
\"-

:==D=e=m=o=d=ul=at=or==~
" \ AAAAAnAA
vvvvvvvv
'----~ ....~'. /1'~~ Carrierh
Example6.1
Assumethatavoicechanneloccupiesabandwidth of4kHz.Weneedtocombinethreevoice
channelsintoalinkwithabandwidth
of12kHz,from20to32kHz.Showtheconfiguration,
usingthefrequencydomain.Assumetherearenoguardbands.
Solution
Weshift(modulate)each ofthethreevoicechannelstoadifferentbandwidth,asshowninFig­
ure6.6.
Weusethe20-to24-kHzbandwidthforthefirstchannel,the24-to28-kHzbandwidth
forthesecondchannel,andthe28-to32-kHzbandwidthforthethirdone.Thenwecombine
them
asshowninFigure6.6.Atthereceiver,eachchannelreceivestheentiresignal,usinga
filtertoseparateoutitsownsignal.Thefirstchannelusesafilterthatpassesfrequencies
between20and24kHzandfiltersout(discards)anyotherfrequencies.Thesecondchannel
usesafilterthatpassesfrequenciesbetween24and
28kHz,andthethirdchannelusesafilter
thatpassesfrequenciesbetween28and32kHz.Eachchannelthenshiftsthefrequencytostart
fromzero.
Example6.2
Fivechannels,eachwithalOa-kHz bandwidth,aretobemultiplexedtogether.Whatisthemini­
mumbandwidth
ofthelinkifthereisaneedforaguardband of10kHzbetweenthechannelsto
preventinterference?
Solution
Forfivechannels,weneedatleastfourguardbands.Thismeansthattherequiredbandwidthisat
least5
x100+4x10=540kHz,asshowninFigure6.7.

SECTION6.1MULTIPLEXING 165
Figure6.6 Example6.1
Shiftandcombine
Higher-bandwidthlink
Bandpass
filter
Bandpass
filter
Figure6.7 Example6.2
Guardband
of10kHz
I.
100kHz-Ill'100kHz_I

2024
-_.._-
2428
540kHz
Example6.3
Fourdatachannels(digital),eachtransmittingatIMbps,useasatellitechannel ofIMHz.
Design
anappropriateconfiguration,usingFDM.
Solution
Thesatellitechannel isanalog.Wedivideitintofourchannels,eachchannelhavinga2S0-kHz
bandwidth.Eachdigitalchannel
ofIMbpsismodulatedsuchthateach4bitsismodulatedto
1Hz.Onesolutionis16-QAMmodulation.Figure6.8showsonepossibleconfiguration.
TheAnalogCarrierSystem
Tomaximizetheefficiency oftheirinfrastructure,telephonecompanieshavetradition­
allymultiplexedsignalsfromlower-bandwidthlinesontohigher-bandwidthlines.Inthis
way,manyswitchedorleasedlinescanbecombinedintofewerbutbiggerchannels.For
analoglines,FDMisused.

166 CHAPTER6BANDWIDTH UTILIZATION:MULTIPLEXING ANDSPREADING
Figure6.8Example6.3
IMbps 250kHz
Digital Analog
IMbps 250kHz
Digital Analog
IMHz
IMbps 250kHz
Digital Analog
IMbps 250kHz
Digital
Analog
OneofthesehierarchicalsystemsusedbyAT&Tismadeup ofgroups,super­
groups,mastergroups,andjumbogroups(seeFigure6.9).
Figure6.9Analoghierarchy
48kHz
12
voicechannels
Jumbo
group
16.984
MHz
3600voicechannels
§.-~F
~- ..-jD
!:l M
~-.....~
E
'.Q-.....~
en
g.----i~ FMastergroup
~ D
~----:l.~1 M
:=:
F
Dt------i~
M
Group
Inthisanaloghierarchy, 12voicechannelsaremultiplexedontoahigher-bandwidth
line
tocreateagroup.Agrouphas48kHz ofbandwidthandsupports 12voicechannels.
Atthenextlevel,uptofivegroupscanbemultiplexedtocreateacompositesignal
calleda
supergroup.Asupergrouphasabandwidth of240kHzandsupportsupto
60voicechannels.Supergroupscanbemadeup
ofeitherfivegroupsor60independent
voicechannels.
Atthenextlevel,10supergroupsaremultiplexedtocreatea
mastergroup.A
mastergroupmusthave2.40MHz
ofbandwidth,buttheneedforguard bandsbetween
thesupergroupsincreasesthenecessarybandwidthto2.52MHz.Mastergroupssupport
upto600voicechannels.
Finally,sixmastergroupscanbecombinedintoa
jumbogroup.Ajumbogroup
musthave15.12MHz(6x2.52MHz)butisaugmentedto16.984MHztoallowfor
guard bandsbetweenthemastergroups.

SECTION6.1MULTIPLEXING 167
OtherApplicationsofFDM
Averycommonapplication ofFDMisAMandFMradiobroadcasting.Radiousesthe
air
asthetransmissionmedium.Aspecialbandfrom530to1700kHz isassignedtoAM
radio.Allradiostationsneedtosharethisband. AsdiscussedinChapter
5,eachAMsta­
tionneeds
10kHzofbandwidth.Eachstationusesadifferentcarrierfrequency,which
meansit
isshiftingitssignalandmultiplexing.Thesignalthatgoestotheairisacombi­
nation
ofsignals.Areceiverreceives allthesesignals,butfilters(bytuning)onlytheone
whichisdesired.Withoutmultiplexing,onlyoneAMstationcouldbroadcasttothecom­
monlink,the
air.However,weneedtoknowthatthere isphysicalmultiplexerordemulti­
plexerhere.AswewillseeinChapter
12multiplexingisdone atthedatalinklayer.
Thesituation
issimilarinFMbroadcasting.However,FMhasawiderband of88
to108MHzbecauseeachstationneedsabandwidth of200kHz.
Anothercommonuse
ofFDMisintelevisionbroadcasting.EachTVchannelhas
itsownbandwidth
of6MHz.
Thefirstgenerationofcellulartelephones(stillinoperation)alsousesFDM.Each
user
isassignedtwo30-kHzchannels,oneforsendingvoiceandtheotherforreceiving.
Thevoicesignal,whichhasabandwidth
of3kHz(from300to3300Hz), ismodulatedby
using
FM.Rememberthat anFMsignalhasabandwidth 10timesthatofthemodulating
signal,whichmeanseachchannelhas30kHz(10x3)
ofbandwidth.Therefore,eachuser
isgiven,bythebasestation,a60-kHzbandwidth inarangeavailable atthetimeofthecall.
Example6.4
TheAdvancedMobilePhoneSystem (AMPS)usestwobands.Thefirstband of824to849MHz
isusedforsending,and869to894
MHzisusedforreceiving.Eachuserhasabandwidth of
30kHzineachdirection.The3-kHzvoiceismodulatedusingFM,creating30kHz ofmodulated
signal.Howmany peoplecanusetheircellularphonessimultaneously?
Solution
Eachbandis25MHz. Ifwedivide25MHzby30kHz,weget833.33. Inreality,thebandisdivided
into832channels.
Ofthese,42channelsareusedforcontrol,whichmeansonly790channelsare
availableforcellularphoneusers.
WediscussAMPSingreaterdetailinChapter 16.
Implementation
FDMcanbeimplementedveryeasily.Inmanycases,suchasradioandtelevision
broadcasting,there
isnoneedforaphysicalmultiplexerordemultiplexer.Aslong as
thestations agreetosendtheirbroadcaststotheairusingdifferentcarrierfrequencies,
multiplexing
isachieved.Inothercases,such asthecellulartelephonesystem,abase
stationneedstoassignacarrierfrequencytothetelephoneuser.Thereisnotenough
bandwidthinacelltopermanentlyassignabandwidthrangetoeverytelephoneuser.
Whenauserhangsup,herorhisbandwidth
isassignedtoanothercaller.
Wavelength-DivisionMultiplexing
Wavelength-divisionmultiplexing(WDM)isdesignedtousethehigh-data-rate
capability
offiber-opticcable.Theopticalfiberdatarateishigherthanthedatarate of
metallictransmissioncable.Usingafiber-opticcableforonesinglelinewastesthe
availablebandwidth. Multiplexingallowsustocombineseverallinesintoone.

168 CHAPTER6 BANDWIDTH UTILIZATION:MULTIPLEXING ANDSPREADING
WDMisconceptuallythesameasFDM,exceptthatthemultiplexinganddemulti­
plexinginvolveopticalsignalstransmittedthroughfiber-opticchannels.Theidea
isthe
same:
Wearecombiningdifferentsignals ofdifferentfrequencies.Thedifference is
thatthefrequenciesareveryhigh.
Figure6.10givesaconceptualview
ofaWDMmultiplexeranddemultiplexer.
Verynarrowbands
oflightfromdifferentsourcesarecombinedtomakeawiderband
oflight.Atthereceiver,thesignalsareseparatedbythedemultiplexer.
Figure6.10Wavelength-divisionmultiplexing
AI
fl f\.
AI
AZ
fl flflfl fl
Az
Ai+Az+A3
fl fl
A:J A:J
WDMisananalogmultiplexingtechniquetocombineopticalsignals.
AlthoughWDMtechnologyisverycomplex,thebasicideaisverysimple. We
wanttocombinemultiplelightsourcesintoonesinglelightatthemultiplexeranddo
thereverseatthedemultiplexer.Thecombiningandsplitting
oflightsourcesareeasily
handledbyaprism.Recallfrombasicphysicsthataprismbendsabeam
oflightbased
ontheangle
ofincidenceandthefrequency.Usingthistechnique,amultiplexercanbe
madetocombineseveralinputbeams
oflight,eachcontaininganarrowband offre­
quencies,intooneoutputbeam
ofawiderband offrequencies.Ademultiplexercan
alsobemadetoreversetheprocess.Figure6.11showstheconcept.
:Figure6.11 Prismsinwavelength-divisionmultiplexing anddemultiplexing
Multiplexer
Fiber-opticcable
Demultiplexer
OneapplicationofWDMistheSONETnetworkinwhichmultipleoptical
fiberlinesaremultiplexedanddemultiplexed.
WediscussSONETinChapter17.
Anewmethod,called
denseWDM(DWDM),canmultiplexaverylargenumber
ofchannelsbyspacingchannelsveryclosetooneanother.Itachievesevengreater
efficiency.

SECTION6.1MULTIPLEXING 169
SynchronousTime-DivisionMultiplexing
Time-divisionmultiplexing(TDM)isadigitalprocessthatallowsseveralconnections
tosharethehighbandwidth
ofa
linleInsteadofsharingaportion ofthebandwidthasin
FDM,timeisshared.
Eachconnectionoccupiesaportion oftimeinthelink.Figure6.12
givesaconceptualview
ofTDM.Notethatthesamelinkisusedas inFDM;here,how­
ever,thelinkisshownsectionedbytimeratherthanbyfrequency.
Inthefigure,portions
ofsignals1,2,3,and4occupythelinksequentially.
Figure6.12TDM
Dataflow
. D 2
E
J--..::--{§:~
l'4321M
U 3
Xt---~=~-~_
t--L-L-.l...--'--=.........-"'=..L...;;...J...-...l...-...l...-...J.........j
2
M ~,
U 4 3 2 1t'3
3 X
r=:~---l
NotethatinFigure6.12weareconcernedwithonlymultiplexing,notswitching.
Thismeansthatallthedatainamessagefromsource1alwaysgotoonespecificdesti­
nation,
beit1,2,3,or4. Thedeliveryisfixed andunvarying,unlikeswitching.
Wealsoneedtorememberthat
TDMis,inprinciple,adigitalmultiplexingtechnique.
Digitaldatafromdifferentsourcesarecombinedintoonetimesharedlink.However,this
doesnot
meanthatthesourcescannotproduceanalogdata;analogdatacan besampled,
changedtodigitaldata,andthenmultiplexed
byusingTDM.
TDMisadigitalmultiplexingtechniqueforcombining
severallow-ratechannelsintoonehigh-rateone.
Wecandivide
TDMintotwodifferentschemes:synchronousandstatistical.Wefirst
discuss
synchronousTDMandthenshowhow statisticalTDMdiffers.Insynchronous
TDM,eachinputconnectionhasanallotmentintheoutputeven ifitisnotsendingdata.
TimeSlots andFrames
InsynchronousTDM,thedataflow ofeachinputconnectionisdividedintounits,where
eachinputoccupiesoneinputtimeslot.Aunitcan
be1bit,onecharacter,oroneblock of
data.Eachinputunitbecomesoneoutputunitandoccupiesoneoutputtimeslot.How­
ever,theduration
ofanoutputtimeslotis ntimesshorterthantheduration ofaninput
timeslot.
Ifaninputtimeslotis Ts,theoutputtimeslotis Tins,wherenisthenumber
ofconnections.Inotherwords,aunitintheoutputconnectionhasashorterduration;it
travelsfaster.Figure6.13showsanexample
ofsynchronousTDMwherenis3.

170 CHAPTER6BANDWIDTH UTILIZATION:MULTIPLEXING ANDSPREADING
Figure6.13 Synchronoustime-divisionmultiplexing
Dataaretakenfromeach
lineeveryT s.
Eachframeis3timeslots.
Eachtimeslotdurationis
Tf3s.
Bl
T
Al
Cl
Jil
A2
B2
T
C2
Jlf
T
C3
A3
B3
If
InsynchronousTDM,around ofdataunitsfromeachinputconnectioniscollected
intoaframe(wewillseethereasonforthisshortly).
Ifwehavenconnections,aframe
isdividedinto
ntimeslotsandoneslotisallocatedforeachunit,oneforeachinput
line.
Ifthedurationoftheinputunit isT,thedurationofeachslotis Tinandthedura­
tion
ofeachframeis T(unlessaframecarriessomeotherinformation, aswewillsee
shortly).
Thedatarate
oftheoutputlinkmustbe ntimesthedatarate ofaconnectionto
guaranteethe
flowofdata.InFigure6.13,thedatarate ofthelinkis3timesthedata
rate
ofaconnection;likewise,theduration ofaunitonaconnectionis3timesthat of
thetimeslot(duration ofaunitonthelink).Inthefigurewerepresentthedatapriorto
multiplexingas3timesthesize
ofthedataaftermultiplexing.Thisisjusttoconveythe
ideathateachunitis3timeslongerindurationbeforemultiplexingthanafter.
InsynchronousTDM,the datarateofthelinkis ntimesfaster,
andtheunitdurationis
ntimesshorter.
Timeslotsaregroupedintoframes.Aframeconsists ofonecompletecycle of
timeslots,withone slotdedicatedtoeachsendingdevice.Inasystemwith ninput
lines,eachframehas
nslots,witheachslotallocatedtocarryingdatafromaspecific
inputline.
Example6.5
InFigure6.13,thedatarateforeachinputconnectionis3kbps. If1bitatatimeismultiplexed(a
unitis1bit),whatistheduration
of(a)eachinputslot,(b)eachoutputslot,and(c)eachframe?
Solution
Wecananswerthequestions asfollows:
a.Thedatarate ofeachinputconnection is1kbps.Thismeansthatthebitduration is111000s
or1ms.Theduration
oftheinputtimeslotis1 ms(sameasbitduration).
b.Thedurationofeachoutputtimeslotisone-thirdoftheinputtimeslot.Thismeansthatthe
durationoftheoutputtimeslotis1/3ms.
c.Eachframecarriesthreeoutputtimeslots.Sotheduration ofaframeis3 x113ms,or1ms.
Theduration
ofaframeisthesame asthedurationofaninputunit.

SECTION6.1MULTIPLEXING 171
Example6.6
Figure6.14showssynchronousTOMwithadatastreamforeachinputandonedatastreamfor
theoutput.Theunit
ofdatais1bit.Find(a)theinputbitduration,(b)theoutputbitduration,
(c)theoutputbitrate,and(d)theoutputframerate.
Figure6.14Example6.6
IMbps
•••1
1Mbps
•••00 0 0
1Mbps
•••10 0
1Mbps
•••00 0
o
o
Frames
•••
ffilQI!][Q]QJQliJ1III[Q[QJQli]"
Solution
Wecananswerthequestions asfollows:
a.Theinputbitdurationistheinverse ofthebitrate: 1/1Mbps=1lls.
b.Theoutputbitdurationisone-fourthoftheinputbitduration,or1/411s.
c.Theoutputbitrate istheinverseoftheoutputbitdurationor 1/4lls,or4Mbps.Thiscanalso
bededucedfromthefactthattheoutputrate
is4timesasfastasanyinputrate;sotheoutput
rate
=4 x 1Mbps =4Mbps.
d.Theframerateisalwaysthesameasanyinputrate.Sotheframerate is1,000,000framesper
second.Becausewearesending4bits
ineachframe,wecanverifytheresult oftheprevious
questionbymultiplyingtheframeratebythenumberofbitsperframe.
Example6.7
Fourl-kbpsconnectionsaremultiplexedtogether.AunitisIbit.Find(a)theduration ofIbit
beforemultiplexing,(b)thetransmissionrate
ofthelink,(c)theduration ofatimeslot,and
(d)theduration
ofaframe.
Solution
Wecananswerthequestionsasfollows:
a.Thedurationof1bitbeforemultiplexing is1/1kbps,or0.001s (lms).
b.Therateofthelinkis4timestherate ofaconnection,or4kbps.
c.Thedurationofeachtimeslotisone-fourthoftheduration ofeachbitbeforemultiplexing,
or
1/4msor250
I.ls.Notethatwecanalsocalculatethisfromthedatarate ofthelink,4kbps.
Thebitdurationistheinverseofthedatarate,or1/4kbpsor250I.ls.
d.Thedurationofaframe isalwaysthesame asthedurationofaunitbeforemultiplexing,or
I
ms.Wecanalsocalculatethis inanotherway.Eachframeinthiscasehas
fouftimeslots.
Sothedurationofaframeis4times250I.ls,orIms.
Interleaving
TDMcanbevisualizedastwofast-rotatingswitches,oneonthemultiplexingsideand
theotheronthedemultiplexingside.Theswitchesaresynchronizedandrotateatthe
samespeed,butinoppositedirections.Onthemultiplexingside,astheswitchopens

172 CHAPTER6BANDWIDTHUTILIZATION:MULTIPLEXING ANDSPREADING
infrontofaconnection,thatconnectionhastheopportunitytosendaunitontothe
path.Thisprocessiscalled
interleaving.Onthedemultiplexingside,astheswitch
opensinfront
ofaconnection,thatconnectionhastheopportunitytoreceiveaunit
fromthepath.
Figure6.15showstheinterleavingprocessfortheconnectionshowninFigure6.13.
Inthisfigure,weassumethatnoswitchingisinvolvedandthatthedatafromthefirst
connectionatthemultiplexersitegotothefirstconnectionatthedemultiplexer.We
discussswitchinginChapter
8.
Figure6.15 Interleaving
A3 A2 Al
c=J[==:Jc::::::J
B3 B2 Bl
~~~
C3 C2 CI
c=:::J[==:Jc::::::J
r - - - - - - - - - -Synchronization- - - - - - - - -,
I
I
I
I
I
A3 A2 Al
[==:J[==:Jc:::J
B3 B2 Bl
~~~
C3 C2 Cl
c:::Jr:::::Jc=:::J
Example6.8
FourchannelsaremultiplexedusingTDM. Ifeachchannelsends100byte sisandwemultiplex
1byteperchannel,showtheframetravelingonthe
link,thesizeoftheframe,thedurationofa
frame,theframerate,andthebitrateforthelink.
Solution
ThemultiplexerisshowninFigure6.16.Eachframecarries1bytefromeachchannel;thesize of
eachframe,therefore, is4bytes,or32bits.Becauseeachchannel issending100bytes/sanda
framecarries1bytefromeachchannel,theframeratemustbe100framespersecond.Thedura­
tion
ofaframeistherefore 11100s.Thelinkiscarrying100framespersecond,andsinceeach
framecontains32bits,thebitrateis100x32,or3200bps.This
isactually4timesthebitrate of
eachchannel,which is100x 8=800bps.
Figure6.16 Example 6.8
-
100bytes/s
Frame4bytes Frame4bytes
32bits 32bits
II 1,*"tiJ'I...II g~ II
100frames/s
3200bps
Frameduration==160s

SECTION6.1MULTIPLEXING 173
Example6.9
Amultiplexercombinesfour100-kbpschannelsusingatimeslot of2bits.Showtheoutputwith
fourarbitraryinputs.Whatistheframerate?Whatistheframeduration?What
isthebitrate?
What
isthebitduration?
Solution
Figure6.17showstheoutputforfourarbitraryinputs.Thelinkcarries50,000framespersecond
sinceeachframecontains2bitsperchannel.Theframedurationistherefore1/50,000sor20
~s.
Theframerate is50,000framespersecond,andeachframecarries8bits;thebitrate is50,000x
8=400,000bitsor400kbps.Thebitduration is1/400,000s,or2.5IJ.s.Notethattheframedura­
tion
is8timesthebitdurationbecauseeachframeiscarrying8bits.
Figure6.17 Example6.9
·..110010
100kbps
...001010
100kbps
·..101101
100kbps
·..000111
100kbps
Frameduration
=lI50,000s =20
Ils
Frame:8bitsFrame:8bitsFrame:8bits
...~~~
50,000frames/s
400kbps
EmptySlots
SynchronousTDM isnotasefficient asitcouldbe. Ifasourcedoesnothavedatato
send,thecorrespondingslotintheoutputframe
isempty.Figure6.18showsacasein
whichoneoftheinputlineshasnodatatosendandoneslotinanotherinputlinehas
discontinuousdata.
Figure6.18Emptyslots
II
II
I~0110 DII~ 01
Thefirstoutputframehasthreeslotsfilled,thesecondframehastwoslotsfilled,
andthethirdframehasthreeslotsfilled.Noframeisfull.
Welearninthenextsection
thatstatisticalTDMcanimprovetheefficiencybyremovingtheemptyslotsfromthe
frame.
DataRateManagement
OneproblemwithTDMishowtohandleadisparityintheinputdatarates.Inallour
discussionso
far,weassumedthatthedataratesofallinputlineswerethesame.However,

174 CHAPTER6BANDWIDTHUTILIZATION:MULTIPLEXING ANDSPREADING
ifdataratesarenotthesame,threestrategies,oracombination ofthem,canbeused.
Wecallthesethreestrategiesmultilevel multiplexing,multiple-slotallocation,and
pulsestuffing.
MultilevelMultiplexingMultilevelmultiplexingisatechniqueusedwhenthedata
rate
ofaninputlineisamultiple ofothers.Forexample,inFigure6.19,wehavetwo
inputs
of20kbpsandthreeinputs of40kbps.Thefirsttwoinputlinescanbemulti­
plexedtogethertoprovideadatarateequaltothelastthree.Asecondlevel
ofmulti­
plexingcancreateanoutput
of160kbps.
Figure6.19
Multilevelmultiplexing
20
kbps----;"\
>------t
20kbps----I
40kbps--------1
40kbps--------1
40kbps--------1
160kbps
Multiple-SlotAllocationSometimesitismoreefficienttoallotmorethanoneslotin
aframe
toasingleinputline.Forexample,wemighthaveaninputlinethathasadata
ratethatisamultipleofanotherinput.InFigure6.20,theinputlinewitha
SO-kbpsdata
ratecanbegiventwoslotsintheoutput.
Weinsertaserial-to-parallelconverter inthe
linetomaketwoinputsout
ofone.
Figure6.20
Multiple-slotmultiplexing
50kbps
25kbps
-------1
25kbps-------1
25kbps
-------1/
Theinputwith a
50-kHzdataratehastwo
slotsineachframe.
PulseStuffingSometimesthebitrates ofsourcesarenotmultipleintegers ofeach
other.Therefore,neither
ofthe abovetwotechniquescanbeapplied.Onesolution isto
makethehighestinputdataratethedominantdatarateandthenadddummybitstothe
inputlineswithlowerrates.Thiswillincreasetheirrates.Thistechnique
iscalledpulse
stuffing,bitpadding,orbitstuffing.TheideaisshowninFigure6.21.Theinputwitha
datarate
of46ispulse-stuffedtoincreasetherateto50kbps.Nowmultiplexingcan
takeplace.

SECTION6.1MULTIPLEXING 175
Figure6.21Pulsestuffing
50kbps----------1
50kbps----------1
46kbps---I
150kbps
FrameSynchronizing
TheimplementationofTDM isnotassimple asthatofFDM.Synchronizationbetween
themultiplexeranddemultiplexer
isamajorissue.If the.multiplexerandthedemulti­
plexerarenotsynchronized,abitbelongingtoonechannelmaybe receivedbythe
wrongchannel.Forthisreason,one
ormoresynchronizationbitsareusuallyadded to
thebeginningofeachframe.Thesebits,called framingbits,followapattern,frameto
frame,thatallowsthedemultiplexer
tosynchronizewiththeincomingstreamsothatit
canseparatethetimeslotsaccurately.Inmostcases,thissynchronizationinformation
consists
of1bitperframe,alternatingbetween0andI,asshowninFigure6.22.
Figure6.22Framingbits
I
1 0 1ISynchronization
pattern
Frame3 Frame2 Frame1
C3
IB3IA3 182IA2 CII I Al
.:11II:0
0
I I I
:0:11I:0
I
I
Example6.10
Wehavefoursources,eachcreating250characters persecond.Iftheinterleavedunitisacharacter
and1synchronizingbitisaddedtoeachframe,find(a)thedatarate
ofeachsource,(b)theduration
ofeachcharacterineachsource,(c)theframerate,(d)theduration ofeachframe,(e)thenumber of
bitsineachframe,and (f)thedatarate ofthelink.
Solution
Wecananswerthequestionsasfollows:
a.Thedatarateofeachsourceis250 x8=2000bps =2kbps.
b.Eachsourcesends250characters persecond;therefore,theduration ofacharacteris1/250s,
or4ms.
c.Eachframehasonecharacterfromeachsource,whichmeansthelinkneedstosend
250frames
persecondtokeepthetransmissionrate ofeachsource.
d.
Thedurationofeachframeis 11250s,or4ms.Notethattheduration ofeachframeisthe
sameastheduration
ofeachcharactercomingfrom eachsource.
e.Eachframecarries4charactersandIextrasynchronizingbit.Thismeansthateachframeis
4 x 8
+1=33bits.

176 CHAPTER 6BANDWIDTHUTILIZATION:MULTIPLEXING ANDSPREADING
f.Thelinksends250framespersecond,andeachframecontains 33bits.Thismeansthatthe
datarate
ofthelinkis250x33,or8250bps.Notethatthebitrate ofthelinkisgreaterthan
thecombinedbitrates
ofthefourchannels. Ifweaddthebitrates offourchannels,weget
8000bps.Because250framesaretravelingpersecondandeachcontains1extrabitfor
synchronizing,
weneedtoadd250 tothesum toget8250bps.
Example6.11
Twochannels,onewithabitrateof100kbpsandanotherwithabitrate of200kbps,aretobe
multiplexed.Howthiscanbeachieved?Whatistheframerate?Whatistheframeduration?
What
isthebitrateofthelink?
Solution
Wecanallocateoneslottothefirstchannelandtwoslotstothesecondchannel.Eachframecar­
ries3bits.Theframerateis100,000framespersecondbecauseitcarries1bitfromthefirst
channel.Theframe durationis1/100,000
s,or10ms.Thebitrate is100,000frames/sx 3bitsper
frame,or300kbps.Notethatbecauseeachframecarries1bitfromthefirstchannel,thebitrate
forthefirstchannel
ispreserved.Thebitrateforthesecondchannelisalsopreservedbecause
eachframecarries2bitsfromthesecondchannel.
DigitalSignalService
TelephonecompaniesimplementTDMthroughahierarchy ofdigitalsignals,called
digitalsignal (DS)serviceordigitalhierarchy. Figure6.23showsthedataratessup­
portedbyeachlevel.
Figure6.23 Digitalhierarchy
OS-4

274.176Mbps
60S-3
OS-3
T
D
M
--+-\
6.312Mbps
405-1
T
D:---......~
--~M
OS-2
T
D
M
1.544Mbps
24DS-O
OS-1
os-o
oADS-Oserviceisasingledigitalchannel of64kbps.
ODS-Iisa1.544-Mbpsservice;1.544Mbpsis24times64kbpsplus8kbps of
overhead.Itcanbeused asasingleservicefor1.544-Mbpstransmissions,oritcan
beused
tomultiplex24 DS-Ochannelsortocarryanyothercombinationdesired
bytheuserthatcanfitwithinits1.544-Mbpscapacity.
oDS-2isa6.312-Mbpsservice;6.312Mbpsis96times64kbpsplus168kbps of
overhead.Itcanbeused asasingleservicefor6.312-Mbpstransmissions;oritcan

SECTION6.1MULTIPLEXING 177
beusedtomultiplex4 DS-lchannels,96 DS-Ochannels,oracombination ofthese
servicetypes.
oDS-3isa44.376-Mbpsservice;44.376 Mbps is672times64kbpsplus1.368Mbps
ofoverhead.Itcanbeusedasasingleservicefor44.376-Mbpstransmissions;orit
canbeusedtomultiplex7DS-2channels,28
DS-lchannels,672 DS-Ochannels,
oracombination
oftheseservicetypes.
oDS-4isa274.176-Mbpsservice;274.176is4032times64kbpsplus16.128Mbps of
overhead.Itcanbeused tomultiplex6DS-3channels,42DS-2channels, 168DS-l
channels,4032
DS-Ochannels,oracombination oftheseservicetypes.
TLines
DS-O,DS-l,andsoonarethenames ofservices.Toimplementthoseservices,thetele­
phonecompaniesuse
Tlines(T-ltoT-4).Thesearelineswithcapacitiesprecisely
matchedtothedatarates
oftheDS-ltoDS-4services(seeTable6.1).SofaronlyT-l
and
T-3linesarecommerciallyavailable.
Table6.1 DSandTlinerates
Sen/ice Line Rate(Mbps) VoiceChannels
DS-1 T-1 1.544 24
DS-2 T-2 6.312 96
DS-3
T-3 44.736 672
DS-4 T-4 274.176 4032
TheT-llineisusedtoimplement DS-l;T-2isusedtoimplementDS-2;andsoon.
AsyoucanseefromTable6.1,
DS-Oisnotactuallyofferedasaservice,butithasbeen
defined
asabasisforreferencepurposes.
TLinesforAnalogTransmission
Tlinesaredigitallinesdesignedforthetransmission ofdigitaldata,audio,orvideo.
However,theyalsocanbeusedforanalogtransmission(regulartelephoneconnec­
tions),providedtheanalogsignalsarefirstsampled,thentime-divisionmultiplexed.
Thepossibility
ofusingTlines asanalogcarriersopenedupanewgeneration of
servicesforthetelephonecompanies.Earlier,whenanorganizationwanted 24separate
telephonelines,itneededtorun
24twisted-paircablesfromthecompanytothecentral
exchange.(Rememberthoseoldmoviesshowingabusyexecutivewith
10telephones
lineduponhisdesk?Ortheoldofficetelephoneswithabigfatcablerunningfrom
them?Thosecablescontainedabundleofseparatelines.)Today,thatsameorganization
cancombinethe24linesintooneT-llineandrunonlytheT-llinetotheexchange.
Figure6.24showshow24voicechannelscanbemultiplexedontooneT-Iline.(Refer
toChapter5forPCMencoding.)
TheT-1FrameAsnotedabove,DS-lrequires8kbps ofoverhead.Tounderstandhow
thisoverhead
iscalculated,wemustexaminetheformat ofa24-voice-channelframe.
TheframeusedonaT-llineisusually
193bitsdividedinto24slots of8bitseach
plus1extrabitforsynchronization(24x 8
+1=193);seeFigure6.25.Inotherwords,

178 CHAPTER 6BANDWIDTHUTILIZATION:MULTIPLEXING ANDSPREADING
Figure6.24 T-llineformultiplexingtelephonelines
Samplingat8000sampJes/s
Llsing8bitspersample
t
I)
M
T-Iline1.544Mbps
24x64kbps +8kbpsoverhead
Figure6.25T-lframestructure
Samplen
I
1frame=193bits
IChannelI···1ChannelIIChannelI
24 2 I
1bit8bits 8bits 8bits
Frame
I
FrameIIFrame... ...
n 2 1
T-I:8000frames/s= 8000x193bps=1.544Mbps
eachslotcontainsonesignalsegmentfromeachchannel;24segmentsareinterleaved
inoneframe.
IfaT-llinecarries8000frames,thedatarateis1.544Mbps(193x8000 =
1.544Mbps)-thecapacityoftheline.
ELines
Europeansuseaversion ofTlinescalledElines.Thetwosystemsareconceptuallyiden­
tical,buttheircapacitiesdiffer.Table6.2showstheElinesandtheircapacities.

SECTION6.1MULTIPLEXING 179
Table6.2 Elinerates
Line Rate(Mbps) VoiceChannels
E-1 2.048 30
E-2 8.448 120
E-3 34.368 480
E-4 139.264 1920
MoreSynchronous TDMApplications
Somesecond-generationcellulartelephonecompaniesusesynchronousTDM. For
example,thedigitalversion ofcellulartelephonydividestheavailablebandwidthinto
3D-kHzbands.Foreachband,TDMisappliedsothatsixuserscansharetheband.This
meansthateach3D-kHzbandisnowmade
ofsixtimeslots,andthedigitizedvoicesig­
nals
oftheusersareinsertedintheslots.UsingTDM,thenumber oftelephoneusersin
eachareaisnow6timesgreater.
Wediscusssecond-generationcellulartelephonyin
Chapter16.
StatisticalTime-DivisionMultiplexing
Aswesawintheprevioussection,insynchronousTDM,eachinputhasareservedslot
intheoutputframe.Thiscanbeinefficient
ifsomeinputlineshavenodata tosend.In
statisticaltime-divisionmultiplexing,slotsaredynamicallyallocatedtoimproveband­
widthefficiency.Onlywhenaninputlinehasaslot'sworth
ofdatatosendisitgivena
slotintheoutputframe.Instatisticalmultiplexing,thenumber
ofslotsineachframeis
lessthanthenumber
ofinputlines.Themultiplexercheckseachinput lineinround­
robinfashion;itallocatesaslotforaninputline
ifthelinehasdatatosend;otherwise,
itskipsthelineandchecksthenextline.
Figure6.26showsasynchronousandastatistical
TDMexample.Intheformer,
someslotsareemptybecausethecorrespondinglinedoesnothavedatatosend.In
thelatter,however,noslotisleftemptyaslongasthereare
datatobesentbyany
inputline.
Addressing
Figure6.26alsoshowsamajordifferencebetweenslotsinsynchronous TDMand
statisticalTDM.Anoutputslotinsynchronous
TDMistotallyoccupiedbydata;in
statisticalTDM,aslotneedstocarrydataaswellastheaddress
ofthedestination.
InsynchronousTDM,thereisnoneedfor addressing;synchronizationandpreassigned
relationshipsbetweentheinputsandoutputsserveasanaddress.Weknow,forexam­
ple,thatinput1alwaysgoestoinput2.
Ifthemultiplexerandthedemultiplexerare
synchronized,thisisguaranteed.Instatisticalmultiplexing,thereisnofixedrelation­
ship
betweentheinputsandoutputs becausethereareno preassignedorreserved
slots.Weneedtoincludetheaddress
ofthereceiverinsideeachslottoshowwhereit
istobedelivered.Theaddressinginitssimplestformcan
benbitstodefine Ndifferent
outputlineswith
n=10g2N.Forexample,foreightdifferentoutputlines,weneeda
3-bitaddress.

180 CHAPTER 6BANDWIDTHUTILIZATION:MULTIPLEXING ANDSPREADING
Figure6.26TDMslotcomparison
LineA----[:3:0
LineB
LineC--------{
Line0--i.iI~=~
LineE
a.SynchronousTDM
LineA-----[=:ACH
LineB
LineC--------i
Line0---:~~
LineE--I
b.StatisticalTDM
SlotSize
SinceaslotcarriesbothdataandanaddressinstatisticalTDM,theratio ofthedatasize
toaddresssize
mustbereasonabletomaketransmissionefficient. Forexample,it
wouldbeinefficienttosend1bitperslotasdatawhentheaddressis3bits.Thiswould
meananoverhead
of300percent.InstatisticalTDM,ablock ofdataisusuallymany
byteswhiletheaddressisjustafewbytes.
NoSynchronizationBit
ThereisanotherdifferencebetweensynchronousandstatisticalTDM,butthistimeit is
attheframelevel.TheframesinstatisticalTDMneednotbesynchronized,sowedonot
needsynchronizationbits.
Bandwidth
InstatisticalTDM,thecapacity ofthelinkisnormallylessthanthesum ofthecapaci­
ties
ofeachchannel.Thedesigners ofstatisticalTDMdefinethecapacity ofthelink
basedonthestatistics
oftheloadforeachchannel. Ifonaverageonly xpercentofthe
inputslotsarefilled,thecapacity
ofthelinkreflectsthis. Ofcourse,duringpeaktimes,
someslotsneed
towait.
6.2SPREADSPECTRUM
Multiplexingcombinessignalsfromseveralsourcestoachievebandwidthefficiency;the
availablebandwidth
ofalinkisdividedbetweenthesources. Inspreadspectrum(88),we
alsocombinesignalsfromdifferentsources
tofitintoalargerbandwidth,butourgoals

SECTION6.2SPREADSPECTRUM 181
aresomewhatdifferent.Spreadspectrumisdesigned tobeusedinwirelessapplications
(LANsandWANs).Inthesetypesofapplications,wehavesomeconcernsthatoutweigh
bandwidthefficiency.Inwirelessapplications,allstationsuseair(oravacuum)asthe
mediumforcommunication.Stationsmustbeabletosharethismediumwithoutintercep­
tionbyaneavesdropperandwithoutbeingsubject
tojammingfromamaliciousintruder
(inmilitaryoperations,forexample).
Toachievethesegoals,spreadspectrumtechniquesaddredundancy;theyspread
theoriginalspectrumneededforeachstation.
Iftherequiredbandwidthforeachstation
is
B,spreadspectrumexpandsit toB
ss
'suchthatB
ss»B.Theexpandedbandwidth
allowsthesourcetowrapitsmessageinaprotectiveenvelopeforamore securetrans­
mission.Ananalogyisthesending
ofadelicate,expensivegift. Wecaninsertthegiftin
aspecialboxtopreventitfrombeingdamagedduringtransportation,andwecanusea
superiordeliveryservicetoguaranteethesafety
ofthepackage.
Figure6.27showstheidea
ofspreadspectrum.Spreadspectrumachievesitsgoals
throughtwoprinciples:
1.Thebandwidthallocated toeachstationneedstobe,byfar,largerthanwhatis
needed.Thisallowsredundancy.
2.Theexpandingoftheoriginalbandwidth BtothebandwidthB ssmustbedonebya
processthatisindependent
oftheoriginalsignal.Inotherwords,thespreading
processoccursafterthesignaliscreatedbythesource.
Figure6.27Spreadspectrum
B
SS
I'
>I
Spreading
process
i
Spreading
code
Afterthesignaliscreatedbythesource,thespreadingprocessusesaspreading
codeandspreadsthebandwidth.Thefigureshowstheoriginalbandwidth
Bandthe
spreadedbandwidth
Bss.Thespreadingcode isaseriesofnumbersthatlookrandom,
butareactuallyapattern.
Therearetwotechniquestospreadthebandwidth:frequencyhoppingspreadspec­
trum(FHSS)anddirectsequencespreadspectrum(DSSS).
FrequencyHopping SpreadSpectrum(FHSS)
Thefrequencyhoppingspreadspectrum(FHSS)techniqueuses Mdifferentcarrier
frequenciesthataremodulatedbythesourcesignal.Atonemoment,thesignalmodu­
latesonecarrierfrequency;atthenextmoment,thesignalmodulatesanothercarrier

182 CHAPTER 6BANDWIDTHUTILIZATION:MULTIPLEXING ANDSPREADING
frequency.Althoughthemodulationisdoneusingonecarrierfrequencyatatime,
Mfrequenciesareusedinthelongrun.Thebandwidthoccupiedbyasourceafter
spreading
isB
pHSS»B.
Figure6.28showsthegenerallayoutforFHSS.A pseudorandomcodegenerator,
called
pseudorandomnoise(PN),createsak-bitpatternforevery hoppingperiodT
h

Thefrequencytableusesthepatterntofindthefrequency tobeusedforthishopping
periodandpassesittothefrequencysynthesizer.Thefrequencysynthesizercreatesa
carriersignal
ofthatfrequency,andthesourcesignalmodulatesthecarriersignal.
Figure6.28
Frequencyhoppingspreadspectrum(FHSS)
Modulator
t-
--lt-~Spread
signal
Original--I----------'l~
signal
Frequencytable
Supposewehavedecidedtohaveeighthoppingfrequencies.Thisisextremelylow
forrealapplicationsandisjustforillustration.
Inthiscase,Mis8andkis 3.Thepseudo­
randomcodegeneratorwillcreateeightdifferent3-bitpatterns.Thesearemappedto
eightdifferentfrequenciesinthefrequencytable(seeFigure6.29).
Figure6.29
FrequencyselectioninFHSS
First-hopfrequency
t
k-bitFrequency
k-bilpatterns
000200kHz
001 300kHz
1
101111001000010 110011100I
010 400kHz
011 500kHz
I Firstselection
100600kHz
101700kHz--
UQ 800kHz
III900kHz
Frequencytable

SECTION6.2SPREADSPECTRUM 183
Thepatternforthisstation is101,111,001, 000,010, all,100.Notethatthepat­
ternispseudorandomitisrepeatedaftereighthoppings.Thismeansthatathopping
period
1,thepatternis101.Thefrequencyselectedis700kHz;thesourcesignalmod­
ulatesthiscarrierfrequency.Thesecondk-bitpatternselectedis111,whichselectsthe
900-kHzcarrier;theeighthpatternis100,thefrequency
is600kHz.Aftereighthop­
pings,thepatternrepeats,startingfrom
101again.Figure6.30showshowthesignalhops
aroundfromcarriertocarrier.
Weassumetherequiredbandwidth oftheoriginalsignal
is100kHz.
Figure6.30FHSScycles
Carrier
frequencies
(kHz) ••..
Cycle1
D
cP
Cycle2
D
••
900
800
700
600
500
400
300
200
1 2 3 4 5 6 7 8 9 10111213 14l516 Hop
periods
Itcanbeshownthatthisschemecanaccomplishthepreviouslymentionedgoals.
Iftherearemanyk-bitpatternsandthehoppingperiodisshort,asenderandreceiver
canhaveprivacy.
Ifanintrudertriestointerceptthetransmittedsignal,shecanonly
accessasmallpiece
ofdatabecauseshedoesnotknowthespreadingsequenceto
quicklyadaptherselftothenexthop.Theschemehasalso
anantijammingeffect.A
malicioussendermaybeabletosendnoiseto
jamthesignalforonehoppingperiod
(randomly),butnotforthewholeperiod.
BandwidthSharing
Ifthenumberofhoppingfrequencies isM,wecanmultiplex Mchannelsintoonebyusing
thesameB
ss
bandwidth.This ispossiblebecauseastationusesjustonefrequencyineach
hoppingperiod;
M-1otherfrequenciescanbeusedbyother M-1stations.Inother
words,
MdifferentstationscanusethesameB
ssifanappropriatemodulationtechnique
such
asmultipleFSK(MFSK)isused.FHSSissimilartoFDM, asshowninFigure6.31.
Figure6.31showsanexample
offourchannelsusingFDMandfourchannels
usingFHSS.InFDM,eachstationuses
11Mofthebandwidth,buttheallocationis
fixed;inFHSS,eachstationuses
11Mofthebandwidth,buttheallocationchangeshop
tohop.

184 CHAPTER 6BANDWIDTHUTILIZATION:MULTIPLEXING ANDSPREADING
Figure6.31Bandwidthsharing
Frequency
a.FDM
Frequency
14
h
f1
Time Time
b.FHSS
DirectSequence SpreadSpectrum
Thedirectsequencespreadspectrum(nSSS)techniquealsoexpandsthebandwidth
oftheoriginalsignal,buttheprocessisdifferent.InDSSS,wereplaceeachdatabit
with11bitsusingaspreadingcode.Inotherwords,eachbitisassignedacodeof11bits,
calledchips,wherethechiprateis11timesthat ofthedatabit.Figure6.32showsthe
concept
ofDSSS.
Figure6.32DSSS
Modulator
Original
-+-------+i
signal
r--------ll-~ Spread
signal
Asanexample,letusconsiderthesequenceusedinawirelessLAN,thefamous
Barkersequencewhere
11is11.Weassumethattheoriginalsignalandthechipsinthe
chipgeneratorusepolarNRZencoding.Figure6.33showsthechipsandtheresult
of
multiplyingtheoriginaldatabythechipstogetthespreadsignal.
InFigure6.33,thespreadingcodeis
11chipshavingthepattern10110111000(in
thiscase).
Iftheoriginalsignalrateis N,therateofthespreadsignalis lIN.This
meansthattherequiredbandwidthforthespreadsignalis
11timeslargerthanthe
bandwidth
oftheoriginalsignal.Thespreadsignalcanprovideprivacy iftheintruder
doesnotknowthecode.
Itcanalsoprovideimmunityagainstinterference ifeachsta­
tionusesadifferentcode.

SECTION6.4KEYTERMS 185
Figure6.33DSSSexample
Original1--_
signal
Spreading1---+--+--1-+--1--­
code
Spreadf----t-+-+-i--+--­
signal
BandwidthSharing
CanweshareabandwidthinDSSS aswedidinFHSS?Theanswerisnoandyes. Ifwe
useaspreadingcodethatspreadssignals(fromdifferentstations)thatcannotbecombined
andseparated,wecannotshareabandwidth.Forexample,aswewillseeinChapter
14,
somewirelessLANsuseDSSS andthespreadbandwidthcannotbeshared.However, if
weuseaspecialtype ofsequencecodethatallowsthecombiningandseparatingofspread
signals,wecansharethebandwidth.AswewillseeinChapter
16,aspecialspreadingcode
allows
ustouseDSSSincellulartelephonyandshareabandwidthbetweenseveralusers.
6.3RECOMMENDED READING
Formoredetailsaboutsubjectsdiscussedinthischapter,werecommendthefollowing
books.Theitemsinbrackets[
...]refertothereferencelistattheend ofthetext.
Books
,'-
MultiplexingiselegantlydiscussedinChapters 19of[Pea92].[CouOI]givesexcellent
coverage
ofTDMand FDMinSections3.9to3.11.Moreadvancedmaterialscanbe
foundin[Ber96].MultiplexingisdiscussedinChapter8
of[Sta04].Agoodcoverage of
spreadspectrumcanbefoundinSection5.13 of[CouOl]andChapter9 of[Sta04].
6.4KEYTERMS
analoghierarchy
Barkersequence
channel
chip
demultiplexer(DEMUX)
dense
WDM(DWDM)
digitalsignal(DS)service
directsequencespreadspectrum(DSSS)
Eline
framingbit
frequencyhoppingspreadspectrum
(FSSS)

186 CHAPTER 6BANDWIDTHUTILIZATION:MULTIPLEXING ANDSPREADING
frequency-divisionmultiplexing(FDM)
group
guardband
hoppingperiod
interleaving
jumbogroup
link
mastergroup
multilevelmultiplexing
multiple-slotmultiplexing
multiplexer(MUX)
6.5SUMMARY
multiplexing
pseudorandomcodegenerator
pseudorandomnoise(PN)
pulsestuffing
spreadspectrum(SS)
statisticalTDM
supergroup
synchronousTDM
Tline
time-divisionmultiplexing(TDM)
wavelength-divisionmultiplexing(WDM)
oBandwidthutilizationistheuse ofavailablebandwidthtoachievespecificgoals.
Efficiencycanbeachievedbyusingmultiplexing;privacyandantijammingcanbe
achievedbyusingspreading.
oMultiplexingistheset oftechniquesthatallows thesimultaneoustransmission of
multiplesignalsacrossasingledatalink.Inamultiplexedsystem,nlinessharethe
bandwidth
ofonelink.Thewordlinkreferstothephysicalpath.Thewordchannel
referstotheportion
ofalinkthatcarriesatransmission.
oTherearethreebasicmultiplexingtechniques:frequency-divisionmultiplexing,
wavelength-divisionmultiplexing,andtime-divisionmultiplexing.Thefirsttwoare
techniquesdesignedforanalogsignals,thethird,fordigitalsignals
oFrequency-divisionmultiplexing(FDM)isananalogtechniquethatcanbeapplied
whenthebandwidth
ofalink(inhertz) isgreaterthanthecombinedbandwidths of
thesignalstobetransmitted.
oWavelength-divisionmultiplexing(WDM) isdesignedtousethehighbandwidth
capability
offiber-opticcable.WDMisananalogmultiplexingtechniquetocom­
bineopticalsignals.
oTime-divisionmultiplexing(TDM) isadigitalprocessthatallowsseveralconnec­
tionstosharethehighbandwidth
ofalink.TDMisadigitalmultiplexingtechnique
forcombiningseverallow-ratechannelsintoonehigh-rateone.
oWecandivideTDMintotwodifferentschemes:synchronousorstatistical.Insyn­
chronousTDM,eachinputconnectionhasanallotmentintheoutputeven
ifitis
notsendingdata.InstatisticalTDM,slotsaredynamicallyallocatedtoimprove
bandwidthefficiency.
oInspreadspectrum(SS),wecombinesignalsfromdifferentsourcesto fitintoa
largerbandwidth.Spreadspectrumisdesignedtobeusedinwirelessapplications
inwhichstationsmustbeabletosharethemediumwithoutinterceptionbyan
eavesdropperandwithoutbeingsubjecttojammingfromamaliciousintruder.
oThefrequencyhoppingspreadspectrum(FHSS)techniqueusesMdifferentcarrier
frequenciesthataremodulatedbythesourcesignal.Atonemoment,thesignal

SECTION6.6PRACTICESET 187
modulatesonecarrierfrequency;atthenextmoment,thesignalmodulatesanother
carrierfrequency.
oThedirectsequencespreadspectrum(DSSS)techniqueexpandsthebandwidth of
asignalbyreplacingeachdatabitwithnbitsusingaspreadingcode.Inotherwords,
eachbit
isassignedacode ofnbits,calledchips.
6.6PRACTICESET
ReviewQuestions
1.Describethegoals ofmultiplexing.
2.Listthreemainmultiplexingtechniquesmentionedinthischapter.
3.Distinguishbetweenalinkandachannelinmultiplexing.
4.Whichofthethreemultiplexingtechniques is(are)used tocombineanalogsignals?
Which
ofthethreemultiplexingtechniques is(are)usedtocombinedigitalsignals?
5.Definetheanaloghierarchyusedbytelephonecompaniesandlistdifferentlevels
ofthehierarchy.
6.Definethedigitalhierarchyusedbytelephonecompaniesandlistdifferentlevels
ofthehierarchy.
7.Whichofthethreemultiplexingtechniquesiscommonforfiberopticlinks?
Explainthereason.
8.DistinguishbetweenmultilevelTDM,multipleslotTDM,andpulse-stuffedTDM.
9.DistinguishbetweensynchronousandstatisticalTDM.
10.Definespreadspectrumanditsgoal.Listthetwospreadspectrumtechniquesdis­
cussedinthischapter.
11.DefineFHSSandexplainhowitachievesbandwidthspreading.
12.DefineDSSSandexplainhow itachievesbandwidthspreading.
Exercises
13.Assumethatavoicechanneloccupiesabandwidth of4kHz.Weneedtomultiplex
10voicechannelswithguard bandsof500HzusingFDM.Calculatetherequired
bandwidth.
14.Weneedtotransmit100digitizedvoicechannelsusingapass-bandchannel of
20KHz.Whatshouldbetheratio ofbits/Hzifweusenoguardband?
15.Intheanaloghierarchy ofFigure6.9,findtheoverhead(extrabandwidthforguard
bandorcontrol)ineachhierarchylevel(group,supergroup,mastergroup,and
jumbogroup).
16.WeneedtousesynchronousTDMandcombine20digitalsources,each of100Kbps.
Eachoutputslotcarries1bitfromeachdigitalsource,butoneextrabit
isaddedto
eachframeforsynchronization.Answerthefollowingquestions:
a.Whatisthesize ofanoutputframe inbits?
b.Whatistheoutputframerate?

188 CHAPTER 6BANDWIDTHUTIUZATION:MULTIPLEXING ANDSPREADING
c.Whatistheduration ofanoutputframe?
d.Whatistheoutputdatarate?
e.Whatistheefficiency ofthesystem(ratio ofusefulbitstothetotalbits).
17.RepeatExercise 16ifeachoutputslotcarries2bitsfromeachsource.
18.Wehave14sources,eachcreating5008-bitcharacterspersecond.Sinceonlysome
ofthesesourcesareactiveatanymoment,weusestatisticalTDMtocombinethese
sourcesusingcharacterinterleaving.Eachframecarries6slots
atatime,butweneed
toaddfour-bitaddressestoeachslot.Answerthefollowingquestions:
a.Whatisthesize ofanoutputframeinbits?
b.Whatistheoutputframerate?
c.Whatisthedurationofanoutputframe?
d.Whatistheoutputdatarate?
19.Tensources,sixwithabitrate of200kbpsandfourwithabitrate of400kbpsare
tobecombinedusingmultilevelTDMwithnosynchronizingbits.Answerthefol­
lowingquestionsaboutthefinalstage
ofthemultiplexing:
a.Whatisthesize ofaframeinbits?
b.Whatistheframerate?
c.Whatistheduration ofaframe?
d.Whatisthedatarate?
20.Fourchannels,twowithabitrate
of200kbpsandtwowithabitrate of150kbps,are
tobemultiplexedusingmultipleslotTDMwithnosynchronizationbits.Answer
thefollowingquestions:
a.Whatisthesize ofaframeinbits?
b.Whatistheframerate?
c.Whatistheduration ofaframe?
d.Whatisthedatarate?
21.Twochannels,onewithabitrate
of190kbpsandanotherwithabitrate of180kbps,
are
tobemultiplexedusingpulsestuffingTDMwithnosynchronizationbits.Answer
thefollowingquestions:
a.Whatisthesize ofaframeinbits?
b.Whatistheframerate?
c.Whatistheduration ofaframe?
d.Whatisthedatarate?
22.Answerthefollowingquestionsabouta
T-1line:
a.Whatistheduration ofaframe?
b.Whatistheoverhead(number ofextrabitspersecond)?
23.Showthecontents ofthefiveoutputframesforasynchronousTDMmultiplexer
thatcombinesfoursourcessendingthefollowingcharacters.Notethatthecharacters
aresentinthesameorderthattheyaretyped.Thethirdsourceissilent.
a.Source1message:HELLO
b.Source2message:HI

SECTION6.6PRACTICESET 189
c.Source3message:
d.Source4message:BYE
24.Figure6.34showsamultiplexerinasynchronousTDMsystem.Eachoutputslotis
only
10bitslong(3bitstakenfromeachinputplus1framingbit).Whatistheoutput
stream?Thebitsarriveatthemultiplexerasshownbythearrows.
Figure6.34Exercise24
101110111101~
11111110000~
1010000001111~
IFrameof10bitsI
25.Figure6.35showsademultiplexerinasynchronousTDM. Iftheinputslotis 16bits
long(noframingbits),whatisthebitstreamineachoutput?Thebitsarriveatthe
demultiplexerasshownbythearrows.
Figure6.35Exercise25
101000001110101010101000011101110000011110001

26.AnswerthefollowingquestionsaboutthedigitalhierarchyinFigure6.23:
a.Whatistheoverhead(number ofextrabits)inthe DS-lservice?
b.Whatistheoverhead(numberofextrabits)intheDS-2service?
c.Whatistheoverhead(number ofextrabits)intheDS-3service?
d.Whatistheoverhead(number ofextrabits)intheDS-4service?
27.Whatistheminimumnumber
ofbitsinaPNsequence ifweuseFHSSwitha
channelbandwidth
ofB=4KHzandB
ss=100KHz?
28.AnFHSSsystemusesa4-bitPNsequence.
Ifthebitrate ofthePNis64bitsper
second,answerthefollowingquestions:
a.Whatisthetotalnumber ofpossiblehops?
b.Whatisthetimeneededtofinishacomplete cycle ofPN?

190 CHAPTER6BANDWIDTH UTILIZATION:MULTIPLEXING ANDSPREADING
29.Apseudorandomnumbergeneratorusesthefollowingformulatocreatearandom
series:
N
i
+1=(5+7N
i
)mod
17-1
InwhichN
jdefinesthecurrentrandomnumberand Nj+
1definesthenextrandom
number.Theterm
modmeansthevalue oftheremainderwhendividing (5+7Nj)
by17.
30.Wehaveadigitalmediumwithadatarate of10Mbps.Howmany64-kbpsvoice
channelscanbecarriedbythismedium
ifweuseDSSSwiththeBarkersequence?

CHAPTER7
TransmissionMedia
WediscussedmanyissuesrelatedtothephysicallayerinChapters3through 6.Inthis
chapter,wediscusstransmissionmedia.Transmissionmediaareactuallylocatedbelow
thephysicallayerandaredirectlycontrolledbythephysicallayer.
Youcouldsaythat
transmissionmediabelongtolayerzero.Figure7.1showstheposition
oftransmission
mediainrelationtothephysicallayer.
Figure7.1Transmissionmedium andphysicallayer
SenderI
PhysicallayerI
L...
Transmissionmedium
Cableorair
I
Physicallayer
.....J
IReceiver
Atransmissionmediumcanbebroadlydefinedasanythingthatcancarryinfor­
mationfromasourcetoadestination.Forexample,thetransmissionmediumfortwo
peoplehavingadinnerconversationisthe
air.Theaircanalsobeusedtoconveythe
messageinasmokesignal
orsemaphore.Forawrittenmessage,thetransmission
mediummightbeamailcarrier,atruck,oranairplane.
Indatacommunicationsthedefinition
oftheinformationandthetransmission
mediumismorespecific.Thetransmissionmediumisusuallyfreespace,metalliccable,
orfiber-opticcable.Theinformationisusuallyasignalthatistheresult ofaconversion
ofdatafromanotherform.
The use
oflong-distancecommunicationusingelectricsignalsstartedwiththe
invention
ofthetelegraphbyMorseinthe19thcentury.Communicationbytelegraph
wasslowanddependentonametallicmedium.
Extendingtherange
ofthehumanvoicebecamepossiblewhenthetelephonewas
inventedin1869.Telephonecommunicationatthattimealsoneededametallicmedium
tocarrytheelectricsignalsthatweretheresult
ofaconversionfromthehumanvoice.
191

192 CHAPTER 71RANSMISSIONMEDIA
Thecommunicationwas,however,unreliableduetothepoorqualityofthewires.The
lineswereoftennoisyandthetechnologywasunsophisticated.
Wirelesscommunication startedin1895whenHertzwasabletosendhigh­
frequencysignals.Later,Marconidevisedamethodtosendtelegraph-typemessages
overtheAtlanticOcean.
Wehavecomealongway.Bettermetallicmediahavebeeninvented(twisted­
pairandcoaxialcables,forexample).Theuse
ofopticalfibershasincreasedthedata
rateincredibly.Freespace(air,vacuum,andwater)isusedmoreefficiently,inpart
duetothetechnologies(such
asmodulationandmultiplexing)discussedintheprevious
chapters.
Asdiscussed
inChapter3,computersandothertelecommunicationdevicesuse
signalstorepresentdata.Thesesignalsaretransmittedfromonedevicetoanother
inthe
formofelectromagneticenergy,which
ispropagatedthroughtransmissionmedia.
Electromagneticenergy,acombinationofelectricandmagneticfieldsvibratingin
relationtoeachother,includespower,radiowaves,infraredlight,visiblelight,ultraviolet
light,and
X,gamma,andcosmicrays.Eachoftheseconstitutesaportionoftheelectro­
magneticspectrum.Notallportionsofthespectrumarecurrentlyusablefortelecommu­
nications,however.Themedia
toharnessthosethatareusablearealsolimitedtoa few
types.
Intelecommunications,transmissionmediacanbedividedintotwobroadcatego­
ries:guidedandunguided.Guidedmediaincludetwisted-paircable,coaxialcable,and
fiber-opticcable.Unguidedmediumisfreespace.Figure
7.2showsthistaxonomy.
Figure7.2
Classesoftransmissionmedia
7.1GUIDEDMEDIA
Guidedmedia,whicharethosethatprovideaconduitfromonedevicetoanother,
include
twisted-paircable,coaxialcable,andfiber-opticcable.Asignaltraveling
alongany
ofthesemediaisdirectedandcontainedbythephysicallimits ofthe
medium.Twisted-pairandcoaxialcableusemetallic(copper)conductorsthat accept
andtransportsignalsintheformofelectriccurrent.Opticalfiberisacablethataccepts
andtransportssignalsintheform
oflight.

SECTION7.1GUIDEDMEDIA 193
Twisted-PairCable
Atwistedpairconsists oftwo conductors(normallycopper),eachwithitsownplastic
insulation,twistedtogether,
asshowninFigure7.3.
Figure7.3 Twisted-paircable
'""il""'<
Oneofthewiresisusedtocarrysignalstothereceiver,andtheotherisusedonly
asagroundreference.Thereceiverusesthedifferencebetweenthetwo.
Inadditiontothesignalsentbythesender
ononeofthewires,interference(noise)
andcrosstalkmayaffectbothwiresandcreateunwantedsignals.
Ifthetwowiresareparallel,theeffect oftheseunwantedsignals isnotthesamein
bothwiresbecausetheyareatdifferentlocationsrelativetothenoiseorcrosstalksources
(e,g.,one
iscloserandtheother isfarther).Thisresultsinadifferenceatthereceiver.By
twist,ingthepairs,abalance
ismaintained.Forexample,suppose inonetwist,onewire
isclosertothenoisesourceandtheotherisfarther;inthenexttwist,thereverse istrue.
Twistingmakesitprobablethatbothwiresareequallyaffectedbyexternalinfluences
(noiseorcrosstalk).Thismeansthatthereceiver,whichcalculatesthedifferencebetween
thetwo,receivesnounwantedsignals.Theunwantedsignalsaremostlycanceledout.
Fromtheabovediscussion,
itisclearthatthenumber oftwistsperunitoflength
(e.g.,inch)hassomeeffect
onthequalityofthecable.
UnshieldedVersusShieldedTwisted-PairCable
Themostcommontwisted-paircableusedincommunicationsisreferredtoas
unshieldedtwisted-pair (UTP).IBMhasalsoproducedaversion oftwisted-paircable
foritsusecalled
shieldedtwisted-pair (STP).STPcablehasametalfoilorbraided­
meshcoveringthatencaseseachpair
ofinsulatedconductors.Althoughmetalcasing
improvesthequality
ofcablebypreventingthepenetration ofnoiseorcrosstalk,it is
bulkierandmoreexpensive.Figure7.4showsthedifferencebetweenUTPandSTP.
OurdiscussionfocusesprimarilyonUTPbecauseSTPisseldomusedoutside
ofIBM.
Categories
TheElectronicIndustriesAssociation(EIA)hasdevelopedstandards toclassify
unshieldedtwisted-paircableintosevencategories.Categoriesaredeterminedbycable
quality,with1asthelowestand7asthehighest.EachEIAcategory
issuitablefor
specificuses.Table7.Ishowsthesecategories.
Connectors
ThemostcommonUTPconnectoris RJ45(RJstandsforregisteredjack),asshown
inFigure7.5.TheRJ45
isakeyedconnector,meaningtheconnectorcanbeinsertedin
onlyoneway.

194 CHAPTER7TRANSMISSIONMEDIA
Figure7.4 UTPandSTPcables
Metalshield
Plasticcover
a.UTP
Plasticcover
b.STP
Table7.1 Categoriesofunshieldedtwisted-paircables
DataRate
Category Specification (Mbps) Use
I Unshieldedtwisted-pairusedintelephone <0.1 Telephone
2 Unshieldedtwisted-pairoriginallyusedin 2
T-llines
T-lines
3 ImprovedCAT2usedinLANs 10 LANs
4 ImprovedCAT3usedinTokenRingnetworks 20 LANs
5 Cablewireisnormally24AWGwithajacket 100 LANs
andoutsidesheath
SE An extensiontocategory5thatincludes
125 LANs
extrafeaturestominimizethecrosstalkand
electromagneticinterference
6 A newcategorywithmatchedcomponents 200 LANs
comingfromthesamemanufacturer.The
cablemustbetestedata200-Mbpsdatarate.
7 SometimescalledSSTP(shieldedscreen 600 LANs
twisted-pair).Eachpairisindividually
wrappedinahelicalmetallicfoilfollowedby
ametallicfoilshieldinadditiontotheoutside
sheath.Theshielddecreasestheeffect
of
crosstalk:andincreasesthedatarate.
Performance
Onewaytomeasuretheperformance oftwisted-paircableistocompareattenuation
versusfrequencyanddistance.Atwisted-paircablecanpassawiderange
offrequencies.
However,Figure7.6showsthatwithincreasingfrequency,theattenuation,measuredin
decibelsperkilometer(dB/km),sharplyincreaseswithfrequenciesabove100kHz.Note
that
gaugeisameasureofthethicknessofthewire.

SECTION7.1GUIDEDMEDIA 195
Figure7.5UTPconnector
nrnln
12345678
RJ-45Male
Figure7.6UTPperformance
18gauge
26gauge
GaugeDiameter(inches)
18 0.0403
22 0.02320
24 0.02010
26 0.0159
18
2
E::::::::..------
4
20
16
]'14
iIi
::3-12
<::
.g
'"10:I
<::
"
~8
6
10 100 1000
!(kHz)
Applications
Twisted-paircablesareusedintelephonelinestoprovidevoiceanddatachannels.The
local
loop-thelinethatconnectssubscriberstothecentraltelephoneoffice---commonly
consists
ofunshieldedtwisted-paircables. WediscusstelephonenetworksinChapter 9.
TheDSLlinesthatareusedbythetelephonecompaniestoprovidehigh-data-rate
connectionsalsousethehigh-bandwidthcapability
ofunshieldedtwisted-paircables.
WediscussDSLtechnologyinChapter9.
Local-areanetworks,such
aslOBase-Tand lOOBase-T,alsousetwisted-paircables.
WediscussthesenetworksinChapter13.
CoaxialCable
Coaxialcable(or coax)carriessignals ofhigherfrequencyrangesthanthoseintwisted­
paircable,inpartbecausethetwomediaareconstructedquitedifferently.Instead
of

196 CHAPTER 7TRANSMISSIONMEDIA
havingtwowires,coaxhasacentralcoreconductor ofsolidorstrandedwire(usually
copper)enclosedinaninsulatingsheath,whichis,inturn,encasedinanouterconductor
ofmetalfoil,braid,oracombination ofthetwo.Theoutermetallicwrappingserves
bothasashieldagainstnoiseandasthesecondconductor,whichcompletesthecircuit.
Thisouterconductorisalsoenclosedinaninsulatingsheath,andthewholecableis
protectedbyaplasticcover(seeFigure7.7).
Figure7.7 Coaxialcable
Insulator
Outerconductor
(shield)
CoaxialCableStandards
Coaxialcablesarecategorizedbytheir radiogovernment(RG) ratings.EachRGnum­
berdenotesauniqueset
ofphysicalspecifications,includingthewiregauge ofthe
innerconductor,thethicknessandtype
oftheinnerinsulator,theconstruction ofthe
shield,andthesizeandtype
oftheoutercasing.Eachcabledefinedbyan RGratingis
adaptedforaspecializedfunction,asshowninTable7.2.
Table
7.2Categoriesofcoaxialcables
Category Impedance Use
RG-59 75
n CableTV
RG-58 50n ThinEthernet
RG-ll 50n ThickEthernet
CoaxialCableConnectors
Toconnectcoaxialcabletodevices,weneedcoaxialconnectors.Themost common
typeofconnectorusedtodayis theBayone-Neill-Concelman(BNe),connector.
Figure7.8showsthree
populartypesoftheseconnectors:the BNCconnector,the
BNCTconnector,andthe
BNCterminator.
The
BNCconnectorisusedtoconnecttheend ofthecabletoadevice,suchasa
TVset.TheBNCTconnectorisusedinEthernetnetworks(seeChapter13)tobranch
outtoaconnectiontoacomputerorotherdevice.
TheBNCterminatorisusedatthe
end
ofthecabletopreventthereflection ofthesignal.

SECTION7.1GUIDEDMEDIA 11)7
----------------------------_.------
Figure7.8BNCconnectors
BNCT
Cable
t
BNCconnector 50-a
BNeterminator
Ground
wire
---------------------------~- --
Performance
Aswedidwithtwisted-paircables,wecanmeasuretheperformanceofacoaxialcable.
WenoticeinFigure7.9thattheattenuationismuchhigherincoaxialcablesthanin
twisted-paircable.In otherwords,althoughcoaxialcablehasamuchhigherbandwidth,
thesignalweakensrapidlyandrequiresthefrequentuse
ofrepeaters.
Figure7.9Coaxialcablepeiformance
100IO
0.712.9mm
!
/
I
/1.2/4.4mm
!
/
/
1.0
j(kHz)
0.1
35
30
a
25
~
a:l
:2-
20.:
0
.~
;::l
.:
15
~
~
10
5
0.01
Applications
Coaxialcablewaswidelyusedinanalogtelephonenetworkswhereasinglecoaxialnet­
workcouldcarry10,000voicesignals.Lateritwasusedindigitaltelephonenetworks
whereasinglecoaxialcablecouldcarrydigitaldataupto600Mbps.However,coaxial
cableintelephonenetworkshaslargelybeenreplacedtodaywithfiber-opticcable.
CableTVnetworks(seeChapter9)alsousecoaxialcables.Inthetraditionalcable
TVnetwork,theentirenetworkusedcoaxialcable.Later,however,cableTVproviders

198 CHAPTER7TRANSMISSIONMEDIA
replacedmost ofthemediawithfiber-opticcable;hybridnetworksusecoaxialcable
onlyatthenetworkboundaries,neartheconsumerpremises.CableTVusesRG-59
coaxialcable.
Anothercommonapplication
ofcoaxialcableis intraditionalEthernetLANs(see
Chapter13).Because
ofitshighbandwidth,andconsequentlyhighdatarate,coaxial
cablewaschosenfordigitaltransmissioninearlyEthernetLANs.The10Base-2,orThin
Ethernet,usesRG-58coaxialcablewith
BNeconnectorstotransmitdataat10Mbps
witharange
of185m.ThelOBase5,orThickEthernet,usesRG-11(thickcoaxialcable)
totransmit
10Mbpswitharange of5000m.ThickEthernethasspecializedconnectors.
Fiber-OpticCable
Afiber-opticcableismade ofglassorplasticandtransmitssignalsintheform oflight.
Tounderstandopticalfiber,wefirstneed toexploreseveralaspects ofthenatureoflight.
Lighttravels
inastraightline aslongasitismovingthroughasingleuniformsub­
stance.
Ifarayoflighttravelingthroughonesubstancesuddenlyentersanothersubstance
(ofadifferentdensity),theraychangesdirection.Figure7.10showshowaray
oflight
changesdirectionwhengoingfromamoredensetoalessdensesubstance.
Figure7.10Bendingof
lightray
Less
dense
More
dense
More
dense
Less
dense
I>criticalangle,
reflection
Less
dense
I
I
I
More,
A
densezj.~
[ I
I
I
I
r
II
I
I=criticalangle,
refraction
/
A
I
I<criticalangle,
refraction
Asthefigureshows, iftheangleofincidenceI(the
arIgletheraymakeswiththe
lineperpendiculartotheinterfacebetweenthetwosubstances)
islessthanthecritical
angle,theray
refractsandmovesclosertothesurface. Iftheangleofincidenceis
equal
tothecriticalangle,thelightbendsalongtheinterface. Iftheangleisgreaterthan
thecriticalangle,therayreflects(makesaturn)andtravelsagaininthedensersub­
stance.Notethatthecriticalangle
isapropertyofthesubstance,anditsvaluediffers
fromonesubstance
toanother.
Opticalfibersusereflectiontoguidelightthroughachannel.Aglassorplasticcore
issurroundedbyacladding oflessdenseglassorplastic.Thedifferenceindensity ofthe
twomaterialsmustbesuchthatabeam
oflightmovingthroughthecore isreflectedoff
thecladdinginstead
ofbeingrefractedinto it.SeeFigure7.11.
PropagationModes
Currenttechnologysupportstwomodes(multimodeandsinglemode)forpropagatinglight
alongopticalchannels,eachrequiringfiberwithdifferentphysicalcharacteristics. Multi­
modecanbeimplementedintwoforms:step-indexorgraded-index(seeFigure7.12).

SECTION7.1GUlDEDMEDIA 199
Figure7.11Opticaljiber
Cladding
Sender
Figure7.12Propagationmodes
Cladding
Receiver
L.-_....J
MultimodeMultimodeissonamedbecausemultiplebeamsfromalightsource
movethroughthecoreindifferentpaths.Howthesebeamsmovewithinthecable
dependsonthestructure
ofthecore,asshowninFigure7.13.
Inmultimodestep-indexfiber,thedensity
ofthecoreremainsconstantfromthe
centertotheedges.Abeam
oflightmovesthroughthisconstantdensityinastraight
lineuntilitreachestheinterface
ofthecoreandthecladding.Attheinterface,thereis
anabruptchangeduetoalowerdensity;thisalterstheangle
ofthebeam'smotion.The
term
stepindexreferstothesuddenness ofthischange,whichcontributestothedistor­
tion
ofthesignalasitpassesthroughthe fiber.
Asecondtype offiber,calledmultimodegraded-indexfiber,decreasesthisdistor­
tion
ofthesignalthroughthecable.Theword indexherereferstotheindexofrefraction.
Aswesawabove,theindex
ofrefractionisrelatedtodensity.Agraded-indexfiber,
therefore,isonewithvaryingdensities.Density
ishighestatthecenter ofthecoreand
decreasesgradually
toitslowestattheedge.Figure7.13showstheimpact ofthisvari­
abledensityonthepropagation
oflightbeams.
Single-ModeSingle-modeusesstep-indexfiberand ahighlyfocusedsource
oflight
thatlimitsbeamstoasmallrange
ofangles,allclosetothehorizontal.Thesingle­
modefiberitselfismanufacturedwithamuchsmallerdiameterthanthat
ofmultimode
fiber,andwithsubstantiallYlowerdensity(index
ofrefraction).Thedecreaseindensity
resultsinacriticalanglethatiscloseenoughto90°tomakethepropagation
ofbeams
almosthorizontal.Inthiscase,propagation
ofdifferentbeamsisalmostidentical,and
delaysarenegligible.Allthebeamsarriveatthedestination"together"andcanbe
recombinedwithlittledistortiontothesignal(seeFigure7.13).

200 CHAPTER 7TRANSMISSIONMEDIA
Figure7.13Modes
JlJ1
Source
a.Multimode,stepindex
Destination
JlJ1
Source Destination
b.Multimode,gradedindex
JlJ1
Source
c.Singlemode
Destination
FiberSizes
Opticalfibersaredefinedbytheratio ofthediameteroftheircoretothediameter of
theircladding,bothexpressedinmicrometers.ThecommonsizesareshowninTable7.3.
Notethatthelastsizelistedisforsingle-modeonly.
Table7.3 Fibertypes
Type
Core(~) Cladding(Jlm) Mode
501125 50.0 125 Multimode,gradedindex
62.51125 62.5 125 Multimode,gradedindex
100/125 100.0 125 Multimode,gradedindex
7/125 7.0 125 Singlemode
CableComposition
Figure7.14showsthecomposition ofatypicalfiber-opticcable.Theouterjacketismade
ofeitherPVCorTeflon.InsidethejacketareKevlarstrandstostrengthenthecable.Kevlar
isastrongmaterialusedinthefabrication
ofbulletproofvests.BelowtheKevlar isanother
plasticcoatingtocushionthefiber.Thefiberisatthecenter
ofthecable,anditconsists of
claddingandcore.
Fiber-OpticCableConnectors
Therearethreetypes ofconnectorsforfiber-opticcables,asshowninFigure7.15.

SECTION7.1GUIDEDMEDIA 201
Figure7.14 Fiberconstruction
DuPontKevlar
/ forstrength
Glassor
plasticcore
Figure7.15 Fiber-opticcableconnectors
SCconnector STconnector
RX
TX
MT-RJconnector
Thesubscriberchannel (SC)connectorisusedforcable TV.Itusesapush/pull
lockingsystem.The
straight-tip(ST)connectorisusedforconnectingcableto
networkingdevices.
ItusesabayonetlockingsystemandismorereliablethanSC.
MT-RJisaconnectorthatisthesamesize asRJ45.
Performance
TheplotofattenuationversuswavelengthinFigure7.16showsaveryinteresting
phenomenoninfiber-opticcable.Attenuationisflatterthaninthecase
oftwisted-pair
cableandcoaxialcable.Theperformanceissuchthatweneedfewer(actually
10times
less)repeaterswhenweusefiber-opticcable.
Applications
Fiber-opticcableisoftenfoundinbackbonenetworksbecauseitswidebandwidthis
cost-effective.Today,withwavelength-divisionmultiplexing(WDM),wecantransfer

202 CHAPTER 7IRANSMISSIONMEDIA
Figure7.16 Opticalfiberperformance
100
50
IO
~
5
~
~
00
1
00
0
..l
0.5
0.1
0.05
0.01
800 1000 1200 1400 1600 1800
Wavelength(urn)
dataatarate of1600Gbps.TheSONETnetworkthat wediscussinChapter 17provides
suchabackbone.
SomecableTVcompaniesuseacombination
ofopticalfiberandcoaxialcable,
thuscreatingahybridnetwork.Opticalfiberprovidesthebackbonestructurewhile
coaxialcableprovidestheconnectiontotheuserpremises.Thisisacost-effectivecon­
figurationsincethenarrowbandwidthrequirementattheuserenddoesnotjustifythe
use
ofopticalfiber.
Local-areanetworkssuchas100Base-FXnetwork(FastEthernet)and1000Base-X
alsousefiber-opticcable.
AdvantagesandDisadvantagesofOpticalFiber
AdvantagesFiber-opticcablehasseveraladvantagesovermetalliccable(twisted­
pairorcoaxial).
DHigherbandwidth.Fiber-opticcablecansupportdramaticallyhigherbandwidths
(andhencedatarates)thaneithertwisted-pairorcoaxialcable.Currently,datarates
andbandwidthutilizationoverfiber-opticcablearelimitednotbythemediumbut
bythesignalgenerationandreceptiontechnologyavailable.
DLesssignalattenuation.Fiber-optictransmissiondistanceissignificantlygreater
thanthat
ofotherguidedmedia.Asignalcanrunfor50kmwithoutrequiring
regeneration.
Weneedrepeatersevery5 kmforcoaxialortwisted-paircable.
DImmunitytoelectromagneticinterference.Electromagneticnoisecannotaffect
fiber-opticcables.
oResistancetocorrosivematerials.Glassismoreresistanttocorrosivematerials
thancopper.

SECTION7.2UNGUIDEDMEDIA:WIRELESS 203
oLightweight.Fiber-opticcablesaremuchlighterthancoppercables.
oGreaterimmunitytotapping.Fiber-opticcablesaremoreimmunetotappingthan
coppercables.Coppercablescreateantennaeffectsthatcaneasilybetapped.
DisadvantagesTherearesomedisadvantagesintheuseofopticalfiber.
oInstallationandmaintenance.Fiber-opticcableisarelativelynewtechnology.Its
installationandmaintenancerequireexpertisethatisnotyetavailableeverywhere.
oUnidirectionallight propagation.Propagationoflightisunidirectional.Ifwe
needbidirectionalcommunication,twofibersareneeded.
oCost.Thecableandtheinterfacesarerelativelymoreexpensivethanthoseofother
guidedmedia.
Ifthedemandforbandwidth isnothigh,oftentheuseofopticalfiber
cannotbejustified.
7.2UNGUIDEDMEDIA:WIRELESS
Unguidedmediatransportelectromagneticwaveswithoutusingaphysicalconductor.
Thistype
ofcommunicationisoftenreferredtoaswirelesscommunication.Signals
arenormallybroadcastthroughfreespaceandthusareavailabletoanyonewhohasa
devicecapable
ofreceivingthem.
Figure7.17showsthepart
oftheelectromagneticspectrum,rangingfrom3kHzto
900THz,usedforwirelesscommunication.
Figure7.17Electromagneticspectrumforwirelesscommunication
3
kHz
Radiowaveandmicrowave
300 400900
GHz THzTHz
Unguidedsignalscantravelfromthesourcetodestinationinseveralways:ground
propagation,skypropagation,andline-of-sightpropagation,asshowninFigure7.18.
Ingroundpropagation,radiowavestravelthroughthelowestportion ofthe
atmosphere,huggingtheearth.Theselow-frequencysignalsemanateinalldirections
fromthetransmittingantennaandfollowthecurvature
oftheplanet.Distancedepends
ontheamount
ofpowerinthesignal:Thegreaterthepower,thegreaterthedistance.In
skypropagation,higher-frequencyradiowavesradiateupwardintotheionosphere
(thelayer
ofatmospherewhereparticlesexistasions)wheretheyarereflectedbackto
earth.Thistype
oftransmissionallows forgreaterdistanceswithloweroutputpower.
Inline-or-sight
propagation,veryhigh-frequencysignalsaretransmittedinstraight
linesdirectlyfromantennatoantenna.Antennasmustbedirectional,facingeachother,

204 CHAPTER7TRANSMISSIONMEDIA
Figure7.18 Propagationmethods
Ionosphere
Groundpropagation
(below2MHz)
Ionosphere
Skypropagation
(2-30MHz)
Ionosphere
Line-af-sightpropagation
(above 30MHz)
andeithertallenoughorcloseenoughtogethernottobeaffectedbythecurvature of
theearth.Line-of-sightpropagationistrickybecauseradiotransmissionscannotbe
completelyfocused.
Thesection
oftheelectromagneticspectrumdefined asradiowavesandmicrowaves
isdividedintoeightranges,called
bands,eachregulatedbygovernmentauthorities.
Thesebandsareratedfrom
verylowfrequency(VLF)toextremelyhighfrequency (EHF).
Table7.4liststhesebands,theirranges,propagationmethods,andsomeapplications.
Table7.4Bands
Band Range Propagation Application
VLF(verylowfrequency) 3-30kHz Ground Long-rangeradio
navigation
LF(lowfrequency) 30-300kHz Ground Radiobeaconsand
navigationallocators
MF(middlefrequency) 300 kHz-3MHz Sky AMradio
HF(highfrequency) 3-30MHz Sky Citizensband(CB),
shi
piaircraft
communication
VHF(veryhighfrequency)
30-300MHz Skyand VHF TV,FMradio
line-of-sight
UHF(ultrahighfrequency)300
MHz-3GHzLine-of-sightUHF TV,cellularphones,
paging,satellite
SHF(superhighfrequency)
3-30GHz Line-of-sightSatellitecommunication
EHF(extremelyhigh
30-300GHz Line-of-sightRadar,satellite
frequency)
Wecandividewirelesstransmissionintothreebroadgroups:radiowaves,micro­
waves,andinfraredwaves.SeeFigure7.19.

SECTION7.2UNGUIDEDMEDIA:WIRELESS 205
Figure7.19Wirelesstransmissionwaves
RadioWaves
Althoughthere isnoclear-cutdemarcationbetweenradiowavesandmicrowaves,elec­
tromagneticwavesranginginfrequenciesbetween3kHzand1GHzarenormallycalled
radiowaves;wavesranginginfrequenciesbetween1and300GHzarecalledmicro­
waves.However,thebehavior
ofthewaves,ratherthanthefrequencies,isabetter
criterionforclassification.
Radiowaves,forthemostpart,areomnidirectional.Whenanantennatransmits
radiowaves,theyarepropagatedinalldirections.Thismeansthatthesendingand
receivingantennas
donothavetobealigned.Asendingantennasendswavesthatcan
bereceivedbyanyreceivingantenna.Theomnidirectionalpropertyhasadisadvantage,
too.Theradiowavestransmittedbyoneantennaaresusceptibletointerferenceby
anotherantennathatmaysendsignalsusingthesamefrequencyorband.
Radiowaves,particularlythosewavesthatpropagateintheskymode,cantravel
longdistances.Thismakesradiowavesagoodcandidateforlong-distancebroadcast­
ingsuchasAMradio.
Radiowaves,particularlythose
oflowandmediumfrequencies,canpenetratewalls.
Thischaracteristiccanbebothanadvantageandadisadvantage.
Itisanadvantage
because,forexample,anAMradiocanreceivesignalsinsideabuilding.
Itisadisadvan­
tagebecausewecannotisolateacommunication
tojustinsideoroutsideabuilding.The
radiowavebandisrelativelynarrow,justunder1GHz,comparedtothemicrowave
band.Whenthisbandisdividedintosubbands,thesubbandsarealsonarrow,leadingtoa
lowdataratefordigitalcommunications.
Almosttheentirebandisregulatedbyauthorities(e.g.,theFCCintheUnited
States).Usinganypart
ofthebandrequirespermissionfromtheauthorities.
OmnidirectionalAntenna
Radiowavesuse omnidirectionalantennasthatsendoutsignals inalldirections.
Based
onthewavelength,strength,andthepurpose oftransmission,wecanhavesev­
eraltypes
ofantennas.Figure7.20shows anomnidirectionalantenna.
Applications
Theomnidirectionalcharacteristics ofradiowavesmakethemusefulformulticasting,
inwhichthereisonesenderbutmanyreceivers.AMandFMradio,television,mari­
timeradio,cordlessphones,andpagingareexamples
ofmulticasting.

206 CHAPTER 7TRANSMISSIONMEDIA
Figure7.20 Omnidirectionalantenna
Radiowaves areused formulticastcommunications,
such
asradioandtelevision,andpagingsystems.
Microwaves
ElectromagneticwaveshavingfrequenciesbetweenIand300GHzarecalledmicro­
waves.
Microwavesareunidirectional.Whenanantennatransmitsmicrowavewaves,they
canbenarrowlyfocused.Thismeansthatthesendingandreceivingantennasneedto
bealigned.Theunidirectionalpropertyhasanobviousadvantage.Apair
ofantennas
canbealignedwithoutinterferingwithanotherpair
ofalignedantennas.Thefollowing
describessomecharacteristics
ofmicrowavepropagation:
oMicrowavepropagationisline-of-sight.Sincethetowerswiththemountedantennas
needtobeindirectsight
ofeachother,towersthatarefarapartneedtobeverytall.
Thecurvature
oftheearthaswellasotherblockingobstaclesdonotallowtwoshort
towerstocommunicatebyusingmicrowaves.Repeatersareoftenneededforlong­
distancecommunication.
oVeryhigh-frequencymicrowavescannotpenetratewalls.Thischaracteristiccanbe
adisadvantage
ifreceiversareinsidebuildings.
oThemicrowavebandisrelativelywide,almost299GHz.Thereforewidersubbands
canbeassigned,andahighdatarate
ispossible
oUseofcertainportions ofthebandrequirespermissionfromauthorities.
UnidirectionalAntenna
Microwavesneed unidirectionalantennas thatsendoutsignalsinonedirection.Two
types
ofantennasareusedformicrowavecommunications:theparabolicdishandthe
hom(seeFigure7.21).
Aparabolicdishantennaisbasedonthegeometry ofaparabola:Everyline
paralleltotheline
ofsymmetry(line ofsight)reflectsoffthecurveatanglessuchthat
allthelinesintersectinacommonpointcalledthefocus.Theparabolicdishworksasa

SECTION7.2UNGUIDEDMEDIA:WIRELESS 207
Figure7.21 Unidirectionalantennas
Focus~,,*=:::I
a.Dishantenna b.Hornantenna
funnel,catchingawiderange ofwavesanddirectingthemtoacommonpoint.In
thisway,more
ofthesignalisrecoveredthanwouldbepossiblewithasingle-point
receiver.
Outgoingtransmissionsarebroadcastthroughahornaimedatthedish.Themicro­
waveshitthedishandaredeflectedoutwardinareversal
ofthereceiptpath.
A
hornantennalookslikeagiganticscoop.Outgoingtransmissionsarebroadcast
upastem(resemblingahandle)anddeflectedoutwardinaseries
ofnarrowparallel
beamsbythecurvedhead.Receivedtransmissionsarecollectedbythescoopedshape
of
thehorn,inamannersimilartotheparabolicdish,andaredeflecteddownintothestem.
Applications
Microwaves,dueto theirunidirectionalproperties,areveryusefulwhenunicast
(one-to-one)communicationisneededbetweenthesenderandthereceiver.Theyare
usedincellularphones(Chapter16),satellitenetworks(Chapter16),andwirelessLANs
(Chapter14).
Microwavesareusedforunicastcommunicationsuchascellulartelephones,
satellitenetworks,
andwirelessLANs.
Infrared
Infraredwaves, withfrequenciesfrom 300GHzto 400THz(wavelengthsfrom1mm
to770nm),canbeusedforshort-rangecommunication.Infraredwaves,havinghigh
frequencies,cannotpenetratewalls.Thisadvantageouscharacteristicpreventsinterfer­
encebetweenonesystemandanother;ashort-rangecommunicationsysteminoneroom
cannotbeaffectedbyanothersysteminthenextroom.Whenweuseourinfraredremote
control,wedonotinterferewiththeuseoftheremotebyourneighbors.However,this
samecharacteristicmakesinfraredsignalsuselessforlong-rangecommunication.In
addition,wecannotuseinfraredwavesoutsideabuildingbecausethesun'srayscontain
infraredwavesthatcaninterferewiththecommunication.

208 CHAPTER 7TRANSMISSIONMEDIA
Applications
Theinfraredband,almost 400THz,hasanexcellentpotentialfordatatransmission.
Suchawidebandwidthcan
beusedtotransmitdigitaldatawithaveryhighdatarate.
TheInfraredDataAssociation (IrDA),anassociationforsponsoring theuse ofinfrared
waves,hasestablishedstandardsforusingthesesignalsforcommunicationbetween
devicessuchaskeyboards,mice,PCs,andprinters.Forexample,somemanufacturers
provideaspecialportcalledthe
IrDAportthatallowsawirelesskeyboardtocommu­
nicatewithaPC.Thestandardoriginallydefinedadatarate
of75kbpsforadistance
upto
8m.Therecentstandarddefinesadatarate of4Mbps.
Infraredsignalsdefined
byIrDAtransmitthroughline ofsight;theIrDAporton
thekeyboardneedstopointtothePCfortransmissiontooccur.
Infraredsignalscanbeusedforshort-rangecommunication
inaclosed
areausingline-of-sightpropagation.
7.3RECOMMENDED READING
Formoredetailsaboutsubjectsdiscussedinthischapter,werecommendthefollowing
books.
Theitemsinbrackets[ ...]refertothereferencelistatthe endofthetext.
Books
Transmissionmedia isdiscussedinSection3.8 of[GW04],Chapter4 of[Sta04],Sec­
tion
2.2and2.3of[Tan03].[SSS05]givesafullcoverage oftransmissionmedia.
7.4KEY TERMS
angleofincidence
Bayone-Neil-Concelman
(BNC)
connector
cladding
coaxialcable
core
criticalangle
electromagneticspectrum
fiber-opticcable
gauge
groundpropagation
guidedmedia
horn antenna
infraredwave
IrDAport
line-of-sightpropagation
microwave
MT-RJ
multimodegraded-indexfiber
multimodestep-indexfiber
omnidirectionalantenna
opticalfiber
parabolicdishantenna
RadioGovernment(RG)number
radiowave
reflection
refraction
RJ45

shieldedtwisted-pair(STP)
single-modefiber
skypropagation
straight-tip(ST)connector
subscriberchannel(SC)connector
transmissionmedium
SECTION7.6PRACTICESET 209
twisted-paircable
unguidedmedium
unidirectionalantenna
unshieldedtwisted-pair
(UTP)
wirelesscommunication
7.5SUMMARY
oTransmissionmedialiebelowthephysicallayer.
DAguidedmediumprovidesaphysicalconduitfromonedevice toanother.Twisted­
paircable,coaxialcable,andopticalfiberarethemostpopulartypes
ofguided
media.
DTwisted-paircableconsists oftwoinsulatedcopperwirestwistedtogether.Twisted­
paircableisusedforvoiceanddatacommunications.
DCoaxialcableconsists ofacentralconductorandashield.Coaxialcablecancarry
signalsofhigherfrequencyrangesthantwisted-paircable.Coaxialcable
isusedin
cableTVnetworksandtraditionalEthernetLAN
s.
oFiber-opticcablesarecomposed ofaglassorplasticinnercoresurroundedby
cladding,allencasedinanoutsidejacket.Fiber-opticcablescarrydatasignalsin
theform
oflight.Thesignalispropagatedalongtheinnercorebyreflection.Fiber­
optictransmissionisbecomingincreasinglypopulardue
toitsnoiseresistance,low
attenuation,andhigh-bandwidthcapabilities.Fiber-opticcableisusedinbackbone
networks,cableTVnetworks,andFastEthernetnetworks.
DUnguidedmedia(freespace)transportelectromagneticwaveswithouttheuse ofa
physicalconductor.
oWirelessdataaretransmittedthroughgroundpropagation,skypropagation,andline­
of-sightpropagation.Wirelesswavescanbeclassified
asradiowaves,microwaves,or
infraredwaves.Radiowavesareomnidirectional;microwavesareunidirectional.
Microwavesareusedforcellularphone,satellite,andwirelessLANcommunications.
DInfraredwavesareusedforshort-rangecommunicationssuchasthosebetweena
PCandaperipheraldevice.
ItcanalsobeusedforindoorLANs.
7.6PRACTICESET
ReviewQuestions
1.WhatisthepositionofthetransmissionmediaintheOSIortheInternetmodel?
2.Namethetwomajorcategories oftransmissionmedia.
3.Howdoguidedmediadifferfromunguidedmedia?
4.Whatarethethreemajorclasses ofguidedmedia?
5.Whatisthesignificance ofthetwistingintwisted-paircable?

210 CHAPTER7TRANSMISSIONMEDIA
6.Whatisrefraction?Whatisreflection?
7.Whatisthepurpose ofcladdinginanopticalfiber?
8.Nametheadvantagesofopticalfiberovertwisted-pairandcoaxialcable.
9.Howdoesskypropagationdifferfromline-of-sightpropagation?
10.Whatisthedifferencebetweenomnidirectionalwavesandunidirectionalwaves?
Exercises
11.UsingFigure7.6,tabulatetheattenuation(indB) ofa18-gaugeUTPfortheindicated
frequenciesanddistances.
Table7.5 Attenuation/orI8-gaugeUTP
Distance dBat1
KHz dRat10KHz dBat100 KHz
1Krn
lOKm
15Krn
20Km
12.Usetheresult ofExercise11toinferthatthebandwidth ofaUTPcabledecreases
withanincreaseindistance.
13.Ifthepoweratthebeginning ofa 1KIn18-gaugeUTPis200 mw,whatisthe
powerattheendforfrequencies1KHz,
10KHz,and100KHz?Usetheresult of
Exercise11.
14.UsingFigure7.9,tabulatetheattenuation(indB) ofa2.6/9.5mmcoaxialcablefor
theindicatedfrequenciesanddistances.
Table7.6 Attenuation/or2.6/9.5mmcoaxialcable
Distance dB
at1KHz dB at10KHz dBat 100KHz
1Km
lOKrn
15Km
20Km
15.Usetheresult ofExercise14toinferthatthebandwidth ofacoaxialcable
decreaseswiththeincreaseindistance.
16.Ifthepoweratthebeginning ofa 1KIn2.6/9.5mmcoaxialcableis200mw,what
isthepower
attheendforfrequencies1KHz, 10KHz,and100KHz?Usethe
result
ofExercise14.
17.Calculatethebandwidth ofthelightforthefollowingwavelengthranges(assumea
propagation speed
of2 x10
8
m):
a.1000to1200nm
b.1000to1400nm

SECTION7.6PRACTICESET 211
18.ThehorizontalaxesinFigure7.6and7.9representfrequencies.Thehorizontal
axisinFigure7.16representswavelength.Canyouexplainthereason?
lftheprop­
agationspeed
inanopticalfiberis2 x10
8
ill,canyouchangetheunitsinthehori­
zontalaxistofrequency?Shouldthevertical-axisunitsbechangedtoo?Shouldthe
curvebechangedtoo?
19.UsingFigure7.16,tabulatetheattenuation(indB)
ofanopticalfiberfortheindicated
wavelengthanddistances.
Table7.7 Attenuationforopticalfiber
Distance dB
at800nm dBat1000nm dBat1200nm
1Km
lOKm
15Km
20Km
20.Alightsignalistravellingthroughafiber.Whatisthedelay inthesignalifthe
length
ofthefiber-opticcableis10m,100m,and1Km(assumeapropagation
speed
of2 x10
8
ill)?
21.Abeam
oflightmovesfromonemediumtoanothermediumwithlessdensity.The
criticalangleis60°.Dowehaverefractionorreflectionforeach
ofthefollowing
incidentangles?Showthebending
ofthelightrayineachcase.
a.40°
b.60°
c.80
0

CHAPTER8
Switching
Anetworkisaset ofconnecteddevices.Wheneverwehavemultipledevices,wehave
theproblem
ofhowtoconnectthemtomakeone-to-onecommunicationpossible.One
solutionistomakeapoint-to-pointconnectionbetweeneachpair
ofdevices(amesh
topology)orbetweenacentraldeviceandeveryotherdevice(astartopology).These
methods,however,areimpracticalandwasteful whenappliedtoverylargenetworks.
Thenumberandlength
ofthelinksrequiretoomuchinfrastructuretobecost-efficient,
andthe
majorityofthoselinkswould beidlemostofthetime.Othertopologies
employingmultipointconnections,suchasabus,areruledoutbecausethedistances
betweendevicesandthetotalnumberofdevicesincreasebeyondthecapacities
ofthe
mediaandequipment.
Abettersolutionis
switching.Aswitchednetworkconsistsofaseries ofinterlinked
nodes,called
switches.Switchesaredevicescapable ofcreatingtemporaryconnections
betweentwoormoredeviceslinked
totheswitch.Inaswitchednetwork,some ofthese
nodesareconnectedtotheendsystems(computersortelephones,forexample).Others
areusedonlyforrouting.Figure
8.1showsaswitchednetwork.
Figure8.1 Switchednetwork
Theendsystems(communicatingdevices)arelabeled A,B, C,D,andsoon,andthe
switchesarelabeledI,II,III,
IV,andV.Eachswitchisconnectedtomultiplelinks.
213

214 CHAPTER 8SWITCHING
Traditionally,threemethods ofswitchinghavebeenimportant:circuitswitching,
packetswitching,andmessageswitching.Thefirsttwoarecommonlyusedtoday.The
thirdhasbeenphasedoutingeneralcommunicationsbutstillhasnetworkingapplications.
Wecanthendividetoday'snetworksintothreebroadcategories:circuit-switchednetworks,
packet-switchednetworks,andmessage-switched.Packet-switchednetworkscanfunher
bedividedintotwosubcategories-virtual-circuitnetworksanddatagram
networks­
asshowninFigure8.2.
Figure8.2 Taxonomyofswitchednetworks
Wecansaythatthevirtual-circuitnetworkshavesomecommoncharacteristics
withcircuit-switchedanddatagramnetworks.Thus,wefirstdiscusscircuit-switched
networks,thendatagramnetworks,andfinallyvirtual-circuitnetworks.
Todaythetendencyinpacketswitchingistocombinedatagramnetworksandvirtual­
circuitnetworks.Networksroutethefirstpacketbasedonthedatagramaddressingidea,
butthencreateavirtual-circuitnetworkfortherest
ofthepacketscomingfromthesame
sourceandgoingtothesamedestination.
Wewillseesome ofthesenetworksinfuture
chapters.
Inmessageswitching,eachswitchstoresthewholemessageandforwardsittothe
nextswitch.Although,wedon'tseemessageswitchingatlowerlayers,itisstillusedin
someapplicationslikeelectronicmail(e-mail).
Wewillnotdiscussthistopicinthisbook.
8.1CIRCUIT-SWITCHED NETWORKS
Acircuit-switchednetworkconsistsofasetofswitchesconnectedbyphysicallinks.
Aconnectionbetweentwostationsisadedicatedpathmade
ofoneormorelinks.How­
ever,eachconnectionusesonlyonededicatedchanneloneachlink.Eachlinkisnor­
mallydividedinto
nchannelsbyusingFDMorTDM asdiscussedinChapter6.
Acircuit-switchednetworkismadeofasetofswitchesconnectedbyphysicallinks,
inwhicheachlinkisdividedinto
nchannels.
Figure8.3showsatrivialcircuit-switchednetworkwithfourswitchesandfour
links.Eachlink
isdividedinto n(nis3inthefigure)channelsbyusingFDMorTDM.

SECTION8.1CIRCUIT-SWITCHEDNETWORKS 215
Figure8.3Atrivialcircuit-switchednetwork
Onelink,IIchannels
Path
Wehaveexplicitlyshownthemultiplexingsymbolstoemphasizethedivision ofthe
linkintochannelseventhoughmultiplexingcan
beimplicitlyincludedintheswitch
fabric.
Theendsystems,suchascomputers
ortelephones,aredirectlyconnectedtoa
switch.
Wehaveshownonlytwoendsystemsforsimplicity.WhenendsystemAneeds
tocommunicatewithendsystemM,systemAneedstorequestaconnectiontoMthat
mustbeacceptedbyallswitchesaswellasbyMitself.Thisiscalledthe
setupphase;
acircuit(channel)isreservedoneachlink,andthecombination ofcircuitsorchannels
definesthededicatedpath.Afterthededicatedpathmade
ofconnectedcircuits(channels)
isestablished,
datatransfercantakeplace.Afteralldatahavebeentransferred,the
circuitsaretomdown.
Weneedtoemphasizeseveralpointshere:
DCircuitswitchingtakesplaceatthephysicallayer.
DBeforestartingcommunication,thestationsmustmakeareservationfortheresources
tobeusedduringthecommunication.Theseresources,such aschannels(bandwidth
inFDMandtimeslotsinTDM),switchbuffers,switchprocessingtime,andswitch
input/outputports,mustremaindedicatedduringtheentireduration
ofdatatransfer
untilthe
teardownphase.
DDatatransferredbetweenthetwostationsarenotpacketized(physicallayertransfer
ofthesignal).Thedataareacontinuousflowsentbythesourcestationandreceived
bythedestinationstation,althoughtheremaybeperiods
ofsilence.
DThereisnoaddressinginvolvedduringdatatransfer.Theswitchesroutethedata
basedontheiroccupiedband(FDM)ortimeslot(TDM).
Ofcourse,thereisend-to­
endaddressingusedduringthesetupphase,
aswewillseeshortly.
Incircuitswitching,theresourcesneedtobereservedduringthesetupphase;
theresourcesremaindedicatedfortheentireduration
ofdatatransferuntiltheteardownphase.

216 CHAPTER8SWITCHING
Example8.1
Asatrivialexample,let ususeacircuit-switchednetwork toconnecteighttelephonesinasmall
area.Communication
isthrough4-kHzvoicechannels. WeassumethateachlinkusesFDMto
connectamaximumoftwovoicechannels.Thebandwidthofeachlink
isthen8kHz.Figure8.4
showsthesituation.Telephone1
isconnectedtotelephone 7;2to5;3to8;and4to 6.Ofcourse
thesituationmaychangewhennewconnectionsaremade.Theswitchcontrolstheconnections.
Figure8.4 Circuit-switchednetworkusedinExample8.1
Circuit-switchednetwork
Example8.2
Asanotherexample,consideracircuit-switchednetworkthatconnectscomputersintworemote
offices
ofaprivatecompany.TheofficesareconnectedusingaT-llineleasedfromacommuni­
cationserviceprovider.Therearetwo4
X8(4inputsand8outputs)switchesinthisnetwork.For
eachswitch,fouroutputportsarefoldedintotheinputportstoallowcommunicationbetween
computersinthesameoffice.Fourotheroutputportsallowcommunicationbetweenthetwo
offices.Figure8.5showsthesituation.
Figure8.5 Circuit-switchednetworkused inExample8.2
Circuit-switchednetwork
4x8
swItch T-llinewith
1.544Mbps
4x8
switch

SECTION8.1CIRCUIT-SWITCHEDNEIWORKS 217
ThreePhases
Theactualcommunicationinacircuit-switchednetworkrequiresthreephases:connec­
tionsetup,datatransfer,andconnectionteardown.
SetupPhase
Beforethetwoparties(ormultiplepartiesinaconferencecall)cancommunicate,a
dedicatedcircuit(combinationofchannelsinlinks)needstobeestablished.Theendsys­
temsarenormallyconnectedthroughdedicatedlinestotheswitches,soconnectionsetup
meanscreatingdedicatedchannelsbetweentheswitches.Forexample,inFigure8.3,
whensystemAneedstoconnecttosystemM,itsendsasetuprequestthatincludesthe
address
ofsystemM,toswitch I.SwitchIfindsachannelbetweenitselfandswitchIV
thatcanbededicatedforthispurpose.SwitchIthensendstherequesttoswitch
IV,
whichfindsadedicatedchannelbetweenitselfandswitchIII.SwitchIIIinformssys­
temMofsystemA'sintentionatthistime.
Inthenextsteptomakingaconnection,anacknowledgmentfromsystemMneeds
tobesentintheoppositedirectiontosystem
A.OnlyaftersystemAreceivesthis
acknowledgmentistheconnectionestablished.
Notethatend-to-endaddressingisrequiredforcreatingaconnectionbetweenthe
twoendsystems.Thesecanbe,forexample,theaddresses
ofthecomputersassigned
bytheadministratorinaTDMnetwork,ortelephonenumbersinan
FDMnetwork.
DataTransferPhase
Aftertheestablishment ofthededicatedcircuit(channels),thetwopartiescantransferdata.
TeardownPhase
Whenone ofthepartiesneedstodisconnect,asignalissenttoeachswitchtorelease
theresources.
Efficiency
Itcanbearguedthatcircuit-switchednetworksarenotasefficientastheothertwo
types
ofnetworksbecauseresourcesareallocatedduringtheentireduration ofthecon­
nection.Theseresourcesareunavailabletootherconnections.Inatelephonenetwork,
peoplenormallyterminatethecommunicationwhentheyhavefinishedtheirconversation.
However,incomputernetworks,acomputercanbeconnectedtoanothercomputer
even
ifthereisnoactivityforalongtime.Inthiscase,allowingresourcestobededicated
meansthatotherconnectionsaredeprived.
Delay
Althoughacircuit-switchednetworknormallyhaslowefficiency,thedelayinthistype
ofnetworkisminimal.Duringdatatransferthedataarenotdelayedateachswitch;the
resourcesareallocatedfortheduration
oftheconnection.Figure8.6showstheidea of
delayinacircuit-switchednetworkwhenonlytwoswitchesareinvolved.
AsFigure8.6shows,thereisnowaitingtimeateachswitch.Thetotaldelayisdue
tothetimeneededtocreatetheconnection,transferdata,anddisconnectthecircuit.The

218 CHAPTER 8SWITCHING
Figure8.6 Delayinacircuit-switchednetwork
Datatransfer
1I-------1.}\.f------l
u
i[------------------
Q
Time Time Time Time
delaycausedbythesetupisthesum offourparts:thepropagationtime ofthesource
computerrequest(slope
ofthefirstgraybox),therequestsignaltransfertime(heightof
thefirstgraybox),thepropagationtime
oftheacknowledgmentfromthedestination
computer(slope
ofthesecondgraybox),andthesignaltransfertime oftheacknowledg­
ment(height
ofthesecondgraybox).Thedelayduetodatatransfer isthesumoftwo
parts:thepropagationtime(slopeofthecoloredbox)anddatatransfertime(height
of
thecoloredbox),whichcanbeverylong.Thethirdboxshowsthetimeneededtotear
downthecircuit.
Wehaveshownthecase inwhichthereceiverrequestsdisconnection,
whichcreatesthemaximumdelay.
Circuit-SwitchedTechnologyinTelephoneNetworks
AswewillseeinChapter 9,thetelephonecompanieshavepreviouslychosenthecircuit­
switchedapproachtoswitchinginthephysicallayer;todaythetendency
ismoving
towardotherswitchingtechniques.Forexample,thetelephonenumberisusedasthe
globaladdress,andasignalingsystem(calledSS7)isusedforthesetupandteardown
phases.
Switchingatthe physicallayer inthetraditionaltelephone
network
usesthecircuit-switchingapproach.
8.2DATAGRAM NETWORKS
Indatacommunications,weneedtosendmessagesfromoneendsystemtoanother. If
themessageisgoingtopassthroughapacket-switchednetwork,itneedstobedivided
intopackets
offixedorvariablesize.Thesize ofthepacketisdeterminedbythenet­
workandthegoverningprotocol.
Inpacketswitching,thereis
noresourceallocationforapacket.Thismeansthat
thereis
noreservedbandwidthonthelinks,andthereisnoscheduledprocessingtime

SECTION8.2DATAGRAMNETWORKS 219
foreachpacket.Resourcesareallocatedondemand.Theallocationisdone onafirst­
come,first-servedbasis.Whenaswitchreceivesapacket,nomatterwhatisthesource
ordestination,thepacketmustwait
ifthereareotherpacketsbeingprocessed.Aswith
othersystemsinourdailylife,thislack
ofreservationmaycreatedelay.Forexample, if
wedonothaveareservationatarestaurant,wemighthave towait.
Inapacket-switchednetwork,thereisnoresourcereservation;
resources
areallocatedondemand.
Inadatagramnetwork,eachpacketistreatedindependentlyofallothers.Even if
apacketispartofamultipackettransmission,thenetworktreatsit asthoughitexisted
alone.Packetsinthisapproacharereferredtoas
datagrams.
Datagramswitchingisnormallydoneatthenetworklayer.Webrieflydiscuss
datagramnetworkshereasacomparisonwithcircuit-switchedandvirtual-circuit­
switchednetworks.InPart4
ofthistext,wegointogreaterdetail.
Figure8.7showshowthedatagramapproachisusedtodeliverfourpacketsfrom
stationA
tostationX.Theswitchesinadatagramnetworkaretraditionallyreferredto
asrouters.Thatiswhyweuseadifferentsymbolfortheswitchesinthefigure.
Figure8.7 Adatagramnetworkwithfourswitches(routers)
Datagramnetwork
A
Inthisexample,allfourpackets(ordatagrams)belongtothesamemessage,but
maytraveldifferentpaths
toreachtheirdestination.Thisissobecausethelinksmaybe
involvedincarryingpacketsfromothersourcesanddonothavethenecessarybandwidth
available
tocarryallthepacketsfromA toX.Thisapproachcancausethedatagrams of
atransmissiontoarriveattheirdestinationout oforderwithdifferentdelaysbetweenthe
packets.Packetsmayalsobelostordroppedbecause
ofalackofresources.Inmost
protocols,itistheresponsibilityofanupper-layerprotocoltoreorderthedatagramsor
askforlostdatagramsbeforepassingthemontotheapplication.
Thedatagramnetworksaresometimesreferred
toasconnectionlessnetworks. The
term
connectionlessheremeansthattheswitch(packetswitch)doesnotkeepinformation
abouttheconnectionstate.Therearenosetuporteardownphases.Eachpacketistreated
thesamebyaswitchregardless
ofitssourceordestination.

220 CHAPTER8SWITCHING
RoutingTable
Iftherearenosetuporteardownphases,howarethepacketsrouted totheirdestinations
inadatagramnetwork?Inthistype
ofnetwork,eachswitch(orpacketswitch)hasarout­
ingtablewhichisbasedonthedestinationaddress.Theroutingtablesaredynamicand
areupdatedperiodically.Thedestinationaddressesandthecorrespondingforwarding
outputportsarerecordedinthetables.Thisisdifferentfromthetable
ofacircuit­
switchednetworkinwhicheachentryiscreatedwhenthesetupphaseiscompletedand
deletedwhentheteardownphaseisover.Figure8.8showstheroutingtablefora
switch.
Figure8.8Routingtableinadatagramnetwork
DestinationOutput
address port
1232 I
4150 2
. .
9130 3
-......;..,:7
-
--
-
1 4
21 3
Aswitchinadatagramnetworkusesaroutingtablethat isbasedonthedestinationaddress.
DestinationAddress
Everypacketinadatagramnetworkcarriesaheaderthatcontains,amongotherinfor­
mation,thedestinationaddress
ofthepacket.Whentheswitchreceivesthepacket,this
destinationaddressisexamined;theroutingtableisconsultedtofindthecorresponding
portthroughwhichthepacketshouldbeforwarded.Thisaddress,unliketheaddress
inavirtual-circuit-switchednetwork,remainsthesameduringtheentirejourney
ofthe
packet.
Thedestinationaddressinthe headerofapacketina datagramnetwork
remainsthesameduringtheentirejourneyofthepacket.
Efficiency
Theefficiencyofadatagramnetworkisbetterthanthat ofacircuit-switchednetwork;
resourcesareallocatedonlywhentherearepacketstobetransferred.
Ifasourcesends
apacketandthereisadelay
ofafewminutesbeforeanotherpacketcanbesent,the
resourcescanbereallocatedduringtheseminutesforotherpacketsfromothersources.

SECTION8.3VIRTUAL-CIRCUITNETWORKS 221
Delay
Theremaybegreaterdelayinadatagramnetworkthaninavirtual-circuitnetwork.
Althoughtherearenosetupandteardownphases,eachpacketmayexperienceawait
ata
switchbefore
itisforwarded.Inaddition,sincenotallpacketsinamessagenecessarily
travelthroughthesameswitches,thedelayis
notuniformforthepackets ofamessage.
Figure8.9givesanexample
ofdelayinadatagramnetworkforonesinglepacket.
Figure8.9Delayinadatagramnetwork
Wai~ing[
time
i------J
Am---------tl~I_----_~_----_____1
Transmis~ion [
limer----=:--,-,---J
Waiting[
time,------1
B
Time Time Time Time
Thepackettravelsthroughtwoswitches.Therearethreetransmissiontimes (3T),
threepropagationdelays(slopes3'tofthelines),andtwowaitingtimes (WI+w2)'We
ignoretheprocessingtimeineachswitch.
Thetotaldelayis
Totaldelay=3T+
3t+WI+W2
DatagramNetworksinthe Internet
Aswewillseeinfuturechapters,the Internethaschosenthedatagramapproachto
switching
atthenetworklayer. Itusestheuniversaladdressesdefinedinthenetwork
layertoroutepackets
fromthesourcetothedestination.
Switching
intheInternetisdonebyusingthe datagram
approachtopacketswitching atthenetworklayer.
8.3VIRTUAL-CIRCUIT NETWORKS
Avirtual-circuitnetworkisacrossbetweenacircuit-switchednetworkandadatagram
network.
Ithassomecharacteristicsofboth.
1.Asinacircuit-switchednetwork,therearesetupandteardownphasesinaddition
tothe
datatransferphase.

222 CHAPTER8SWITCHING
2.Resourcescanbeallocatedduringthesetupphase,asinacircuit-switchednetwork,
or
ondemand,as inadatagramnetwork.
3.Asinadatagramnetwork,dataarepacketizedandeachpacketcarriesanaddressin
theheader.However,theaddressintheheaderhaslocaljurisdiction(itdefineswhat
should
bethenextswitchandthechannelonwhichthepacketisbeingcanied),not
end-to-endjurisdiction.
Thereadermayaskhowtheintermediateswitchesknow
wheretosendthepacket
ifthereisnofinaldestinationaddresscarried byapacket.
Theanswerwillbeclearwhenwediscussvirtual-circuitidentifiersinthenextsection.
4.As
inacircuit-switchednetwork,allpacketsfollowthesamepathestablishedduring
theconnection.
5.Avirtual-circuitnetworkisnormallyimplementedinthedatalinklayer,whilea
circuit-switchednetworkisimplementedinthephysicallayerandadatagramnet­
work
inthenetworklayer. Butthismaychange inthefuture.
Figure
8.10isanexampleofavirtual-circuitnetwork. Thenetworkhasswitchesthat
allowtrafficfromsourcestodestinations.
Asourceordestinationcanbeacomputer,
packetswitch,bridge,
oranyotherdevicethatconnectsothernetworks.
Figure8.10Virtual-circuitnetwork
Addressing
Inavirtual-circuitnetwork,twotypes ofaddressingareinvolved:globalandlocal
(virtual-circuitidentifier).
GlobalAddressing
Asourceoradestinationneedstohaveaglobal address-anaddressthat canbeunique
inthescope
ofthenetworkorinternationally ifthenetworkispart ofaninternational
network.However,
wewillseethataglobaladdressinvirtual-circuitnetworksisused
onlytocreateavirtual-circuitidentifier,asdiscussednext.
Virtual-CircuitIdentifier
Theidentifierthatisactuallyusedfordatatransferiscalledthe virtual-circuitidentifier
(Vel).Avel,unlikeaglobaladdress,isasmall numberthathasonlyswitchscope;it

SECTION8.3VIRTUAL-CIRCUITNETWORKS 223
isusedbyaframebetweentwoswitches.Whenaframearrivesataswitch,ithasa
VCI;whenitleaves,ithasadifferentVCl.Figure8.11showshowtheVCIinadata
framechangesfromoneswitchtoanother.NotethataVCIdoesnotneedtobealarge
numbersinceeachswitchcanuseitsownuniqueset
ofVCls.
Figure8.11 Virtual-circuitidentifier
VCI I VCI
I
DatatEJ~ IDataI~~
-----===::::=------~..I'.. ~=====----
ThreePhases
Asinacircuit-switchednetwork,asourceanddestinationneedtogothroughthree
phasesinavirtual-circuitnetwork:setup,datatransfer,andteardown.Inthesetup
phase,thesourceanddestinationusetheirglobaladdressestohelpswitchesmaketable
entriesfortheconnection.Intheteardownphase,thesourceanddestinationinformthe
switchestodeletethecorrespondingentry.Datatransferoccursbetweenthesetwo
phases.Wefirstdiscussthedatatransferphase,whichismorestraightforward;wethen
talkaboutthesetupandteardownphases.
DataTransferPhase
Totransferaframefromasourcetoitsdestination,allswitchesneedtohaveatable
entryforthisvirtualcircuit.Thetable,initssimplestform,hasfourcolumns.This
meansthattheswitchholdsfourpieces
ofinformationforeachvirtualcircuitthatis
alreadysetup.
Weshowlaterhowtheswitchesmaketheirtableentries,butforthe
momentweassumethateachswitchhasatablewithentriesforallactivevirtualcir­
cuits.Figure8.12showssuchaswitchanditscorrespondingtable.
Figure8.12showsaframearrivingatport1withaVCI
of14.Whentheframe
arrives,theswitchlooksinitstabletofindport1andaVCI
of14.Whenitisfound,the
switchknowstochangetheVCIto22andsendouttheframefromport
3.
Figure8.13showshowaframefromsourceAreachesdestinationBandhowits
VCIchangesduringthetrip.EachswitchchangestheVCIandroutestheframe.
The datatransferphase
isactiveuntilthesourcesendsallitsframestothedestina­
tion.Theprocedureattheswitch
isthesameforeachframe ofamessage.Theprocess
createsavirtualcircuit,notarealcircuit,betweenthesourceanddestination.
SetupPhase
Inthesetupphase,aswitchcreatesanentryforavirtualcircuit.Forexample,suppose
sourceAneedstocreateavirtualcircuittoB.Twostepsarerequired:thesetuprequest
andtheacknowledgment.

224 CHAPTER 8SWITCHING
Figure8.12Switchandtablesinavirtual-circuitnetwork
Incoming Outgoing
PortVClPortVCl
1 14322
1 77 2 41
~'~
I
Data
~I
Data[EJ-+
lA3
I
Data@]-+
2
~
t
Figure8.13Source-to-destinationdatatransferinavirtual-circuitnetwork
IncomingOutgoing
PortVClPortVCl
I14366
IncomingOutgoing
PortVClPortVCI
2223 77
IncomingOutgoing
PortVCIPortVCl
166222
SetupRequestAsetuprequestframeissentfromthesourcetothedestination.
Figure8.14showstheprocess.
a.SourceAsendsasetup frametoswitch 1.
b.Switch1receivesthesetuprequestframe.ItknowsthataframegoingfromAtoB
goesoutthroughport
3.Howtheswitchhasobtainedthisinformationisapoint
coveredinfuturechapters.Theswitch,inthesetupphase,actsasapacketswitch;
ithasaroutingtablewhichisdifferentfromtheswitchingtable.Forthemoment,
assumethatitknowstheoutputport.Theswitchcreatesanentryinitstablefor

SECTION8.3VIRTUAL-CIRCUITNETWORKS 225
Figure8.14 Setuprequestinavirtual-circuitnetwork
IncomingOutgoing
PortIvcIPortIVCI
1
I143I
IncomingOutgoing
PortIVCIPortIVCI
2
1223I
VCI=77
IncomingOutgoing
PortIVCIPortIVCI
I I66
2I
thisvirtualcircuit,butitisonlyabletofillthree ofthefourcolumns. Theswitch
assignstheincomingport
(1)andchoosesanavailableincoming VCI(14)andthe
outgoingport(3).Itdoesnot
yetknowtheoutgoingVCI,whichwill befounddur­
ingtheacknowledgmentstep.
Theswitchthenforwardstheframethroughport3
toswitch2.
c.Switch2receivesthesetuprequestframe.Thesameeventshappenhereasat
switch
1;threecolumns ofthetablearecompleted:inthiscase,incomingport (l),
incomingVCI(66),andoutgoingport(2).
d.Switch3receivesthesetuprequestframe.Again,threecolumnsarecompleted:
incoming
port(2),incomingVCI(22),andoutgoingport(3).
e.DestinationBreceivesthesetupframe,and
ifitisreadytoreceiveframesfromA,
itassignsa VCItotheincomingframesthat comefromA, inthiscase77. This
VCIletsthedestinationknowthattheframes comefromA,and notothersources.
Acknowledgment Aspecialframe,calledthe acknowledgmentframe,completes
theentriesintheswitchingtables.Figure8.15showstheprocess.
a.Thedestinationsendsanacknowledgmenttoswitch3. Theacknowledgmentcarries
theglobalsourceanddestinationaddressessotheswitchknowswhichentryinthe
tableistobecompleted.
TheframealsocarriesVCI77,chosen bythedestinationas
theincoming
VCIforframesfromA.Switch3usesthisVCItocompletetheoutgoing
VCIcolumnforthisentry.Notethat77istheincomingVCIfordestinationB,but
theoutgoing
VCIforswitch3.
b.Switch3sendsanacknowledgmenttoswitch2thatcontainsitsincomingVCIinthe
table,choseninthepreviousstep.Switch2usesthisastheoutgoing
VCIinthetable.
c.Switch2sendsanacknowledgmenttoswitch1thatcontainsitsincoming VCIinthe
table,choseninthepreviousstep.Switch1usesthisastheoutgoingVCIinthetable.
d.Finallyswitch1sends anacknowledgmenttosourceAthatcontainsitsincoming
VCIinthetable,choseninthepreviousstep.
e.ThesourceusesthisastheoutgoingVCIforthedataframestobesent todestinationB.

226 CHAPTER 8SWITCHING
Figure8.15Setupacknowledgmentinavirtual-circuitnetwork
IncomingOutgoing
PortIVCIPortIVCI
21223 I77
IncomingOutgoing
PortIVCIPortIVCIII143166
VCI
==14 VCI==77
A1--==--;
~
o@
B
IncomingOutgoing
PortIVCIPort
IVCI
II662122
TeardowilPhase
Inthisphase,sourceA,aftersendingallframestoB,sendsaspecialframecalleda
teardownrequest.DestinationBrespondswithateardownconfirmationframe.All
switchesdeletethecorrespondingentryfromtheirtables.
Efficiency
Aswesaidbefore,resourcereservationinavirtual-circuitnetworkcanbemadeduring
thesetuporcanbeondemandduringthedatatransferphase.Inthefirstcase,thedelay
foreachpacketisthesame;inthesecondcase,eachpacketmayencounterdifferent
delays.Thereisonebigadvantageinavirtual-circuitnetworkeven
ifresourceallocation
isondemand.Thesourcecanchecktheavailability
oftheresources,withoutactually
reservingit.Considerafamilythatwants
todineatarestaurant.Althoughtherestaurant
maynotaccept reservations(allocation
ofthetablesisondemand),thefamilycancall
andfindoutthewaitingtime.Thiscansavethefamilytimeandeffort.
Invirtual-circuitswitching,allpacketsbelonging tothesamesourceanddestination
travelthesamepath;butthepacketsmayarrive
atthedestination
withdifferentdelays
ifresourceallocation isondemand.
DelayinVirtual-CircuitNetworks
Inavirtual-circuitnetwork,thereisaone-timedelayforsetupandaone-timedelayfor
teardown.
Ifresourcesareallocatedduringthesetupphase,there isnowaittimefor
individualpackets.Figure8.16showsthedelayforapackettravelingthroughtwo
switchesinavirtual-circuitnetwork.
Thepacketistravelingthroughtwoswitches(routers).Therearethreetransmis­
siontimes
(3T),threepropagationtimes
(3't),datatransferdepictedbythesloping
lines,asetupdelay(whichincludestransmissionandpropagationintwodirections),

SECTION8.4STRUCTUREOFASWITCH 227
Figure8.16 Delayinavirtual-circuitnetwork
I~I
"
~[--~---------------
~ ,
~
]
1;'ransmission
tIme
Time Time Time Time
andateardowndelay(whichincludestransmissionandpropagationinonedirection).
Weignoretheprocessingtimeineachswitch.Thetotaldelaytimeis
Totaldelay =3T+
3't+setupdelay +teardowndelay
Circuit-SwitchedTechnologyinWANs
Aswewillsee inChapter18,virtual-circuitnetworksareusedinswitched WANssuch
asFrameRelayand ATMnetworks.Thedatalinklayer ofthesetechnologiesiswell
suitedtothevirtual-circuittechnology.
Switchingatthedatalinklayer inaswitchedWANisnormally
implementedbyusingvirtual-circuittechniques.
8.4STRUCTUREOFASWITCH
Weuseswitchesincircuit-switchedandpacket-switchednetworks.Inthissection,we
discussthestructures
oftheswitchesused ineachtype ofnetwork.
StructureofCircuitSwitches
Circuitswitchingtodaycanuseeither oftwotechnologies:thespace-divisionswitchor
thetime-divisionswitch.
Space-DivisionSwitch
Inspace-divisionswitching,thepathsinthecircuitareseparatedfromoneanother
spatially.Thistechnologywasoriginallydesignedforuseinanalognetworksbutis
usedcurrentlyinbothanaloganddigitalnetworks.
Ithasevolvedthroughalonghistory
ofmanydesigns.

228 CHAPTER8SWITCHING
CrossbarSwitchA crossbarswitchconnects ninputsto moutputsinagrid,using
electronicmicroswitches(transistors)ateach
crosspoint(seeFigure8.17).Themajor
limitationofthisdesignisthenumber
ofcrosspointsrequired. Toconnectninputsto
moutputsusingacrossbarswitchrequires nxmcrosspoints.Forexample,toconnect
1000inputs
to1000outputsrequiresaswitchwith1,000,000crosspoints.Acrossbar
withthisnumber
ofcrosspointsisimpractical.Suchaswitchisalsoinefficientbecause
statisticsshowthat,inpractice,fewerthan
25percentofthecrosspointsareinuseat
anygiventime.Therestareidle.
Figure8.17Crossbarswitchwiththreeinputsandfouroutputs
2
30-+-·
.....--4.---.--.
IIIII IV
MultistageSwitch Thesolutiontothelimitationsofthecrossbarswitchisthe
multistageswitch,whichcombinescrossbarswitchesinseveral(normallythree)
stages,asshowninFigure8.18.Inasinglecrossbarswitch,onlyoneroworcolumn
(onepath)isactiveforanyconnection.Soweneed
Nx Ncrosspoints.Ifwecanallow
multiplepathsinsidetheswitch,wecandecreasethenumber
ofcrosspoints.Each
crosspointinthemiddlestagecan
beaccessedbymultiplecrosspointsinthefirstor
thirdstage.
Figure8.18Multistageswitch
Nln k Nln
Crossbars Crossbars Crossbars
n[ In
n[ InN N
n[ In
Stage1 Stage2 Stage3

SECTION8.4STRUCTUREOFASWITCH 229
Todesignathree-stageswitch,wefollowthesesteps:
1.Wedividethe Ninputlinesintogroups,each ofnlines.Foreachgroup,weuse
onecrossbar
ofsizenx k,wherekisthenumberofcrossbarsinthemiddlestage.
Inotherwords,thefirststagehasN/ncrossbars
ofnxkcrosspoints.
2.Weusekcrossbars,each ofsize(N/n)x(N/n)inthemiddlestage.
3.WeuseN/ncrossbars,each ofsizekxnatthethirdstage.
Wecancalculatethetotalnumber
ofcrosspointsasfollows:
N (NN)N (N)2-enxk)+k-x -+ -(kxn)=2kN+k -
n n n n n
Inathree-stageswitch,thetotalnumber ofcrosspointsis
2kN
+k(~Y
whichismuchsmaller thanthenumber ofcrosspointsinasingle-stageswitch (N
2
).
Example8.3
Designathree-stage,200x200switch (N=200)with k=4andn =20.
Solution
Inthefirststagewehave N/nor10crossbars,each ofsize20x 4.Inthesecondstage,wehave
4crossbars,each
ofsize10x10.Inthethirdstage,wehave 10crossbars,each ofsize4 x20.
Thetotalnumber
ofcrosspointsis2kN+k(N/n)2,or2000crosspoints.Thisis5percent ofthe
number
ofcrosspointsinasingle-stageswitch(200x200 =40,000).
ThemultistageswitchinExample8.3hasone drawback-blockingduringperiods
ofheavytraffic:Thewholeidea ofmultistageswitching istosharethecrosspointsin
themiddle-stagecrossbars.Sharingcancausealack
ofavailabilityiftheresourcesare
limitedandall userswantaconnectionatthesametime.Blockingreferstotimeswhen
oneinputcannotbeconnectedtoanoutputbecausethere
isnopathavailablebetween
them-allthepossibleintermediateswitchesareoccupied.
Inasingle-stageswitch,blockingdoesnotoccurbecauseeverycombination of
inputandoutputhasitsowncrosspoint;thereisalwaysapath.(Casesinwhichtwo
inputsaretryingtocontactthesameoutputdonotcount.Thatpath
isnotblocked;the
outputismerelybusy.)InthemultistageswitchdescribedinExample8.3,however,
only4
ofthefirst20inputscanusetheswitchatatime,only4 ofthesecond 20inputs
canusetheswitchatatime,andsoon.Thesmallnumber
ofcrossbarsatthemiddle
stagecreatesblocking.
Inlargesystems,suchasthosehaving10,000inputsandoutputs,thenumber
of
stagescanbeincreasedtocutdownonthenumber ofcrosspointsrequired.Asthenum­
ber
ofstagesincreases,however,possibleblockingincreasesaswell.Manypeoplehave
experiencedblockingonpublictelephonesystemsinthewake
ofanaturaldisaster
whenthecallsbeingmadetocheckonorreassurerelativesfaroutnumbertheregular
load
ofthesystem.

230 CHAPTER 8SWITCHING
Closinvestigatedthecondition ofnonblockinginmultistageswitchesandcameup
withthefollowingformula.Inanonblockingswitch,thenumber
ofmiddle-stage
switchesmustbeatleast
2n- 1.Inotherwords, weneedtohave k
22n-1.
Notethatthenumber ofcrosspointsisstillsmallerthanthatinasingle-stage
switch.Nowweneedtominimizethenumber
ofcrosspointswithafixed Nbyusing
theCloscriteria.
Wecantakethederivative oftheequationwithrespectto n(theonly
variable)andfindthevalue
ofnthatmakestheresultzero.This nmustbeequaltoor
greaterthan
(N/2)1/2.Inthiscase,thetotalnumber ofcrosspointsisgreaterthanorequal
to
4N[(2N)112-1].Inotherwords,theminimumnumber ofcrosspointsaccordingtothe
Closcriteriaisproportionalto
N
3
/2.
AccordingtoCloscriterion:
n
=(NI2)1/2
k>2n-1
Totalnumberofcrosspoints
24N[(2N)1/2-1]
Example8.4
Redesignthepreviousthree-stage,200 x200switch,usingtheCloscriteriawithaminimum
number
ofcrosspoints.
Solution
Weletn=(200/2)1/2,orn=10.Wecalculatek=2n-1=19.Inthefirststage,wehave200/10,
or20,crossbars,eachwith
lOX19crosspoints.Inthesecondstage,wehave19crossbars,
eachwith10
X10crosspoints.Inthethirdstage,wehave20crossbarseachwith 19X10
crosspoints.Thetotalnumber ofcrosspointsis20(10X19) +19(10X10) +20(19XlO) =
9500.Ifweuseasingle-stageswitch,weneed200 X200=40,000crosspoints.Thenumber
ofcrosspointsinthisthree-stageswitchis24percentthat ofasingle-stageswitch.More
pointsareneededthaninExample8.3
(5percent).Theextracrosspointsareneededtoprevent
blocking.
AmultistageswitchthatusestheCloscriteriaandaminimumnumber ofcrosspoints
stillrequiresahugenumberofcrosspoints.Forexample,tohavea100,000input/output
switch,weneedsomethingcloseto200millioncrosspoints(insteadof10billion).This
meansthat
ifatelephonecompanyneedstoprovideaswitchtoconnect100,000tele­
phonesinacity,itneeds200millioncrosspoints.Thenumbercanbereducedifwe
acceptblocking.
Today,telephonecompaniesusetime-divisionswitchingoracombina­
tion
ofspace-andtime-divisionswitches, aswewillseeshortly.
Time-DivisionSwitch
Time-divisionswitchingusestime-divisionmultiplexing(TDM)insideaswitch.The
mostpopulartechnologyiscalledthetime-slotinterchange(TSI).
Time-Slot
InterchangeFigure8.19showsasystemconnectingfourinputlinesto
fouroutputlines.Imaginethateachinputlinewantstosenddatatoanoutputline
accordingtothefollowingpattern:

SECTION8.4STRUCTUREOFASWITCH 231
Figure8.19 Time-slotinterchange
Time-divisionswitch
TSI,C{Jnt!olunit
1~3
2~4
3~1
4~2
ThefigurecombinesaTDMmultiplexer,aTDMdemultiplexer,andaTSIconsist­
ingofrandomaccessmemory(RAM)withseveralmemorylocations.Thesizeofeach
location
isthesameasthesizeofasingletimeslot.Thenumberoflocationsisthesame
asthenumberofinputs(inmostcases,thenumbers ofinputsandoutputsareequal).
TheRAMfillsupwithincomingdatafromtimeslotsintheorderreceived.Slotsare
thensentoutinanorderbasedonthedecisionsofacontrolunit.
Time-andSpace-DivisionSwitchCombinations
Whenwecomparespace-divisionandtime-divisionswitching,someinterestingfacts
emerge.Theadvantageofspace-divisionswitching
isthatitisinstantaneous.Itsdisadvan­
tage
isthenumberofcrosspointsrequiredtomakespace-divisionswitchingacceptablein
termsofblocking.
Theadvantageoftime-divisionswitchingisthatit needs
nocrosspoints.Itsdisad­
vantage,inthecaseofTSI,isthatprocessingeachconnectioncreatesdelays.Eachtime
slotmustbestoredbytheRAM,thenretrievedandpassedon.
Inathirdoption,wecombinespace-divisionandtime-divisiontechnologiesto
takeadvantage
ofthebestofboth.Combiningthetworesultsinswitchesthatare
optimizedbothphysically(thenumber
ofcrosspoints)andtemporally(theamount
ofdelay).Multistageswitchesofthissortcanbedesigned astime-space-time(TST)
switch.
Figure8.20showsasimpleTSTswitchthatconsistsoftwotimestagesandone
spacestageandhas
12inputsand12outputs.Insteadofonetime-divisionswitch,it
dividestheinputsintothreegroups(offourinputseach)anddirectsthemtothreetime­
slotinterchanges.Theresultisthattheaveragedelayisone-thirdofwhatwouldresult
fromusingonetime-slotinterchangetohandleall
12inputs.
Thelaststageisamirrorimageofthefirststage.Themiddlestageisaspace­
divisionswitch(crossbar)thatconnectstheTSIgroupstoallowconnectivitybetween
allpossibleinputandoutputpairs(e.g.,toconnectinput3
ofthefirstgrouptooutput7
ofthesecondgroup).

232 CHAPTER 8SWITCHING
Figure8.20 Time-space-timeswitch
TST
Space
StructureofPacketSwitches
Aswitchusedinapacket-switchednetworkhasadifferent structurefromaswitchused
inacircuit-switchednetwork.Wecansaythatapacketswitchhasfourcomponents:
inputports,outputports,theroutingprocessor, andtheswitchingfabric, asshown
inFigure8.21.
Figure8.21 Packetswitchcomponents
--------------------------------------1
Output
ports
Switchingfabric
Routing
processor
Inputports
1'--__----'
IL _
InputPorts
Aninputportperformsthephysicalanddatalinkfunctions ofthepacketswitch.The
bitsareconstructedfromthereceivedsignal.Thepacketisdecapsulatedfromtheframe.
Errorsaredetectedandcorrected.Thepacket
isnowreadytoberoutedbythenetwork
layer.Inadditiontoaphysicallayerprocessorand adatalinkprocessor,theinputport
hasbuffers(queues)toholdthepacketbeforeitisdirectedtotheswitchingfabric.
Figure8.22showsaschematicdiagram
ofaninputport.

SECTION8.4STRUCTUREOFASWITCH 233
Figure8.22 Inputport
Inputport
Physicallayer
processor
Data
linklayer
processor
OutputPort
Theoutputportperformsthesamefunctionsastheinputport,butinthereverseorder.
Firsttheoutgoingpacketsarequeued,thenthepacket
isencapsulatedinaframe,and
finallythephysicallayerfunctionsareappliedtotheframetocreatethesignaltobe
sentontheline.Figure8.23showsaschematicdiagram
ofanoutputport.
Figure8.23 Outputport
Outputport
Data
linklayer
processor
Physicallayer
processor
ROlltingProcessor
Theroutingprocessorperformsthefunctions ofthenetworklayer.Thedestination
addressisusedtofindtheaddress
ofthenexthopand,atthesametime,theoutputport
numberfromwhichthepacketissentout.Thisactivityissometimesreferredtoas
tablelookup becausetheroutingprocessorsearchestheroutingtable.Inthenewer
packetswitches,thisfunction
oftheroutingprocessorisbeingmovedtotheinputports
tofacilitateandexpeditetheprocess.
Switching
"Fabrics
Themostdifficulttaskinapacketswitch istomovethepacketfromtheinputqueueto
theoutputqueue.Thespeedwithwhichthis
isdoneaffectsthesize oftheinput/output
queueandtheoveralldelayinpacketdelivery.Inthepast,whenapacketswitchwas
actuallyadedicatedcomputer,thememory
ofthecomputerorabuswasused asthe
switchingfabric.Theinputportstoredthepacketinmemory;theoutputportretrieved
thepacketfrommemory.Today,packetswitchesarespecializedmechanismsthatusea
variety
ofswitchingfabrics. Webrieflydiscusssome ofthesefabricshere.
CrossbarSwitchThe simplesttype ofswitchingfabricisthecrossbarswitch,dis­
cussedintheprevioussection.
BanyanSwitchAmorerealisticapproachthanthecrossbarswitchisthe banyan
switch(namedafterthebanyantree).Abanyanswitchisamultistageswitchwith

234 CHAPTER 8SWITCHING
microswitchesateachstage thatroutethepacketsbasedontheoutputportrepresented as
abinarystring.Forninputsandnoutputs,wehavelog2nstageswithnl2microswitches
ateachstage.Thefirststageroutesthepacketbasedonthehigh-orderbit
ofthebinary
string.Thesecondstageroutesthepacketbasedonthesecondhigh-orderbit,andsoon.
Figure
8.24showsabanyanswitchwitheightinputsandeightoutputs.Thenumber of
stagesis Iog
2
(8)
=3.
Figure8.24Abanyanswitch
Leftbit Middlebit Rightbit
O~
l~
~6
~7
Figure8.25showstheoperation.Inpart a,apackethasarrivedatinputport1and
mustgotooutputport6(110inbinary).Thefirstmicroswitch
(A-2)routesthepacket
basedonthefirstbit(1),thesecondmicroswitch(B-4)routesthepacketbasedonthe
secondbit
(1),andthethirdmicroswitch(C-4)routesthepacketbasedonthethirdbit(0).
Inpartb,apackethasarrivedatinputport5andmustgotooutputport
2(010in
binary).Thefirstmicroswitch
(A-2)routesthepacketbasedonthefirstbit(0),thesec­
ondmicroswitch(B-2)routesthepacketbasedonthesecondbit (l),andthethird
microswitch
(C-2)routesthepacketbased onthethirdbit(0).
Figure8.25 Examplesofroutinginabanyanswitch
0 0 0 0
1 1
1 I
2 2 2 2
3 3 3 3
4 4 4
4
5 5 5 5
6 6 6 6
7 7 7 7
a.Input1sendingacelltooutput6(110) b.Input5sendingacellto output2(010)

SECTION8.6KEYTERMS 235
Figure8.26 Batcher-banyanswitch
Banyanswitch
O~
l~
6~
7~
Batcher
switch
Trap
module
~2
~3
~--+ro ~"'lr-r~4
~5
~6
~7
Batcher-BanyanSwitch Theproblemwiththebanyanswitchisthepossibility of
internalcollisionevenwhentwopacketsarenotheadingforthesameoutputport. We
cansolvethisproblembysortingthearrivingpacketsbasedontheirdestinationport.
K.E.Batcherdesignedaswitchthatcomesbeforethebanyanswitchandsortsthe
incomingpacketsaccordingtotheirfinaldestinations.Thecombinationiscalledthe
Batcher-banyanswitch. Thesortingswitchuseshardwaremergingtechniques,butwe
donotdiscussthedetailshere.Normally,anotherhardware modulecalleda
trapis
addedbetweentheBatcherswitchandthebanyanswitch(seeFigure8.26)Thetrap
modulepreventsduplicatepackets(packetswiththesameoutputdestination)from
passingtothebanyanswitchsimultaneously.Onlyonepacketforeachdestinationis
allowedateachtick;
ifthereismorethanone,theywaitforthenexttick.
8.5RECOMMENDED READING
Formoredetailsaboutsubjectsdiscussedinthischapter,werecommendthefollowing
books.Theitemsinbrackets[
...]refertothereferencelistattheend ofthetext.
Books
SwitchingisdiscussedinChapter 10of[Sta04]andChapters 4and7 of[GW04].Circuit­
switching
isfullydiscussedin [BELOO].
8.6KEYTERMS
banyanswitch
Batcher-banyanswitch
blocking
circuitswitching
circuit-switchednetwork
crossbarswitch
crosspoint
datatransferphase
datagram
datagramnetwork
endsystem
inputport

236 CHAPTER 8SWITCHING
multistageswitch
outputport
packet-switchednetwork
routingprocessor
setupphase
space-divisionswitching
switch
switching
switchingfabric
tablelookup
teardownphase
time-divisionswitching
time-slotinterchange(TSI)
time-space-time(TST)
switch
trap
virtual-circuitidentifier(VCI)
virtual-circuitnetwork
8.7SUMMARY
oAswitchednetworkconsists ofaseriesofinterlinkednodes,calledswitches.Tradi­
tionally'threemethods
ofswitchinghavebeenimportant:circuitswitching,packet
switching,andmessageswitching.
oWecandividetoday'snetworksintothreebroadcategories:circuit-switchednetworks,
packet-switchednetworks,andmessage-switched.Packet-switchednetworkscanalso
bedividedintotwosubcategories:virtual-circuitnetworksanddatagramnetworks
oAcircuit-switchednetwork ismadeofasetofswitchesconnectedbyphysicallinks,
inwhicheachlinkisdividedintonchannels.Circuitswitchingtakesplaceatthe
physicallayer.
Incircuitswitching,theresourcesneedtobereservedduringthe
setupphase;theresourcesremaindedicatedfortheentireduration
ofdatatransfer
phaseuntiltheteardownphase.
oInpacketswitching,there isnoresourceallocationforapacket.Thismeansthat
thereisnoreservedbandwidthonthelinks,andthereisnoscheduledprocessing
timeforeachpacket.Resourcesareallocatedondemand.
oInadatagramnetwork,eachpacketistreatedindependently ofallothers.Packetsin
thisapproacharereferredto
asdatagrams.Therearenosetuporteardownphases.
oAvirtual-circuitnetwork isacrossbetweenacircuit-switchednetworkandadata­
gramnetwork.Ithassomecharacteristics
ofboth.
oCircuitswitchinguseseither oftwotechnologies:thespace-divisionswitchorthe
time-divisionswitch.
oAswitchinapacket-switchednetworkhasadifferentstructurefromaswitchusedin
acircuit-switchednetwork.Wecansaythatapacketswitchhasfourtypesofcompo­
nents:inputports,outputports,aroutingprocessor,andswitchingfabric.
8.8PRACTICESET
ReviewQuestions
I.Describetheneedforswitchinganddefineaswitch.
2.Listthethreetraditionalswitchingmethods.Whatarethemostcommontoday?

SECTION8.8PRACTICESET 237
3.Whatarethetwoapproachestopacket-switching?
4.Compareandcontrastacircuit-switchednetworkandapacket-switchednetwork.
5.
Whatistherole oftheaddressfieldinapackettravelingthrougha datagram
network?
6.
Whatistherole oftheaddressfieldinapackettravelingthroughavirtual-circuit
network?
7.Comparespace-divisionandtime-divisionswitches.
8.WhatisTSIanditsroleinatime-divisionswitching?
9.Defineblockinginaswitchednetwork.
10.Listfourmajorcomponents
ofapacketswitchandtheirfunctions.
Exercises
11.Apathinadigitalcircuit-switchednetworkhasadatarate ofIMbps.Theexchange
of1000bitsisrequiredforthesetupandteardownphases. Thedistancebetween
twopartiesis5000km.Answerthefollowingquestions
ifthepropagataionspeedis
2
X10
8
m:
a.Whatisthetotaldelay if1000bits ofdataareexchangedduringthedatatransfer
phase?
b.Whatisthetotaldelay if100,000bits ofdataareexchangedduringthedata
transferphase?
c.Whatisthetotaldelay if1,000,000bits ofdataareexchangedduringthedata
transferphase?
d.Findthedelayper1000bits ofdataforeach oftheabovecasesandcompare
them.
Whatcanyouinfer?
12.Fiveequal-size
datagramsbelongingtothesamemessageleaveforthedestina­
tion
oneafteranother.However,theytravelthroughdifferentpathsasshownin
Table8.1.
Table8.1 Exercise12
Datagram PathLength VisitedSwitches
1 3200Km 1,3,5
2 11,700Km 1,2,5
3 12,200 Km 1,2,3,5
4 10,200 Km 1,4,5
5 10,700Km 1,4,3,5
Weassume thatthedelayforeachswitch(includingwaitingandprocessing)is3,
10,20,7,and20msrespectively.Assumingthatthepropagationspeedis2 x10
8
m,
findtheorderthedatagramsarrive
atthedestinationandthedelayforeach.Ignore
anyotherdelaysintransmission.

238 CHAPTER 8SWITCHING
13.Transmissionofinformationinanynetworkinvolvesend-to-endaddressingand
sometimeslocaladdressing(suchasYCI).Table8.2showsthetypesofnetworks
andtheaddressingmechanismusedineach
ofthem.
Table8.2Exercise13
Network Setup DataTransfer Teardown
Circuit-switched End-ta-end End-ta-end
Datagram End-ta-end
Virtual-circuit End-to-end Local End-to-end
Answerthefollowingquestions:
a.Whydoesacircuit-switchednetworkneedend-to-endaddressingduringthesetup
andteardownphases?Whyarenoaddressesneededduringthedatatransferphase
forthistype
ofnetwork?
b.Whydoesadatagramnetworkneedonlyend-to-endaddressingduringthedata
transferphase,butnoaddressingduringthesetupandteardownphases?
c.Whydoesavirtual-circuitnetworkneedaddressesduringallthreephases?
14.Wementionedthattwotypes ofnetworks,datagramandvirtual-circuit,needa
routingorswitchingtabletofindtheoutputportfromwhichtheinformation
belongingtoadestinationshouldbesentout,butacircuit-switchednetworkhas
noneedforsuchatable.Givethereasonforthisdifference.
15.Anentryintheswitchingtableofavirtual-circuitnetworkisnormallycreated
duringthesetupphaseanddeletedduringtheteardownphase.Inotherwords,the
entriesinthistype
ofnetworkreflectthecurrentconnections,theactivityinthe
network.Incontrast,theentriesinaroutingtable
ofadatagramnetworkdonot
depend
onthecurrentconnections;theyshowtheconfiguration ofthenetworkand
howanypacketshouldberoutedtoafinaldestination.Theentriesmayremain
thesameeven
ifthereisnoactivityinthenetwork.Theroutingtables,however,are
updated
iftherearechangesinthenetwork.Canyouexplainthereasonforthese
twodifferentcharacteristics?Canwesaythatavirtual-circuitisa
connection­
oriented
networkandadatagramnetworkisa connectionLessnetworkbecauseofthe
abovecharacteristics?
16.Theminimumnumberofcolumnsinadatagramnetworkistwo;theminimumnum­
berofcolumns
inavirtual-circuitnetworkisfour.Canyouexplainthereason?Isthe
differencerelated
tothetypeofaddressescarriedinthepackets ofeachnetwork?
17.Figure8.27showsaswitch(router)inadatagramnetwork.
Findtheoutputportforpacketswiththefollowingdestinationaddresses:
Packet
1:7176
Packet
2:1233
Packet
3:8766
Packet
4:9144
18.Figure8.28showsaswitchinavirtualcircuitnetwork.

SECTION8.8PRACTICESET 239
Figure8.27Exercise17
DestinationOutput
address port
1233
3
1456 2
3255 1
4470 4
7176 2
8766 3
9144 2
4
2 3
Figure8.28Exercise18
Incoming Outgoing
PortVCI PortVCI
1 14 3 22
2 71 4 41
2 92 1 45
3 58 2 43
3 78 2 70
4 56 3 11
2
4
FindtheoutputportandtheoutputVCIforpacketswiththefollowinginputport
andinputVCIaddresses:
Packet
1:3,78
Packet
2:2,92
Packet
3:4,56
Packet
4:2,71
19.Answerthefollowingquestions:
a.Canaroutingtableinadatagramnetworkhavetwoentrieswiththesamedestina­
tionaddress?Explain.
b.Canaswitchingtableinavirtual-circuitnetworkhavetwoentrieswiththesame
inputportnumber?Withthesameoutputportnumber?Withthesameincoming
VCls?WiththesameoutgoingVCls?Withthesameincomingvalues(port,VCI)?
Withthesameoutgoingvalues(port,VCI)?
20.
Itisobviousthatarouteroraswitchneedstodosearchingtofindinformationin
thecorrespondingtable.Thesearchinginaroutingtableforadatagramnetwork
is
basedonthedestinationaddress;thesearchinginaswitchingtableinavirtual­
circuitnetwork
isbasedonthecombination ofincomingportandincomingVCI.
Explainthereasonanddefinehowthesetablesmustbeordered(sorted)basedon
thesevalues.
2].Considerann Xkcrossbarswitchwithninputsand koutputs.
a.Canwesaythatswitchactsasamultiplexer ifn>k?
b.Canwesaythatswitchactsasademultiplexer ifn<k?

240 CHAPTER8SWITCHING
22.Weneedathree-stagespace-divisionswitchwithN =100.Weuse10crossbarsat
thefirstandthirdstagesand 4crossbarsatthemiddlestage.
a.Drawtheconfigurationdiagram.
b.Calculatethetotalnumber ofcrosspoints.
c.Findthepossiblenumber ofsimultaneousconnections.
d.Findthepossiblenumberofsimultaneousconnections ifweuseonesinglecross­
bar(100x100).
e.Findtheblockingfactor,theratio ofthenumberofconnectionsincandin d.
23.RepeatExercise22 ifweuse6crossbarsatthemiddlestage.
24.Redesigntheconfiguration
ofExercise22usingtheCloscriteria.
25.
Weneedtohaveaspace-divisionswitchwith1000inputsandoutputs.Whatisthe
totalnumber
ofcrosspointsineach ofthefollowingcases?
a.Usingonesinglecrossbar.
b.Usingamulti-stageswitchbasedontheCloscriteria
26.
Weneedathree-stagetime-space-timeswitchwithN =100.Weuse10TSIsatthe
firstandthirdstagesand 4crossbarsatthemiddlestage.
a.Drawtheconfigurationdiagram.
b.Calculatethetotalnumber ofcrosspoints.
c.Calculatethetotalnumber ofmemorylocationsweneedfortheTSIs.

CHAPTER9
UsingTelephone andCableNetworks
forDataTransmission
Telephonenetworkswereoriginallycreatedtoprovidevoicecommunication.Theneed
tocommunicatedigitaldataresultedintheinvention
ofthedial-upmodem.Withthe
advent
oftheInternetcametheneedforhigh-speeddownloadinganduploading;the
modemwasjusttooslow.Thetelephonecompaniesaddedanewtechnology,the
digital
subscriberline
(DSL).Althoughdial-upmodemsstillexistinmanyplacesalloverthe
world,DSLprovidesmuchfasteraccesstotheInternetthroughthetelephonenetwork.
Inthischapter,wefirstdiscussthebasicstructure
ofthetelephonenetwork. Wethensee
howdial-upmodemsandDSLtechnologyusethesenetworkstoaccesstheInternet.
Cablenetworkswereoriginallycreatedtoprovideaccessto
TVprogramsforthose
subscriberswhohadnoreceptionbecause
ofnaturalobstructionssuchasmountains.
Laterthecablenetworkbecamepopularwithpeoplewho
justwantedabettersignal.In
addition,cablenetworksenabledaccesstoremotebroadcastingstationsviamicrowave
connections.Cable
TValsofoundagoodmarketinInternetaccessprovisionusing
some
ofthechannelsoriginallydesignedforvideo.Afterdiscussingthebasicstructure
ofcablenetworks,wediscusshowcablemodemscanprovideahigh-speedconnection
totheInternet.
9.1TELEPHONENETWORK
Telephonenetworksusecircuitswitching.Thetelephonenetworkhaditsbeginnings
inthelate1800s.Theentirenetwork,whichisreferredtoasthe
plainoldtelephone
system(POTS),
wasoriginallyananalogsystemusinganalogsignalstotransmitvoice.
Withtheadvent
ofthecomputerera,thenetwork,inthe1980s,begantocarrydatain
additiontovoice.Duringthelastdecade,thetelephonenetworkhasundergonemany
technicalchanges.Thenetworkisnowdigitalaswellasanalog.
MajorComponents
Thetelephonenetwork,asshowninFigure9.1,ismade ofthreemajorcomponents:
localloops,trunks,andswitchingoffices.Thetelephonenetworkhasseverallevels
of
switchingofficessuchas endoffices,tandemoffices,andregionaloffices.
241

242 CHAPTER9USING1ELEPHONE ANDCABLENETWORKSFORDATATRANSMISSION
Figure9.1 Atelephonesystem
Trunk
Tandem
offices
Trunk
Regionaloffices
LocalLoops
Onecomponent ofthetelephonenetworkisthe localloop, atwisted-paircablethatcon­
nectsthesubscribertelephonetothenearestendofficeorlocalcentraloffice.Thelocal
loop,whenusedforvoice,hasabandwidthof
4000Hz(4kHz).Itisinterestingtoexamine
thetelephonenumberassociatedwitheachlocalloop.Thefirstthreedigits
ofalocaltele­
phonenumberdefinetheoffice,andthenextfourdigitsdefinethelocalloopnumber.
Trunks
Trunksaretransmissionmediathathandlethecommunicationbetweenoffices.A
trunknormallyhandleshundredsorthousands
ofconnectionsthroughmultiplexing.
Transmissionisusuallythroughopticalfibersorsatellitelinks.
SwitchingOffices
Toavoidhavingapermanentphysicallinkbetweenanytwosubscribers,thetelephone
companyhasswitcheslocatedina
switchingoffice. Aswitchconnectsseverallocal
loopsortrunksandallowsaconnectionbetweendifferentsubscribers.
LATAs
Afterthedivestiture of1984(seeAppendixE),theUnitedStateswasdividedintomore
than
200local-accesstransportareas(LATAs). Thenumber ofLATAshasincreased
sincethen.A
LATAcanbeasmallorlargemetropolitanarea.Asmallstatemayhaveone
single
LATA;alargestatemayhaveseveralLATAs.A LATAboundarymayoverlapthe
boundary
ofastate;part ofaLATAcanbeinonestate,partinanotherstate.
Intra-LATAServices
Theservicesoffered
bythecommoncarriers (telephonecompanies)insidea LATAare
called
intra-LATAservices.Thecarrierthathandlestheseservicesiscalleda local
exchangecarrier(LEC).
BeforetheTelecommunicationsAct of1996(seeAppendix E),
intra-LATAservicesweregrantedtoonesinglecarrier.Thiswasamonopoly.After1996,
morethanonecarriercouldprovideservicesinsidea
LATA.Thecarrierthatprovidedser­
vicesbefore1996ownsthecablingsystem(localloops)andiscalledthe
incumbentlocal
exchange
carrier(ILEC).Thenewcarriersthat canprovideservicesarecalled
competitivelocalexchange carriers(CLECs).Toavoidthecosts ofnewcabling,it

SECTION9.1TELEPHONENETWORK 243
wasagreedthattheILECswouldcontinuetoprovidethemainservices,andtheCLECs
wouldprovideotherservicessuchasmobiletelephoneservice,tollcallsinsidea
LATA,
andsoon.Figure9.2showsa LATAandswitchingoffices.
Intra-LATAservices areprovidedbylocalexchangecarriers.Since
1996,therearetwo
types
ofLECs:incumbentlocalexchangecarriers andcompetitivelocalexchangecarriers.
Figure9.2 SwitchingofficesinaLATA
Tandem(toll)offices
Communicationinsidea LATAishandledbyendswitchesandtandemswitches.A
callthatcanbecompletedbyusingonlyendofficesisconsideredtoll-free.Acallthat
hastogothroughatandemoffice(intra-LATAtolloffice)ischarged.
Inter-LATAServices
TheservicesbetweenLATAsarehandled byinterexchangecarriers(IXCs).These
carriers,sometimescalled
long-distancecompanies, providecommunicationservices
betweentwocustomersindifferentLATAs.Aftertheact
of1996(seeAppendixE),
theseservicescanbeprovidedbyanycarrier,includingthoseinvolvedinintra-LATA
services.Thefieldiswideopen.Carriersprovidinginter-LATAservicesincludeAT&T,
MCI,WorldCom,Sprint,andVerizon.
TheIXCsarelong-distancecarriersthatprovidegeneraldatacommunicationsser­
vicesincludingtelephoneservice.AtelephonecallgoingthroughanIXCisnormally
digitized,withthecarriersusingseveraltypes
ofnetworkstoprovideservice.
PointsofPresence
Aswediscussed,intra-LATAservicescanbeprovidedbyseveralLECs(oneILECand
possiblymorethanoneCLEC).
Wealsosaidthatinter-LATAservicescanbeprovided
byseveralIXCs.Howdothesecarriersinteractwithoneanother?Theansweris,viaa
switchingofficecalleda
pointofpresence(POP).EachIXCthatwants toprovideinter­
LATAservicesina LATAmusthaveaPOPinthat LATA.TheLECsthatprovideservices
insidethe
LATAmustprovideconnectionssothateverysubscribercanhaveaccess toall
POPs.Figure9.3illustratestheconcept.
Asubscriberwhoneeds
tomakeaconnectionwithanothersubscriberisconnected
first
toanendswitchandthen,eitherdirectlyorthroughatandemswitch,toaPOP.The

244 CHAPTER9USINGTELEPHONE ANDCABLENETWORKSFORDATATRANSMISSION
Figure9.3 Pointofpresences(POPs)
LATA
callnowgoesfromthePOP ofanIXC(theonethesubscriberhaschosen)inthesource
LATAtothePOP ofthesameIXCinthedestination LATA.Thecallispassedthrough
thetolloffice
oftheIXCandiscarriedthroughthenetworkprovidedbytheIXC.
Signaling
Thetelephonenetwork,atitsbeginning,usedacircuit-switchednetworkwithdedicated
links(multiplexinghadnotyetbeeninvented)totransfervoicecommunication.Aswe
sawinChapter
8,acircuit-switchednetworkneedsthesetupandteardownphasesto
establishandterminatepathsbetweenthetwocommunicatingparties.Inthebeginning,
thistaskwasperformedbyhumanoperators.Theoperatorroomwasacentertowhich
allsubscriberswereconnected.Asubscriberwhowishedtotalktoanothersubscriber
pickedupthereceiver(off-hook)andrangtheoperator.Theoperator,afterlisteningto
thecallerandgettingtheidentifier
ofthecalledparty,connectedthetwobyusingawire
withtwoplugsinsertedintothecorrespondingtwojacks.Adedicatedcircuitwascreated
inthis
way.Oneoftheparties,aftertheconversationended,informedtheoperatorto
disconnectthecircuit.Thistypeofsignaling
iscalledin-bandsignaling becausethesame
circuitcanbeusedforbothsignalingandvoicecommunication.
Later,thesignalingsystembecameautomatic.Rotarytelephoneswereinventedthat
sentadigitalsignaldefiningeachdigitinamultidigittelephonenumber.Theswitchesin
thetelephonecompaniesusedthedigitalsignalstocreateaconnectionbetweenthecaller
andthe calledparties.Bothin-bandand
out-of-bandsignaling wereused.Inin-band
signaling,the4-kHzvoicechannelwasalsoused
toprovidesignaling.Inout-of-band
signaling,aportion
ofthevoicechannelbandwidthwasusedforsignaling;thevoice
bandwidthandthesignalingbandwidthwereseparate.

SECTION9.1TELEPHONENETWORK 245
Astelephonenetworksevolvedintoacomplexnetwork,thefunctionality ofthesig-
nalingsystemincreased.Thesignalingsystemwasrequiredtoperformothertaskssuchas
1.Providingdialtone,ringtone,andbusytone
2.Transferringtelephonenumbersbetweenoffices
3.Maintainingandmonitoringthecall
4.Keepingbillinginformation
5.Maintainingandmonitoringthestatus ofthetelephonenetworkequipment
6.Providingotherfunctionssuch ascallerID,voicemail,andsoon
Thesecomplextasksresultedintheprovision
ofaseparatenetworkforsignaling.This
meansthatatelephonenetworktodaycanbethought
ofastwonetworks:asignaling
networkandadatatransfernetwork.
Thetasksof datatransferandsignalingareseparatedinmoderntelephonenetworks:
datatransferisdone byonenetwork,signaling byanother.
However,weneed toemphasizeapointhere.Althoughthetwonetworksareseparate,
thisdoesnotmeanthatthereareseparatephysicallinkseverywhere;thetwonetworks
mayuseseparatechannels
ofthesamelinkinparts ofthesystem.
DataTransferNetwork
Thedatatransfernetworkthatcancarrymultimediainformationtodayis,forthemost
part,acircuit-switchednetwork,althoughitcanalsobeapacket-switchednetwork.This
networkfollowsthesametype
ofprotocolsandmodel asothernetworksdiscussedin
thisbook.
Signaling Network
Thesignalingnetwork,
whichisourmainconcerninthissection, isapacket-switched
networkinvolvingthelayerssimilartothoseintheOSImodel
orInternetmodel,dis­
cussedinChapter
2.Thenatureofsignalingmakesitmoresuited toapacket-switching
networkwithdifferentlayers.Forexample,theinformationneeded
toconveyatelephone
addresscaneasilybeencapsulatedinapacketwithalltheerrorcontrolandaddressing
information.Figure9.4showsasimplified situation
ofatelephonenetworkinwhichthe
twonetworksareseparated.
Theusertelephoneorcomputerisconnected
tothesignalpoints(SPs).Thelink
betweenthetelephonesetandSPiscommonforthetwonetworks.Thesignalingnet­
workusesnodescalledsignal
transportports(STPs)thatreceiveandforwardsignaling
messages.Thesignalingnetworkalsoincludesaservicecontrol
point(SCP)thatcon­
trolsthewholeoperation
ofthenetwork.Othersystemssuch asadatabasecentermay
beincludedtoprovidestoredinformationabouttheentiresignalingnetwork.
SignalingSystemSeven (5S7)
Theprotocolthatisusedinthesignalingnetwork iscalledSignalingSystemSeven(SS7).
Itisverysimilar tothefive-layerInternetmodel wesawinChapter 2,butthelayershave
differentnames,
asshowninFigure9.5.

246 CHAPTER 9USINGTELEPHONE ANDCABLENETWORKSFORDATATRANSMISSION
Figure9.4 Datatransfer andsignalingnetworks
SP:Signalpoint
STP:Signaltransferpoint
Database
Figure9.5Layersin SS7
Signalingnetwork
Datatransfernetwork
Upperlayers
,',T(;~ __
Networklayer
Datalinklayer
Physicallayer
TUP
SCCP
MTPlevel3
MTPIevel2
MTPlevell
~SNP,I,
r,;":~-
MTP:Messagetransferpart
SCCP:Signalingconnectioncontrolpoint
TeAP:Transactioncapabilitiesapplicationport
TUP:Telephoneuserport
ISUP:ISDNuserport
PhysicalLayer: MTPLevel1ThephysicallayerinSS7calledmessage transport
part(MTP)level Iusesseveralphysicallayerspecificationssuch asT-l(1.544Mbps)
andDCa(64kbps).
DataLinkLayer:MTPLevel2TheMTPlevel2layerprovidestypicaldatalink
layerservicessuch
aspacketizing,usingsourceanddestinationaddressinthepacket
header,andCRCforerrorchecking.
NetworkLayer:
MTPLevel3TheMTPlevel3layerprovidesend-to-endconnectivity
byusingthedatagramapproachtoswitching.Routersandswitchesroutethesignalpackets
fromthesourcetothedestination.
TransportLayer:SCCPThesignalingconnectioncontrol point(SCCP)isused
forspecialservicessuchasSaO-callprocessing.
UpperLayers: TUP,TCAP, andISUPTherearethreeprotocolsattheupperlayers.
Telephone
userport(TUP)isresponsibleforsetting upvoicecalls.Itreceivesthedialed

SECTION9.1TELEPHONENETWORK 247
digitsandroutesthecalls. Transactioncapabilitiesapplicationport(TCAP)provides
remotecallsthatlet
anapplicationprogramonacomputerinvokeaprocedureonanother
computer.ISDN
userport(ISUP)canreplaceTUPtoprovide servicessimilar tothose
ofanISDNnetwork.
ServicesProvided byTelephoneNetworks
Telephonecompaniesprovidetwotypes ofservices:analoganddigital.
AnalogServices
Inthebeginning,telephonecompaniesprovidedtheirsubscriberswithanalogservices.
Theseservicesstillcontinuetoday.
Wecancategorizetheseservices aseitheranalog
switchedservicesor analogleasedservices.
AnalogSwitchedServicesThis
isthefamiliardial-upservicemostoftenencountered
whenahometelephone
isused.Thesignalonalocalloopisanalog,andthebandwidth is
usuallybetween 0and4000Hz.Alocalcallservice isnormallyprovidedforaflatmonthly
rate,althoughinsome
LATAs,thecarrierchargesforeachcallorasetofcalls.Therationale
foranonflat-ratechargeis
toprovidecheaperserviceforthosecustomerswhodonot
makemanycalls.Atollcallcanbeintra-LATAorinter-LATA.
IftheLATAisgeographi­
callylarge,acallmaygothroughatandemoffice(tolloffice)andthesubscriberwillpaya
feeforthecall.Theinter-LATAcallsarelong-distancecallsandarechargedassuch.
Anotherservice
iscalled800service.Ifasubscriber(normallyanorganization)
needstoprovidefreeconnectionsforothersubscribers(normallycustomers),
itcan
requestthe800service.Inthiscase,thecall
isfreeforthecaller,butitispaidbythe
callee.Anorganizationusesthisservice
toencouragecustomerstocall.Therateisless
expensivethanthatforanormallong-distancecall.
The
wide-areatelephoneservice(WATS)istheopposite ofthe800service.The
latterareinboundcallspaidbytheorganization;theformerareoutboundcallspaidby
theorganization.Thisserviceisalessexpensivealternativetoregulartollcalls;
chargesarebasedonthenumber
ofcalls.Theservicecanbespecifiedasoutbound
callstothesamestate,toseveralstates,ortothewholecountry,withratescharged
accordingly.
The900servicesarelikethe
800service,inthattheyareinboundcallstoasub­
scriber.However,unlikethe
800service,thecallispaidbythecallerandisnormally
muchmoreexpensivethananormallong-distancecall.Thereasonisthatthecarrier
charges
twofees:thefirst isthelong-distancetoll,andthesecondisthefeepaid tothe
calleeforeachcall.
Analog
LeasedServiceAn analogleasedserviceofferscustomerstheopportunity
toleasealine,sometimescalledadedicatedline,thatispermanentlyconnectedto
anothercustomer.Althoughtheconnectionstillpassesthroughtheswitchesinthetele­
phonenetwork,subscribersexperience
itasasinglelinebecausetheswitchisalways
closed;nodialingisneeded.
DigitalServices
Recentlytelephonecompaniesbeganofferingdigitalservicestotheirsubscribers.Digital
servicesarelesssensitivethananalogservicestonoiseandotherformsofinterference.

248 CHAPTER9USINGTELEPHONE ANDCABLENETWORKSFORDATATRANSMISSION
Thetwomostcommondigitalservicesareswitched/56serviceanddigital dataservice
(DDS).
Wealreadydiscussedhigh-speeddigital services-theTlines-inChapter6.We
discusstheotherservicesinthischapter.
Switched/56ServiceSwitched/56serviceisthedigitalversion
ofananalogswitched
line.Itisaswitcheddigitalservicethatallowsdatarates
ofupto56kbps. Tocommuni­
catethroughthisservice,bothpartiesmustsubscribe.Acallerwithnormaltelephone
servicecannotconnecttoatelephoneorcomputerwithswitched/56serviceevenifthe
callerisusingamodem.Onthewhole,digitalandanalogservicesrepresenttwocom­
pletelydifferentdomainsforthetelephonecompanies.Becausethelineinaswitched!
56serviceisalreadydigital,subscribersdonotneedmodemstotransmitdigitaldata.
However,theydoneedanotherdevicecalledadigitalservice
unit(DSU).
Digital
DataServiceDigital dataservice(DDS) isthedigitalversion ofananalog
leasedline;itisadigitalleasedlinewithamaximumdatarate
of64kbps.
9.2
DIAL~UP MODEMS
Traditionaltelephonelinescancarryfrequenciesbetween300and3300Hz,giving
themabandwidthof3000Hz.Allthisrangeisusedfortransmittingvoice,wherea
greatdeal
ofinterferenceanddistortioncanbeacceptedwithoutloss ofintelligibility.
Aswehaveseen,however,datasignalsrequireahigherdegree
ofaccuracytoensure
integrity.Forsafety'ssake,therefore,theedgesofthisrangearenotusedfordatacom­
munications.Ingeneral,wecansaythatthesignalbandwidthmustbesmallerthanthe
cablebandwidth.Theeffectivebandwidth
ofatelephonelinebeingusedfordatatrans­
missionis2400Hz,coveringtherangefrom600to3000Hz.Notethattodaysome
telephonelinesarecapableofhandlinggreaterbandwidththantraditionallines.How­
ever,modemdesignisstillbasedontraditionalcapability(seeFigure9.6).
Figure9.6
Telephonelinebandwidth
Usedforvoice
300 600
2400
Hzfordata
3300
I I I
I
I" I
I
3000Hzforvoice
II. ..I
I I
Thetermmodemisacompositewordthatreferstothetwofunctionalentitiesthat
makeupthedevice:asignalmodulatorandasignaldemodulator.A
modulatorcreates
abandpassanalogsignalfrombinarydata.A
demodulatorrecoversthebinarydata
fromthemodulatedsignal.
Modemstandsformodulator/demodulator.

SECTION9.2DIAL-UPMODEMS 249
Figure9.7showstherelationship ofmodemstoacommunicationslinleThecomputer
ontheleftsendsadigitalsignaltothemodulatorportion ofthemodem;thedataaresentas
ananalogsignal onthetelephonelines. Themodemontherightreceivestheanalogsignal,
demodulatesitthroughitsdemodulator,anddeliversdatatothecomputer
ontheright.The
communicationcanbebidirectional,whichmeansthecomputer ontherightcansimulta­
neouslysenddatatothecomputer
ontheleft,usingthesamemodulation/demodulation
processes.
Figure9.7 Modulation/demodulation
TELCO:Telephonecompany
A
ModemStandards
c=Jn
B
r<
.........
Today,manyofthemostpopularmodemsavailableare basedontheV-seriesstandards
publishedbytheITU-T.Wediscussjustthemostrecentseries.
V.32andV.32bis
TheV.32modemusesa combinedmodulationandencodingtechniquecalledtrellis­
codedmodulation.Trellisisessentially QAMplusa redundantbit.Thedatastreamis
dividedinto4-bitsections.Instead
ofaquadbit
(4-bitpattern),however,a pentabit(5-bit
pattern)istransmitted.
Thevalueoftheextrabitiscalculatedfromthevaluesofthe
databits.
Theextrabitisusedforerrordetection.
TheY.32callsfor 32-QAMwithabaudrateof2400.Becauseonly4bits ofeach
pentabitrepresentdata,theresultingdatarateis4 x 2400=9600bps.Theconstellation
diagramandbandwidthareshowninFigure9.8.
TheV.32bismodemwasthefirstoftheITU-Tstandardstosupport14,400-bps
transmission.TheY.32bisuses 128-QAMtransmission(7 bits/baudwithIbitforerror
control)atarate of2400baud(2400x 6 =14,400bps).
AnadditionalenhancementprovidedbyY.32bisistheinclusion ofanautomatic
fall-back
andfall-forwardfeaturethatenablesthe modemtoadjustits speedupwardor
downwarddependingonthequalityofthelineorsignal.Theconstellationdiagramand
bandwidtharealsoshownin Figure9.8.
V.34bis
TheV.34bismodemprovidesa bitrateof28,800witha960-pointconstellationanda
bitrateof33,600bpswitha1664-pointconstellation.

250 CHAPTER9USINGTELEPHONE ANDCABLENETWORKSFORDATATRANSMISSION
Figure9.8TheV.32andV.32bisconstellation andbandwidth
90
Full-duplex2400-baud
01'• •
9600-bps2-wire
• • • •
• • • •
180•·


0
600 1800 3000
• • • •


1•

• •
• I•
270
a.Constellation
andbandwidthforV.32
90

l•• • • •
•• ••
• • • • ••
••••••
• • • • • •••
••••••••
• • • • • • ••••
••••••••
180• •••••••0
••••••••••
• •••••••
••••••••
••••••
••••••
••••
••••
• •
270
Full-duplex.2400-baud
14,400-bps4-wire
600 1800 3000
1--:90
b.ConstellationandbandwidthforV.32bis
Traditionalmodemshaveadataratelimitation of33.6kbps,asdeterminedbythe
Shannoncapacity(seeChapter3).However,
V.90modemswithabitrate of56,000bps
areavailable;thesearecalled56Kmodems.Thesemodemsmaybeusedonlyifone
partyisusingdigitalsignaling(such
asthroughanInternetprovider).Theyareasym­
metricinthatthedownloadingrate(flow
ofdatafromtheInternetserviceproviderto
thePC)isamaximum
of56kbps,whiletheuploadingrate(flow ofdatafromthePCto
theInternetprovider)canbeamaximum
of33.6kbps.Dothesemodemsviolatethe
Shannoncapacityprinciple?No,inthedownstreamdirection,theSNRratioishigher
becausethereisnoquantizationerror(seeFigure9.9).
Inuploading,theanalogsignalmuststillbesampledattheswitchingstation.In
thisdirection,quantizationnoise(aswesaw
inChapter4) isintroducedintothesignal,
whichreducestheSNRratioandlimitstherateto33.6kbps.
However,thereisnosamplinginthedownloading.Thesignalisnotaffectedby
quantizationnoiseandnotsubjecttotheShannoncapacitylimitation.Themaximumdata
rateintheuploadingdirectionisstill33.6kbps,butthedatarateinthedownloading
directionisnow56kbps.
Onemaywonderhowwearriveatthe56-kbpsfigure.Thetelephonecompanies
sample8000timespersecondwith8bitspersample.One
ofthebitsineachsampleis
usedforcontrolpurposes,whichmeanseachsampleis7bits.Therateistherefore
8000x
7,or56,000bpsor56kbps.

SECTION9.3DIGITALSUBSCRIBER LINE 251
Figure9.9 Uploadinganddownloadingin56Kmodems
-=tP-~
~
Quantizationnoiselimits
thedatarate
1--------1
1 PCM I
1
--.-I
1 I
Uploading,
quantizationnoise
ISP
server
1--------1
1Inverse I
1 PCM I
1 I
-=tP-~ -=tP-~
"'--~~ ~
ISP
server
Downloading,
noquantizationnoise
1':92
Thestandardabove V90iscalled~92.Thesemodemscanadjusttheirspeed,andif
thenoiseallows,theycanuploaddataattherate
of48kbps.Thedownloadingrateis
still56kbps.Themodemhasadditionalfeatures.Forexample,themodemcaninter­
rupttheInternetconnectionwhenthere
isanincomingcall ifthelinehascall-waiting
service.
9.3DIGITALSUBSCRIBERLINE
Aftertraditionalmodemsreachedtheirpeakdatarate,telephonecompaniesdeveloped
anothertechnology,DSL,toprovidehigher-speedaccess
totheInternet.Digitalsub­
scriberline(DSL)technologyisone ofthemostpromisingforsupportinghigh-speed
digitalcommunicationovertheexistinglocalloops.DSLtechnologyisaset
oftech­
nologies,eachdiffering
inthefirstletter(ADSL,VDSL,HDSL,andSDSL).Thesetis
oftenreferredto
asxDSL,where xcanbereplacedby A,V,H,orS.

252 CHAPTER 9USINGTELEPHONE ANDCABLENETWORKSFORDATATRANSMISSION
ADSL
Thefirsttechnologyinthesetis asymmetricDSL(ADSL).ADSL,likea56Kmodem,
provideshigherspeed(bitrate)inthedownstreamdirection(fromtheInternettothe
resident)thanintheupstreamdirection(fromtheresidenttotheInternet).Thatisthe
reason
itiscalledasymmetric. Unliketheasymmetryin56Kmodems,thedesigners of
ADSLspecificallydividedtheavailablebandwidthofthelocalloopunevenlyforthe
residentialcustomer.Theserviceisnotsuitableforbusinesscustomerswhoneeda
largebandwidthinbothdirections.
ADSLis anasymmetriccommunicationtechnologydesignedforresidentialusers;
itisnotsuitableforbusinesses.
UsingExistingLocalLoops
OneinterestingpointisthatADSLusestheexistinglocalloops.ButhowdoesADSL
reachadataratethatwasneverachievedwithtraditionalmodems?Theansweristhatthe
twisted-pairlocalloopisactuallycapable
ofhandlingbandwidthsup to1.1MHz,butthe
filterinstalledattheendoffice
ofthetelephonecompanywhereeachlocallooptermi­
nateslimitsthebandwidthto4kHz(sufficientforvoicecommunication).
Ifthefilteris
removed,however,theentire
1.1MHzisavailablefordataandvoicecommunications.
Theexistinglocalloopscanhandlebandwidths upto1.1MHz.
AdaptiveTechnology
Unfortunately,1.1MHzisjustthetheoreticalbandwidth ofthelocalloop.Factorssuch
asthedistancebetweentheresidenceandtheswitchingoffice,thesize
ofthecable,the
signalingused,andsoonaffectthebandwidth.Thedesigners
ofADSLtechnology
wereaware
ofthisproblemandusedanadaptivetechnologythatteststheconditionand
bandwidthavailability
ofthelinebeforesettlingonadatarate.Thedatarate ofADSL
isnotfixed;
itchangesbasedontheconditionandtype ofthelocalloopcable.
ADSLis anadaptivetechnology.Thesystemusesa datarate
basedonthecondition ofthelocalloopline.
DiscreteMultitoneTechnique
ThemodulationtechniquethathasbecomestandardforADSLiscalledthe discrete
multitonetechnique
(DMT)whichcombinesQAMandFDM.Thereisnosetway
thatthebandwidth
ofasystemisdivided.Eachsystemcandecideonitsbandwidth
division.Typically,anavailablebandwidth
of1.104MHz isdividedinto256channels.
Eachchannelusesabandwidthof4.312kHz,
asshowninFigure9.10.Figure9.11shows
howthebandwidthcanbedividedintothefollowing:
oVoice.Channel0isreservedforvoicecommunication.
oIdle.Channels1to5arenotusedandprovideagapbetweenvoiceanddata
communication.

SECTION9.3DIGITALSUBSCRIBERLINE 253
Figure9.10 Discretemultitonetechnique
Upstream
bits
Downstream
bits
Figure9.11 Bandwidthdivision inADSL
Voice Upstream Downstream
""'\/ I'
'"
,;d
Not
"-
used
o4 26 108 138 1104
kHz
oUpstreamdataandcontrol.Channels6to30(25channels)areusedforupstream
datatransferandcontrol.Onechannelisforcontrol,and24channelsarefordata
transfer.
Ifthereare24channels,eachusing4kHz(out of4.312kHzavailable)
withQAMmodulation,wehave24x4000x15,ora1.44-Mbpsbandwidth,in
theupstreamdirection.However,thedatarate
isnormallybelow500kbpsbecause
someofthecarriersaredeletedatfrequencieswherethenoiselevel
islarge.Inother
words,someofchannelsmaybeunused.
oDownstreamdataandcontrol.Channels31to255(225channels)areusedfor
downstreamdatatransferandcontrol.Onechannelisforcontrol,and224channels
arefordata.
Ifthereare224channels,wecanachieveupto224x4000x 15,or
13.4Mbps.However,thedatarateisnormallybelow8Mbpsbecausesome
ofthe
carriersaredeletedatfrequencieswherethenoiselevelislarge.Inotherwords,
some
ofchannelsmaybeunused.
CustomerSite: ADSLModem
Figure9.12showsan ADSLmodeminstalledatacustomer'ssite.Thelocalloop
connectstoasplitterwhichseparatesvoiceanddatacommunications.TheADSL

254 CHAPTER 9USINGTELEPHONE ANDCABLENETWORKSFORDATATRANSMISSION
modemmodulatesanddemodulatesthedata,usingDMT,andcreatesdownstream
andupstreamchannels.
Figure9.12ADSLmodem
Splitter
Localloop
Voice
Data
ADSLmodem
Notethatthesplitterneedstobeinstalledatthecustomer'spremises,normallybya
technicianfromthetelephonecompany.Thevoicelinecanusetheexistingtelephone
wiringinthehouse,butthedatalineneedstobeinstalledbyaprofessional.Allthis
makestheADSLlineexpensive.Wewillseethatthereisanalternativetechnology,
UniversalADSL(orADSLLite).
TelephoneCompanySite: DSLAM
Atthetelephonecompanysite,thesituationisdifferent.Instead ofanADSLmodem,a
devicecalleda
digitalsubscriberlineaccessmultiplexer (DSLAM)isinstalledthat
functionssimilarly.Inaddition,
itpacketizesthedatatobesenttotheInternet(ISP
server).Figure9.13showstheconfiguration.
Figure9.13DSLAM
Splitter
Totelephone
~ V_o_ic_e__-+--i
network
Low-pass
filter
Localloop
High-pass
filter
Packetized
Tothe~__~d~at~a_---i~d~
Internet UIIM---I--""
",_,",!"",,_..u.
ADSLLite
Theinstallationofsplittersattheborder ofthepremisesandthenewwiringforthedata
linecanbeexpensiveandimpracticalenoughtodissuademostsubscribers.Anewver­
sion
ofADSLtechnologycalledADSL Lite(orUniversalADSLorsplitterlessADSL)is
availableforthesesubscribers.ThistechnologyallowsanASDLLite
modemtobe
pluggeddirectlyintoatelephonejackandconnectedtothecomputer.Thesplittingis
doneatthetelephonecompany.ADSLLiteuses256DMTcarrierswith8-bitmodulation

SECTION9.3DIGITALSUBSCRIBERLINE 255
(insteadof15-bit).However,someofthecarriersmaynotbeavailablebecauseerrors
createdbythevoicesignalmightminglewiththem.
Itcanprovideamaximumdown­
streamdatarateof
1.5Mbpsand anupstreamdatarateof512kbps.
HDSL
Thehigh-bit-ratedigital subscriberline(HDSL)wasdesigned asanalternativeto
the
T-lline(1.544Mbps).TheT-1lineusesalternatemarkinversion(AMI)encoding,
whichisverysusceptibletoattenuationathighfrequencies.Thislimitsthelengthof
aT-llineto3200ft
(1km).Forlongerdistances,arepeaterisnecessary,whichmeans
increasedcosts.
HDSLuses2B1Qencoding(seeChapter4),which
islesssusceptibletoattenuation.
Adatarateof1.544Mbps(sometimesupto2Mbps)canbeachievedwithoutrepeaters
uptoadistanceof12,000 ft(3.86km).HDSLusestwotwistedpairs(onepairforeach
direction)toachievefull-duplextransmission.
SDSL
Thesymmetricdigital subscriberline(SDSL)isaonetwisted-pairversionofHDSL.
Itprovidesfull-duplexsymmetriccommunicationsupportingupto768kbps ineach
direction.SDSL,whichprovidessymmetriccommunication,canbeconsideredan
alternativetoADSL.ADSLprovidesasymmetriccommunication,withadownstream
bitratethatismuchhigherthantheupstreambitrate.Althoughthisfeaturemeetsthe
needs
ofmostresidentialsubscribers,itisnotsuitableforbusinessesthatsendand
receivedatainlargevolumesinbothdirections.
VDSL
Theveryhigh-bit-ratedigital subscriberline(VDSL),analternativeapproachthatis
similartoADSL,usescoaxial,fiber-optic,ortwisted-paircableforshortdistances.The
modulatingtechniqueisDMT.
Itprovidesarange ofbitrates(25to55Mbps)for
upstreamcommunicationatdistancesof3000to10,000
ft.Thedownstreamrateisnor­
mally3.2Mbps.
Summary
Table9.1showsasummaryofDSLtechnologies.Notethatthedatarateanddistances
areapproximationsandcanvaryfromoneimplementationtoanother.
Table9.1
SummaryofDSLtechnologies
Downstream Upstream Distance Twisted Line
Technology Rate Rate
(jt) Pairs Code
ADSL 1.5-6.1Mbps16-640kbps 12,000
1 DMT
ADSLLite1.5Mbps 500kbps 18,000 1 DMT
HDSL 1.5-2.0Mbps1.5-2.0Mbps 12,000 2 2B1Q
SDSL 768kbps 768kbps 12,000
1 2B1Q
VDSL 25-55Mbps 3.2Mbps 3000-10,000 1 DMT

256 CHAPTER 9USINGTELEPHONE ANDCABLENETWORKSFORDATATRANSMISSION
9.4CABLETV NETWORKS
ThecableTVnetwork startedasavideoserviceprovider,butithasmovedtothebusiness
ofInternetaccess.Inthissection,wediscusscableTVnetworksperse;inSection9.5we
discusshowthisnetworkcan
beusedtoprovidehigh-speedaccesstotheInternet.
TraditionalCableNetworks
CableTV startedtodistributebroadcastvideosignalstolocationswithpoor orno
receptioninthelate1940s.
ItwascalledcommunityantennaTV(CATV) becausean
antennaatthetop
ofatallhillorbuildingreceivedthesignalsfromtheTVstationsand
distributedthem,viacoaxialcables,tothecommunity.Figure9.14showsaschematic
diagram
ofatraditionalcableTVnetwork.
Figure9.14 Traditionalcable TVnetwork
Splitter
Tap
ThecableTVoffice,calledthe headend, receivesvideosignalsfrombroadcasting
stationsandfeedsthesignals intocoaxialcables.Thesignalsbecameweakerand
weakerwithdistance,soamplifierswereinstalledthroughthenetworktorenewthe
signals.Therecouldbeupto35amplifiersbetweentheheadendandthesubscriber
premises.Attheotherend,splitterssplitthecable,andtapsanddropcablesmakethe
connectionstothesubscriberpremises.
ThetraditionalcableTVsystemusedcoaxialcableendtoend.Duetoattenuation
of
thesignalsandtheuseofalargenumber ofamplifiers,communicationinthetraditional
networkwasunidirectional(one-way).Videosignalsweretransmitteddownstream,from
theheadend
tothesubscriberpremises.
CommunicationinthetraditionalcableTVnetwork isunidirectional.
HybridFiber-Coaxial(HFC)Network
Thesecondgeneration ofcablenetworksiscalleda hybridfiber-coaxial (HFC)net­
work.
Thenetworkusesacombination offiber-opticandcoaxialcable.Thetransmission

SECTION9.5CABLETVFORDATATRANSFER 257
mediumfromthecableTVoffice toabox,calledthefibernode,isopticalfiber;fromthe
fibernodethroughtheneighborhoodandintothehouseisstillcoaxialcable.Figure9.15
showsaschematicdiagramofanHFCnetwork.
Figure
9.15Hybridfiber-coaxial(HFC)network
RCH
High-bandwidth
fiber
Theregionalcable head(RCH)normallyservesupto400,000subscribers.The
RCHsfeedthedistributionhubs,eachofwhichservesupto40,000subscribers.The
distributionhubplaysanimportantroleinthenewinfrastructure.Modulationanddis­
tributionofsignalsaredonehere;thesignalsarethenfedtothefibernodesthrough
fiber-opticcables.Thefibernodesplitstheanalogsignalssothatthesamesignalissent
toeachcoaxialcable.Eachcoaxialcableservesupto1000subscribers.Theuse
of
fiber-opticcablereducestheneedforamplifiersdowntoeightorless.
Onereasonformovingfromtraditionaltohybridinfrastructureistomakethecable
networkbidirectional(two-way).
Communicationin anHFCcableTVnetworkcanbebidirectional.
9.5CABLETV FORDATATRANSFER
Cablecompaniesarenowcompetingwithtelephonecompaniesfortheresidential
customerwhowantshigh-speeddatatransfer.DSLtechnologyprovideshigh-data-rate
connectionsforresidentialsubscribersoverthelocalloop.However,DSLusesthe
existingunshieldedtwisted-paircable,whichisverysusceptibletointerference.This
imposesanupperlimitonthedatarate.Anothersolutionistheuse
ofthecableTVnet­
work.Inthissection,webrieflydiscussthistechnology.
Bandwidth
EveninanHFCsystem,thelastpart ofthenetwork,fromthefibernodetothesub­
scriberpremises,isstillacoaxialcable.Thiscoaxialcablehasabandwidththatranges

258 CHAPTER 9USINGTELEPHONE ANDCABLENETWORKSFORDATATRANSMISSION
from5to750MHz(approximately). ToprovideInternetaccess,thecablecompanyhas
dividedthisbandwidthintothreebands:video,downstreamdata,andupstreamdata,
as
showninFigure9.16.
Figure9.16 Divisionofcoaxialcableband byCATV
Frequency,MHz 5
.~::2i
Data:~
l1PStf~~~
4254
Video
bapd
550
Data
downstream
750
DownstreamVideoBand
Thedownstreamvideo bandoccupiesfrequenciesfrom54to550MHz.Sinceeach
TVchanneloccupies6MHz,thiscanaccommodatemorethan80channels.
DownstreamData Band
Thedownstreamdata(fromtheInternettothesubscriberpremises)occupiestheupper
band,from550
to750MHz.Thisbandisalsodividedinto6-MHzchannels.
ModulationDownstream databandusesthe64-QAM(orpossibly256-QAM)
modulationtechnique.
Downstreamdataaremodulatedusingthe64-QAMmodulationtechnique.
DataRate Thereis6bits/baudin64-QAM.Onebitisusedforforwarderrorcorrection;
thisleaves5bitsofdataperbaud.ThestandardspecifiesIHzforeachbaud;thismeansthat,
theoretically,downstreamdatacanbereceivedat30Mbps
(5bitslHzx6MHz).Thestan­
dardspecifiesonly
27Mbps.However,sincethecablemodemisnormallyconnected tothe
computerthroughalOBase-Tcable(seeChapter13),thislimitsthedatarate
to10Mbps.
Thetheoreticaldownstream datarateis30Mbps.
UpstreamDataBand
Theupstreamdata(fromthesubscriberpremises totheInternet)occupiesthelower
band,from5to42MHz.Thisbandisalsodividedinto6-MHzchannels.
ModulationTheupstreamdatabanduseslowerfrequenciesthataremoresuscepti­
ble
tonoiseandinterference.Forthisreason,theQAMtechniqueisnotsuitableforthis
band.AbettersolutionisQPSK.
UpstreamdataaremodulatedusingtheQPSKmodulationtechnique.

SECTION9.5CABLETVFORDATATRANSFER 259
DataRateThereare 2bitslbaudinQPSK.Thestandardspecifies 1Hzforeachbaud;
thismeansthat,theoretically,upstreamdatacanbesentat
12Mbps(2bitslHzx 6MHz).
However,thedatarateisusuallylessthan
12Mbps.
Thetheoreticalupstreamdatarateis12Mbps.
Sharing
Bothupstreamanddownstreambandsaresharedbythesubscribers.
UpstreamSharing
Theupstreamdatabandwidthis37MHz.Thismeansthatthereareonlysix6-MHz
channelsavailableintheupstreamdirection.Asubscriberneedstouseonechannelto
senddataintheupstreamdirection.Thequestionis,"Howcansixchannelsbesharedin
anareawith1000,2000,
oreven100,000subscribers?"Thesolutionistimesharing.The
bandisdividedintochannelsusingFDM;thesechannelsmustbesharedbetweensub­
scribersinthesameneighborhood.Thecableproviderallocatesonechannel,statically
ordynamically,foragroup ofsubscribers.Ifonesubscriberwantstosenddata,she or
hecontendsforthechannelwithotherswhowantaccess;thesubscriber mustwaituntil
thechannelisavailable.
DownstreamSharing
Wehaveasimilarsituationinthedownstreamdirection.Thedownstream bandhas
33channels
of6MHz.Acableproviderprobablyhasmorethan33subscribers;therefore,
eachchannelmustbesharedbetweenagroup
ofsubscribers.However,thesituationisdif­
ferentforthedownstreamdirection;herewehaveamulticastingsituation.
Iftherearedata
forany
ofthesubscribersinthegroup,thedataaresenttothatchannel.Eachsubscriberis
sentthedata.Butsinceeachsubscriberalsohasanaddressregisteredwiththeprovider;the
cablemodemforthegroupmatchestheaddresscarriedwiththedatatotheaddressassigned
bytheprovider.
Iftheaddressmatches,thedataarekept;otherwise,theyarediscarded.
CMandCMTS
Touseacablenetworkfordatatransmission,weneedtwokeydevices:a cablemodem
(CM)andacablemodemtransmissionsystem(CMTS).
CM
Thecablemodem(CM) isinstalledonthesubscriberpremises.It issimilartoanADSL
modem.Figure9.17showsitslocation.
CMTS
Thecablemodemtransmissionsystem(CMTS)isinstalledinsidethedistribution
hubbythecablecompany.
ItreceivesdatafromtheInternetandpassesthemtothe
combiner,whichsendsthemtothesubscriber.TheCMTSalsoreceivesdatafromthe
subscriberandpassesthemtotheInternet.Figure9.18showsthelocation
oftheCMTS.

260 CHAPTER 9USINGTELEPHONE ANDCABLENETWORKSFORDATATRANSMISSION
Figure9.17 Cablemodem(CM)
Cable
Customerresidence
r------------------------I
I I
I
V~OO I
Thp"~~ I
I
1
1
1
r- 1
Data 1
=- 1
1
1
Cablemodem 1
1
..J
Figure9.18 Cablemodemtransmissionsystem(CMTS)
Fromheadend
Toandfrom
theInternet
Distributionhub
-------------------
I
I
VideoI
I Fiber
I ICombinerI ~,",,"-,,<.-::-. -'-_~
I I
I I
I I
I I
:Data '-c', :
I I
I CMTS I
L~
DataTransmissionSchemes: DOeSIS
Duringthelast fewdecades,severalschemeshavebeendesigned tocreatea standardfor
datatransmissionoveranHFCnetwork.PrevalentistheonedevisedbyMultimedia
CableNetworkSystems(MCNS),called
DataOverCableSystemInterfaceSpecifi­
cation(DOCSIS).DOCSISdefinesalltheprotocolsnecessarytotransportdatafroma
CMTSto
aCM.
UpstreamCommunication
Thefollowingisaverysimplifiedversion oftheprotocoldefinedbyDOCSISfor
upstreamcommunication.
ItdescribesthestepsthatmustbefollowedbyaCM:
1.TheCMchecksthedownstreamchannelsforaspecificpacketperiodicallysentby
theCMTS.ThepacketasksanynewCMtoannounceitselfonaspecificupstream
channel.
2.TheCMTSsendsapackettotheCM,definingitsallocateddownstreamand
upstreamchannels.
3.TheCMthenstartsaprocess,calledranging,whichdeterminesthedistance
betweentheCMandCMTS.Thisprocess
isrequiredforsynchronizationbetweenall

SECTION9.7KEYTERMS 261
CMsandCMTSsfortheminislotsusedfortimesharing oftheupstreamchannels.
Wewilllearnaboutthistimesharingwhenwediscusscontentionprotocolsin
Chapter
12.
4.TheCMsendsapackettothe ISP,askingfortheInternetaddress.
5.TheCMandCMTSthenexchangesomepacketstoestablishsecurityparameters,
whichareneededforapublicnetworksuch
ascableTV.
6.TheCMsendsitsuniqueidentifiertotheCMTS.
7.Upstreamcommunicationcanstartintheallocatedupstreamchannel;theCMcan
contendfortheminislotstosenddata.
DownstreamCommunication
Inthedownstreamdirection,thecommunicationismuchsimpler.Thereis noconten­
tionbecausethereisonlyonesender.TheCMTSsendsthepacketwiththeaddress
of
thereceivingeM,usingtheallocateddownstreamchannel.
9.6RECOMMENDED READING
Formoredetailsaboutsubjectsdiscussedinthischapter,werecommendthefollowing
books.Theitemsinbrackets[
...]refertothereferencelistattheend ofthetext.
Books
[CouOl]givesaninterestingdiscussionabouttelephonesystems,DSLtechnology,
andCATVinChapter
8.[Tan03]discussestelephonesystemsandDSLtechnologyin
Section2.5andCATVinSection2.7.[GW04]discussestelephonesystemsinSec­
tion1.1.1andstandardmodems
inSection3.7.3.Acompletecoverage ofresidential
broadband(DSLandCATV)canbefoundin[Max99].
9.7KEYTERMS
56Kmodem
800service
900service
ADSLLite
ADSLmodem
analogleasedservice
analogswitchedservice
asymmetricDSL(ADSL)
cablemodem(CM)
cablemodemtransmissionsystem
(CMTS)
cableTVnetwork
commoncarrier
communityantennaTV(CATV)
competitivelocalexchangecarrier
(CLEC)
DataOver CableSystemInterface
Specification(DOCSIS)
demodulator
digitaldataservice(DDS)
digitalservice
digitalsubscriberline(DSL)
digitalsubscriberlineaccessmultiplexer
(DSLAM)
discretemultitonetechnique(DMT)
distributionhub

262 CHAPTER 9USINGTELEPHONE ANDCABLENETWORKSFORDATATRANSMISSION
downloading
downstreamdataband
endoffice
fibernode
headend
high-bit-rateDSL(HDSL)
hybridfiber-coaxial(HFC)network
in-bandsignaling
incumbentlocalexchangecarrier
(ILEC)
interexchangecarrier(IXC)
ISDNuserport(ISUP)
localaccesstransportarea(LATA)
localexchangecarrier(LEC)
localloop
longdistancecompany
messagetransportport(MTP)level
modem
modulator
out-of-bandsignaling
plainoldtelephonesystem(POTS)
point
ofpresence(POP)
ranging
regionalcablehead(RCH)
regionaloffice
servercontrolpoint(SCP)
signalpoint(SP)
signaltransportport(STP)
signalingconnectioncontrolpoint
(SCep)
SignalingSystemSeven(SS7)
switched/56service
switchingoffice
symmetricDSL(SDSL)
tandemoffice
telephoneuserport(TUP)
transactioncapabilitiesapplicationport
(TCAP)
trunk
uploading
upstreamdataband
Y.32
Y.32bis
Y.34bis
Y.90
Y.92
very-high-bit-rateDSL(VDSL)
videoband
V-series
wide-areatelephoneservice(WATS)
9.8SUMMARY
oThetelephone,whichisreferredtoastheplainoldtelephonesystem(POTS),
wasoriginallyananalogsystem.Duringthelastdecade,thetelephonenetwork
hasundergonemanytechnicalchanges.Thenetworkisnowdigitalaswellas
analog.
oThetelephonenetwork ismadeofthreemajorcomponents:localloops,trunks,
andswitchingoffices.Ithasseverallevels
ofswitchingofficessuchasendoffices,
tandemoffices,andregionaloffices.
oTheUnitedStatesisdividedintomanylocalaccesstransportareas(LATAs).The
servicesofferedinsideaLATAarecalledintra-LATAservices.Thecarrierthat
handlestheseservicesiscalledalocalexchangecarrier(LEC).Theservices
betweenLATAsarehandledbyinterexchangecarriers(lXCs).
oInin-bandsignaling,thesamecircuitisusedforbothsignalinganddata.Inout-of­
bandsignaling,aportion
ofthebandwidthisusedforsignalingandanotherportion

SECTION9.9PRACTICESET 263
fordata.Theprotocolthatisusedforsignalinginthetelephonenetworkiscalled
SignalingSystemSeven(SS7).
oTelephonecompaniesprovidetwotypes ofservices:analoganddigital. Wecan
categorizeanalogservicesaseitheranalogswitchedservicesoranalogleasedser­
vices.Thetwomostcommondigitalservicesareswitched/56serviceanddigital
dataservice(DDS).
oDatatransferusingthetelephonelocalloopwastraditionallydoneusingadial-up
modem.Theterm
modemisacompositewordthatreferstothetwofunctional
entitiesthatmakeupthedevice:asignalmodulatorandasignaldemodulator.
oMostpopularmodemsavailablearebasedontheV-seriesstandards.The V.32modem
hasadatarate
of9600bps.TheV32bismodemsupports14,400-bpstransmission.
V90modems,called56Kmodems,withadownloadingrateof56kbpsandupload­
ingrateof33.6kbpsareverycommon.ThestandardaboveV90
iscalledV92.These
modemscanadjusttheirspeed,and
ifthenoiseallows,theycanuploaddataattherate
of48kbps.
oTelephonecompaniesdevelopedanothertechnology,digitalsubscriberline(DSL),to
providehigher-speedaccesstotheInternet.DSLtechnology
isasetoftechnologies,
eachdifferinginthefirstletter(ADSL,VDSL,HDSL,andSDSL.ADSLprovides
higherspeedinthedownstreamdirectionthanintheupstreamdirection.Thehigh-bit­
ratedigitalsubscriberline(HDSL)wasdesignedasanalternativetotheT-lline
(1.544Mbps).Thesymmetricdigitalsubscriberline(SDSL)
isaonetwisted-pairver­
sionofHDSL.Theveryhigh-bit-ratedigitalsubscriberline(VDSL)
isanalternative
approachthatissimilartoADSL.
oCommunityantennaTV(CATV)wasoriginallydesignedtoprovidevideoservices
forthecommunity.ThetraditionalcableTVsystemusedcoaxialcableendto end.
Thesecondgeneration
ofcablenetworksiscalledahybridfiber-coaxial(HFC)
network.Thenetworkusesacombination
offiber-opticandcoaxialcable.
oCablecompaniesarenowcompetingwithtelephonecompaniesfortheresidential
customerwhowantshigh-speedaccesstotheInternet.
Touseacablenetworkfor
datatransmission,weneedtwokeydevices:acablemodem(CM)andacablemodem
transmissionsystem(CMTS).
9.9PRACTICESET
ReviewQuestions
1.Whatarethethreemajorcomponents ofatelephonenetwork?
2.Givesomehierarchicalswitchinglevels ofatelephonenetwork.
3.WhatisLATA?Whatareintra-LATAandinter-LATAservices?
4.DescribetheSS7serviceanditsrelationtothetelephonenetwork.
S.WhatarethetwomajorservicesprovidedbytelephonecompaniesintheUnited
States?
6.Whatisdial-upmodemtechnology?Listsome ofthecommonmodemstandards
discussedinthischapterandgivetheirdatarates.

264 CHAPTER9USINGTELEPHONE ANDCABLENETWORKSFORDATATRANSMISSION
7.WhatisDSLtechnology?Whataretheservicesprovidedbythetelephonecompanies
usingDSL?DistinguishbetweenaDSLmodemandaDSLAM.
8.Compareandcontrastatraditionalcablenetworkwithahybridfiber-coaxialnetwork.
9.HowisdatatransferachievedusingCATVchannels?
10.DistinguishbetweenCMandCMTS.
Exercises
11.Usingthediscussion ofcircuit-switchinginChapter 8,explainwhythistype of
switching waschosenfortelephonenetworks.
12.InChapter8,wediscussedthethreecommunicationphasesinvolvedinacircuit­
switchednetwork.Matchthesephaseswiththephasesinatelephonecallbetween
twoparties.
13.InChapter8,welearnedthatacircuit-switchednetworkneedsend-to-endaddressing
duringthesetupandteardownphases.Defineend-to-endaddressinginatelephone
networkwhentwopartiescommunicate.
14.Whenwehaveanoverseastelephoneconversation,wesometimesexperiencea
delay.Canyouexplainthereason?
15.Drawabarchart tocomparethedifferentdownloadingdatarates ofcommonmodems.
16.Drawabarchart tocomparethedifferentdownloadingdatarates ofcommonDSL
technologyimplementations(useminimumdatarates).
17.Calculatetheminimumtimerequiredtodownloadonemillionbytes ofinformation
usingeach
ofthefollowingtechnologies:
a.V32modem
b.V32bismodem
c.V90modem
18.RepeatExercise 17usingdifferentDSLimplementations(considertheminimum
rates).
19.RepeatExercise 17usingacablemodem(considertheminimumrates).
20.Whattype
oftopologyisusedwhencustomersinanareauseDSLmodemsfor
datatransferpurposes?Explain.
21.Whattype
oftopology
isusedwhencustomersinanareausecable modemsfor
datatransferpurposes?Explain.

DataLinkLayer
Objectives
Thedatalinklayertransformsthephysicallayer,arawtransmissionfacility,toalink
responsiblefornode-to-node(hop-to-hop)communication.Specificresponsibilities
of
thedatalinklayerinclude framing,addressing,flowcontrol,errorcontrol, andmedia
accesscontrol.
Thedatalinklayerdividesthestream ofbitsreceivedfromthenetwork
layerintomanageabledataunitscalledframes.Thedatalinklayeraddsaheadertothe
frametodefinetheaddresses
ofthesenderandreceiver oftheframe.Iftherateat
whichthedataareabsorbedbythereceiverislessthantherateatwhichdataarepro­
ducedinthesender,thedatalinklayerimposesaflowcontrolmechanismtoavoid
overwhelmingthereceiver.Thedatalinklayeralsoaddsreliabilitytothephysicallayer
byaddingmechanismstodetectandretransmitdamaged,duplicate,orlostframes.
Whentwoormoredevicesareconnectedtothesamelink,datalinklayerprotocolsare
necessarytodeterminewhichdevicehascontroloverthelinkatanygiventime.
InPart3
ofthebook,wefirstdiscussservicesprovidedbythedatalinklayer. We
thendiscusstheimplementation oftheseservicesinlocalareanetworks(LANs).Finally
wediscusshowwideareanetworks(WANs)usetheseservices.
Part3ofthebookisdevotedtothe datalinklayerand
theservicesprovidedbythislayer.
Chapters
Thispartconsists ofninechapters:Chapters10to 18.
Chapter10
Chapter10discusseserrordetectionandcorrection.Althoughthequality ofdevicesand
mediahavebeenimprovedduringthelastdecade,
westillneedtocheckforerrorsand
correcttheminmostapplications.

Chapter11
Chapter
11isnameddatalinkcontrol,whichinvolves flowanderrorcontrol. Itdis­
cusses someprotocolsthataredesignedtohandlethe servicesrequiredfromthedata
linklayerinrelationtothenetworklayer.
Chapter12
Chapter
12isdevotedtoaccesscontrol,theduties ofthedatalinklayerthatarerelated
totheuse
ofthephysicallayer.
Chapter13
Thischapterintroduceswiredlocalareanetworks.AwiredLAN,viewed
asalink,is
mostlyinvolvedinthephysicalanddatalinklayers. Wehavedevotedthechaptertothe
discussion
ofEthernetanditsevolution,adominanttechnologytoday.
Chapter14
Thischapterintroduceswirelesslocalareanetworks.ThewirelessLANisagrowing
technologyintheInternet.
Wedevoteonechaptertothistopic.
Chapter15
AfterdiscussingwiredandwirelessLANs,weshowhowtheycanbeconnectedtogether
usingconnectingdevices.
Chapter16
This
isthefirstchapteronwideareanetworks(WANs). WestartwithwirelessWANs
andthenmoveontosatellitenetworksandmobiletelephonenetworks.
Chapter
17
Todemonstratetheoperation ofahigh-speedwideareanetworkthatcanbeused asa
backboneforother
WANsorfortheInternet,wehavechosen todevoteall ofChapter17
toSONET,awideareanetworkthatusesfiber-optictechnology.
Chapter18
Thischapterconcludesourdiscussiononwideareanetworks.TwoswitchedWANs,
FrameRelayand
ATM,arediscussedhere.

CHAPTER10
ErrorDetectionandCorrection
Networksmustbeabletotransferdatafromonedevicetoanotherwithacceptableaccu­
racy.Formostapplications,asystemmustguaranteethatthedatareceivedareidenticalto
thedatatransmitted.Anytimedataaretransmittedfromonenodetothenext,theycan
becomecorruptedinpassage.Manyfactorscanalteroneormorebits
ofamessage.Some
applicationsrequireamechanismfordetectingandcorrecting
errors.
Datacanbecorruptedduringtransmission.
Someapplicationsrequire
thaterrorsbedetectedandcorrected.
Someapplicationscantolerateasmalllevel oferror.Forexample,randomerrors
inaudioorvideotransmissionsmaybetolerable,butwhenwetransfertext,weexpect
averyhighlevel
ofaccuracy.
10.1INTRODUCTION
Letusfirstdiscusssomeissuesrelated,directlyorindirectly,toerrordetectionand
correcion.
TypesofErrors
Wheneverbitsflow fromonepointtoanother,theyare subjecttounpredictable
changesbecause
ofinterference.Thisinterferencecanchangetheshape ofthesignal.
Inasingle-biterror,a 0ischangedtoa 1ora 1toa
O.Inabursterror,multiplebitsare
changed.Forexample,a
11100sburstofimpulsenoiseonatransmissionwithadata
rate
of1200bpsmightchangeall orsomeofthe12bitsofinformation.
Single-BitError
Theterm single-biterror meansthatonly1bit ofagivendataunit(suchasabyte,
character,orpacket)ischangedfrom1to0orfrom0to
1.
267

268 CHAPTER10ERRORDETECTION ANDCORRECTION
Inasingle-biterror,only1bitinthe dataunithaschanged.
Figure
10.1showstheeffect ofasingle-biterroronadataunit.Tounderstandthe
impact
ofthechange,imaginethateachgroup of8bitsisanASCIIcharacterwitha 0bit
addedtotheleft.InFigure
10.1,00000010(ASCII
STX)wassent,meaning startof
text,but00001010(ASCIILF)wasreceived,meaning linefeed.(Formoreinformation
aboutASCIIcode,seeAppendixA.)
:Figure
10.1Single-biterror
ochangedto I
Sent Received
Single-biterrorsaretheleastlikelytype oferrorinserialdatatransmission. Tounder­
standwhy,imaginedatasentat
1Mbps.Thismeansthateachbitlastsonly 1/1,000,000s,
or1
)ls.Forasingle-biterrortooccur,thenoisemusthaveaduration ofonly1)ls,which
isveryrare;noisenormallylastsmuchlongerthanthis.
BurstError
Thetermbursterror meansthat2 ormorebitsinthedataunithavechangedfrom1to0
orfrom0to1.
Abursterrormeansthat2ormorebitsinthe dataunithavechanged.
Figure10.2showstheeffectofabursterroronadataunit.Inthiscase,
0100010001000011wassent,but 0101110101100011wasreceived.Notethataburst
errordoesnotnecessarilymeanthattheerrorsoccurinconsecutivebits.Thelength
of
theburstismeasuredfromthefirstcorrupted bittothelastcorruptedbit. Somebitsin
betweenmaynothavebeencorrupted.
Figure10.2Bursterror oflength8
Lengthofburst
error
(8bits)

SECTION10.1INTRODUCTION 269
Abursterrorismorelikelytooccurthanasingle-biterror.Theduration ofnoiseis
normallylongerthantheduration
of1bit,whichmeansthatwhennoiseaffectsdata,it
affectsaset
ofbits.Thenumberofbitsaffecteddependsonthedatarateandduration
ofnoise.Forexample, ifwearesendingdataatIkbps,anoise of11100scanaffect
10bits;
ifwearesendingdataatIMbps,thesamenoise canaffect10,000bits.
Redundancy
Thecentralconcept indetectingorcorrectingerrorsis redundancy.Tobeableto
detectorcorrecterrors,weneedtosendsomeextrabitswithourdata.Theseredundant
bitsareadded
bythesenderandremovedbythereceiver.Theirpresenceallowsthe
receivertodetectorcorrectcorruptedbits.
Todetectorcorrecterrors, weneedtosend
extra(redundant)bitswithdata.
DetectionVersusCorrection
Thecorrectionoferrorsismoredifficultthanthedetection.In errordetection,weare
lookingonlytosee
ifanyerrorhasoccurred. Theanswerisasimpleyesorno.Weare
noteveninterestedinthenumber
oferrors.Asingle-biterror isthesameforusasa
bursterror.
In
errorcorrection,weneedtoknowtheexactnumberofbitsthatarecorruptedand
moreimportantly,theirlocation
inthemessage.Thenumberoftheerrorsandthesize of
themessageareimportantfactors. Ifweneedtocorrectonesingleerrorinan8-bitdata
unit,weneedtoconsidereightpossibleerrorlocations;
ifweneedtocorrecttwoerrors
inadataunit
ofthesamesize,weneedtoconsider28possibilities.Youcanimaginethe
receiver'sdifficultyinfinding10errorsinadataunit
of1000bits.
ForwardErrorCorrectionVersusRetransmission
Therearetwomainmethods oferrorcorrection.Forwarderrorcorrection
isthepro­
cessinwhichthereceivertriestoguessthemessage
byusingredundantbits.This
is
possible,asweseelater, ifthenumber oferrorsissmall.Correctionby retransmission
isatechniqueinwhichthereceiverdetectstheoccurrence ofanerrorandasksthesender
toresendthemessage.Resendingisrepeateduntilamessagearrivesthatthereceiver
believesiserror-free(usually,notallerrorscanbedetected).
Coding
Redundancyisachievedthroughvariouscodingschemes.Thesenderaddsredundant
bitsthroughaprocessthatcreatesarelationshipbetweentheredundantbitsandthe
actualdatabits.
Thereceivercheckstherelationshipsbetweenthetwosets ofbitsto
detectorcorrecttheerrors.Theratio
ofredundantbitstothedatabitsandtherobust­
ness
oftheprocessareimportantfactors
inanycodingscheme.Figure10.3showsthe
generalidea
ofcoding.
Wecandividecodingschemesintotwobroadcategories:
blockcodingandconvo­
lutioncoding.Inthisbook, weconcentrateon blockcoding;convolutioncodingis
morecomplexandbeyondthescope
ofthisbook.

270 CHAPTER10ERRORDETECTION ANDCORRECTION
Figure10.3 Thestructureofencoderanddecoder
Sender Receiver
Encoder Decoder
~
e8sage IMessageI
t
corrector
discard
lGeneratorI ICheckerI
~ t
[~es~~~~u~~y<;lHl-u.::..:n:.;;.re:.;;.li;,:;ab:.:le:..t::.:ra:.;;.ns:.::Iill.::..:·s;;;;'si;;;;on~~:~:~~~~~~f~~o,~=l
Inthisbook,weconcentrateonblockcodes;weleaveconvolutioncodestoadvancedtexts.
ModularArithmetic
Beforewefinishthissection,let usbrieflydiscussaconceptbasictocomputerscience
ingeneralandtoerrordetectionandcorrectioninparticular:modulararithmetic.Our
intenthereisnottodelvedeeplyintothemathematics
ofthistopic;wepresent just
enoughinformationtoprovideabackgroundtomaterialsdiscussed inthischapter.
In
modulararithmetic,weuseonlyalimitedrange ofintegers.Wedefineanupper
limit,calleda
modulusN.Wethenuseonlytheintegers 0toN-I,inclusive.Thisis
modulo-Narithmetic.Forexample, ifthemodulus is12,weuseonlytheintegers 0to
11,inclusive.Anexample
ofmoduloarithmeticis ourclocksystem.Itisbasedon
modulo-12arithmetic,substitutingthenumber
12forO.Inamodulo-Nsystem,ifa
numberisgreaterthan
N,itisdividedby Nandtheremainder istheresult.Ifitisneg­
ative,asmany
Nsasneededareaddedtomakeitpositive.Considerourclocksystem
again.
Ifwestartajobat 11A.M.andthejobtakes5h,wecansaythatthe jobistobe
finishedat16:00
ifweareinthemilitary, orwecansaythatitwillbefinishedat 4P.M.
(theremainderof16/12is4).
Inmodulo-Narithmetic,weuseonly theintegersintherange0toN
-1,inclusive.
Additionandsubtractioninmoduloarithmeticaresimple.Thereisnocarrywhen
youaddtwodigitsinacolumn.There
isnocarrywhenyousubtractonedigitfrom
anotherinacolumn.
Modulo-2Arithmetic
Ofparticularinterest ismodulo-2arithmetic.Inthisarithmetic,themodulus Nis2.We
canuseonly0and 1.Operationsinthisarithmeticareverysimple.Thefollowing
showshowwecanaddorsubtract2bits.
Adding:
Subtracting:
0+0=0
0-0=0
0+1=1
0-1=1
1+0=1
1-0=1
1+1=0
1-1=0

SECTION10.2 BLOCKCODING 271
Noticeparticularlythatadditionandsubtractiongivethesameresults.Inthisarith­
meticweusetheXOR(exclusiveOR)operationforbothadditionandsubtraction.The
result
ofanXORoperation is0iftwobitsarethesame;theresultisI iftwobitsare
different.Figure10.4showsthisoperation.
Figure10.4XORingoftwosinglebits ortwowords
a.Twobitsarethesame,theresultis O.
loeB1=1 leBO
b.Twobitsaredifferent,theresult is1.
o
o
I I 0
eB I0°
° ° °
c.ResultofXORingtwopatterns
OtherModuloArithmetic
Wealsouse,modulo-Narithmeticthroughthebook.Theprincipleisthesame;weuse
numbersbetween0and
N-1.Ifthemodulusisnot2,additionandsubtractionaredistinct.
Ifwegetanegativeresult,weaddenoughmultiples ofNtomakeitpositive.
10.2BLOCKCODING
Inblockcoding,wedivideourmessageintoblocks,each ofkbits,called datawords.We
addrredundantbits toeachblocktomakethelength n=k+r.Theresultingn-bitblocks
arecalledcodewords.Howtheextra
rbitsischosenorcalculated issomethingwewill
discusslater.Forthemoment,itisimportanttoknowthatwehaveaset
ofdatawords,
eachofsize
k,andaset ofcodewords,each ofsizeofn.Withkbits,wecancreateacom­
bination
of2
k
datawords;withnbits,wecancreateacombination of2
n
codewords.
Since
n>k,thenumberofpossiblecodewordsislargerthanthenumber ofpossibledata­
words.Theblockcodingprocessisone-to-one;thesamedatawordisalwaysencoded
as
thesamecodeword.Thismeansthatwehave 2
n
-
2
k
codewordsthatarenotused. We
callthesecodewordsinvalidorillegal.Figure10.5showsthesituation.
Figure10.5Datawordsandcodewordsinblockcoding
II
HitsIIHitsI•eoIHitsII
2
k
Datawords,each ofkbits
IIIIbitsIIIIbits nbitsII
2
n
Codewords,each ofnbits(only2
k
ofthemarevalid)

272 CHAPTER 10ERRORDETECTION ANDCORRECTION
Example10.1
The4B/5BblockcodingdiscussedinChapter4 isagoodexample ofthistypeofcoding.Inthis
codingscheme,
k=4andn =5.Aswesaw,wehave 2
k
=16datawordsand 2
n
=32codewords.
Wesawthat16out
of32codewordsareusedformessagetransferandtherestareeitherusedfor
otherpurposesorunused.
ErrorDetection
Howcanerrorsbedetected byusingblockcoding? Ifthefollowingtwoconditionsare
met,thereceivercandetectachangeintheoriginalcodeword.
1.Thereceiverhas(orcanfind)alist ofvalidcodewords.
2.Theoriginalcodewordhaschangedtoaninvalidone.
Figure10.6showstherole
ofblockcodinginerrordetection.
Figure10.6 Processoferrordetectioninblockcoding
Sender Receiver
Encoder Decoder
kbitsI
D,at:aword1 IDat~~ord·1 kbits
I tExtract
IGeneratorI I
Checker
Discard
+ i
nbitsICodeword
Unreliabletransmission r·
CodewordInbits
I r
Thesendercreatescodewordsout ofdatawordsbyusingageneratorthatappliesthe
rulesandprocedures
ofencoding(discussedlater).Eachcodewordsenttothereceivermay
changeduringtransmission.
Ifthereceivedcodewordisthesameasone ofthevalidcode­
words,theword
isaccepted;thecorrespondingdatawordisextractedforuse. Ifthereceived
codewordisnotvalid,itisdiscarded.However,
ifthecodewordiscorruptedduringtrans­
missionbutthereceivedwordstillmatchesavalidcodeword,theerrorremainsundetected.
This type
ofcodingcandetectonlysingleerrors.Twoormoreerrorsmayremainundetected.
Example10.2
Letusassumethat k=2andn =3.Table10.1showsthelist ofdatawordsandcodewords.Later,
wewillseehowtoderiveacodewordfromadataword.
Table10.1Acodeforerrordetection(Example10.2)
Datawords Codewords
00 000
01 011
10 101
11 110

SECTION10.2 BLOCKCODING 273
Assumethesenderencodesthedataword 01as011andsendsittothereceiver.Considerthe
followingcases:
1.Thereceiverreceives OIl.Itisavalidcodeword.Thereceiverextractsthedataword 01
fromit.
2.Thecodewordiscorruptedduringtransmission,and 111isreceived(theleftmostbitiscor­
rupted).This
isnotavalidcodewordandisdiscarded.
3.Thecodewordiscorruptedduringtransmission,and000 isreceived(therighttwobitsare
corrupted).Thisisavalidcodeword.Thereceiverincorrectlyextractsthedataword00.Two
corruptedbitshavemadetheerrorundetectable.
Anerror-detectingcodecandetectonlythetypesof errorsforwhichit isdesigned;
othertypesof
errorsmayremainundetected.
ErrorCorrection
Aswesaidbefore,errorcorrection
ismuchmoredifficultthanerrordetection.Inerror
detection,thereceiverneedstoknowonlythatthereceivedcodewordisinvalid;in
errorcorrectionthereceiverneedstofind(orguess)theoriginal codewordsent.
Wecan
saythatweneedmoreredundantbitsforerrorcorrectionthanforerrordetection.
Figure10.7showstherole
ofblockcoding
inerrorcorrection.Wecanseethattheidea
isthesameaserrordetectionbutthecheckerfunctionsaremuchmorecomplex.
Figure10.7Structureofencoderanddecoderinerrorcorrection
Sender Receiver
Encoder Decoder
kbitsIDatawordI IDatawordIkbits
I tCorrect
IGeneratorI I
CheckerI~ i
nbitsI
I
Unreliabletransmission
InbitsCodeword
I I
Codeword
Example10.3
LetusaddmoreredundantbitstoExample10.2tosee ifthereceivercancorrectanerrorwithout
knowingwhatwasactuallysent.Weadd3redundantbitstothe2-bitdatawordtomake5-bit
codewords.Again,laterwewillshowhowwechosetheredundantbits.Forthemomentletus
concentrateontheerrorcorrectionconcept.Table10.2showsthedatawordsandcodewords.
Assumethedataword
is01.Thesenderconsultsthetable(orusesanalgorithm)tocreatethe
codeword01011.Thecodeword
iscorruptedduringtransmission,and01001 isreceived(errorin
thesecondbitfromtheright).First,thereceiverfindsthatthereceivedcodeword
isnotinthetable.
Thismeansanerrorhasoccurred. (Detectionmustcomebeforecorrection.)Thereceiver,assuming
thatthere
isonly1bitcorrupted,usesthefollowingstrategytoguessthecorrectdataword.

274 CHAPTER10ERRORDETECTION ANDCORRECTION
Table10.2 Acodeforerrorcorrection(Example10.3)
Dataword Codeword
00 00000
01 01011
10 10101
11 11110
I.Comparingthereceivedcodewordwiththefirstcodewordinthetable(01001versus00000),
thereceiverdecidesthatthefirstcodewordisnottheonethatwassentbecausetherearetwo
differentbits.
2.Bythesamereasoning,theoriginalcodewordcannotbethethirdorfourthoneinthetable.
3.Theoriginalcodewordmustbethesecondoneinthetablebecausethisistheonlyonethat
differsfromthereceivedcodewordby1bit.Thereceiverreplaces01001with01011and
consultsthetabletofindthedataword01.
HammingDistance
Oneofthecentralconceptsincodingforerrorcontrolistheidea oftheHammingdis­
tance.The
Hammingdistancebetweentwowords(ofthesamesize)isthenumber of
differencesbetweenthecorrespondingbits. WeshowtheHammingdistancebetween
twowords
xandyasd(x,y).
TheHammingdistancecaneasilybefound ifwcapplytheXORoperation
(ffi)onthe
twowordsandcountthenumber
ofIsintheresult.NotethattheHammingdistance is
avaluegreaterthanzero.
TheHammingdistancebetweentwowords isthenumber
ofdifferencesbetweencorrespondingbits.
Example10.4
LetusfindtheHammingdistancebetweentwopairs ofwords.
1.TheHammingdistance d(OOO,011)is2because000
ffi011is011(twoIs).
2.TheHammingdistance d(10101,11110)is3because10101ffi11110is01011(threeIs).
MinimumHammingDistance
Althoughtheconcept oftheHammingdistance isthecentralpointindealingwitherror
detectionandcorrectioncodes,themeasurementthatisusedfordesigningacode
isthe
minimumHammingdistance.Inaset
ofwords,the minimumHammingdistanceisthe
smallestHammingdistancebetweenallpossiblepairs.
Weused
min
todefinethemini­
mumHammingdistanceinacodingscheme.
Tofindthisvalue,wefindtheHamming
distancesbetweenallwordsandselectthesmallestone.
TheminimumHammingdistanceisthesmallestHamming
distancebetweenallpossiblepairsinaset
ofwords.

SECTIONiO.2BLOCKCODiNG 275
Example10.5
FindtheminimumHammingdistance ofthecodingschemeinTable10.1.
Solution
WefirstfindallHammingdistances.
d(OOO,011)=2
d(Oll,110)=2
Thed
min
inthiscaseis 2.
d(OOO,101)=2
d(W1,110)=2
d(OaO,110)=2 d(Oll,101)=2
Example10.6
FindtheminimumHammingdistance ofthecodingschemeinTable10.2.
Solution
WefirstfindalltheHammingdistances.
d(OOOOO,01011)=3
d(01011,10101)=4
The
d
min
inthiscaseis 3.
d(OOOOO,10101)=3
d(OlO11,11110)=3
d(OOOOO,11110)
=4
d(10101,11110)
=3
ThreeParameters
Beforewecontinuewithourdiscussion,weneedtomentionthatanycodingscheme
needstohaveatleastthreeparameters:thecodewordsize
n,thedatawordsize k,and
theminimum Hammingdistance
d
min
.AcodingschemeCiswrittenas C(n,k) witha
separateexpressionfor
dmin-Forexample,wecancallourfirstcodingscheme C(3,2)
withd
min=2andoursecondcodingscheme C(5,2)withd
min
::=3.
HammingDistance andError
Beforeweexplorethecriteriaforerrordetectionorcorrection,letusdiscusstherelationship
betweentheHammingdistanceanderrorsoccurringduringtransmission.Whenacodeword
iscorruptedduringtransmission,theHammingdistancebetweenthesentandreceivedcode­
wordsisthenumberofbitsaffectedbytheerror.Inotherwords,theHammingdistance
betweenthereceivedcodewordandthesentcodewordisthenumber
ofbitsthatarecorrupted
duringtransmission.Forexample,
ifthecodeword00000issentand01101isreceived,3bits
areinerrorandtheHammingdistancebetweenthetwois
d(OOOOO,01101)=3.
MinimumDistance forErrorDetection
NowletusfindtheminimumHammingdistanceinacode ifwewanttobeabletodetect
uptoserrors.
Ifserrorsoccurduringtransmission,theHammingdistancebetweenthe
sentcodewordandreceivedcodewordiss.
Ifourcodeistodetectuptoserrors,themini­
mumdistancebetweenthevalidcodesmustbes +1,sothatthereceivedcodeworddoes
notmatchavalidcodeword.Inotherwords,
iftheminimumdistancebetweenallvalid
codewordsiss
+1,thereceivedcodewordcannotbeerroneouslymistakenforanother
codeword.Thedistancesarenotenough(s
+1)forthereceivertoacceptitasvalid.The
errorwillbedetected.Weneedtoclarifyapointhere:Althoughacodewith
d
min=s+1

276 CHAPTER10ERROR DETECTIONANDCORRECTION
maybeabletodetectmorethanserrors insomespecialcases,onlys orfewererrorsare
guaranteedtobedetected.
Toguaranteethedetection ofuptoserrorsinallcases, theminimum
Hammingdistanceinablockcodemustbed
min=S+1.
Example10.7
TheminimumHammingdistanceforourfirstcodescheme(Table10.1) is2.Thiscodeguarantees
detectionofonlyasingleerror.Forexample,
ifthethirdcodeword (l01)issentandoneerror
occurs,thereceivedcodeworddoesnotmatch
anyvalidcodeword.Iftwoerrorsoccur,however,
thereceivedcodewordmaymatchavalidcodewordandtheerrorsarenotdetected.
Example10.8
Oursecondblockcodescheme(Table10.2) has d
min
=3.Thiscodecandetectuptotwoerrors.
Again,weseethatwhenany
ofthevalidcodewords issent,twoerrorscreateacodewordwhich
isnotinthetable
ofvalidcodewords.Thereceivercannotbefooled.However,somecombina­
tionsofthreeerrorschangeavalidcodeword
toanothervalidcodeword.Thereceiveracceptsthe
receivedcodewordandtheerrorsareundetected.
Wecanlookatthisgeometrically. Letusassumethatthesentcodeword xisatthe
center
ofacirclewithradius s.Allotherreceivedcodewordsthatarecreated by1tos
errorsarepointsinsidethecircle orontheperimeter ofthecircle.Allothervalidcode­
wordsmust
beoutsidethecircle,asshowninFigure10.8.
Figure10.8Geometricconcept forfindingd
min
inerrordetection
.y
I
I
I
I
I
I
I
I
I
'1
Legend
•Anyvalidcodeword
•Anycorruptedcodeword
with0toserrors
InFigure10.8,d
min
mustbeanintegergreaterthan s;thatis,d
min=s+1.
MinimumDistanceforErrorCorrection
Errorcorrectionismorecomplexthanerrordetection;adecisionisinvolved. Whena
receivedcodewordisnotavalidcodeword,thereceiverneedstodecidewhichvalid
codewordwasactuallysent.
Thedecisionisbasedontheconcept ofterritory,anexclu­
siveareasurroundingthecodeword.Eachvalidcodewordhasitsownterritory.
Weuseageometricapproachtodefineeachterritory.Weassumethateachvalid
codewordhasacircularterritorywitharadius
oftandthatthevalidcodewordisatthe

SECTION10.3LINEAR BLOCKCODES 277
center.Forexample,supposeacodeword xiscorruptedby tbitsorless.Thenthiscor­
ruptedcodewordislocatedeitherinsideorontheperimeter
ofthiscircle.Ifthereceiver
receivesacodewordthatbelongstothisterritory,itdecidesthattheoriginal codewordis
theoneatthecenter.Notethatweassumethatonlyupto
terrorshaveoccurred;other­
wise,thedecisioniswrong.Figure10.9showsthisgeometricinterpretation.Sometexts
useaspheretoshowthedistancebetweenallvalidblockcodes.
Figure10.9 Geometricconcept forfindingd
min
inerrorcorrection

Territoryof x

e
x
I'
d
min
>2t
Territoryofy
eo
Legend
y
:..
•Anyvalidcodeword

• •
Anycorruptedcodeword
with1toterrors


InFigure10.9, d
min
>2t;sincethenextintegerincrementis 1,wecansaythat
d
min=2t+1.
Toguaranteecorrectionof uptoterrorsinallcases,theminimum
Hammingdistanceinablockcodemustbed
min
==2t+1.
Example10.9
AcodeschemehasaHammingdistanced
min
==4.Whatistheerrordetectionandcorrection
capability
ofthisscheme?
Solution
Thiscodeguaranteesthedetection ofuptothree errOrs(s
==3),butitcancorrectuptooneerror.
Inotherwords,
ifthiscodeisusedforerrorcorrection,part ofitscapabilityiswasted.Errorcor­
rectioncodesneedtohaveanoddminimumdistance
(3,5,7,...).
10.3LINEARBLOCKCODES
Almostallblockcodesusedtodaybelongtoasubsetcalled linearblockcodes. Theuseof
nonlinearblockcodesforerrordetectionandcorrectionisnotaswidespreadbecause
theirstructuremakestheoreticalanalysisandimplementationdifficult.
Wethereforecon­
centrateonlinearblockcodes.
Theformaldefinition
oflinearblockcodesrequirestheknowledge ofabstractalgebra
(particularlyGaloisfields),which
isbeyondthescopeofthisbook. Wethereforegive an
informaldefinition.Forourpurposes,alinearblockcode isacodeinwhichtheexclusive
OR(additionmodulo-2)oftwovalidcodewordscreatesanothervalidcodeword.

278 CHAPTER10ERRORDETECTION ANDCORRECTION
Inalinearblockcode,theexclusiveOR(XOR)ofany
twovalidcode wordscreatesanothervalidcodeword.
Example10.10
Letussee ifthetwocodeswedefinedinTable10.1andTable10.2belongtotheclass oflinear
blockcodes.
1.TheschemeinTable10.1 isalinearblockcodebecausetheresult ofXORinganycodeword
withanyothercodeword
isavalidcodeword.Forexample,theXORing ofthesecondand
thirdcodewordscreatesthefourthone.
2.TheschemeinTable10.2isalsoalinearblockcode. Wecancreateallfourcodewordsby
XORingtwoothercodewords.
MinimumDistancefor LinearBlockCodes
ItissimpletofindtheminimumHammingdistanceforalinearblockcode.Themini­
mumHammingdistanceisthenumber
ofIsinthenonzerovalidcodewordwiththe
smallestnumber
ofIs.
Example10.11
Inourfirstcode(Table10.1),thenumbers ofIsinthenonzerocodewordsare2, 2,and2.Sothe
minimumHammingdistance
isd
min=2.Inoursecondcode(Table10.2),thenumbers ofIsin
thenonzero codewordsare3, 3,and4.Sointhiscodewehaved
min=3.
SomeLinearBlockCodes
Letusnowshowsomelinearblockcodes.Thesecodesaretrivialbecausewecaneasily
findtheencodinganddecodingalgorithmsandchecktheirperformances.
SimpleParity-CheckCode
Perhapsthemostfamiliarerror-detectingcodeisthe simpleparity-checkcode. Inthis
code,a
k-bitdatawordischangedtoann-bitcodewordwhere n=k+1.Theextrabit,
calledtheparitybit,isselectedtomakethetotalnumber
ofIsinthecodewordeven.
Althoughsomeimplementationsspecifyanoddnumber
ofIs,wediscusstheeven
case.TheminimumHammingdistanceforthiscategory
isd
min=2,whichmeansthat
thecode
isasingle-biterror-detectingcode;itcannotcorrectanyerror.
Asimpleparity-checkcodeisasingle-biterror-detecting
codeinwhichn=k+1withd
min=2.
Ourfirstcode(Table10.1)isaparity-checkcodewith k
-=2 andn=3.Thecodein
Table10.3
isalsoaparity-checkcodewith k=4 andn=5.
Figure10.10showsapossiblestructure ofanencoder(atthesender)andadecoder
(atthereceiver).
Theencoderusesageneratorthattakesacopy
ofa4-bitdataword (ao,aI'a2'and
a3)andgeneratesaparitybit rooThedatawordbitsandthe paritybitcreatethe5-bit
codeword.Theparitybitthat
isaddedmakesthenumber ofIsinthecodewordeven.

SECTION10.3LINEAR BLOCKCODES 279
Table10.3 Simpleparity-checkcodeC(5,4)
Datawords Codewords Datawords Codewords
0000 00000 1000 10001
0001 00011 1001 10010
0010 00101 1010 10100
0011 00110 1011 10111
0100 01001 1100 11000
0101 01010 1101 11011
0110 01100 1110 11101
0111 01111 1111 11110
Figure10.10 Encoderanddecoderforsimpleparity-checkcode
Sender Receiver
Encoder Decoder
Dataword Dataword
la31a21allaol la31a21adaol
Accept
SYUdmm,r1
"0
Decision
<-<
'"
0
logic '"
t~l
C;
IGeneratorI I CheckerI
J t
l
Paritybit
Unreliable
la31a21allaolro
transmissionb3lb2lbllboTq~
Codeword Codeword
Thisisnormallydone byaddingthe4bits ofthedataword(modulo-2);theresultisthe
paritybit.Inotherwords,
Ifthenumberof1siseven,theresultis0; ifthenumberof1sisodd,theresultis 1.
Inbothcases,thetotalnumber of1sinthecodewordiseven.
Thesendersendsthecodewordwhichmay
becorruptedduringtransmission.The
receiverreceivesa5-bitword.Thecheckeratthereceiverdoesthesamethingasthegen­
eratorinthesenderwithoneexception:Theadditionisdoneoverall5bits.Theresult,
whichiscalledthe
syndrome,isjust1bit.Thesyndromeis 0whenthenumber ofIsinthe
receivedcodewordiseven;otherwise,it
is1.

280 CHAPTER10ERROR DETECTIONANDCORRECTION
Thesyndromeispassedtothedecisionlogicanalyzer. Ifthesyndromeis 0,thereis
noerrorinthereceivedcodeword;thedataportion
ofthereceivedcodeword isaccepted
asthedataword;
ifthesyndromeis 1,thedataportion ofthereceivedcodewordisdis­
carded.Thedataword
isnotcreated.
Example10.12
Letuslookatsometransmissionscenarios.Assumethesendersendsthedataword1011.Thecode­
wordcreatedfromthisdatawordis10111,whichissenttothereceiver.Weexaminefivecases:
1.Noerroroccurs;thereceivedcodewordis10111.Thesyndromeis O.Thedataword1011is
created.
2.Onesingle-biterrorchanges aI'Thereceivedcodewordis10011.Thesyndromeis 1.No
datawordiscreated.
3.Onesingle-biterrorchanges rooThereceivedcodewordis10110.Thesyndromeis 1.Nodata­
wordiscreated.Notethatalthoughnone
ofthedatawordbitsarecorrupted,nodatawordis
createdbecausethecodeisnotsophisticatedenoughtoshowtheposition
ofthecorruptedbit.
4.Anerrorchanges roandaseconderrorchanges a3'Thereceivedcodewordis00110.Thesyn­
dromeis
O.Thedataword0011iscreatedatthereceiver.Notethat herethedatawordis
wronglycreatedduetothesyndromevalue.Thesimpleparity-checkdecodercannotdetectan
evennumber
oferrors.Theerrorscanceleachotheroutandgivethesyndromeavalue ofO.
5.Threebits-a3,az,andaI-arechangedbyerrors.Thereceivedcodewordis01011.The
syndromeis
1.Thedatawordisnotcreated.Thisshowsthatthesimpleparitycheck,guaran­
teedtodetectonesingleerror,canalsofindany
oddnumberoferrors.
Asimpleparity-checkcodecandetect anoddnumber oferrors.
Abetterapproachisthe two-dimensionalparitycheck. Inthismethod,thedata­
wordisorganizedinatable(rowsandcolumns).
InFigure10.11,thedatatobesent, five
7-bitbytes,areputinseparaterows.Foreachrowandeachcolumn,1parity-checkbit is
calculated.Thewholetableisthensent tothereceiver,whichfindsthesyndromeforeach
rowandeachcolumn.AsFigure10.11shows,thetwo-dimensionalparitycheckcan
detectuptothreeerrorsthatoccuranywhereinthetable(arrowspointtothelocations
of
thecreatednonzerosyndromes).However,errorsaffecting4bitsmaynotbedetected.
HammingCodes
Nowletusdiscussacategory oferror-correctingcodescalled Hammingcodes. These
codeswereoriginallydesignedwith
d
min=3,whichmeansthattheycandetectuptotwo
errorsorcorrectonesingleerror.AlthoughtherearesomeHammingcodesthatcancor­
rectmorethanoneerror,ourdiscussionfocusesonthesingle-biterror-correctingcode.
Firstletusfindtherelationshipbetween
nandkinaHammingcode. Weneedto
chooseaninteger
m>=3.Thevaluesofnandkarethencalculatedfrom masn=2
m
-
1
and
k:::n-m.Thenumber ofcheckbits r=m.
AllHammingcodesdiscussedinthisbookhaved
min=3.
Therelationshipbetween
mandninthesecodesis n=2
m
-1.
Forexample,ifm=3,thenn :::7andk:::4.ThisisaHammingcode C(7,4)withd
min=3.
Table10.4showsthedatawordsandcodewordsforthiscode.

SECTION10.3LINEARBLOCKCODES 281
Figure10.11 Two-dimensionalparity-checkcode
J
Columnparities
a.Design
ofrowandcolumnparities
t
b.Oneerroraffectstwoparities
~~fJfji:;f;ji,~!tt~~I'~iij;f~~s~&fi1.i~--+­
rij~~J~I'tr~~;~*~i~
d.Threeerrorsaffectfourparities
Table10.4 Hammingcode C(7,4)
c.Twoerrorsaffecttwoparities
e.
Fourerrorscannotbedetected
Datawords Codewords Datawords Codewords
0000 0000000 1000 1000110
0001 0001101 1001 1001011
0010 0010111 1010 1010001
0011 0011010 1011 1011100
0100 0100011 1100 1100101
0101 01011
10 1101 1101000
0110 0110100 1110 1110010
0111 0111001 1111 1111111

282 CHAPTER10ERRORDETECTION ANDCORRECTION
Figure10.12showsthestructure oftheencoderanddecoderforthisexample.
Figure10.12 ThestructureoftheencoderanddecoderforaHammingcode
Sender Receiver
Encoder Decoder
Dataword Dataword
Ia31azla1IaoI la31azlatlaol
d.CDlTeCtiOi:1,1
:199ie.
ttl
SyndromeISzStlSoI ',
I
IfGeneratorI l
CheckerI
'ttt
l
Unreliable
la3lazlatlaolr
2hITO
transmission
b31bzlbtlboIq21qllqol
Codeword Codeword
Acopyofa4-bitdatawordisfedintothegeneratorthatcreatesthreeparitychecks
ro,rl'andr2'asshownbelow:
TO=;aZ+al+ao
Tl=a3+az+al
T2=aI+aO+a3
modulo-2
modulo-2
modulo-2
Inotherwords,each oftheparity-checkbitshandles3 outofthe4bits ofthedata­
word.Thetotalnumber
of1sineach4-bitcombination (3datawordbitsand1parity
bit)
mustbeeven.Weare notsayingthatthesethreeequationsareunique;anythree
equationsthatinvolve3
ofthe4bitsinthedatawordandcreateindependentequations
(acombination
oftwocannotcreatethethird)arevalid.
Thecheckerinthedecodercreatesa3-bitsyndrome
(s2s1s0)inwhicheach bitis
theparitycheckfor4
outofthe7bitsinthereceivedcodeword:
So
==bz+bi+bo+qo
Sl=b3+bz+bI+ql
8Z==bl+bo+b3+qz
modulo-Z
modulo-2
modulo-2
Theequationsused bythecheckerarethesameasthoseusedbythegeneratorwith
theparity-checkbitsaddedtotheright-handside
oftheequation.The3-bitsyndrome
createseightdifferentbitpatterns(000to111)thatcanrepresenteightdifferentcondi­
tions.Theseconditionsdefinealack
oferrororanerrorin1 ofthe7bitsofthereceived
codeword,asshowninTable10.5.

SECTION10.3LINEAR BLOCKCODES 283
Table10.5 Logicaldecisionmadebythecorrectionlogicanalyzer a/thedecoder
Syndrome
000 001 010 011 100 101 110 111
Error None
% ql b
2 q2 bo
b
3
b
l
Notethatthegeneratoris notconcernedwiththefourcasesshadedinTable10.5
becausethereis eithernoerrororanerrorintheparitybit.Inthe otherfourcases,1 of
thebitsmustbeflipped(changedfrom0to1or1to0)tofindthe correctdataword.
ThesyndromevaluesinTable10.5arebasedonthesyndromebitcalculations.For
example,ifqoisinerror,Soistheonly bitaffected;thesyndrome,therefore,is001. If
b
2isinerror, Soands1arethebitsaffected;thesyndrome,thereforeis OIl.Similarly,if
b
Iisinerror,all3 syndromebitsareaffected andthesyndromeis111.
Therearetwopointsweneedtoemphasizehere.First,iftwoerrorsoccurduring
transmission,
thecreateddatawordmightnotbetherightone.Second,ifwewantto
use
theabovecodeforerrordetection,weneedadifferentdesign.
Example10.13
Letustracethepathofthreedatawordsfromthesender tothedestination:
1.Thedataword 0100becomesthecodeword 0100011.Thecodeword 0100011isreceived.
Thesyndrome
is000(noerror),thefinaldataword is0100.
2.Thedataword 0111becomesthecodeword 0111001.Thecodeword 0011001isreceived.
Thesyndrome
is011.AccordingtoTable10.5,b
2
isinerror.Afterflipping b
2
(changingthe
1to0),thefinaldataword is0111.
3.Thedataword 1101becomesthecodeword 1101000.Thecodeword 0001000isreceived
(twoerrors).Thesyndrome
is101,whichmeansthat bo
isinerror.Afterflipping b
a
,
weget
0000,thewrongdataword.Thisshowsthatourcodecannot correcttwoerrors.
Example10.14
Weneedadatawordof atleast7bits.Calculatevaluesof kandnthatsatisfythisrequirement.
Solution
Weneedtomakek=n-m greaterthanorequalto7,or 2
1n
-
1 -m
~7.
1.Ifwesetm=3,theresultisn=2
3
-
1andk=7 -3,or4,whichisnotacceptable.
2.Ifwesetm=4,thenn=2
4
-
1=15andk=15-4=11,whichsatisfiesthecondition.Sothe
codeisC(l5,
11).Therearemethodstomakethedatawordaspecificsize,butthediscussion
andimplementationarebeyondthescopeofthisbook.
Performance
AHammingcodecanonlycorrectasingleerrorordetectadoubleerror.However,
thereisawaytomakeitdetectabursterror,as showninFigure10.13.
Thekeyistosplitabursterrorbetweenseveralcodewords,oneerrorforeach
codeword.Indatacommunications,wenormallysendapacketoraframeofdata.To
maketheHammingcoderespondtoabursterror
ofsizeN,weneedtomakeNcodewordsout
ofourframe.Then,instead ofsendingonecodewordatatime, wearrangethecodewordsina
tableandsendthebits
inthetableacolumnatatime. InFigure10.13,thebitsaresentcolunm
bycolumn(fromtheleft).
Ineachcolumn,thebitsaresentfromthebottomtothetop. Inthis
way,aframeismadeout
ofthefourcodewordsandsenttothereceiver.Figure10.13shows

284 CHAPTER10ERRORDETECTION ANDCORRECTION
Figure10.13BursterrorcorrectionusingHammingcode
Sender
Codeword4
Codeword
3
Receiver
Codeword4
Codeword
3
Codeword2 1
Codeword1 1
BurstelTor
-------------------------------------~~~---------------------------,
-r---r---r---r---r--,...--...---,,----.,:
Adataunitintransit
COlTUptedbits
thatwhenabursterror ofsize4corruptstheframe,only 1bitfromeachcodewordiscor­
rupted.Thecorruptedbitineachcodewordcantheneasilybecorrectedatthereceiver.
10.4CYCLICCODES
Cycliccodesarespeciallinearblockcodeswithoneextraproperty.Inacycliccode, if
acodewordiscyclicallyshifted(rotated),theresultisanothercodeword.Forexample,
if1011000isacodewordandwecyclicallyleft-shift,then0110001isalsoacodeword.
Inthiscase,
ifwecallthebitsinthefirstword aotoa6'andthebitsinthesecondword
bo
tob
6
,
wecanshiftthebitsbyusingthefollowing:
Intherightmostequation,thelast
bitofthefirstwordiswrappedaroundand
becomesthefirstbit
ofthesecondword.
CyclicRedundancyCheck
Wecancreatecycliccodestocorrecterrors.However,thetheoreticalbackground
requiredisbeyondthescope
ofthisbook.Inthissection,wesimplydiscussacategory
ofcycliccodescalledthecyclic redundancycheck(CRC)thatisusedinnetworks
such
asLANsandWANs.

SECTION10.4 CYCUCCODES 285
Table10.6showsanexample ofaCRCcode. Wecanseeboththelinearandcyclic
properties
ofthiscode.
Table10.6 ACRCcodewithC(7, 4)
Dataword Codeword Dataword
Code~rord
0000 0000000 1000 1000101
0001 0001011 1001 1001110
0010 0010110 1010 1010011
0011 0011101 1011 1011000
0100 0100111 1100 1100010
0101 0101100 1101 1101001
0110 0110001 1110 1110100
0111 0111010
1111 1111111
Figure10.14showsonepossibledesignfortheencoderanddecoder.
Figure10.14 CRCencoderanddecoder
Sender Receiver
Dataword
Decoder
Unreliable
transmission
Dataword
000
Encoder
Intheencoder,thedatawordhaskbits(4here);thecodewordhas nbits(7here).
Thesize
ofthedatawordisaugmentedbyaddingn- k(3here)Ostotheright-handside
oftheword.Then-bitresultisfedintothegenerator.Thegeneratorusesadivisor of
sizen-k+I(4here),predefinedandagreedupon.Thegeneratordividestheaug­
menteddatawordbythedivisor(modulo-2division).Thequotient
ofthedivisionisdis­
carded;theremainder
(r2rlro)isappendedtothedatawordtocreatethecodeword.
Thedecoderreceivesthepossiblycorruptedcodeword.Acopy
ofallnbitsisfedto
thecheckerwhichisareplica
ofthegenerator.Theremainderproducedbythechecker

286 CHAPTER10ERRORDETECTION ANDCORRECTiON
isasyndromeofn- k(3here)bits,whichisfed tothedecisionlogicanalyzer.Theana­
lyzerhasasimplefunction.
Ifthesyndromebitsareallas,the4leftmostbitsofthe
codewordareaccepted
asthedataword(interpreted asnoerror);otherwise,the4bits
arediscarded(error).
Encoder
Letustakeacloserlookattheencoder.Theencodertakesthedatawordandaugments
itwith
n-knumberofas. Itthendividestheaugmenteddatawordbythedivisor, as
showninFigure10.15.
Figure10.15
DivisioninCRCencoder
Division
Dalaword
11
001I
~
Quotient
1 0 1 0
Divisor1 0 1
1)
I 0 0 1L..T--i'------T--'
1011
Dividend:
augmenled
dataword
Leftmostbit
0:
use0000divisor
Leftmostbit
0:
use0000divisor
o100
o0 0 0
1000
1011
o1 1 0
0000
I
110IRemainder
Codeword11001'-1-1-0-1
DatawordRemainder
Theprocessofmodulo-2binarydivision isthesameasthefamiliardivisionpro­
cessweusefordecimalnumbers.However,asmentionedatthebeginning
ofthe
chapter,inthiscaseadditionandsubtractionarethesame.
WeusetheXORoperation
todoboth.
Asindecimaldivision,theprocessisdonestepbystep.
Ineachstep,acopyof the
divisorisXORedwiththe4bits ofthedividend.TheresultoftheXORoperation
(remainder)is3bits(inthiscase),whichisusedforthenextstepafter1extrabitis
pulleddown
tomakeit4bitslong.There isoneimportantpointweneed toremember
inthistypeofdivision.
Iftheleftmostbit ofthedividend(orthepartusedineachstep)
is0,thestepcannotusetheregulardivisor;weneedtousean all-Osdivisor.
Whentherearenobitslefttopulldown,wehavearesult.The3-bitremainder
formsthecheckbits
(r2'rl'andro).Theyareappendedtothedataword tocreatethe
codeword.

SECTION10.4CYCLICCODES 287
Decoder
Thecodewordcanchangeduringtransmission.Thedecoderdoesthesamedivision
process
astheencoder.Theremainder ofthedivisionisthesyndrome.Ifthesyndrome
isall
Os,thereisnoerror;thedatawordisseparatedfromthereceivedcodewordand
accepted.Otherwise,everythingisdiscarded.Figure10.16showstwocases:Theleft­
handfigureshowsthevalue
ofsyndromewhennoerrorhasoccurred;thesyndrome is
000.Theright-handpart ofthefigureshowsthecaseinwhichthereisonesingleerror.
Thesyndrome
isnotallOs(itisOIl).
Figure10.16 DivisionintheCRCdecoder fortwocases
Codeword11
o00111 0I
Division t
I 0 I 0
1 0 1
1)
10 0o1 1o_Codeword
101
1+10II 1
00o()
1 I
0 1
o0 0
011
~Syndrome
t
Dataword_
discarded
Divisor
Youmaybewonderinghowthedivisor] 011ischosen.Laterinthechapterwepresent
somecriteria,butingeneralitinvolvesabstractalgebra.
HardwareImplementation
Oneoftheadvantagesofacycliccodeisthattheencoderanddecodercaneasilyand
cheaplybeimplementedinhardwarebyusingahandful
ofelectronicdevices.Also,a
hardwareimplementationincreasestherate
ofcheckbitandsyndromebitcalculation.
Inthissection,wetrytoshow,stepbystep,theprocess.Thesection,however,is
optionalanddoesnotaffecttheunderstanding
oftherestofthechapter.
Divisor
Letusfirstconsiderthedivisor.
Weneedtonotethefollowingpoints:
1.ThedivisorisrepeatedlyXORedwithpartofthedividend.

288 CHAPTER10ERRORDETECTIONANDCORRECTION
2.Thedivisorhas n-k+1bitswhicheitherarepredefinedorareall Os.Inother
words,the bitsdonotchangefromonedatawordtoanother.Inourpreviousexam­
ple,thedivisorbitswereeither
1011or0000.Thechoicewasbasedontheleftmost
bit
ofthepartoftheaugmenteddatabitsthatareactiveinthe XORoperation.
3.Acloselookshowsthatonly n-kbitsofthedivisorisneededintheXORoperation.
Theleftmostbitisnotneededbecausetheresult
oftheoperationisalways0,no
matterwhatthevalue
ofthisbit.ThereasonisthattheinputstothisXORoperation
areeitherboth
Osorboth1 s.Inourpreviousexample,only3bits,not4,isactually
usedintheXORoperation.
Usingthesepoints,wecanmakeafixed(hardwired)divisorthatcanbeusedforacyclic
code
ifweknowthedivisorpattern.Figure10.17showssuchadesignforourprevious
example.Wehavealsoshownthe
XORdevicesusedfortheoperation.
Figure10.17Hardwireddesign ofthedivisorinCRC
Leftmostbit ofthepart
ofdividendinvolved
in
XORoperation

Brokenline:
thisbitisalways0
+
(±)
XOR
Notethat iftheleftmostbit ofthepartofdividendtobeusedinthisstepis 1,the
divisorbits
(d
2
d
1
do)areall;iftheleftmostbit is0,thedivisorbitsarc000.Thedesign
providestheright choicebasedontheleftmostbit.
AugmentedDataword
Inourpaper-and-pencildivisionprocessinFigure10.15,weshowtheaugmenteddata­
wordasfixedinpositionwiththedivisorbitsshiftingtotheright,1bitineachstep.
Thedivisorbitsarealignedwiththeappropriatepart
oftheaugmenteddataword.Now
thatourdivisorisfixed,weneedinstead
toshiftthebits oftheaugmenteddatawordtothe
left(oppositedirection)toalignthedivisorbitswiththeappropriatepart.Thereis
no
needtostoretheaugmenteddatawordbits.
Remainder
Inourpreviousexample,theremainderis3bits (n-kbitsingeneral)inlength.Wecan
usethree
registers(single-bitstoragedevices)toholdthesebits.Tofindthefinal
remainder
ofthedivision,weneedtomodifyourdivisionprocess.Thefollowingisthe
step-by-stepprocessthatcanbeusedtosimulatethedivisionprocessinhardware(or
eveninsoftware).
1.Weassumethattheremainderisoriginallyall Os(000inourexample).

SECTION10.4CYCLICCODES 289
2.Ateachtimeclick(arrivalof1bitfromanaugmenteddataword),werepeatthe
followingtwoactions:
a.Weusetheleftmostbittomakeadecisionaboutthedivisor(011or000).
b.Theother2bitsoftheremainderandthenextbitfromtheaugmenteddataword
(totalof3bits)areXORedwiththe3-bitdivisortocreatethenextremainder.
Figure10.18showsthissimulator,butnotethatthisisnotthefinaldesign;therewillbe
moreimprovements.
Figure10.18 SimulationofdivisioninCRCencoder
.C;/~~~ /~I~
o~
Augmenteddataword
,-(B~I0 0 0 0 0TIme:I .iLk' ,
, , ,
Time:2L:1i
,
t -'
,~l~o
ot~
/-@ 0/~@~ 0 000
,o?:-'mMft ,
/ , ,
Time:3L:i!&
,
°t'
,~1~0°t--dJ/-(B 1/-@~ 000
'p'~~~ ,
/ , ,
Time:4L:1i
,
/~I~ ,~1~1ot~
/-(B0 000
8~:<8?::<8ffi) ,
/ , ,
Time:5L::Ii/~~--dJ
t'
,~l~o/~l±)~ 0 0
,
/ , ,
Time:6~
.
It -'
,!1~0ot~
/-l±) 0/-l±)~ 0,
/ , ,
Time:7l1'°t--dJ
°t'ol
/-0 1,'-0~
,-(B~o
~- /
/ / ,
/ / /
IIoJ IT]
\~.''"'-<
I
Finalremainder
Ateachclocktick,shown asdifferenttimes,oneofthebitsfromtheaugmented
dataword
isusedintheXORprocess.Ifwelookcarefullyatthedesign,wehave seven
stepshere,whileinthepaper-and-pencilmethodwehadonlyfoursteps.Thefirstthree
stepshavebeenaddedhere
tomakeeachstepequalandtomakethedesignforeachstep
thesame.Steps
1,2,and3pushthefirst3bitstotheremainderregisters;steps4, 5,6,
and7matchthepaper-and-pencildesign.Notethatthevaluesintheremainderregister
insteps4to7exactlymatchthevaluesinthepaper-and-pencildesign.Thefinalremain­
derisalsothesame.
Theabovedesignisfordemonstrationpurposesonly.
Itneedssimplificationtobe
practical.First,wedonotneedtokeeptheintermediatevaluesoftheremainderbits;
weneedonlythefinalbits.
Wethereforeneedonly3registersinsteadof24.Afterthe
XORoperations,wedonotneedthebitvaluesofthepreviousremainder.Also,wedo

290 CHAPTER 10ERRORDETECTION ANDCORRECTION
notneed21XORdevices;twoareenoughbecausetheoutput ofanXORoperationin
whichone
ofthebitsis0issimplythevalue oftheotherbit.Thisotherbitcanbeused
astheoutput.Withthesetwomodifications,thedesignbecomestremendouslysimpler
andlessexpensive,
asshowninFigure10.19.
Figure10.19TheCRCencoderdesignusingshiftregistersLillf-ol.f-----~l
Augmenteddataword
o0 1000
Weneed,however,tomaketheregistersshiftregisters.AI-bitshiftregisterholds
abitforaduration
ofoneclocktime.Atatimeclick,theshiftregisteraccepts thebitat
itsinputport,storesthenewbit,anddisplaysitontheoutputport.Thecontentandthe
outputremainthesameuntilthenextinputarrives.WhenweconnectseveralI-bitshift
registerstogether,itlooksas
ifthecontentsoftheregisterareshifting.
GeneralDesign
AgeneraldesignfortheencoderanddecoderisshowninFigure10.20.
Figure10.20Generaldesign ofencoderanddecoderofaCRCcode
Note:
ThedivisorlineandXORare
missing
ifthecorresponding
bitinthedivisoris
O.
Dataword
rn_k_l r
l Yo
a.Encoder
L{;b
Received...
codeword
..+
sn-k-l sl So
b.Decoder
Notethatwehave n-k I-bitshiftregistersinboththeencoderanddecoder. We
haveupto n-kXORdevices,butthedivisorsnormallyhaveseveral Osintheirpattern,
whichreducesthenumber
ofdevices.Alsonotethat,instead ofaugmenteddatawords,
weshowthedataworditselfastheinputbecauseafterthebitsinthedatawordareall
fedintotheencoder,theextrabits,whichallare
Os,donothaveanyeffectontheright­
mostXOR.
Ofcourse,theprocessneedstobecontinuedforanother n-kstepsbefore

SECTION10.4CYCLICCODES 291
thecheckbitsareready.Thisfactisone ofthecriticismsofthisdesign.Betterschemes
havebeendesignedtoeliminatethiswaitingtime(thecheckbitsarereadyafter
ksteps),
butweleavethisasaresearchtopicforthereader.Inthedecoder,however,theentire
codewordmustbefedtothedecoderbeforethesyndromeisready.
Polynomials
Abetterwaytounderstandcycliccodesandhowtheycanbeanalyzed istorepresent
them
aspolynomials.Again,thissection isoptional.
Apattern
ofOsand1scanberepresentedasa polynomialwithcoefficientsof0and
1.Thepower ofeachtermshowstheposition ofthebit;thecoefficientshowsthevalue
ofthebit.Figure 10.21showsabinarypatternanditspolynomialrepresentation.InFig­
ure10.21aweshowhowtotranslateabinarypatterntoapolynomial;inFigure
1O.21b
weshowhowthepolynomialcanbeshortenedbyremovingalltermswithzerocoeffi­
cientsandreplacing
xlbyxandxOby1.
Figure10.21 Apolynomialtorepresentabinaryword
I1I0I0I0I0I1I1I
I
iii+oX'+ox
4
+o~+o?+Ix
l
+IxoI
a.Binarypatternandpolynomial b.Shortform
Figure10.21showsoneimmediatebenefit;a7-bitpatterncanbereplacedbythree
terms.Thebenefitisevenmoreconspicuouswhenwehaveapolynomialsuchas
x
23
+
X
3
+1.Herethebitpatternis24bitsinlength(threeIsandtwenty-one Os)whilethe
polynomialisjustthreeterms.
DegreeofaPolynomial
Thedegreeofapolynomialisthehighestpowerinthepolynomial.Forexample,the
degree
ofthepolynomialx
6
+x+1is6.Notethatthedegree ofapolynomialis1less
thatthenumber
ofbitsinthepattern.Thebitpatterninthiscasehas7bits.
AddingandSubtractingPolynomials
Addingandsubtractingpolynomialsinmathematicsaredonebyaddingorsubtracting
thecoefficients
oftermswiththesamepower.Inourcase,thecoefficientsareonly0
and
1,andaddingisinmodulo-2.Thishastwoconsequences.First,additionandsub­
tractionarethesame.Second,addingorsubtractingisdonebycombiningtermsand
deletingpairs
ofidenticalterms.Forexample,adding x
5
+x
4
+x
2
andx
6
+x
4
+x
2
gives
just
x
6
+x
5
.
Thetermsx
4
andx
2
aredeleted.However,notethat ifweadd,forexample,
threepolynomialsandweget
x
2
threetimes,wedeleteapair ofthemandkeepthethird.

292 CHAPTER10ERRORDETECTION ANDCORRECTION
MultiplyingorDividingTerms
Inthisarithmetic,multiplyingatermbyanothertermisverysimple;wejustaddthe
powers.Forexample,
x
3
xx
4
isx
7
,
Fordividing,wejustsubtractthepower ofthesec­
ondtermfromthepower
ofthefirst.Forexample,x
5
1x
2
isx
3
.
MultiplyingTwoPolynomials
Multiplyingapolynomialbyanother
isdonetermbyterm.Eachterm ofthefirstpolyno­
mialmustbemultipliedbyallterms
ofthesecond.Theresult, ofcourse,isthensimplified,
andpairs
ofequaltermsaredeleted.Thefollowing isanexample:
(~+X3 +~ +x)(~+x+1)
=~+~+~+~+0+~+0+~+~+~+~+x
=x
7
+x
6
+x
3
+x
DividingOnePolynomialby Another
Divisionofpolynomialsisconceptuallythesameasthebinarydivisionwediscussed
foranencoder.
Wedividethefirstterm ofthedividendbythefirstterm ofthedivisorto
getthefirstterm
ofthequotient.Wemultiplytheterminthequotientbythedivisorand
subtracttheresultfromthedividend.
Werepeattheprocessuntilthedividenddegreeis
lessthanthedivisordegree.
Wewillshowanexample ofdivisionlaterinthischapter.
Shifting
Abinarypatternisoftenshiftedanumber
ofbitstotherightorleft.Shiftingtotheleft
meansaddingextra
Osasrightmostbits;shiftingtotherightmeansdeletingsomeright­
mostbits.Shiftingtotheleftisaccomplishedbymultiplyingeachterm
ofthepolynomial
by
xn,wheremisthenumber ofshiftedbits;shiftingtotherightisaccomplishedby
dividingeachterm
ofthepolynomialby
xn.Thefollowingshowsshiftingtotheleftand
totheright.Note thatwedonothavenegativepowersinthepolynomialrepresentation.
Shiftingleft3bits:
Shiftingright3bits: 10011becomes10011000
10011becomes10 x
4
+x+1becomesx
7
+x
4
+
~
x
4
+x+1becomesx
Whenweaugmentedthedatawordintheencoder ofFigure10.15,weactually
shiftedthebits
totheleft.Alsonotethatwhenweconcatenatetwobitpatterns,weshift
thefirstpolynomialtotheleftandthenaddthesecondpolynomial.
CyclicCodeEncoderUsingPolynomials
Nowthatwehavediscussedoperationsonpolynomials,weshowthecreationofacode­
wordfromadataword.Figure10.22
isthepolynomialversion ofFigure10.15. Wecan
seethattheprocess
isshorter.Thedataword 1001isrepresentedasx
3
+1.Thedivisor
1011isrepresentedasx
3
+x+1.Tofindtheaugmenteddataword,wehaveleft-shifted
thedataword3bits(multiplyingby
x\Theresultisx
6
+x
3
.
Divisionisstraightforward.
Wedividethefirstterm ofthedividend,x
6
,
bythefirstterm ofthedivisor,x
3
.
Thefirst
term
ofthequotientisthen x
6
/x
3
,
orx
3
.
Thenwemultiply x
3
bythedivisorandsubtract
(accordingtoourpreviousdefinition
ofsubtraction)theresultfromthedividend.The

SECTION10.4CYCLiCCODES 293
resultis x
4
,
withadegreegreaterthanthedivisor'sdegree; wecontinuetodivideuntil
thedegreeoftheremainderislessthanthedegreeofthedivisor.
Figure10.22
CRCdivisionusingpolynomials
DatawordI
x
3
+1
t
Divisor x
3+x
Dividend:
x
3
+x+I )x
6+ x
3
augmented
x
6+.0+x
3 dataword
.0
.0+x
2
+x
I
x
2
+xIRemainder
CodewordIx6+x
3Ixl+xI
DatawordRemainder
Itcanbeseenthatthepolynomialrepresentationcaneasilysimplifytheoperation
ofdivisioninthiscase,becausethetwostepsinvolving all-Osdivisorsarenotneeded
here.(Ofcourse,onecouldarguethatthe
all-Osdivisorstepcanalsobeeliminatedin
binarydivision.)Inapolynomialrepresentation,thedivisorisnormallyreferredtoas
the
generatorpolynomialt(x).
Thedivisorinacycliccode
isnormallycalledthegeneratorpolynomial
orsimplythegenerator.
CyclicCodeAnalysis
Wecananalyzeacycliccodetofinditscapabilitiesbyusingpolynomials. Wedefine
thefollowing,
wheref(x)isapolynomialwithbinarycoefficients.
Dataword:d(x)
Syndrome:sex)
Codeword:c(x)
Error:e(x)
Generator:g(x)
Ifsex)isnotzero,thenoneormorebitsiscorrupted.However,if sex)iszero,either
nobitiscorruptedorthedecoderfailedtodetectanyerrors.
Inacycliccode,
I.If
s(x)"*0,oneormorebitsiscorrupted.
2.Ifsex)=0,either
a.Nobitiscorrupted.or
b.Somebitsarecorrupted,butthedecoderfailedtodetectthem.

294 CHAPTER10ERRORDETECTION ANDCORRECTION
Inouranalysiswewanttofindthecriteriathatmustbeimposedonthegenerator,
g(x)todetectthetype oferrorweespeciallywanttobedetected.Letusfirstfindthe
relationshipamongthesentcodeword,error,receivedcodeword,andthegenerator.
Wecansay
Receivedcodeword =c(x)+e(x)
Inotherwords,thereceivedcodeword isthesumofthesentcodewordandtheerror.
Thereceiverdividesthereceivedcodewordby
g(x)togetthesyndrome. Wecanwrite
this
as
Received
codeword=c(x)+e(x)
g(x) g(x) g(x)
Thefirsttermattheright-handside oftheequalitydoesnothavearemainder
(accordingtothedefinition
ofcodeword).Sothesyndromeisactuallytheremainder of
thesecondtermontheright-handside. Ifthistermdoesnothavearemainder(syn­
drome
=0),eithere(x)is0or e(x)isdivisibleby g(x).Wedonothavetoworryabout
thefirstcase(there
isnoerror);thesecondcaseisveryimportant.Thoseerrorsthatare
divisibleby
g(x)arenotcaught.
Inacycliccode, thosee(x)errorsthataredivisiblebyg(x)arenotcaught.
Letusshowsomespecificerrorsandseehowtheycan becaughtbyawell­
designed
g(x).
Single-BitError
Whatshouldbethestructure
ofg(x)toguaranteethedetection ofasingle-biterror?A
single-biterroris
e(x)=xi,wherei isthepositionofthebit.Ifasingle-biterror iscaught,
then
xiisnotdivisibleby g(x).(Notethatwhenwesay notdivisible,wemeanthatthere
isaremainder.)
Ifg(x)
ha~atleasttwoterms(whichisnormallythecase)andthecoeffi­
cient
ofxOisnotzero(therightmostbit is1),thene(x)cannotbedividedby g(x).
HthegeneratorhasmorethanonetermandthecoefficientofxOis1,
allsingle
errorscanbecaught.
Example10.15
Whichofthefollowingg(x)valuesguaranteesthatasingle-biterroriscaught?Foreachcase,
whatistheerrorthatcannotbecaught?
a.x+1
b.x
3
c.1

SECTION10.4CYCLICCODES 295
Solution
a.Noxicanbedivisiblebyx+1.Inotherwords,xi/ex+1)alwayshasaremainder.Sothe
syndromeisnonzero.Anysingle-biterrorcanbecaught.
b.Ifiisequalto orgreaterthan3,xiisdivisiblebyg(x).Theremainderofx
i
/x
3
iszero,and
thereceiverisfooledintobelievingthatthereisnoerror,althoughtheremightbeone.
Notethatinthiscase,thecorruptedbitmustbeinposition4orabove.All single-bit
errorsinpositionsIto3arecaught.
c.Allvaluesofimakejdivisibleby g(x).Nosingle-biterrorcan becaught.Inaddition,this
g(x)isuselessbecauseitmeansthecodeword isjustthedatawordaugmented withn-kzeros.
TwoIsolatedSingle-BitErrors
Nowimaginetherearetwosingle-bitisolatederrors.Underwhatconditionscanthis
type
oferrorbecaught?Wecanshowthistype oferroras e(x)
=:xl+xi.Thevaluesofi
andjdefinethepositions oftheerrors,andthedifference j-idefinesthedistance
betweenthetwoerrors,asshowninFigure10.23.
Figure10.23 Representationo/twoisolatedsingle-biterrorsusingpolynomials
I
'Difference:j-i
Wecanwrite e(x)=1(x
j
-i+1).Ifg(x)hasmorethanonetermandoneterm isxo,it
cannotdivide1,aswesawintheprevioussection.So ifg(x)istodividee(x),itmustdivide
x
j
-i
+1.Inotherwords, g(x)mustnotdivide
Y!+1,wheretisbetween0and n-1.However,
t=:Oismeaninglessand t=Iisneededaswewillseelater.Thismeans tshouldbebetween
2andn-1.
Hageneratorcannotdivider+1(tbetween0 andn-1),
thenallisolateddoubleerrors
canbedetected.
Example10.16
Find
thestatusofthefollowinggeneratorsrelatedtotwoisolated,single-biterrors.
a.x+1
b.x
4
+I
c.x
7
+x
6
+1
d.
x
ls
+x
I4
+1
Solution
a.Thisisaverypoorchoiceforagenerator.Anytwoerrorsnexttoeachothercannotbedetected.
b.Thisgeneratorcannotdetecttwoerrorsthatarefourpositionsapart. Thetwoerrorscan
beanywhere,butiftheirdistanceis 4,theyremainundetected.
c.Thisisa
goodchoiceforthispurpose.
d.This
polynomialcannotdivide anyerroroftypex
t
+1iftislessthan32,768.This means
thata codewordwithtwoisolatederrorsthatare nexttoeachotherorupto32,768bits
apart
canbedetectedbythisgenerator.

296 CHAPTER10ERRORDETECTION ANDCORRECTION
OddNumbers ofErrors
Ageneratorwithafactor ofx+1cancatchalloddnumbers oferrors.Thismeansthat
weneedtomake
x+1 afactorofanygenerator.Notethatwearenotsayingthatthe
generatoritselfshouldbe
x+1;wearesayingthatitshouldhaveafactor ofx+1.Ifit
isonly
x+1,itcannotcatchthetwoadjacentisolatederrors(seetheprevioussection).
Forexample,
x
4
+x
2
+X+1cancatchallodd-numberederrorssinceitcanbewritten
asaproduct
ofthetwopolynomials x+1andx
3
+x
2
+1.
Ageneratorthatcontainsafactor ofx+1candetectallodd-numberederrors.
BurstErrors
Nowletusextendouranalysistothebursterror,whichisthemostimportant ofall.A
bursterroris
oftheform e(x)=
eJ+...+xi).Notethedifferencebetweenabursterror
andtwoisolatedsingle-biterrors.Thefirstcanhavetwoterms
ormore;thesecondcan
onlyhavetwoterms.
Wecanfactorout xiandwritetheerror as
xi(xJ-i+...+1).Ifour
generatorcandetectasingleerror(minimumconditionforagenerator),thenitcannot
divide
xi.Whatweshouldworryaboutarethosegeneratorsthatdivide
xJ-i+...+1.In
otherwords,theremainder
of
(xJ-
i
+...+1)/(x
r
+...+1)mustnotbezero.Notethat
thedenominator
isthegeneratorpolynomial. Wecanhavethreecases:
1.Ifj-i<r,theremaindercanneverbezero. Wecanwritej-i=L-1,whereLis
thelength
oftheerror.So L-1<rorL<r+1orL
:::;:r.Thismeansallbursterrors
withlengthsmallerthanorequaltothenumber
ofcheckbits rwillbedetected.
2.Insomerarecases, ifj
-i=r,orL=r+1,thesyndromeis0andtheerror isunde­
tected.
Itcanbeprovedthatinthesecases,theprobability ofundetectedbursterror of
lengthr+1is
(ll2r-
l
.Forexample,ifourgeneratorisx
l4
+~+1,inwhichr=14,a
bursterror
oflengthL=15canslipbyundetectedwiththeprobability of(1/2)14-1or
almost1in10,000.
3.Insomerarecases, ifj-i>r,orL>r+1,thesyndromeis0andtheerrorisunde­
tected.
Itcanbeprovedthatinthesecases,theprobability ofundetectedbursterror
oflengthgreaterthan r+1is
(112tForexample,ifourgeneratorisx
14
+x
3
+1,in
whichr=14,abursterror oflengthgreaterthan 15canslipbyundetectedwiththe
probability
of(112)14oralmost1in16,000cases.
oAllbursterrorswithL
::::;rwillbedetected.
oAllbursterrorswithL=r+1willbedetectedwithprobability1 - (112/-
1

oAllbursterrorswithL>r+1willbedetectedwithprobability 1-(1/2[.
Example10.17
Findthesuitability ofthefollowinggeneratorsinrelationtobursterrors ofdifferentlengths.
a.x
6+1
b.x
I8
+x
7
+x+1
c.x32+~3+x7+1

SECTION10.4CYCLICCODES 297
Solution
a.Thisgeneratorcandetectallbursterrorswithalengthlessthanorequalto6bits;3out
of100bursterrorswithlength7willslipby; 16outof1000bursterrors oflength8or
morewillslip
by.
b.Thisgeneratorcandetectallbursterrorswithalengthlessthanorequalto 18bits;8out
of1millionbursterrorswithlength 19willslipby;4out ofImillionbursterrors of
length20ormorewillslip by.c.Thisgeneratorcandetectallbursterrorswithalengthlessthanorequalto32bits;5out
of10billionbursterrorswithlength33willslipby;3out of10billionbursterrors of
length34ormorewillslip by.
Summary
Wecansummarizethecriteriaforagoodpolynomialgenerator:
Agoodpolynomialgeneratorneedstohavethefollowingcharacteristics:
1.Itshouldhave atleasttwoterms.
2.Thecoefficientoftheterm xOshouldbe1.
3.
Itshouldnotdivide Xl+1,fortbetween2 andn-1.
4.Itshouldhavethefactorx+ 1.
StandardPolynomials
Somestandardpolynomialsusedbypopularprotocolsfor eRegenerationareshown
inTable10.7.
Table10.7
Standardpolynomials
Name Polynomial Application
CRC-8 x
S+x
2
+x+1 ATMheader
CRC-lO
xIO+x9+~+x4+x2+ I ATMAAL
CRC-16
x
16
+x
12
+
~+1 HDLC
CRC-32
x
32
+
2
6
+2
3
+x
22
+x
16
+x
12
+xlI+x
lO
+ LANs
x
8+x
7+x
5+x
4+x
2+x+1
AdvantagesofCyclicCodes
Wehaveseenthatcycliccodeshaveaverygoodperformanceindetectingsingle-bit
errors,doubleerrors,anoddnumber
oferrors,andbursterrors.Theycaneasilybe
implementedinhardwareandsoftware.Theyareespeciallyfastwhenimplementedin
hardware.Thishasmadecycliccodesagoodcandidateformanynetworks.
OtherCyclicCodes
Thecycliccodeswehavediscussedinthissectionareverysimple.Thecheckbitsand
syndromescanbecalculatedbysimplealgebra.Thereare,however,morepowerful
polynomialsthatarebasedonabstractalgebrainvolvingGaloisfields.Thesearebeyond

298 CHAPTER 10ERRORDETECTION ANDCORRECTION
thescopeofthisbook.One ofthemostinteresting ofthesecodesisthe Reed-Solomon
code
usedtodayforbothdetectionandcorrection.
10.5CHECKSUM
Thelasterrordetectionmethodwediscusshere iscalledthe checksum.Thechecksum
isusedintheInternetbyseveralprotocolsalthoughnotatthedatalinklayer.However,
webrieflydiscussitheretocompleteourdiscussiononerrorchecking.
Likelinearandcycliccodes,thechecksumisbasedontheconcept
ofredundancy.
Severalprotocolsstillusethechecksumforerrordetection
aswewillseeinfuture
chapters,althoughthetendencyis
toreplaceitwitha CRe.ThismeansthattheCRCis
alsousedinlayersotherthanthedatalinklayer.
Idea
Theconceptofthechecksumisnotdifficult.Letusillustrateitwithafewexamples.
Example10.18
Supposeourdataisalist offive4-bitnumbersthatwewanttosend toadestination.Inaddition
tosendingthesenumbers,wesendthesum ofthenumbers.Forexample, ifthesetofnumbersis
(7,11, 12,0,6),wesend(7,11,12,0,6,36),where36isthesum oftheoriginalnumbers.The
receiveraddsthefivenumbersandcomparestheresultwiththesum.
Ifthetwoarethesame,
thereceiverassumes
noerror,acceptsthe fivenumbers,anddiscardsthesum.Otherwise,thereis
anerrorsomewhereandthedataarenotaccepted.
Example10.19
Wecanmakethejob ofthereceivereasier ifwesendthenegative(complement) ofthesum,
calledthe
checksum.Inthiscase,wesend (7,11,12,0,6,-36).Thereceivercanaddallthenum­
bersreceived(includingthechecksum).
Iftheresultis 0,itassumesnoerror;otherwise,there is
anerror.
One'sComplement
Thepreviousexamplehasonemajordrawback.All ofourdatacanbewrittenasa4-bit
word(theyarelessthan15)exceptforthechecksum.Onesolution
istouseone'scom­
plement
arithmetic.Inthisarithmetic,wecanrepresentunsignednumbersbetween0
and
2
n
-
1usingonlynbits. tIfthenumberhasmorethannbits,theextraleftmostbits
needtobeaddedtothe
nrightmostbits(wrapping).Inone'scomplementarithmetic,a
negativenumbercanberepresentedby invertingallbits(changinga 0toa 1anda 1to
a0).Thisisthesameassubtractingthenumberfrom
2
n
-
1.
Example10.20
Howcanwerepresentthenumber 21inone'scomplementarithmeticusingonlyfourbits?
tAlthoughone'scomplementcanrepresentbothpositiveandnegativenumbers,weareconcernedonlywith
unsignedrepresentationhere.

SECTION10.5CHECKSUM 299
Solution
Thenumber 21inbinaryis10101(itneedsfivebits). Wecanwraptheleftmostbitand additto
thefourrightmostbits.
Wehave(0101 +1)=0110or 6.
Example10.21
Howcanwerepresentthenumber -6inone'scomplementarithmeticusingonlyfourbits?
Solution
Inone'scomplementarithmetic,thenegativeorcomplement ofanumberisfoundbyinverting
allbits.Positive6
is0110;negative6is100I. Ifweconsideronlyunsignednumbers,thisis 9.In
otherwords,thecomplementof6is9.Anotherwaytofindthecomplement
ofanumberinone's
complementarithmetic
istosubtractthenumberfrom 2
n
-
I(16- 1inthiscase).
Example10.22
LetusredoExercise10.19usingone'scomplementarithmetic.Figure10.24showstheprocessat
thesenderandatthereceiver.Thesenderinitializesthechecksumto0andaddsalldataitemsand
thechecksum(thechecksum
isconsideredasonedataitemandisshownincolor).Theresult is
36.However,36cannotbeexpressedin4bits.Theextratwobitsarewrappedandaddedwith
thesumtocreatethewrappedsumvalue6.Inthefigure,wehaveshownthedetailsinbinary.The
sumisthencomplemented,resultinginthechecksumvalue9(15- 6
=9).Thesendernowsends
sixdataitemstothereceiverincludingthechecksum9.Thereceiverfollowsthesameprocedure
asthesender.Itaddsalldataitems(includingthechecksum);theresultis45. Thesumis
wrappedandbecomes
15.Thewrappedsumiscomplementedandbecomes O.Sincethevalue of
thechecksumis0,thismeansthatthedata isnotcorrupted.Thereceiverdropsthechecksumand
keepstheotherdataitems.
Ifthechecksumisnotzero,theentirepacket isdropped.
Figure10.24
Sendersite Receiversite
7 7
11 11
12 12
0 0
6 6
0
~7,II,12,0,6,9~
9
Sum~ 36 Sum~ 45
Wrappedsum~ 6 Packet Wrappedsum~ 15
Checksum~ 9 Checksum~ 0
L!.J!JO1 0 0
~10
o1 1 0
1001
36
6
9
L!....Q.J1 1 0 1
~10
1 1 1 1
o0 0 0
45
15
o
Detailsofwrapping
andcomplementing
Details ofwrapping
andcomplementing
InternetChecksum
Traditionally,theInternethasbeenusinga16-bitchecksum.Thesendercalculatesthe
checksumbyfollowingthesesteps.

300 CHAPTER10ERRORDETECTIONANDCORRECTION
Sendersite:
1.Themessageisdividedinto16-bitwords.
2.Thevalueofthechecksumwordissetto O.
3.Allwordsincludingthechecksumareaddedushtgone'scomplementaddition.
4.Thesumiscomplemented andbecomesthechecksum.
5.Thechecksumissentwiththedata.
Thereceiverusesthefollowing stepsforerrordetection.
Receiversite:
1.Themessage(includingchecksum)isdividedinto16-bitwords.
2.Allwordsareaddedusingone'scomplementaddition.
3.Thesumiscomplementedandbecomesthenewchecksum.
4.Ifthevalueofchecksumis 0,themessageisaccepted;otherwise,itisrejected.
Thenatureofthechecksum(treatingwordsasnumbersandaddingandcomple­
mentingthem)iswell-suitedforsoftwareimplementation.Shortprogramscanbewritten
tocalculatethechecksumatthe receiversiteortocheckthevalidity
ofthemessageat
thereceiversite.
Example10.23
Letuscalculatethechecksumforatext of8characters("Forouzan").Thetextneedstobedivided
into2-byte(l6-bit)words.WeuseASCII(seeAppendixA)tochangeeachbytetoa2-digithexa­
decimalnumber.Forexample,Fisrepresentedas
Ox46and0isrepresentedas Ox6F.Figure10.25
showshowthechecksumiscalculatedatthesenderandreceiversites.Inparta
ofthefigure,
thevalue
ofpartialsumforthefirstcolumnis Ox36.Wekeeptherightmostdigit(6)andinsertthe
Figure10.25
I013 Carries
46 6F (Fo)
726F (ro)
757A luz)
6
16E (an)
00 0 0 Checksum(initial)
8
FC6Sum(partial)
1
8FC7Sum
70
38Checksum(tosend)
a.
Checksumatthesendersite
1()1
3 Carries
4 6
6F IFo)
726F (ro)
757A (uz)
6
16E (an)
7038Checksum(received)
FF FESum(partial)
1
FF FF Sum
0 0
0()Checksum(new}
b.
Checksumatthereceiversite

SECTIONfO.7KEYTERMS 301
leftmostdight (3)asthecarryinthesecondcolumn.Theprocessisrepeatedforeachcolumn.
HexadecimalnumbersarereviewedinAppendixB.
Notethatifthere isanycorruption,thechecksumrecalculated bythereceiverisnotallas.
Weleavethisanexercise.
Performance
Thetraditionalchecksumusesasmallnumber ofbits(16) todetecterrorsinamessage
ofanysize(sometimesthousands ofbits).However,itisnotasstrongastheCRCin
error-checkingcapability.Forexample,
ifthevalueofonewordisincrementedandthe
value
ofanotherwordisdecremented bythesameamount,thetwoerrorscannotbe
detectedbecausethesumandchecksumremainthesame.Also
ifthevaluesofseveral
wordsareincrementedbutthetotalchangeisamultiple
of65535,thesumandthe
checksumdoesnotchange,whichmeanstheerrorsarenotdetected.FletcherandAdler
haveproposedsomeweightedchecksums,inwhicheachwordismultipliedbya
num­
ber(itsweight)thatisrelated toitspositioninthetext.Thiswilleliminatethefirst
problemwementioned.However,thetendencyintheInternet,particularlyindesigning
newprotocols,is
toreplacethechecksumwithaCRC.
10.6RECOMMENDED READING
Formoredetailsaboutsubjectsdiscussedinthischapter,werecommendthefollowing
books.Theitemsinbrackets[
...]refertothereferencelistattheend ofthetext.
Books
Severalexcellentbookaredevoted toerrorcoding.Amongthemwerecommend[Ham80],
[Zar02],[Ror96],and[SWE04].
RFCs
AdiscussionoftheuseofthechecksumintheInternetcanbefoundinRFC1141.
10.7KEYTERMS
blockcode
bursterror
checkbit
checksum
codeword
convolutioncode
cycliccode
cyclicredundancycheck(CRC)
dataword
error
errorcorrection
errordetection
forwarderrorcorrection
generatorpolynomial
Hammingcode
Hammingdistance
interference
linearblockcode
minimumHammingdistance
modulararithmetic

302 CHAPTER 10ERRORDETECTION ANDCORRECTION
modulus
one'scomplement
paritybit
parity-checkcode
polynomial
redundancy
Reed-Solomon
register
retransmission
shiftregister
single-biterror
syndrome
two-dimensionalparity
check
10.8SUMMARY
oDatacanbecorruptedduringtransmission.Someapplicationsrequirethaterrorsbe
detectedandcorrected.
oInasingle-biterror,onlyonebitinthedataunithaschanged.Abursterrormeans
thattwoormorebitsinthedataunithavechanged.
oTodetectorcorrecterrors,weneedtosendextra(redundant)bitswithdata.
oTherearetwomainmethods oferrorcorrection:forwarderrorcorrectionandcorrec­
tionbyretransmission.
oWecandividecodingschemesintotwobroadcategories:blockcodingandconvo­
lutioncoding.
oIncoding,weneedtousemodulo-2arithmetic.Operationsinthisarithmeticarevery
simple;additionandsubtractiongivethesameresults.weusetheXOR(exclusive
OR)operationforbothadditionandsubtraction.
oInblockcoding,wedivideourmessageintoblocks,each ofkbits,calleddatawords.
Weaddrredundantbits toeachblocktomakethelength n:::k+r.Theresultingn-bit
blocksarecalledcodewords.
oInblockcoding,errorsbedetectedbyusingthefollowingtwoconditions:
a.Thereceiverhas(orcanfind)alist ofvalidcodewords.
b.Theoriginalcodewordhaschangedtoaninvalidone.
oTheHammingdistancebetweentwowords isthenumber ofdifferencesbetween
correspondingbits.TheminimumHammingdistanceisthesmallestHamming
distancebetweenallpossiblepairsinaset
ofwords.
oToguaranteethedetection ofuptoserrorsinallcases,theminimumHammingdis­
tanceinablockcodemustbed
min
:::s+1.Toguaranteecorrection ofuptoterrorsin
allcases,theminimumHammingdistanceinablockcodemustbed
min
:::2t+1.
oInalinearblockcode,theexclusiveOR(XOR) ofanytwovalidcodewordscreates
anothervalidcodeword.
oAsimpleparity-checkcodeisasingle-biterror-detectingcode inwhichn :::k+1
withd
min
:::2.Asimpleparity-checkcodecandetectanoddnumber oferrors.
oAllHammingcodesdiscussedinthisbookhaved
min
:::3.Therelationshipbetween
mandninthesecodes isn:::2m- 1.
oCycliccodesarespeciallinearblockcodeswithoneextraproperty.Inacycliccode,
ifacodewordiscyclicallyshifted(rotated),theresultisanothercodeword.

SECTION10.9PRACTICE SET 303
oAcategoryofcycliccodescalledthecyclicredundancycheck(CRC)isusedin
networkssuchasLANsandWAN
s.
oApatternofOsandIscanberepresentedasapolynomialwithcoefficients of0and1.
oTraditionally,theInternethasbeenusingaI6-bitchecksum,whichuses one'scom­
plement
arithmetic.Inthisarithmetic,wecanrepresentunsignednumbersbetween
oand2
n
-1usingonlynbits.
10.9PRACTICESET
ReviewQuestions
1.Howdoesasingle-biterrordifferfromabursterror?
2.Discusstheconcept ofredundancyinerrordetectionandcorrection.
3.Distinguishbetweenforwarderrorcorrectionversuserrorcorrectionbyretransmission.
4.Whatisthedefinitionofalinearblockcode?What isthedefinitionofacycliccode?
5.WhatistheHammingdistance?WhatistheminimumHammingdistance?
6.Howisthesimpleparitycheckrelatedtothetwo-dimensionalparitycheck?
7.InCRC,showtherelationshipbetweenthefollowingentities(sizemeansthenumber
ofbits):
a.Thesizeofthedatawordandthesize ofthecodeword
b.Thesizeofthedivisorandtheremainder
c.Thedegreeofthepolynomialgeneratorandthesize ofthedivisor
d.Thedegreeofthepolynomialgeneratorandthesize oftheremainder
8.Whatkind ofarithmeticisusedtoadddataitemsinchecksumcalculation?
9.Whatkind oferrorisundetectablebythechecksum?
10.Canthevalue ofachecksumbeall Os(inbinary)?Defendyouranswer.Canthe
valuebe
allIs(inbinary)?Defendyouranswer.
Exercises
11.Whatisthemaximumeffect ofa2-msburst ofnoiseondatatransmittedatthefol­
lowingrates?
a.1500bps
b.12kbps
c.100kbps
d.100Mbps
12.Applytheexclusive-oroperationonthefollowingpair ofpatterns(thesymbol
EB
meansXOR):
a.(10001)EB(10000)
b.(10001)EB(10001)(What doyouinferfromtheresult?)
c.(11100)EB(00000)(Whatdoyouinferfromtheresult?)
d.(10011)EEl(11111)(Whatdoyouinferfromtheresult?)

304 CHAPTER10ERRORDETECTION ANDCORRECTION
13.InTable10.1,thesendersendsdataword10.A3-bitbursterrorcorruptsthecode­
word.Canthereceiverdetecttheerror?Defendyouranswer.
14.InTable10.2,thesendersendsdataword10.
Ifa3-bitburst
en-orcon-uptsthefirst
threebits
ofthecodeword,canthereceiverdetecttheerror?Defendyouranswer.
15.
WhatistheHammingdistanceforeach ofthefollowingcodewords:
a.d(10000,00000)
b.d(10101,10000)
c.d(11111,11111)
d.d(000,000)
16.Findthe
minimumHammingdistanceforthefollowingcases:
a.Detection
oftwo
en-ors.
b.Correctionoftwoerrors.
c.Detection
of3errorsorcorrectionof2errors.
d.Detection
of6errorsorcorrectionof2errors.
17.UsingthecodeinTable10.2,whatisthedataword
ifoneofthefollowingcode­
wordsisreceived?
a.01011
b.11111
c.00000
d.11011
18.ProvethatthecoderepresentedbyTable10.8isnotalinearcode.Youneedtofind
onlyonecasethatviolatesthelinearity.
Table 10.8TableforExercise18
Dataword Codeword
00 00000
01 01011
10 10111
11 11111
19.Althoughitcanmathematically beprovedthatasimpleparitycheckcodeisalinear
code,usemanualtesting
oflinearityforfivepairs ofthecodewordsinTable10.3to
partiallyprovethisfact.
20.ShowthattheHammingcodeC(7,4)
ofTablelOAcandetecttwo-bit
en-orsbutnot
necessarilythree-biterrorbytestingthecodeinthefollowingcases.Thecharacter"V"
inthebursten-ormeansnoen-or;thecharacter"E"meansanerror.
a.Dataword:0100 Bursterror:VEEVVVV
b.Dataword:0111 Bursterror:EVVVVVE
c.Dataword:1111 Bursterror:EVEVVVE
d.Dataword:0000 Bursten-or:EEVEVVV

SECTION10.9PRACTICE SET 305
21.ShowthattheHammingcodeC(7,4) ofTablelOAcancorrectone-biterrorsbut
notmore
bytestingthecode inthefollowingcases. Thecharacter
"V"intheburst
errormeansnoerror;thecharacter
"E"meansanerror.
a.Dataword:0100 Bursterror:
EVVVVVV
b.Dataword:0111 Bursterror:VEVVVVV
c.Dataword:1111 Bursterror:EVVVVVE
d.Dataword:0000 Bursterror:EEVVVVE
22.Althoughitcan beprovedthatcodeinTable10.6isbothlinearandcyclic,use
onlytwoteststopartiallyprovethefact:
a.Testthecyclicproperty oncodeword0101100.
b.Testthelinearproperty oncodewords0010110and1111111.
23.Weneedadataword
ofatleast11bits.Findthevalues ofkandnintheHamming
code
C(n,k) withd
min
:::3.
24.Applythefollowingoperations
onthecorrespondingpolynomials:
a.(x
3+xl+X+1)+(x
4+xl+x+1)
b.(x
3
+xl+x+1)-(x
4
+xl+x+1)
c.(x
3
+xl)X(x
4
+x
2
+x+1)
d.(x
3
+x
2
+x+1)/(x
2
+1)
25.Answerthefollowingquestions:
a.Whatisthepolynomialrepresentation of10111O?
b.Whatistheresult ofshifting101110threebitstotheleft?
c.Repeatpartbusingpolynomials.
d.Whatistheresult ofshifting101110fourbitstotheright?
e.Repeatpartdusingpolynomials.
26.
WhichofthefollowingCRCgeneratorsguaranteethedetection ofasinglebit
error?
a.x
3
+x+1
b.x
4
+xl
c.1
d.x
2
+1
27.ReferringtotheCRC-8polynomialinTable10.7, answerthefollowingquestions:
a.Doesitdetectasingleerror?Defendyouranswer.
b.Doesitdetectabursterror ofsize6?Defendyouranswer.
c.Whatistheprobability ofdetectingabursterror ofsize9?
d.Whatistheprobability ofdetectingabursterror ofsize15?
28.ReferringtotheCRC-32polynomialinTable10.7,answerthefollowingquestions:
a.Doesitdetectasingleerror?Defendyouranswer.
b.Doesitdetectabursterror ofsize16?Defend youranswer.
c.
Whatistheprobabilityofdetectingabursterror ofsize33?
d.Whatistheprobability ofdetectingabursterror ofsize55?

306 CHAPTER 10ERRORDETECTION ANDCORRECTION
29.Assumingevenparity,findtheparitybitforeach ofthefollowingdataunits.
a.1001011
b.0001100
c.1000000
d.1110111
30.Giventhedataword1010011110andthedivisor10111,
a.Showthegeneration ofthecodewordatthesendersite(usingbinarydivision).
h.Show thechecking ofthecodewordatthereceiversite(assumenoerror).
3
I.RepeatExercise30usingpolynomials.
32.Asenderneedstosendthefourdataitems Ox3456,OxABCC,Ox02BC,andOxEEEE.
Answerthefollowing:
a.Findthechecksumatthesendersite.
b.Findthechecksumatthe receiversite ifthereisnoerror.c.Findthechecksumatthereceiversite iftheseconddataitemischangedto
OxABCE.
d.Findthechecksumatthereceiversite iftheseconddataitemischangedto
OxABCEandthethirddataitemischangedtoOx02BA.33.Thisproblemshowsaspecialcaseinchecksumhandling.Asenderhastwodata
items
tosend:Ox4567andOxBA98.Whatisthevalue ofthechecksum?

CHAPTER11
DataLinkControl
Thetwomainfunctions ofthedatalinklayeraredatalinkcontrolandmediaaccess
control.Thefirst,datalinkcontrol,dealswiththedesignandproceduresforcommuni­
cationbetweentwoadjacentnodes:node-to-nodecommunication.Wediscussthis
functionalityinthischapter.Thesecondfunction
ofthedatalinklayerismediaaccess
control,
orhowtosharethelink. WediscussthisfunctionalityinChapter 12.
Datalinkcontrol functionsincludeframing,flowanderrorcontrol,andsoftware­
implementedprotocolsthatprovidesmoothandreliabletransmission offrames
betweennodes.Inthischapter,wefirstdiscussframing,orhowtoorganizethebitsthat
arecarriedbythephysicallayer.Wethendiscussflowanderrorcontrol.Asubset
of
thistopic,techniquesforerrordetectionandcorrection,wasdiscussedinChapter 10.
Toimplementdatalinkcontrol,weneedprotocols.Eachprotocolisaset ofrules
thatneedtobeimplementedinsoftwareandrunbythetwonodesinvolvedindata
exchangeatthedatalinklayer.
Wediscussfiveprotocols:twofornoiseless(ideal)
channelsandthreefornoisy(real)channels.Thoseinthefirstcategoryarenotactually
implemented,butprovideafoundationforunderstandingtheprotocolsinthesecond
category.
Afterdiscussingthefiveprotocoldesigns,weshowhowabit-orientedprotocolis
actuallyimplementedbyusingtheHigh-levelDataLinkControl(HDLC)Protocol
asan
example.Wealsodiscussapopularbyte-orientedprotocol,Point-to-PointProtocol(PPP).
11.1FRAMING
Datatransmissioninthephysicallayermeansmovingbitsintheform ofasignalfrom
thesourcetothedestination.Thephysicallayerprovidesbitsynchronizationtoensure
thatthesenderandreceiverusethesamebitdurationsandtiming.
Thedatalinklayer,ontheotherhand,needstopackbitsintoframes,sothateach
frameisdistinguishablefromanother.Ourpostalsystempracticesatype
offraming.
Thesimpleact
ofinsertingaletterintoanenvelopeseparatesonepiece ofinformation
fromanother;theenvelopeservesasthedelimiter.Inaddition,eachenvelopedefines
thesenderandreceiveraddressessincethepostalsystemisamany-to-manycarrier
facility.
307

308 CHAPTER11DATALINKCONTROL
Framinginthedatalinklayerseparatesamessagefromonesourcetoadestina­
tion,orfromothermessagestootherdestinations,byaddingasenderaddressanda
destinationaddress.Thedestinationaddressdefineswherethepacketistogo;thesender
addresshelpstherecipientacknowledgethereceipt.
Althoughthewholemessagecouldbepackedinoneframe,that
isnotnormally
done.Onereasonisthataframecanbeverylarge,making
flowanderrorcontrolvery
inefficient.Whenamessageiscarriedinoneverylargeframe,evenasingle-biterror
wouldrequiretheretransmission
ofthewholemessage.Whenamessage isdivided
intosmallerframes,asingle-biterroraffectsonlythatsmallframe.
Fixed-SizeFraming
Framescanbe offixedorvariablesize.Infixed-sizeframing,there isnoneedfordefin­
ingtheboundaries
oftheframes;thesizeitselfcanbeused asadelimiter.Anexample
ofthistype
offramingisthe ATMwide-areanetwork,whichusesframesoffixedsize
calledcells.
WediscussATMinChapter18.
Variable-SizeFraming
Ourmaindiscussioninthischapterconcernsvariable-sizeframing,prevalentinlocal­
areanetworks.
Invariable-sizeframing,weneedawaytodefinetheend oftheframe
andthebeginning
ofthenext.Historically,twoapproacheswereusedforthispurpose:
acharacter-orientedapproachandabit-orientedapproach.
Character-OrientedProtocols
Inacharacter-orientedprotocol,datatobecarriedare8-bitcharactersfromacoding
systemsuch
asASCII(seeAppendixA).Theheader,whichnormallycarriesthesource
anddestinationaddressesandothercontrolinformation,andthetrailer, whichcarries
errordetectionorerrorcorrectionredundantbits,arealsomultiples
of8bits.Toseparate
oneframefromthenext,an8-bit(I-byte)flag
isaddedatthebeginningandtheendofa
frame.The
flag,composedofprotocol-dependentspecialcharacters,signalsthestartor
end
ofaframe.Figure 11.1showstheformatofaframe inacharacter-orientedprotocol.
Figure11.1
Aframeinacharacter-orientedprotocol
Datafromupperlayer
Character-orientedframingwaspopularwhenonlytextwasexchangedbythedata
linklayers.Theflagcouldbeselectedtobeanycharacternotusedfortextcommunica­
tion.Now,however,wesendothertypes
ofinformationsuchasgraphs,audio,and
video.Anypatternusedforthe
flagcouldalsobepart oftheinformation.Ifthishap­
pens,thereceiver,whenitencountersthispatterninthemiddle
ofthedata,thinksithas
reachedtheend
oftheframe.Tofixthisproblem,abyte-stuffingstrategywasaddedto

SECTION11.1FRAMING 309
character-orientedframing.Inbytestuffing(orcharacterstuffing),aspecialbyteis
addedtothedatasection
oftheframewhenthereisacharacterwiththesamepattern as
theflag.Thedatasectionisstuffedwithanextrabyte.Thisbyte isusuallycalledthe
escapecharacter(ESC),whichhasapredefinedbitpattern.Wheneverthereceiver
encounterstheESCcharacter,itremovesitfromthedatasectionandtreatsthenext
characterasdata,notadelimitingflag.
Bytestuffingbytheescapecharacterallowsthepresence
oftheflaginthedatasec­
tion
oftheframe,butitcreatesanotherproblem.Whathappens ifthetextcontainsoneor
moreescapecharactersfollowedbyaflag?Thereceiverremovestheescapecharacter,
butkeepstheflag,whichisincorrectly interpreted
astheendoftheframe.Tosolvethis
problem,theescapecharactersthatarepart
ofthetextmustalsobemarkedbyanother
escapecharacter.In otherwords,
iftheescapecharacterispart ofthetext,anextraoneis
added
toshowthatthesecondoneispart ofthetext.Figure11.2showsthesituation.
Figure11.2 Bytestuffingandunstuffing
Framesent
Flag Header
Stuffed
Extra2
bytes
Framereceived
Flag Header
Unstuffed
Bytestuffingistheprocess ofadding1extrabytewhenever
thereisaflag
orescapecharacterinthetext.
Character-orientedprotocolspresentanotherproblemindatacommunications.
Theuniversalcodingsystemsinusetoday,suchasUnicode,have16-bitand32-bit
charactersthatconflictwith8-bitcharacters.
Wecansaythatingeneral,thetendency is
movingtowardthebit-orientedprotocolsthatwediscussnext.
Bit-OrientedProtocols
Inabit-orientedprotocol, thedatasection ofaframeisasequenceofbitstobeinter­
pretedbytheupperlayer
astext,graphic,audio,video,andsoon.However,inaddition
toheaders(andpossibletrailers),westillneedadelimitertoseparateoneframefrom
theother.Mostprotocolsuseaspecial8-bitpatternflag01111110asthedelimiter
to
definethebeginningandtheend oftheframe,asshowninFigure11.3.

310 CHAPTER11DATALINKCONTROL
Figure11.3 Aframeinabit-orientedprotocol
I'
Datafromupperlayer
Variablenumber
ofbits'
I
Header
Flag
Thisflagcancreatethesametype ofproblemwesawinthebyte-orientedproto­
cols.Thatis,
iftheflagpatternappearsinthedata,weneedtosomehowinformthe
receiverthatthisisnottheend
oftheframe.Wedothisbystuffing1singlebit(instead
ofIbyte)topreventthepatternfromlookinglikeaflag.Thestrategyiscalled bit
stuffing.Inbitstuffing,ifa 0andfiveconsecutiveIbitsareencountered, anextra0is
added.Thisextrastuffedbit
iseventuallyremovedfromthedatabythereceiver.Note
thattheextrabit
isaddedafterone0followedby five1sregardlessofthevalueofthe
nextbit.Thisguaranteesthattheflagfieldsequencedoesnotinadvertentlyappearin
theframe.
Bitstuffingistheprocess ofaddingoneextra0whenever fiveconsecutive18followa 0
inthedata,so
thatthereceiverdoesnotmistakethe pattern0111110foraflag.
Figure11.4showsbitstuffingatthesenderandbitremovalatthereceiver.Notethat
even
ifwehavea 0afterfive1 s,westillstuffa O.The0willberemovedbythereceiver.
Figure11.4 Bitstuffingandunstuffing
Frame
sent
IFlag!Header
Framereceived
Datafromupperlayer
100011111110011111010001
Stuffedt
10001111101100111110010001Trailer IFlagI
Extra2
bits
IFlag1Header 10001111101100111110010001Trailer1FlagI
Unsroffedt
I0001l11l11001111101000I
Datatoupperlayer
Thismeansthat iftheflaglikepattern01111110appearsinthedata,itwillchange
to011111010(stuffed)andisnotmistaken
asaflagbythereceiver.Therealflag01111110
isnotstuffedbythesenderandisrecognizedbythereceiver.

SECTIONII.3PROTOCOLS 311
11.2FLOWAND ERRORCONTROL
Datacommunicationrequiresatleasttwodevicesworkingtogether,onetosendandthe
other
toreceive.Evensuchabasicarrangementrequiresagreatdeal ofcoordination
foranintelligibleexchangetooccur.Themost importantresponsibilities
ofthedata
linklayerareflow
controlanderrorcontrol.Collectively,thesefunctionsareknown
as
datalinkcontrol.
FlowControl
Flowcontrolcoordinatestheamount ofdatathatcanbesentbeforereceivinganacknowl­
edgmentand
isoneofthemostimportantduties ofthedatalinklayer.Inmostprotocols,
flowcontrol
isasetofproceduresthattellsthesenderhowmuchdataitcantransmit
beforeitmustwaitforanacknowledgmentfromthereceiver.Theflow
ofdatamustnot
beallowedtooverwhelmthereceiver.Anyreceivingdevicehasalimitedspeedatwhich
itcanprocessincomingdataandalimitedamount
ofmemoryinwhichtostoreincom­
ingdata.Thereceivingdevicemustbeabletoinformthesendingdevicebeforethose
limitsarereachedandtorequestthatthetransmittingdevicesendfewerframesorstop
temporarily.Incomingdatamustbecheckedandprocessedbeforetheycanbeused.The
rate
ofsuchprocessing isoftenslowerthantherate oftransmission.Forthisreason,
eachreceivingdevicehasablock
ofmemory,calleda buffer,reservedforstoringincom­
ingdatauntiltheyareprocessed.
Ifthebufferbegins tofillup,thereceivermustbeable
totellthesendertohalttransmissionuntilit
isonceagainable toreceive.
Flowcontrolreferstoaset ofproceduresusedtorestricttheamount ofdata
thatthesendercansendbeforewaitingforacknowledgment.
ErrorControl
Errorcontrolisbotherrordetectionanderrorcorrection. Itallowsthereceiver to
informthesender ofanyframeslostordamagedintransmissionandcoordinatesthe
retransmission
ofthoseframesbythesender.Inthedatalinklayer,thetermerrorcon­
trolrefersprimarily
tomethodsoferrordetectionandretransmission.Errorcontrolin
thedatalinklayerisoftenimplementedsimply:Anytimeanerrorisdetectedinan
exchange,specifiedframesareretransmitted.Thisprocessiscalled
automaticrepeat
request(ARQ).
Errorcontrolinthe datalinklayerisbasedonautomatic
repeatrequest,whichistheretransmission
ofdata.
11.3PROTOCOLS
Nowletusseehowthedatalinklayercancombineframing,flowcontrol,anderrorcontrol
toachievethedelivery ofdatafromonenode toanother.Theprotocolsarenormallyimple­
mentedinsoftwarebyusingone
ofthecommonprogramminglanguages. Tomakeour

312 CHAPTER11DATALINKCONTROL
discussionslanguage-free,wehavewritteninpseudocodeaversion ofeachprotocolthat
concentratesmostlyontheprocedureinstead
ofdelvingintothedetails oflanguagerules.
Wedividethediscussion
ofprotocolsintothosethat canbeusedfornoiseless
(error-free)channelsandthosethat
canbeusedfornoisy(error-creating)channels.The
protocolsinthefirstcategorycannotbeusedinreallife,buttheyserveasabasisfor
understandingtheprotocols
ofnoisychannels.Figure11.5showstheclassifications.
Figure11.5Taxonomyofprotocols discussedinthischapter
Simplest
Stop-and-Wait
Stop-and-WaitARQ
Go-Hack-N
ARQ
SelectiveRepeatARQ
Thereisadifferencebetweentheprotocolswediscusshereandthoseusedinreal
networks.Alltheprotocolswediscussareunidirectionalinthesensethatthedataframes
travelfromonenode,calledthesender,toanothernode,calledthereceiver.Although
specialframes,called
acknowledgment(ACK)andnegative acknowledgment(NAK)
canflowintheoppositedirectionforflowanderrorcontrolpurposes,dataflowinonly
onedirection.
Inareal-lifenetwork,thedata linkprotocolsareimplementedasbidirectional;
dataflowinbothdirections.Intheseprotocolstheflowanderrorcontrolinformationsuch
asACKsandNAKsisincludedinthedataframesinatechniquecalledpiggybacking.
Becausebidirectionalprotocolsaremorecomplexthanunidirectionalones,wechosethe
latterforourdiscussion.
Iftheyareunderstood,theycanbeextendedtobidirectional
protocols.Weleavethisextensionasanexercise.
11.4NOISELESSCHANNELS
Letusfirstassumewehaveanidealchannelinwhich noframesarelost,duplicated,or
corrupted.Weintroducetwoprotocolsforthistype
ofchannel.Thefirstisaprotocol
thatdoesnotuseflowcontrol;thesecondistheonethatdoes.
Ofcourse,neitherhaserror
controlbecausewehaveassumedthatthechannelisaperfectnoiseless
channel.
SimplestProtocol
Ourfirstprotocol,whichwecalltheSimplestProtocolforlack ofanyothername,isone
thathasnoflow
oren'orcontrol.Likeotherprotocolswewilldiscussinthischapter,itisa
unidirectionalprotocolinwhichdataframesaretravelinginonlyone
direction-fromthe

SECTION11.4NOISELESSCHANNELS 313
sendertoreceiver. Weassumethatthereceivercanimmediatelyhandleanyframeit
receiveswithaprocessingtimethatissmallenoughtobenegligible.Thedatalink
layer
ofthereceiverimmediatelyremovestheheaderfromtheframeandhandsthedata
packettoitsnetworklayer,whichcanalsoacceptthepacketimmediately.Inother
words,thereceivercanneverbeoverwhelmedwithincomingframes.
Design
Thereisnoneedfor
flowcontrolinthisscheme.Thedatalinklayeratthesendersite
getsdatafromitsnetworklayer,makesaframeoutofthedata, andsendsit.Thedata
linklayeratthereceiversitereceivesaframefromitsphysicallayer,extractsdatafrom
theframe,anddeliversthedatatoitsnetworklayer.Thedatalinklayersofthesender
andreceiverprovidetransmissionservicesfortheirnetworklayers.Thedatalinklayers
usetheservicesprovidedbytheirphysicallayers(such
assignaling,multiplexing,and
soon)forthephysicaltransmission
ofbits.Figure11.6showsadesign.
Figure11.6 Thedesignofthesimplestprotocolwithnoflow orerrorcontrol
Sender Receiver
Network
Datalink
Physical
Getdata
Delivrdata
t
I
I ...
t
I
Sendframe Receiveframe
Dataframes-+-
I~~~~~~~ I
Network
Data
link
Physical
Repeatforever
Event:
)\{otifu:ationfrom
physlclUiaye]"
Weneedtoelaborateontheprocedureusedbybothdatalinklayers.Thesendersite
cannotsendaframeuntilitsnetworklayerhasadatapackettosend.Thereceiversite
cannotdeliveradatapackettoitsnetworklayeruntilaframearrives.
Iftheprotocolis
implementedasaprocedure,weneedtointroducetheideaofeventsintheprotocol.The
procedureatthesendersiteisconstantlyrunning;there
isnoactionuntilthereisarequest
fromthenetworklayer.Theprocedureatthereceiversiteisalsoconstantlyrulming,but
there
isnoactionuntilnotificationfromthephysicallayerarrives.Bothproceduresare
constantlyrunningbecausetheydonotknowwhenthecorrespondingeventswilloccur.

314 CHAPTER 11DATALINKCONTROL
Algorithms
Algorithm11.1showstheprocedureatthesendersite.
Algorithm11.1Sender-sitealgorithm forthesimplestprotocol
//Sendtheframe
IISleepuntilaneventoccurs
//Thereisapackettosend
GetData()i
MakeFrame()i
SendFrame()i
}
WaitForEvent()i
if(Event(RequestToSend»
{
1while(true) IIRepeatforever
2 {
3
4
5
6
7
8
9
10}
AnalysisThealgorithmhas aninfiniteloop,whichmeanslines 3to9arerepeatedforever
oncetheprogramstarts.Thealgorithmisanevent-drivenone,whichmeansthatit
sleeps(line3)
untilanevent wakesitup(line4).Thismeansthattheremaybeanundefinedspan oftime
betweentheexecution
ofline3andline4;there isagapbetweentheseactions.Whentheevent,
arequestfromthenetworklayer,occurs,lines6though8areexecuted.Theprogramthenrepeats
theloopandagainsleepsatline3untilthenextoccurrence
oftheevent.Wehavewritten
pseudocodeforthemainprocess.
WedonotshowanydetailsforthemodulesGetData,Make­
Frame,andSendFrame.GetDataOtakesadatapacketfromthenetworklayer,MakeFrameOadds
aheaderanddelimiterflags
tothedatapackettomakeaframe,andSendFrameOdeliversthe
frame
tothephysicallayerfortransmission.
Algorithm11.2showstheprocedureatthereceiversite.
Algorithm11.2Receiver-sitealgorithm forthesimplestprotocol
//Deliverdatatonetworklayez
ReceiveFrame()i
ExtractData()i
DeliverData ( )i
}
1while(true) IIRepeatforever
2 {
3WaitForEvent()i IISleepuntilanevent
occurs
4if(Event(ArrivalNotification»IIDataframearrived
5 {
6
7
8
9
10}
AnalysisThisalgorithmhasthesameformat asAlgorithm11.1,exceptthatthedirection of
theframesanddata isupward.Theeventhereisthearrival ofadataframe.Aftertheevent
occurs,thedatalinklayerreceivestheframefromthephysicallayerusingtheReceiveFrameO
process,extractsthedatafromtheframeusingtheExtractDataOprocess,anddeliversthedata
to
thenetworklayerusingtheDeliverDataOprocess.Here,wealsohavean event-drivenalgorithm
becausethealgorithmneverknowswhenthedataframewillarrive.

SECTION11.4NOISELESSCHANNELS 315
Example11.1
Figure11.7showsanexample ofcommunicationusingthisprotocol. Itisverysimple.The
sendersendsasequenceofframeswithouteventhinkingaboutthereceiver.
Tosendthreeframes,
threeeventsoccuratthesendersiteandthreeeventsatthereceiversite.Notethatthedataframes
areshownbytiltedboxes;theheight
oftheboxdefinesthetransmissiontimedifferencebetween
thefirstbitandthelastbitintheframe.
Figure11.7 Flowdiagram forExample11.1
Sender Receiver
GJ [i""1
I I
I I
Request
~r=am:-e---------1.
I ~Arri"al
Request~ratne~
: ~Arr~
Request~ame :
: ~Arrival
t t
Time Time
Stop-and-WaitProtocol
Ifdataframesarriveatthereceiversitefasterthantheycanbeprocessed,theframes
mustbestoreduntiltheiruse.Normally,thereceiverdoesnothaveenoughstorage
space,especially
ifitisreceivingdatafrommanysources.Thismayresultineitherthe
discarding
offramesordenial ofservice.Topreventthereceiverfrombecomingover­
whelmedwithframes,wesomehowneedtotellthesendertoslowdown.Theremustbe
feedbackfromthereceivertothesender.
Theprotocolwediscussnowiscalledthe
Stop-and-WaitProtocol becausethe
sendersendsoneframe,stopsuntil
itreceivesconfirmationfromthereceiver(okayto
goahead),andthensendsthenextframe.
Westillhaveunidirectionalcommunication
fordataframes,butauxiliaryACKframes(simpletokens
ofacknowledgment)travel
fromtheotherdirection.
Weaddflowcontroltoourpreviousprotocol.
Design
Figure11.8illustratesthemechanism.ComparingthisfigurewithFigure11.6,wecan
seethetrafficontheforwardchannel(fromsendertoreceiver)andthereversechannel.
Atanytime,thereiseitheronedataframeontheforwardchannel
oroneACKframeon
thereversechannel.
Wethereforeneedahalf-duplexlink.
Algorithms
Algorithm11.3isforthesendersite.

316 CHAPTER11DATALINKCONTROL
Figure11.8DesignofStop-and-WaitProtocol
Sender Receiver
Network
Data
link:
Physical
Deliver
Gettata data
..
T I
..I ~ I
RI.
T
RI.,T
ecelveSend ecelVeSend
frame frame frameframe
Dataframe
I
~~ I
~DACKframe
Network
Datalink
Physical
Repeatforever
Algorithm11.3Sender-sitealgorithm forStop-and-WaitProtocol
Iwhile(true)
canSend=true
IISleepuntilaneventoccurs
ANDcanSend}
IISleepuntilaneventoccurs
/1AnACKhasarrived
I/Sendthedataframe
I/cannotsenduntilACKarrives
IIRepeatforever
IIAllowthefirstframetogo
I/ReceivetheACK£r~eReceiveFrame();
canSend~true;
GetDataOi
MakeFrame();
SendFrame()i
canSend=false;
}
}
WaitForEvent()i
if(Event(ArrivalNotification)
{
{
WaitForEvent()i
if(Event(RequestToSend)
{
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18}
AnalysisHeretwoeventscanoccur:arequestfromthenetworklayeroranarrivalnotifica­
tionfromthephysicallayer.Theresponses
totheseeventsmustalternate. Inotherwords,aftera
frameissent,thealgorithmmustignoreanothernetworklayer
requestuntilthatframeis

SECTION1I.4NOISELESSCHANNELS 317
acknowledged.Weknowthattwoarrivaleventscannothappenoneafteranotherbecausethe
channeliserror-freeanddoesnotduplicatetheframes.Therequestsfromthenetworklayer,
however,mayhappenoneafteranotherwithoutanarrivaleventinbetween.
Weneedsomehow to
preventtheimmediatesending ofthedataframe.Althoughthereareseveralmethods,wehave
usedasimple
canSendvariablethatcaneitherbetrueorfalse.Whenaframeissent,thevariable
issettofalsetoindicatethatanewnetworkrequestcannotbesentuntil
canSendistrue.Whenan
ACK
isreceived,canSendisset totruetoallowthesending ofthenextframe.
Algorithm11.4showstheprocedureatthereceiversite.
Algorithm11.4Receiver-sitealgorithm forStop-and-WaitProtocol
WaitForEvent(); IISleepuntilanevent
occurf
if(Event(ArrivalNotification)}IIDataframearrives
{
/IDeliverdatatonetworklayex
IISendanACKframe
IIRepeatforever
ReceiveFrame(};
ExtractData(}i
Deliver(data};
SendFrame();
}
1while(true)
2 {
3
4
5
6
7
8
9
10
11}
AnalysisThisisverysimilartoAlgorithm11.2withoneexception.Afterthedataframe
arrives,thereceiversends
anACKframe(line9)toacknowledgethereceiptandallowthesender
tosendthenextframe.
Example11.2
Figure11.9shows anexampleofcommunicationusingthisprotocol. Itisstillverysimple.The
sendersendsoneframeandwaitsforfeedbackfromthereceiver.WhentheACKarrives,the
sendersendsthenextframe.Notethatsendingtwoframesintheprotocolinvolvesthesenderin
foureventsandthereceiverintwoevents.
Figure11.9FlowdiagramforExample 1I.2
Sender
INA]
Receiver
rIJ
Arrival
Frame
Arrival :
I
Request
ReqUest~~ :
I Arrival
I
1. AC'i..
Arrival' I
• 1
t t
Time Time

318 CHAPTER11DATALINKCONTROL
11.5NOISYCHANNELS
AlthoughtheStop-and-WaitProtocolgivesusanidea ofhowtoaddflowcontroltoits
predecessor,noiselesschannelsarenonexistent.
Wecanignoretheerror(aswesome­
timesdo),orweneedtoadderrorcontroltoourprotocols.
Wediscussthreeprotocols
inthissectionthatuseerrorcontrol.
Stop-and-WaitAutomaticRepeatRequest
Ourfirstprotocol,calledthe Stop-and-WaitAutomaticRepeatRequest(Stop-and­
WaitARQ),
addsasimpleerrorcontrolmechanismtotheStop-and-WaitProtocol.Let
usseehowthisprotocoldetectsandcorrectserrors.
Todetectandcorrectcorruptedframes,weneedtoaddredundancybitstoourdata
frame(seeChapter10).Whentheframearrivesatthereceiversite,itischeckedand
if
itiscorrupted,itissilentlydiscarded.Thedetection oferrorsinthisprotocolismani­
festedbythesilence
ofthereceiver.
Lostframesaremoredifficulttohandlethancorruptedones.Inourpreviousproto­
cols,therewasnowaytoidentifyaframe.Thereceivedframecouldbethecorrectone,
oraduplicate,oraframeout
oforder.Thesolutionistonumbertheframes.Whenthe
receiverreceivesadataframethatisout
oforder,thismeansthatframeswereeither
lostorduplicated.
Thecomlptedandlostframesneedtoberesentinthisprotocol.
Ifthereceiverdoes
notrespondwhenthereisanerror,howcanthesenderknowwhichframetoresend?
To
remedythisproblem,thesenderkeepsacopy ofthesentframe.Atthesametime,itstarts
atimer.
Ifthetimerexpiresandthere isnoACKforthesentframe,theframeisresent,the
copyisheld,andthetimer
isrestarted.Sincetheprotocolusesthestop-and-waitmecha­
nism,thereisonlyonespecificframethatneedsanACKeventhoughseveralcopies
of
thesameframecanbeinthenetwork.
ErrorcorrectioninStop-and-WaitARQisdonebykeepingacopy ofthesentframe
andretransmittingofthe framewhenthe timerexpires.
SinceanACKframecanalsobecorruptedandlost,ittooneedsredundancybits
andasequencenumber.TheACKframeforthisprotocolhasasequencenumberfield.
Inthisprotocol,thesendersimplydiscardsacorruptedACKframe
orignoresan
out-of-orderone.
SequenceNumbers
Aswediscussed,theprotocolspecifiesthatframesneedtobenumbered.Thisisdone
byusing
sequencenumbers.Afieldisaddedtothedataframetoholdthesequence
number
ofthatframe.
Oneimportantconsiderationistherange
ofthesequencenumbers.Sincewewant
tominimizetheframesize,welookforthesmallestrangethatprovidesunambiguous

SECTION11.5NOISYCHANNELS 319
communication.Thesequencenumbers ofcoursecanwraparound.Forexample, ifwe
decidethatthefieldis
mbitslong,thesequencenumbersstartfrom0,goto 2
m
-
1,and
thenarerepeated.
Let
usreasonouttherange ofsequencenumbersweneed.Assumewehaveused xas
asequencenumber;weonlyneedtouse
x+1afterthat.There isnoneedfor x+2.To
showthis,assumethatthesenderhassenttheframenumbered x.Threethingscanhappen.
1.Theframearrivessafeandsoundatthereceiversite;thereceiversendsanacknowl­
edgment.Theacknowledgmentarrivesatthesendersite,causingthesender
tosend
thenextframenumbered
x+1.
2.Theframearrivessafeandsoundatthereceiversite;thereceiversendsanacknowl­
edgment,buttheacknowledgmentiscorruptedorlost.Thesenderresendstheframe
(numbered
x)afterthetime-out.Notethattheframehereisaduplicate.Thereceiver
canrecognizethisfactbecauseitexpectsframe
x+Ibutframe xwasreceived.
3.Theframeiscorrupted orneverarrivesatthereceiversite;thesenderresendsthe
frame(numbered
x)afterthetime-out.
Wecanseethatthereisaneedforsequencenumbers
xandx+Ibecausethereceiver
needstodistinguishbetweencase1andcase
2.Butthereisnoneedforaframetobe
numbered
x+2.Incase1,theframecanbenumbered xagainbecauseframes xandx+1
areacknowledgedandthereisnoambiguityateithersite.Incases2and
3,thenewframe
is
x+I,notx+2.Ifonlyxandx+1areneeded,wecanlet x=0andx+I==1.This
meansthatthesequence
is0,I,0,I,0,andsoon.Isthispatternfamiliar?Thisismodulo-2
arithmeticaswesawinChapter
10.
InStop-and-Wait
ARQ~weusesequencenumberstonumbertheframes.
Thesequencenumbersarebasedonmodul0-2arithmetic.
AcknowledgmentNumbers
SincethesequencenumbersmustbesuitableforbothdataframesandACKframes,we
usethisconvention:
Theacknowledgmentnumbersalways announcethesequence
number
ofthenextframeexpectedbythereceiver. Forexample,ifframe0hasarrived
safeandsound,thereceiversendsanACKframe withacknowledgment1(meaning
frame1
isexpectednext). Ifframe1hasarrivedsafeandsound,thereceiversendsan
ACKframewithacknowledgment0(meaningframe0isexpected).
In
Stop-and-WaitARQ~ theacknowledgmentnumberalwaysannouncesin
modul0-2arithmeticthesequencenumberofthenextframeexpected.
Design
Figure11.10showsthedesign oftheStop-and-Wait ARQProtocol.Thesendingdevice
keepsacopy
ofthelastframetransmitteduntilitreceivesanacknowledgmentforthat
frame.AdataframesusesaseqNo(sequencenumber);anACKframeusesanackNo
(acknowledgmentnumber).Thesenderhasacontrolvariable,whichwecall
Sn(sender,
nextframe
tosend),thatholdsthesequencenumberforthenextframetobesent(0or 1).

320 CHAPTER 11DATALINKCONTROL
Figure11.10 DesignoftheStop-and-WaitARQProtocol
SIINextframe
J;
0send
r---r------r---,
'0'101'0'···L ~___ ___1 J
Sender Receiver
Network
Datalink
Physical
Dataframe
ACKframe
Deliver'1**"- rr-Getdata data
I
seqNo ackNo...
T I

I ...I
RI.
T
RI.
T
ecelveSend ecelveSend
frame frame frameframe
I
!
liM~ I
~~
Network
Datalink
Physical
Event:
IRequestfromI
networklayer
I
0
Repeatforevert
.~--~--
,.C;;~AIgmnhm forsender'site
.-
Time-outI
..;._,,,:,,:,,'.:",
Event:
1..
I
Et:INotificationfrom I
ven.physicallayer
Repeatforever
."
.'
~-.--.AJ:go.rlt,bmforreceiverSite
..
..
1..
I
Et:INotificationfromI
ven.h'all
PySlCayer
Thereceiverhasacontrolvariable,whichwecall R
n(receiver,nextframeexpected),
thatholdsthenumberofthenextframeexpected.Whenaframeissent,thevalue
ofSn
isincremented(modulo-2),whichmeans ifitis0,itbecomes1andviceversa.Whena
frameisreceived,thevalueof
R
nisincremented(modulo-2),whichmeans ifitis0,it
becomes1andviceversa.Threeeventscanhappenatthesendersite;oneeventcan
happenatthereceiversite.Variable
Snpointstotheslotthatmatchesthesequence
number
oftheframethathasbeensent,butnotacknowledged; R
n
pointstotheslotthat
matchesthesequencenumberoftheexpectedframe.
Algorithms
Algorithm11.5isforthesendersite.
Algorithm11.5Sender-sitealgorithm
forStop-and-Wait ARQ
WaitForEvent();
1n=0;
2anSend=true;
3hile(true)
4 {
5
IIFrame0shouldbesentfirst
IIAllowthefirstrequesttogo
IIRepeatforever
IISleepuntilaneventoccurs

SECTION11.5 NOISYCHANNELS 321
//Resendacopycheck
//Copyisnotneeded
IIThetimerexpired
//TheseqNoisSn
//Keepcopy
IISleep
IIAnACKhasarrived
//ReceivetheACEfram
80)//ValidACK
Stoptimer{};
PurgeFrame(Sn_l);
canSend=true;
}
ReceiveFrame(ackNo);
if(notcorruptedANDackNo
{
}
GetData()i
MakeFrame(Sn);
StoreFrame(Sn);
SendFrame(Sn);
StartTimerO;
Sn=Sn+1;
canSend=false;
if(Event(TimeOUt)
{
StartTimer();
ResendFrame(Sn_l);
}
}
WaitForEvent();
if(Event(ArrivaINotification)
{
Algorithm11.5Sender-sitealgorithm forStop-and-Wait ARQ(continued)
6if(Event(RequestToSend)ANDcanSend)
7 {
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33}
AnalysisWefirstnoticethepresence ofSn'thesequencenumber ofthenextframeto besent.
Thisvariableisinitializedonce(line
1),butitisincrementedeverytimeaframeissent(line13)in
preparationforthenextframe.However,sincethisismodulo-2arithmetic,thesequencenumbersare
0,
1,0,1,andsoon.Notethattheprocesses inthefirstevent(SendFrame,StoreFrame,andPurge­
Frame)usean
Sndefiningtheframesentout.Weneedatleast onebuffertoholdthisframeuntil
wearesurethatitisreceivedsafeandsound.Line10showsthatbeforetheframeissent,itisstored.
Thecopyisusedforresendingacorruptorlostframe.WearestillusingthecanSendvariabletopre­
ventthenetworklayerfrommakingarequestbeforethepreviousframeisreceivedsafeandsound.
If
theframeisnotcorruptedandtheackNo oftheACKframematchesthesequencenumber ofthenext
frametosend,
westopthetimerandpurgethecopy ofthedataframe wesaved.Otherwise, wejust
ignorethiseventandwaitforthenexteventtohappen.Aftereachframeissent,atimerisstarted.
Whenthetimerexpires(line28),theframe
isresentandthetimer isrestarted.
Algorithm11.6showstheprocedureatthereceiversite.
Algorithm11.6
Receiver-sitealgorithm forStop-and-Wait ARQProtocol
1 =0;
2hile(true)
3 {
4WaitForEvent();
IIFrame0expectedtoarrivefirs
IISleepuntilaneventoccurs

322 CHAPTER11DATALINKCONTROL
Algorithm11.6 Receiver-sitealgorithm forStop-and-Wait ARQProtocol(continued)
5
6
7
8
9
10
11
12
13
14
15
16
17
18}
if(Event(Arriva1Notification»
{
ReceiveFrame()i
if(corrupted(frame»i
sleep()i
if(seqNo
;;;;:;;;;Rn)
{
ExtractData();
De1iverData()i
Ru;;;;Ru+1;
}
SendFrame(Rn);
}
//Dataframearrives
//Validdataframe
//Deliverdata
//SendanACK
AnalysisThisisnoticeablydifferentfromAlgorithm11.4.First, allarriveddataframesthatare
corruptedareignored.
IftheseqNo oftheframeistheonethatisexpected (R
n
),theframeis
accepted,thedataaredelivered tothenetworklayer,andthevalue ofR
nisincremented.How­
ever,thereisonesubtlepointhere.Even
ifthesequencenumber ofthedataframedoesnotmatch
thenextframeexpected,anACKissent
tothesender.ThisACK,however,justreconfirmsthe
previousACKinstead
ofconfirmingtheframereceived.Thisisdonebecausethereceiver
assumesthatthepreviousACKmighthavebeenlost;thereceiver
issendingaduplicateframe.
TheresentACKmaysolvetheproblembeforethetime-outdoes
it.
Example11.3
Figure11.11showsanexample ofStop-and-WaitARQ.Frame aissentandacknowledged.
Frame1
islostandresentafterthetime-out.Theresentframe1 isacknowledgedandthetimer
stops.Frame
aissentandacknowledged,buttheacknowledgment islost.Thesenderhasnoidea
iftheframeortheacknowledgmentislost,soafterthetime-out,itresendsframe0,which is
acknowledged.
Efficiency
TheStop-and-WaitARQdiscussedintheprevioussectionisveryinefficient ifourchan­
nelisthickandlong.
Bythick,wemeanthatourchannelhasalargebandwidth;bylong,
wemeantheround-tripdelayislong.Theproduct
ofthesetwoiscalledthe bandwidth­
delayproduct,
aswediscussedinChapter 3.Wecanthink ofthechannelasapipe.The
bandwidth-delayproductthenisthevolume
ofthepipeinbits.Thepipeisalwaysthere.
Ifwedonotuseit,weareinefficient.Thebandwidth-delayproductisameasure ofthe
number
ofbitswecansendout ofoursystemwhilewaitingfornewsfromthereceiver.
Example11.4
Assumethat,inaStop-and-Wait ARQsystem,thebandwidth ofthelineis1Mbps,and1bit
takes20
mstomakearoundtrip.Whatisthebandwidth-delayproduct? Ifthesystemdataframes
are1000bitsinlength,whatistheutilizationpercentage
ofthelink?
Solution
Thebandwidth-delayproductis

SECTION11.5NOISYCHANNELS 323
Figure11.11Flowdiagram forExample11.3
Sender Receiver
R
n
~9_ET9Ihql!J Arrival
R
n
:~~[nQIrIqUJ Arrival
R
n
~o:-(:-o+o~-(: Arrival
1__1__:_J...!.1_!.._.!
Discard,duplicate
m
I
I
I
ACK1]
---------1
1
1
t
Time
5
n
Requestf9"1iJ-9J]~3iff~
Sn
Request@rU9I(~qn~
5
n
Time-outf9"rtr9n_:_qff~
Stop
Startcp
Stopl
Stop
StartIt
5"
Time-outItTime-out:-6~i+f~0i"1-'
restart , __!._l£J__'__1__1
Time-out
restart
Thesystemcansend20,000bitsduringthetimeittakesforthedatatogofromthesendertothe
receiverandthenbackagain.However,thesystemsendsonly1000bits.
Wecansaythatthelink
utilization
isonly1000/20,000,or5percent.Forthisreason,foralinkwithahighbandwidthor
longdelay,theuse
ofStop-and-WaitARQwastesthecapacity ofthelink.
Example11.5
Whatistheutilizationpercentage ofthelinkinExample11.4 ifwehaveaprotocolthatcansend
upto
15framesbeforestoppingandworryingabouttheacknowledgments?
Solution
Thebandwidth-delayproductisstill20,000bits.Thesystemcansendupto 15framesor
15,000bitsduringaroundtrip.Thismeanstheutilizationis15,000/20,000,or
75percent.Of
course,iftherearedamagedframes,theutilizationpercentageismuchlessbecauseframes
havetoberesent.
Pipelining
Innetworkingandinotherareas,ataskisoftenbegunbeforetheprevioustaskhasended.
Thisisknown
aspipelining.There isnopipelininginStop-and-WaitARQbecausewe
need
towaitforaframetoreachthedestinationandbeacknowledgedbeforethenext
framecanbesent.However,pipeliningdoesapplytoournexttwoprotocolsbecause

324 CHAPTER 11DATALINKCONTROL
severalframescanbesentbeforewereceivenewsaboutthepreviousframes.Pipelining
improvestheefficiency
ofthetransmissionifthenumberofbitsintransitionislargewith
respecttothebandwidth-delayproduct.
Go-Back-NAutomaticRepeatRequest
Toimprovetheefficiency oftransmission(fillingthepipe),multipleframes mustbein
transitionwhilewaitingforacknowledgment.
Inotherwords, weneedtoletmorethan
oneframebe outstandingtokeepthechannelbusywhilethesenderiswaitingfor
acknowledgment.
Inthissection,wediscussoneprotocolthat canachievethisgoal;in
thenextsection,wediscussasecond.
Thefirstiscalled Go-Back-NAutomaticRepeatRequest(therationaleforthe
namewillbecomeclearlater).Inthis protocolwecansendseveralframes before
receivingacknowledgments; wekeepa copyoftheseframesuntiltheacknowledg­
mentsarrive.
SequenceNumbers
Framesfromasendingstationarenumberedsequentially.However,becauseweneed
toincludethesequencenumber
ofeachframe intheheader,weneedtosetalimit. If
theheaderoftheframeallows mbitsforthesequencenumber,thesequencenumbers
rangefrom0 to2
m
-
1.Forexample,ifmis4,theonlysequencenumbersare0
through
15inclusive.However,we canrepeatthesequence.Sothesequencenum­
bersare
0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,0, 1,2,3,4,5,6,7,8,9,10,11,...
Inotherwords,thesequencenumbersaremodulo-2
m
.
IntheGo-Back-NProtocol,thesequencenumbers aremodulo
1!",
wheremisthesize ofthesequencenumberfieldinbits.
SlidingWindow
Inthisprotocol(andthenext),thesliding windowisanabstractconceptthatdefinesthe
range
ofsequencenumbersthat istheconcernofthesenderandreceiver. Inotherwords,
thesenderandreceiverneedtodealwithonlypart
ofthepossiblesequencenumbers.The
rangewhichistheconcern
ofthesenderiscalledthe sendslidingwindow;therangethat
istheconcern
ofthereceiveriscalledthereceiveslidingwindow.Wediscussbothhere.
Thesendwindowisanimaginaryboxcoveringthesequencenumbers
ofthedata
frameswhichcanbe
intransit.Ineachwindowposition,some ofthesesequencenumbers
definetheframesthathavebeensent;othersdefinethosethatcanbesent.Themaximum
size
ofthewindow is2
m
-
1forreasonsthatwediscusslater.Inthischapter,weletthesize
befixedandsettothemaximumvalue,butwewillseeinfuturechaptersthatsomeprotocols
mayhaveavariablewindowsize.Figure11.12showsaslidingwindow
ofsize15(m=4).
Thewindowatanytimedividesthepossiblesequencenumbersintofourregions.
Thefirstregion,fromthefarlefttotheleftwall ofthewindow,definesthesequence

SECTION11.5NOISYCHANNELS 325
Figure11.12 SendwindowforGo-Back-NARQ
SfSendwindow,
~'~d;"g '"m,
:)Xf)!~r(5~~Z;! 3141
5!6
Framesalready
acknowledged
Framessent,butnot
acknowledged(outstanding)
Framesthatcanbesent,
butnotreceivedfromupperlayer
Framesthat
cannotbesent
Sendwindow,size
SSilC
'"2
m
-1
a.Sendwindowbeforesliding
5"
---w:±J:m:w:L:l12i13i14iISi0CIl
b.Sendwindow aftersliding
numbersbelongingtoframesthatarealreadyacknowledged.Thesenderdoesnot
worryabouttheseframesand keepsnocopies
ofthem.Thesecondregion,coloredin
Figure11.12a,definestherange
ofsequencenumbersbelongingtotheframesthatare
sentandhaveanunknownstatus.Thesenderneeds
towaittofindoutiftheseframes
havebeenreceived
orwerelost. Wecalltheseoutstandingframes.Thethirdrange,
whiteinthefigure,definestherangeofsequencenumbersforframesthatcanbesent;
however,thecorrespondingdatapacketshavenotyetbeenreceivedfromthenetwork
layer.Finally,thefourthregiondefinessequencenumbersthatcannotbeuseduntilthe
windowslides,asweseenext.
Thewindowitselfisanabstraction;threevariablesdefineitssizeandlocationat
anytime.
Wecallthesevariables Sf(sendwindow,thefirstoutstandingframe), Sn(send
window,thenextframeto
besent),and Ssize(sendwindow,size).Thevariable Sfdefines
thesequencenumber
ofthefirst(oldest)outstandingframe.Thevariable Snholdsthe
sequencenumberthatwillbeassignedtothenextframetobesent.Finally,thevariable
Ssizedefinesthesize ofthewindow,whichisfixedinourprotocol.
Thesendwindowis anabstractconceptdefining animaginary
boxofsize
2
m
~1withthreevariables:SpSmandSsize'
Figure11.12bshowshowasendwindowcanslideoneormoreslots totheright
whenanacknowledgmentarrivesfromtheotherend.Aswewillseeshortly,theacknowl­
edgmentsinthisprotocolarecumulative,meaningthatmorethanoneframecanbe
acknowledgedby
anACKframe.InFigure11.12b,frames0,I,and2areacknowledged,
sothewindowhasslidtotherightthreeslots.Note thatthevalue
ofSfis3becauseframe3
isnowthefirstoutstandingframe.
Thesendwindow canslideone ormoreslotswhenavalidacknowledgmentarrives.

326 CHAPTER 11DATALINKCONTROL
Thereceivewindowmakessurethatthecorrectdataframesarereceivedandthat
thecorrectacknowledgmentsaresent.Thesize
ofthereceivewindow isalwaysI.The
receiver
isalwayslookingforthearrival ofaspecificframe.Anyframearrivingout of
orderisdiscardedandneedstoberesent.Figure11.13showsthereceivewindow.
Figure11.13 Receivewindow forGo-Back-NARQ
R
II
Receivewindow,nextframeexpected"---,---r---,---,---,---~---,---,---,---,---,---,---,---,---,---,---,---,---,---,
,13I14IISI0I1I2 , 3 I4I5I6I7I8 , 9I10III,12,13I14, 15I0I1I
l.I J l l 1"'J. l 1 1 .1 1~__1 1 1 .L J J J ~
Framesalreadyreceived Framesthatcannot bereceived
andacknowledged untilthewindowslides
a.Receivewindow
R
II
"---,- - -,---,- --,---,---,-- -~- --,---,---,---,- --,---"---,---,- --"- --,- - -,---,---,
,13I14I15I0I1I2 ' 3 ' 4 I5I6 ' 7 I8 ' 9I10II II12I13,14 I15I0I1 ,
~ J J ~ J. 1 1~ .1. 1 .1 ... 1 1 1 1 1 J. .J .I ~
b.Window aftersliding
Thereceivewindow isanabstractconceptdefining animaginary
box
ofsize1withonesinglevariable R
n
•Thewindowslides
whenacorrectframehasarrived;slidingoccursoneslot
atatime.
Notethatweneedonlyonevariable R
n
(receivewindow,nextframeexpected)to
definethisabstraction.Thesequencenumberstotheleft
ofthewindowbelongtothe
framesalreadyreceivedandacknowledged;thesequencenumberstotheright
ofthis
windowdefinetheframesthatcannotbereceived.Anyreceivedframewithasequence
numberinthesetworegionsisdiscarded.Onlyaframewithasequencenumbermatch­
ingthevalue
ofR
n
isacceptedandacknowledged.
Thereceivewindowalsoslides,butonlyoneslotatatime.Whenacorrectframe
isreceived(andaframeisreceivedonlyoneatatime),thewindowslides.
Timers
Althoughtherecanbeatimerforeachframethatissent,inourprotocolweuseonly
one.Thereasonisthatthetimerforthefirstoutstandingframealwaysexpiresfirst;we
sendalloutstandingframeswhenthistimerexpires.
Acknowledgment
Thereceiversendsapositiveacknowledgment ifaframehasarrivedsafeandsound
andinorder.
Ifaframeisdamagedor isreceivedout oforder,thereceiver issilentand
willdiscardallsubsequentframesuntilitreceivestheoneitisexpecting.Thesilence
of

SECTION11.5NOISYCHANNELS 327
thereceivercausesthetimer oftheunacknowledgedframeatthesendersitetoexpire.
This,inturn,causesthesendertogobackandresendallframes,beginningwiththeone
withtheexpiredtimer.Thereceiverdoesnothavetoacknowledgeeachframereceived.
Itcansendonecumulativeacknowledgmentforseveralframes.
ResendingaFrame
Whenthetimerexpires,thesenderresendsalloutstandingframes.Forexample,suppose
thesenderhasalreadysentframe
6,butthetimerforframe3expires.Thismeansthat
frame3hasnotbeenacknowledged;thesendergoesbackandsendsframes
3,4,5,and6
again.ThatiswhytheprotocoliscalledGo-Back-NARQ.
Design
Figure11.14showsthedesignforthisprotocol.Aswecansee,multipleframescan
beintransitintheforwarddirection,andmUltipleacknowledgmentsinthereverse
direction.TheideaissimilartoStop-and-WaitARQ;thedifferenceisthatthesend
Figure11.14DesignofGo-Back-NARQ
SNext
!i~nd
IiI!
Sender Receiver
Network
Datalink
Physical
Dataframe
ACKframe
Deliver
Getdata
'1
~ data
I seqNo ackNo ...,.
I
...I ...I
RI,T I,t
ecelveSend ReceIveSend
frame frame frameframe

I
i&f&§ ,
M¥ !'¥§w,'#,M# I
I-+--~ ~ I:::l\'aI
Network
Datalink
Physical
Event:
Repeatforever
Event:
Repeatforever

328 CHAPTER 11DATALINKCONTROL
windowallowsus tohaveasmanyframesintransitionasthereareslotsinthesend
window.
SendWindowSize
Wecannowshowwhythesize ofthesendwindowmustbelessthan 2
m
.
Asan
example,wechoose
m=2,whichmeansthesize ofthewindowcanbe 2
m
-
1,or3.
Figure11.15comparesawindowsize of3againstawindowsize of4.Ifthesizeof
thewindowis3(lessthan2
2
)
andallthreeacknowledgmentsarelost,theframe °
timerexpiresandallthreeframesareresent.Thereceiverisnowexpectingframe 3,
notframe0,sotheduplicateframeiscorrectlydiscarded.Ontheotherhand, ifthe
size
ofthewindowis4(equalto2
2
)
andallacknowledgmentsarelost,thesender
willsendaduplicate
offrame0.However,thistimethewindow ofthereceiver
expectstoreceiveframe0,soitacceptsframe0,notasaduplicate,butasthefirst
frameinthenextcycle.Thisisanerror.
Figure11.15Windowsize forGo-Back-NARQ
Sender Receiver Sender Receiver
a.Windowsize <2
m
b.Windowsize =2
m
InGo-Back-NARQ,thesize ofthesendwindowmustbeless than
r;
thesizeofthereceiverwindowisalways1.
Algorithms
Algorithm11.7showstheprocedureforthesenderinthisprotocol.

SECTION11.5NOISYCHANNELS 329
Algorithm11.7Go-Back-Nsenderalgorithm
if{Event{ArrivalNotification»IIACKarrives
{
~hile(true)
{
WaitForEvent();
if(Event(RequestToSend»
{
if{Event{TimeOut»
{
StartTimer();
Temp=Sf;
while{Temp<Sn);
{
SendFrame(Sf);
Sf=Sf+1;
}
//Apackettosend
//Repeatforever
IIIfwindowisfull
liThetimerexpires
IIIfavalidACK
Receive(ACK);
if{corrupted{ACK»
Sleep();
if{{ackNo>sf)&&{ackNO<=Sn»
While(Sf<=ackNo)
{
PurgeFrame{Sf);
Sf=Sf+1;
}
StopTimer();
if(Sn-Sf>=Sw)
Sleep();
GetData();
MakeFrame(Sn);
StoreFrame(Sn);
SendFrame(Sn);
Sn=Sn+1;
if(timernotrunning)
StartTimer{);
}
}
}
1Sw=
2'"-1;
2Sf=0;
3Sn =OJ
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
}
AnalysisThisalgorithmfirstinitializesthreevariables.UnlikeStop-and-Wait ARQ,thispro­
tocolallowsseveralrequestsfromthenetworklayerwithouttheneedforothereventstooccur;
wejustneedtobesurethatthewindowisnotfull(line12).Inourapproach,
ifthewindowisfull,

330 CHAPTERJ1DATA LINKCONTROL
therequestisjustignoredandthenetworklayerneedstotryagain.Someimplementationsuseother
methodssuch
asenablingordisablingthenetworklayer.Thehandling ofthearrivalevent ismore
complexthaninthepreviousprotocol.
IfwereceiveacorruptedACK,weignore it.IftheadeNa
belongstooneoftheoutstandingframes,weusealooptopurgethebuffersandmovetheleftwall
totheright.Thetime-outevent
isalsomorecomplex. Wefirststartanewtimer. Wethenresendall
outstandingframes.
Algorithm11.8 istheprocedureatthereceiversite.
Algorithm11.8Go-Back-Nreceiveralgorithm
if(Event{ArrivalNotification»/Dataframearrives
(
WaitForEvent();
IIIfexpectedframe
IIRepeatforever
IIDeliverdata
IISlidewindow
DeliverData()i
Ru=~+1;
SendACK(Ru);
}
Receive(Frame);
if(corrupted(Frame»
Sleep(};
if(seqNo==Ru}
{
}
1~n=0;
2
3~hile(true)
4 {
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19}
AnalysisThisalgorithmissimple.Weignoreacorrupt orout-of-orderframe. Ifaframe
arriveswithanexpectedsequencenumber,wedeliverthedata,updatethevalue
ofR
n
,
andsend
anACKwiththeackNashowingthenextframeexpected.
Example11.6
Figure11.16showsanexample ofGo-Back-N.Thisis anexampleofacasewheretheforward
channel
isreliable,butthereverseisnot.Nodataframesarelost,butsomeACKsaredelayedand
one
islost.Theexamplealsoshowshowcumulativeacknowledgmentscanhelp ifacknowledgments
aredelayedorlost.
Afterinitialization,therearesevensenderevents.Requesteventsaretriggeredbydata
fromthenetworklayer;arrivaleventsaretriggered
byacknowledgmentsfromthephysical
layer.
Thereisnotime-outeventhere becausealloutstandingframesareacknowledged
beforethetimerexpires.NotethatalthoughACK2islost,ACK3servesasbothACK2and
ACK3.
Therearefourreceiverevents,alltriggeredbythearrival offramesfromthephysical
layer.

SECTION11.5NOISYCHANNELS 331
Figure11.16 Flowdiagram forExample 11.6
Arrival
Request
Reque~t
R
I1
Arrival
L....L---'-.L...j,..,J---'------l.......J
Receiver
L!lRI1
~I1213141516171Initial
i--------.::::?,.j-~~.!J2~l±i~l2J Arrival
:-----==::;~+-..-@1Itill:ffiill~ Arrival
Time
Sender
LP
Arrival
Arrival
Sf~
Initial~-7r:lo"l 1--'1-'21
Sf
Reque~t P.O~I""2.3"4'1"'5"'1""'61-
7
'0-'-1'2'
Request
Start
timer
l-
Stop
timer
Example11.7
Figure11.17showswhathappenswhenaframeislost.Frames0, 1,2,and3aresent.However,
frame1islost.Thereceiverreceivesframes2and
3,buttheyarediscardedbecausetheyare
receivedout
oforder(frame1isexpected). Thesenderreceivesnoacknowledgmentabout
frames
1,2,or3.Itstimerfinallyexpires.Thesendersendsalloutstandingframes (1,2,and3)
becauseitdoesnotknowwhatiswrong.Notethattheresending offramesl,2,and3isthe
responsetoonesingleevent.Whenthesenderisresponding
tothisevent,itcannotacceptthe
triggering
ofotherevents.ThismeansthatwhenACK2arrives,thesenderisstillbusywithsend­
ingframe
3.Thephysica1layermustwaituntilthiseventiscompletedandthedatalinklayer
goesbacktoitssleepingstate.
Wehaveshownaverticalline toindicatethedelay.It isthesame
storywithACK3;butwhenACK3arrives,thesenderisbusyrespondingtoACK
2.Ithappens
againwhenACK4arrives.Notethatbeforethesecondtimerexpires,alloutstandingframeshave
beensentandthetimer
isstopped.
Go-Back-NARQVersusStop-and-Wait ARQ
Thereadermayfindthatthereisasimilaritybetween Go-Back-NARQandStop-and-Wait
ARQ.We
cansaythattheStop-and-WaitARQProtocolisactuallya Go-Back-NARQ
inwhichthereareonlytwosequencenumbersandthesendwindowsizeis 1.Inother
words,
m=1,2
m
-
1=1.InGo-Back-NARQ,wesaidthattheadditionismodulo-2
m
;
in
Stop-and-WaitARQit
is2,whichisthesameas 2
m
whenm=1.

332 CHAPTER 11DATALINKCONTROL
Figure11.17Flowdiagram forExample11.7
Sender
L!J
Start
timerSf~
Initial~
Sf Sn
Request0I23456701
Receiver
crJR
n
:~Initial
I
I
r:q;::::::::-A---_:Rn
1Frame0
I
Stop-and-WaitARQisaspecialcase ofGo-Back-NARQ
inwhichthesize ofthesendwindowis 1.
SelectiveRepeatAutomaticRepeatRequest
Go-Back-NARQsimplifiestheprocessatthereceiversite.Thereceiverkeepstrack of
onlyonevariable,andthereisnoneedtobufferout-of-orderframes;theyaresimply
discarded.However,thisprotocolisveryinefficientforanoisylink.Inanoisylinka
framehasahigherprobability
ofdamage,whichmeanstheresending ofmultipleframes.
Thisresendingusesupthebandwidthandslowsdownthetransmission.Fornoisylinks,
thereisanothermechanismthatdoesnotresend
Nframeswhenjustoneframeisdam­
aged;onlythedamagedframe
isresent.Thismechanismiscalled SelectiveRepeatARQ.
Itismoreefficientfornoisylinks,buttheprocessingatthereceiverismorecomplex.

SECTION11.5NOISYCHANNELS 333
Windows
TheSelectiveRepeatProtocolalsousestwowindows:asendwindowandareceivewin­
dow.However,therearedifferencesbetweenthewindowsinthisprotocolandtheonesin
Go-Back-N.First,thesizeofthesendwindow
ismuchsmaller;itis 2
m
-I
.
Thereasonfor
thiswillbediscussedlater.Second,thereceivewindow
isthesamesize asthesendwindow.
Thesendwindowmaximumsizecanbe2
m
-I
.
Forexample,ifm=4,the
sequencenumbersgofrom0to15,butthesize ofthewindowis just8(itis 15in
the
Go-Back-NProtocol).Thesmallerwindowsizemeanslessefficiencyinfillingthe
pipe,butthefact
thattherearefewer duplicateframescan compensateforthis.
TheprotocolusesthesamevariablesaswediscussedforGo-Back-N.
Weshowthe
SelectiveRepeatsendwindowinFigure11.18toemphasizethesize.Compareitwith
Figure11.12.
Figure11.18 Sendwindow forSelectiveRepeat ARQ
L___
J___J___
~
___1___1___1___1___1___~___J___j___J___
FramesalreadyFramessent,but Framesthatcan Framesthat
acknowledgednotacknowledged besent cannotbesent
'\iLC'=2
m
-1
ThereceivewindowinSelectiveRepeatistotallydifferentfromtheoneinGo­
Back-N.First,thesize
ofthereceivewindowisthesame asthesizeofthesendwindow
(2
m
-I
).
TheSelectiveRepeatProtocolallows asmanyframes asthesizeofthereceive
window
toarriveout oforderandbekeptuntilthereisaset ofin-orderframestobe
deliveredtothenetworklayer.Becausethesizes
ofthesendwindowandreceivewin­
dowarethesame,alltheframesinthesendframecanarriveout
oforderandbestored
untiltheycanbedelivered.
Weneed,however,tomentionthatthereceiverneverdelivers
packetsout
ofordertothenetworklayer.Figure11.19showsthereceivewindowinthis
Figure11.19 Receivewindow forSelectiveRepeat ARQ
RReceivewindow•
.t:.nextframeexpected
:))~rl~~f)]5~rfI~!~f~~~tn 4!5ru--71111!11811'9
Framesthatcanbereceived
Framesalready andstoredforlaterdelivery.
received Coloredboxes,alreadyreceived
Framesthat
cannotbereceived

334 CHAPTER IIDATALINKCONTROL
protocol.Thoseslotsinsidethewindowthatarecoloreddefineframesthathavearrived
out
oforderandarewaitingfortheirneighborstoarrivebeforedeliverytothenetwork
layer.
Design
Thedesigninthiscaseistosomeextentsimilartotheonewedescribedforthe 00­
Back-N,butmorecomplicated,asshowninFigure11.20.
Figure11.20 DesignofSelectiveRepeat ARQ
SFirst SNext6oo:io:i6'o"0"
Sender
RNext
n '
~
Receiver
Network
Data
link
Physical
Dataframe
ACKorNAK
Deliver
Getdata
')
~
data
I
seqNo ackNo .+
r
or
I
nakNo
.+1 .+ I
RI,T
RI,T
ecelveSend ecelveSend
frameframe frameframe
)0
I
IP&¥ IJd,
if%*&WE**IF5f?i¥*%W I
I
~~ e::- ~
Network
Datalink
Physical
Event:
IRequestfromI
network
layer
I
I
EINotificationfrom j
vent:physicallayer
Repeatforever
WindowSizes
Wecannowshowwhythesize ofthesenderandreceiverwindowsmustbeatmostone­
halfof
2
m
.
Foranexample,wechoose m=2,whichmeansthesizeofthewindowis 2
m
/2,
or2.Figure11.21comparesawindowsize of2withawindowsizeof 3.
Ifthesizeofthewindow is2andallacknowledgmentsarelost,thetimerforframe0
expiresandframe0isresent.However,thewindow
ofthereceiverisnowexpecting

SECTION11.5NOISYCHANNELS 335
Figure11.21 SelectiveRepeatARQ,windowsize
Sender
Sf_It
o1 2 3
Time-out
a.
Windowsize=2
m
-1
Receiver Sender
Sf~
~
Sf~l
~
Sf~l
~
Time-out
b.
Windowsize>2
m
-
1
Receiver
frame2,notframe0,sothisduplicateframe iscorrectlydiscarded.Whenthesize of
thewindowis3andallacknowledgmentsarelost,thesendersendsaduplicate of
frameO.However,thistime,thewindow ofthereceiverexpectstoreceiveframe0(0is
part
ofthewindow),soitacceptsframe 0,notasaduplicate,butasthefirstframein
thenextcycle.Thisisclearlyanerror.
InSelectiveRepeatARQ,thesizeofthesender andreceiverwindow
mustbeatmostone-halfof2
m

Algorithms
Algorithm11.9showstheprocedureforthesender.
Algorithm11.9 Sender-siteSelectiveRepeatalgorithm
WaitForEvent()i
if(Event(RequestToSend)}
{
1=2
m
-1
i
2=Oi
3 =Oi
4
5hile(true)
6 {
7
8
9
//Repeatforever
//Thereis
apackettosen

336 CHAPTER 11DATALINKCONTROL
Algorithm11.9Sender-siteSelectiveRepeatalgorithm(continued)
}
while{sf<ackNo)
{
Purge(sf);
stopTimer(Sf);
Sf=Sf+1;
}
if(Event{ArrivalNotification»IIACKarrives
{
Receive{frame); I/ReceiveACKorNAK
if{corrupted{frame»
Sleep();
if(FrameType==NAK)
if(nakNobetweenSfandSo)
{
resend{nakNo);
StartTimer{nakNo);
}
if(FrameType==ACK)
if(ackNobetweenSfandSo)
{
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48}
if{Sn-S;E>=Sw)
Sleep{);
GetData{);
MakeFrame(Sn);
StoreFrame{Sn);
SendFrame(Sn);
Sn=Sn+1;
StartTimer{Sn);
}
}
if(Event{TimeOut{t»)
{
StartTimer{t);
SendFrame{t);
}
I/Ifwindowisfull
liThetimerexpires
AnalysisThehandlingoftherequesteventissimilartothat ofthepreviousprotocolexcept
thatonetimer
isstartedforeachframesent.Thearrivaleventismorecomplicatedhere.AnACK
oraNAKframemayarrive.
IfavalidNAKframearrives,we justresendthecorresponding
frame.
IfavalidACKarrives, weusealoop topurgethebuffers,stopthecorrespondingtimer.
andmovetheleftwall
ofthewindow.Thetime-outeventissimplerhere;onlytheframewhich
timesoutisresent.
Algorithm11.10showstheprocedureforthereceiver.

SECTION11.5NOISYCHANNELS 337
AI~orithm 11.10Receiver-siteSelectiveRepeatalgorithm
jDataframearrives
IIRepeatforever
}
if(AckNeeded);
{
SendAck(Rn);
AckNeeded=false;
NakSent=false;
}
}
}
Receive(Frame);
if(corrupted(Frame»&&(NOTNakSent)
{SendNAK(Rn);
NakSent=true;
Sleep{);
}
if(seqNo<>Rn)&&(NOTNakSent)
{
SendNAK(Rn);
NakSent=true;
if{(seqNoinwindow)&&(IMarked(seqNo»
{
StoreFrame{seqNo)
Marked(seqNo)=true;
whi1e(Marked(Rn»
{
DeliverData(Rn);
Purge(Rn);
Rn=Rn+1;
AckNeeded=true;
}
WaitForEvent()i
if{Event{ArrivalNotification»
{
1~n=0;
2~akSent =false;
3~ckNeeded =false;
4~epeat(for allslots)
5 Marked(slot)=false;
6
7!while(true)
8 {
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44}
'-------l":~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~___l
AnalysisHereweneedmoreinitialization.Inordernottooverwhelmtheothersidewith
NAKs,weuseavariablecalledNakSent.
Toknowwhenweneedtosend anACK,weuseavari­
ablecalledAckNeeded.Both
oftheseareinitializedtofalse. Wealsouseaset ofvariablesto

338 CHAPTER 11DATALINKCONTROL
marktheslotsinthereceivewindowoncethecorrespondingframehasarrivedand
isstored.If
wereceiveacorruptedframeandaNAKhasnotyetbeensent,wesendaNAKtotelltheother
sitethatwehavenotreceivedtheframeweexpected.
Iftheframeisnotcorruptedandthe
sequencenumberisinthewindow,westoretheframeandmarktheslot.
Ifcontiguousframes,
startingfrom
R
n
havebeenmarked,wedelivertheir datatothenetworklayerandslidethewin­
dow.Figure11.22showsthissituation.
Figure11.22 DeliveryofdatainSelectiveRepeatARQ
R ackNosent:3
~
a.Beforedelivery b.Afterdelivery
Example11.8
Thisexampleissimilar toExample11.3inwhichframe1islost. WeshowhowSelectiveRepeat
behavesinthiscase.Figure11.23showsthesituation.
Figure11.23 FlowdiagramforExample11.8
Arrival
Arrival
Arrival
"----D......~--'--JL.......J
Receiver
L!JRn
i~Initial
I
I
I
Arrival
"----D~~--'--JL.......J
. R
n
I\C~4m
~01112134 5 6 7Arrival
: Frames 1,2,3
t delivered
J
I
t
Sender
C!l
Request
Request
Request
Arrival
Sf~
Initial~
Sf Sn
Request012345670
o
1

SECTION11.5NOISYCHANNELS 339
Onemaindifferenceisthenumber oftimers.Here,eachframesentorresentneedsatimer,
whichmeansthatthetimersneedtobenumbered(0,
1,2,and3).Thetimerforframe °starts
atthefirstrequest,butstopswhentheACKforthisframearrives.ThetimerforframeIstartsat
thesecondrequest,restartswhenaNAKarrives,andfinallystopswhenthelastACKarrives.
Theothertwotimersstartwhenthecorrespondingframesaresentandstopatthelastarrival
event.
Atthereceiversiteweneedtodistinguishbetweentheacceptance ofaframeandits
deliverytothenetworklayer.Atthesecondarrival,frame2arrivesandisstoredandmarked
(coloredslot),butitcannotbedeliveredbecauseframeI
ismissing.Atthenextarrival,frame3
arrivesandismarkedandstored,butstillnone
oftheframescanbedelivered.Onlyatthelast
arrival,whenfinallyacopy
offrame1arrives,canframesI,2,and3bedeliveredtothenet­
worklayer.Therearetwoconditionsforthedeliveryofframestothenetworklayer:First,aset
ofconsecutiveframesmusthavearrived.Second,thesetstartsfromthebeginning ofthewin­
dow.AfterthefirstalTival,therewasonlyoneframeanditstartedfromthebeginning
ofthe
window.Afterthelastarrival,therearethreeframesandthefirstonestartsfromthebeginning
ofthewindow.
AnotherimportantpointisthataNAK
issentafterthesecondarrival,butnotafterthethird,
althoughbothsituationslookthesame.Thereasonisthattheprotocoldoesnotwanttocrowdthe
networkwithunnecessaryNAKsandunnecessaryresentframes.ThesecondNAKwouldstillbe
NAKItoinformthesendertoresendframe1again;thishasalreadybeendone.ThefirstNAK
sentisremembered(usingthenakSentvariable)andisnotsentagainuntiltheframeslides.A
NAKissentonceforeachwindowpositionanddefinesthefirstslotinthewindow.
ThenextpointisabouttheACKs.NoticethatonlytwoACKsaresenthere.Thefirstone
acknowledgesonlythefirstframe;thesecondoneacknowledgesthreeframes.InSelective
Repeat,ACKsaresentwhendataaredeliveredtothenetworklayer.
Ifthedatabelongingto n
framesaredeliveredinoneshot,onlyoneACKissentforall ofthem.
Piggybacking
Thethreeprotocolswediscussedinthissectionareallunidirectional:dataframesflow
inonlyonedirectionalthoughcontrolinformationsuchasACKandNAKframescan
travelintheotherdirection.Inreallife,dataframesarenormallyflowinginbothdirec­
tions:fromnodeAtonodeBandfromnodeBtonode
A.Thismeansthatthecontrol
informationalsoneedstoflowinbothdirections.Atechniquecalled
piggybackingis
usedtoimprovetheefficiency
ofthebidirectionalprotocols.Whenaframeiscarrying
datafromA
toB,itcanalsocarrycontrolinformationaboutarrived(orlost)frames
from
B;whenaframeiscarryingdatafromBto A,itcanalsocarrycontrolinformation
aboutthearrived(orlost)framesfrom
A.
Weshowthedesign foraGo-Back-NARQusingpiggybackinginFigure11.24.
Notethateachnodenowhastwowindows:onesendwindowandonereceivewindow.
Bothalsoneedtouseatimer.Bothareinvolvedinthreetypesofevents:request,arrival,
andtime-out.However,thearrivaleventhereiscomplicated;whenaframearrives,the
siteneedstohandlecontrolinformation
aswellastheframeitself.Bothoftheseconcerns
mustbetakencareofinoneevent,thearrivalevent.Therequesteventusesonlythesend
windowateachsite;thearrivaleventneeds
tousebothwindows.
Animportant pointaboutpiggybackingisthatbothsitesmustusethesamealgo­
rithm.Thisalgorithmiscomplicatedbecauseitneedstocombinetwoarrivalevents
intoone.
Weleavethistaskasanexercise.

340 CHAPTER 11DATALINKCONTROL
Figure11.24 Designofpiggybacking inGo-Back-NARQ
Send
window
Receive
window
Receive Send
window window
C11m'~1_1 1IJIIJIl
Network
Datalink
Physical
ackNo
DeliverGet I
-Frame
DeliverGet
..I
I
'f ~ I
IT seqNo IT
..I ~ I
RI,T
RI,
T
ecelveSend ecelveSend
frameframe frameframe
I
,
bed.lIrs)_II@@
-~ I
~, f¥fI_I
1""'3-,FB¥i-
Network
Datalink
Physical
Event:
IRequestfromI
'networklayer
I
Repeatforever
t 0
Algorithmfor
f-'oO----iTime-outI
sendingandreceiving
Event:
..
I
E .1NotificationfromI
vent:physicallayer
Algorithmfor
sendingandreceiving
11.6HDLC
High-levelDataLinkControl(HDLC) isabit-orientedprotocolforcommunication
overpoint-to-pointandmultipointlinks.
ItimplementstheARQmechanisms wedis­
cussedinthischapter.
ConfigurationsandTransferModes
HDLCprovidestwocommontransfermodesthatcanbeusedindifferentconfigura­
tions:
normalresponsemode(NRM) andasynchronousbalancedmode(ABM).
NormalResponseMode
Innormalresponsemode(NRM),thestationconfigurationisunbalanced. Wehaveone
primarystationandmultiplesecondarystations.
Aprimarystation cansendcommands;
a
secondarystation canonlyrespond.The NRMisusedforbothpoint-to-pointand
multiple-pointlinks,asshowninFigure11.25.

SECTION11.6HDLC 341
Figure11.25Normalresponsemode
Primary
ICommandt------
a.Point-to-point
Secondary
~ ResponseI
Secondary Secondary
Primary
I
Commandt------
b.Multipoint
~ ResponseI~ ResponseI
AsynchronousBalancedMode
Inasynchronousbalancedmode(ABM),theconfigurationisbalanced.Thelinkis
point-to-point,andeachstationcanfunctionasaprimaryandasecondary(actingas
peers),asshowninFigure11.26.Thisisthecommonmodetoday.
Figure11.26Asynchronousbalancedmode
Combined Combined
I
Command/responset------
~ Command/responseI
Frames
Toprovidetheflexibilitynecessarytosupportalltheoptionspossibleinthemodesand
configurationsjustdescribed,HDLCdefinesthreetypes
offrames:informationframes
(I-frames),supervisoryframes(S-frames),and
unnumberedframes(V-frames).Each
type
offrameserves asanenvelopeforthetransmission ofadifferenttype ofmessage.
I-framesareusedtotransportuserdataandcontrolinformationrelatingtouserdata
(piggybacking).S-framesareusedonlytotransportcontrolinformation.V-framesare
reservedforsystemmanagement.InformationcarriedbyV-framesisintendedformanag­
ingthelinkitself.

342 CHAPTER 11DATALINKCONTROL
FrameFormat
EachframeinHDLCmaycontainuptosixfields,asshowninFigure11.27:abegin­
ningflagfield,anaddressfield,acontrolfield,aninformationfield,aframecheck
sequence(FCS)field,andanendingflagfield.Inmultiple-frametransmissions,the
endingflag
ofoneframecanserveasthebeginningflag ofthenextframe.
Figure11.27HDLCframes
FlagAddressControlFCSFlagS-frame
FlagAddressControl
FlagAddressControl
User
infonnation
Management
infonnatlon
PCSFlagI-frame
FCSFlagU-frame
Fields
Letusnow discussthefieldsandtheiruseindifferentframetypes.
oFlagfield.Theflagfield ofanHDLCframeisan8-bitsequencewiththebitpattern
01111110thatidentifiesboththebeginningandtheend
ofaframeandserves asa
synchronizationpatternforthereceiver.
oAddressfield.Thesecondfield ofanHDLCframecontainstheaddress ofthe
secondarystation.
Ifaprimarystationcreatedtheframe,itcontainsa toaddress.If
asecondarycreatestheframe,itcontains
afromaddress.An addressfieldcanbe
1byte
orseveralbyteslong,dependingontheneeds ofthenetwork.Onebytecan
identifyupto128stations
(lbitisusedforanotherpurpose).Largernetworks
requiremultiple-byteaddressfields.
Iftheaddressfieldisonly1byte,thelastbit
isalwaysa
1.Iftheaddressismorethan1byte,allbytesbutthelastonewillend
with0;onlythelastwillendwith
1.Endingeachintermediatebytewith0indi­
catestothereceiverthattherearemoreaddressbytestocome.
oControlfield.Thecontrolfield isa1-or2-bytesegment oftheframeusedfor
flowanderrorcontrol.Theinterpretation
ofbitsinthisfielddependsontheframe
type.
Wediscussthisfieldlateranddescribeitsformatforeachframetype.
oInformationfield.Theinformationfieldcontainstheuser'sdatafromthenet­
worklayerormanagementinformation.Itslengthcanvaryfromonenetworkto
another.
oFCSfield.Theframechecksequence(FCS)istheHDLCerrordetectionfield. It
cancontaineithera2-or4-byteITU-TCRC.

SECTION11.6HDLC 343
ControlField
Thecontrolfielddeterminesthetype offrameanddefinesitsfunctionality.Soletus
discusstheformatofthisfieldingreaterdetail.Theformatisspecificforthetypeof
frame,
asshowninFigure11.28.
Figure11.28
Controlfieldformat forthedifferentframetypes
~I-frame
N(S) N(R)
~s-frarne
Code N(R)
~U-frame
Code Code
ControlField forI-Frames
I-framesaredesignedtocarryuserdatafromthenetworklayer.Inaddition,theycan
includeflowanderrorcontrolinformation(piggybacking).Thesubfieldsinthecontrol
fieldareusedtodefinethesefunctions.Thefirstbitdefinesthetype.
Ifthefirstbitof
thecontrolfieldis0,thismeanstheframeis
anI-frame.Thenext3bits,called N(S),
definethesequencenumber oftheframe.Notethatwith3bits,wecandefinea
sequencenumberbetween
°and7;butintheextensionformat,inwhichthecontrol
fieldis2bytes,thisfieldislarger.Thelast3bits,called
N(R),correspondtothe
acknowledgmentnumberwhenpiggybackingisused.Thesinglebitbetween
N(S)and
N(R)iscalledthe PIFbit.The PIPfieldisasinglebitwithadualpurpose. Ithasmean­
ingonlywhenitisset(bit
=1)andcanmeanpollorfinal. Itmeanspollwhentheframe
issentbyaprimarystationtoasecondary(whentheaddressfieldcontainstheaddress
ofthereceiver).
Itmeansfinalwhentheframeissentbyasecondarytoaprimary
(whentheaddressfieldcontainstheaddressofthesender).
ControlFieldforS-Frames
Supervisoryframesareusedfor flowanderrorcontrolwheneverpiggybackingiseither
impossibleorinappropriate(e.g.,whenthestationeitherhas
nodataofitsowntosendor
needstosendacommandorresponseotherthan
anacknowledgment).S-frames donot
haveinformationfields.
Ifthefirst2bits ofthecontrolfieldis 10,thismeanstheframe
isanS-frame.Thelast3bits,called N(R),correspondstotheacknowledgmentnumber
(ACK)ornegativeacknowledgmentnumber(NAK)dependingonthetype
ofS-frame.
The2bitscalledcodeisusedtodefinethetype
ofS-frameitself.With2bits,wecan
havefourtypes
ofS-frames,asdescribedbelow:
oReceiveready(RR).Ifthevalueofthecodesubfieldis00,itisanRRS-frame.
Thiskind
offrameacknowledgesthe receiptofasafeandsoundframeor
group
offrames.Inthiscase,thevalue N(R)fielddefinestheacknowledgment
number.

344 CHAPTER 11DATALINKCONTROL
oReceivenotready(RNR).Ifthevalueofthecodesubfieldis10,itisanRNR
S-frame.ThiskindofframeisanRR framewithadditionalfunctions.It
acknowledgesthereceipt ofaframeorgroup offrames,anditannouncesthat
thereceiverisbusyandcannotreceivemoreframes.
Itactsasakind ofconges­
tioncontrolmechanismbyaskingthesender
toslowdown.Thevalue ofNCR)
istheacknowledgmentnumber.
oReject(REJ). Ifthevalueofthecodesubfieldis01,itisaREJS-frame.Thisisa
NAKframe,butnotliketheoneusedforSelectiveRepeatARQ.
ItisaNAKthat
can
beusedin Go-Back-NARQtoimprovetheefficiency oftheprocessby
informingthesender,beforethesendertimeexpires,thatthelastframe
islostor
damaged.Thevalue
ofNCR)isthenegativeacknowledgmentnumber.
oSelectivereject(SREJ).Ifthevalueofthecodesubfield is11,itisanSREJS-frame.
This
isaNAKframeusedinSelectiveRepeatARQ.NotethattheHDLCProtocol
usestheterm
selectivereject insteadof selectiverepeat.Thevalueof N(R)istheneg­
ativeacknowledgmentnumber.
Control
FieldforV-Frames
Unnumberedframesareusedtoexchangesessionmanagementandcontrolinfonnation
betweenconnecteddevices.UnlikeS-frames,U-framescontainaninformationfield,
butoneusedforsystemmanagementinformation,notuserdata.AswithS-frames,
however,much
oftheinfonnationcarriedbyU-framesiscontainedincodesincluded
inthecontrolfield.U-framecodesaredividedintotwosections:a2-bitprefixbefore
thePtFbitand a3-bitsuffixafterthePtFbit.Together,thesetwosegments
(5bits)can
beusedtocreateup
to32differenttypes ofU-frames.Some ofthemorecommontypes
areshowninTable11.1.
Table11.1
U~frame controlcommand andresponse
Code Command Response Meaning
00001 SNRM Setnormalresponsemode
11011SNRME Setnormalresponsemode,extended
11100SABM DM Setasynchronousbalancedmodeordisconnectmode
11110SABME Setasynchronousbalancedmode,extended
00000 UI UI Unnumberedinformation
00110 UA Unnumberedacknowledgment
00010 DISC RD Disconnectorrequestdisconnect
10000SIM RIM Setinitializationmodeor requestinformationmode
00100 UP Unnumberedpoll
11001RSET Reset
11101XID XID ExchangeID
10001FRMR FRMR Framereject

SECTION11.6HDLC 345
Example11.9:Connection/Disconnection
Figure11.29showshowV-framescanbeusedforconnectionestablishmentandconnection
release.NodeAasksforaconnectionwithasetasynchronousbalancedmode(SABM)frame;
nodeBgivesapositiveresponsewithanunnumberedacknowledgment(VA)frame.Afterthese
twoexchanges,datacanbetransferredbetweenthetwonodes(notshowninthefigure).After
datatransfer,nodeAsendsaDISC(disconnect)frametoreleasetheconnection;itisconfirmed
bynodeBrespondingwithaVA(unnumberedacknowledgment).
Figure11.29Exampleofconnectionanddisconnection
NodeA NodeB
Datatransfer
c:
o
.-1)
- cf)
uos
1)1)
<=I-
S~
u
y
Time
I
I
t
Time
Example11.10:PiggybackingwithoutError
Figure11.30showsan exchangeusingpiggybacking.NodeAbeginstheexchangeof
informationwithanI-framenumbered0followedbyanotherI-framenumbered 1.NodeB
piggybacksitsacknowledgment
ofbothframesontoanI-frame ofitsown.Node B'sfirst
I-frameisalsonumbered0
[N(S)field]andcontainsa 2inits N(R)field,acknowledgingthe
receipt
of
Nsframes1and0andindicatingthatitexpectsframe2toarrivenext.NodeB
transmitsitssecondandthirdI-frames(numbered1and2)beforeacceptingfurther
framesfromnodeA.Its N(R)information,therefore,has notchanged:Bframes1and2
indicatethatnodeBisstillexpectingNsframe2toarrivenext.NodeAhassentallits
data.Therefore,itcannotpiggyback
anacknowledgmentontoanI-frameandsendsanS-frame
instead.TheRRcodeindicatesthatAisstillreadytoreceive.Thenumber3inthe
N(R)field
tellsBthatframes0,
1,and2haveallbeenacceptedandthatAisnowexpectingframe
number
3.

346 CHAPTER 11DATALINKCONTROL
Figure11.30Exampleofpiggybackingwithouterror
NodeA NodeB
o
S-frame(RR),anACK3
l'ControlF\'
r-------.,B C.-.------.,
a\ORR3S
a
g g
y
Time
y
Time
Example11.11:PiggybackingwithError
Figure11.31showsanexchangeinwhichaframeislost.NodeBsendsthreedataframes(0, 1,
and2),butframe1islost.WhennodeAreceivesframe2,itdiscardsitandsendsa REIframefor
frame
1.Notethattheprotocolbeingusedis Go-Back-Nwiththespecialuse ofanREIframe as
aNAKframe.TheNAKframedoestwothingshere:Itconfirmsthereceipt offrame°and
declaresthatframe1andanyfollowingframesmustberesent.NodeB,afterreceivingtheREI
frame,resendsframes1and
2.NodeAacknowledgesthereceiptbysendinganRRframe(ACK)
withacknowledgmentnumber
3.
11.7POINT-TO-POINTPROTOCOL
AlthoughHDLCisageneralprotocolthatcanbeusedforbothpoint-to-pointandmulti­
pointconfigurations,oneofthemostcommonprotocolsforpoint-to-pointaccess
isthe
Point-to-PointProtocol(PPP). Today,millions ofInternetuserswhoneedtoconnect
theirhomecomputers
totheserverofanInternetserviceprovideruse PPP.Themajority
oftheseusershaveatraditionalmodem;theyareconnectedtotheInternetthrougha
telephoneline,whichprovidestheservices
ofthephysicallayer.Buttocontroland

SECTION11.7POINT-TO-POINTPROTOCOL 347
Figure11.31 Exampleofpiggybackingwitherror
NodeA NodeB
..
Lost
DiscardedL------<l_-.j
S-frame(REJ1),aNAK
~
IcontrOlFl'
'-----B C~••l>------'
=IOREJlSg
I-frame(dataframe1)
l'Control
r--......~ AI-----1r----.__--(
g0 1 0
F
I
Resent
1------;
a
g
Resent1
1
I
I
'f
Time
S-frame(RR3),anACK
F ControlF F
1-------1I B C I~...-----;
gtoRR3Sg
'f
Time
managethetransfer ofdata,there isaneedforapoint-to-pointprotocolatthedatalink
layer.PPPisbyfarthemostcommon.
PPPprovidesseveralservices:
1.PPPdefinestheformat oftheframetobeexchangedbetweendevices.
2.PPPdefineshowtwodevicescannegotiatetheestablishment ofthelinkandthe
exchange
ofdata.
3.PPPdefineshownetworklayerdataareencapsulatedinthedatalinkframe.
4.PPPdefineshowtwodevicescanauthenticateeachother.
5.PPPprovidesmultiplenetworklayerservicessupportingavariety ofnetworklayer
protocols.
6.PPPprovidesconnectionsovermultiplelinks.
7.PPPprovidesnetworkaddressconfiguration.Thisisparticularly usefulwhenahome
userneedsatemporarynetworkaddresstoconnecttotheInternet.

348 CHAPTER 11DATALINKCONTROL
Ontheotherhand,tokeepPPPsimple,severalservicesaremissing:
I.PPPdoesnotprovideflowcontrol.Asendercansendseveralframesoneafter
anotherwithnoconcernaboutoverwhelmingthereceiver.
2.PPPhasaverysimplemechanismforerrorcontrol.ACRCfieldisusedtodetect
errors.
Iftheframeiscorrupted,it issilentlydiscarded;theupper-layerprotocol
needstotakecare
oftheproblem.Lack oferrorcontrolandsequencenumbering
maycauseapackettobereceivedout
oforder.
3.PPPdoesnotprovideasophisticatedaddressingmechanismtohandleframesina
multipointconfiguration.
Framing
PPPisabyte-orientedprotocol.Framing isdoneaccordingtothediscussion ofbyte­
orientedprotocolsatthebeginning
ofthischapter.
FrameFormat
Figure11.32showstheformat ofaPPPframe.Thedescription ofeachfieldfollows:
Figure11.32PPP
framefomwt
1byte1byte1byte1or2bytes
Payload
Variable 2or4bytes1byte
oFlag.APPPframestartsandendswithaI-byteflagwiththebitpattern01111110.
Althoughthispatternisthesame
asthatusedinHDLC,there isabigdifference.
PPPisabyte-orientedprotocol;HDLCisabit-orientedprotocol.Theflagistreated
asabyte,aswewillexplainlater.
oAddress.Theaddressfieldinthisprotocolisaconstantvalueandsetto11111111
(broadcastaddress).Duringnegotiation(discussedlater),thetwopartiesmayagree
toomitthisbyte.
oControl.Thisfieldissettotheconstantvalue11000000(imitatingunnumbered
framesinHDLC).Aswewilldiscusslater,PPPdoesnotprovideany
flowcontrol.
Errorcontrol
isalsolimitedtoerrordetection.Thismeansthatthisfieldisnotneeded
atall,andagain,thetwopartiescanagree,duringnegotiation,toomitthisbyte.
oProtocol.Theprotocolfielddefineswhatisbeingcarriedinthedatafield:either
userdataorotherinformation.
Wediscussthisfieldindetailshortly.Thisfieldis
bydefault2byteslong,butthetwopartiescanagreetouseonlyIbyte.
oPayloadfield.Thisfieldcarrieseithertheuserdataorotherinformationthatwewill
discussshortly.Thedatafieldisasequence
ofbyteswiththedefault ofamaximum
of1500bytes;butthiscanbechangedduringnegotiation.Thedatafieldisbyte­
stuffed
iftheflagbytepatternappearsinthisfield.Becausethere isnofielddefining
thesize
ofthedatafield,paddingisneeded ifthesizeislessthanthemaximum
defaultvalueorthemaximumnegotiatedvalue.
oFCS.Theframechecksequence(FCS) issimplya2-byteor4-bytestandard CRe.

SECTION11.7POINT-TO-POINTPROTOCOL 349
ByteStuffing
ThesimilaritybetweenPPPand HDLeendsattheframeformat.PPP, aswediscussed
before,isabyte-orientedprotocoltotallydifferentfrom
HDLC.Asabyte-oriented
protocol,theflaginPPPisabyteandneedstobeescapedwhenever
itappearsinthe
datasection
oftheframe.Theescapebyteis01111101,whichmeansthateverytime
theflaglikepatternappearsinthedata,thisextrabyte
isstuffedtotellthereceiverthat
thenextbyte
isnotaflag.
PPPisabyte-orientedprotocolusingbytestuffingwiththeescapebyte01111101.
TransitionPhases
APPPconnectiongoesthroughphaseswhichcanbeshownina transitionphase
diagram(seeFigure11.33).
Figure11.33 Transitionphases
Failed
Carrier
dropped
Tenmnate
Done
Carrier
detected
Failed
Optionsagreed
bybothsides
Authenticate
Authentication
successful
Ifauthentication
notneeded
Networklayer
configuration
Network
DDead.Inthedeadphasethelink isnotbeingused.Thereisnoactivecarrier(at
thephysicallayer)andtheline
isquiet.
DEstablish.Whenone ofthenodesstartsthecommunication,theconnectiongoesinto
thisphase.Inthisphase,optionsarenegotiatedbetweenthetwoparties.
Ifthenegoti­
ationissuccessful,thesystemgoestotheauthenticationphase(ifauthenticationis
required)ordirectlytothenetworkingphase.Thelinkcontrolprotocolpackets,dis­
cussedshortly,areusedforthispurpose.Severalpacketsmaybeexchangedhere.
DAuthenticate.Theauthenticationphaseisoptional;thetwonodesmay decide,
duringtheestablishmentphase,nottoskipthisphase.However,
iftheydecideto
proceedwithauthentication,theysendseveralauthenticationpackets, discussed
later.
Iftheresultissuccessful,theconnectiongoestothenetworkingphase;other­
wise,itgoestotheterminationphase.
DNetwork.Inthenetworkphase,negotiationforthenetworklayerprotocolstakes
place.PPPspecifiesthattwonodesestablishanetworklayeragreementbeforedataat

350 CHAPTER 11DATALINKCONTROL
thenetworklayercanbeexchanged.ThereasonisthatPPPsupportsmultipleproto­
colsatthenetworklayer.
Ifanodeisrunningmultipleprotocolssimultaneouslyatthe
networklayer,thereceivingnodeneedstoknowwhichprotocolwillreceivethedata.
oOpen.Intheopenphase,datatransfertakesplace.Whenaconnectionreaches
thisphase,theexchange
ofdatapacketscanbestarted.Theconnectionremainsin
thisphaseuntilone
oftheendpointswantstoterminatetheconnection.
oTerminate.Intheterminationphasetheconnection isterminated.Severalpackets
areexchangedbetweenthetwoendsforhousecleaningandclosingthelink.
Multiplexing
AlthoughPPPisadatalinklayerprotocol,PPPusesanotherset ofotherprotocolsto
establishthelink,authenticatethepartiesinvolved,andcarrythenetworklayerdata.Three
sets
ofprotocolsaredefinedtomakePPPpowetful:theLinkControlProtocol(LCP),two
AuthenticationProtocols(APs),andseveralNetworkControlProtocols(NCPs).Atany
moment,aPPPpacketcancarrydatafromone
oftheseprotocolsinitsdatafield, asshown
inFigure11.34.Note thatthereisoneLCP,twoAPs,andseveralNCPs.Datamayalso
comefromseveraldifferentnetworklayers.
Figure11.34MultiplexinginPPP
Network
layer
Datalink
layer
Datafromdifferent
networkingprotocols
NCP



LCP:OxC021
AP:OxC023andOxC223
NCP:Ox8021and.
Data:Ox0021and.
LCP:LinkControlProtocol
AP:AuthenticationProtocol
NCP:NetworkControlProtocol
LinkControlProtocol
The
LinkControlProtocol (LCP)isresponsibleforestablishing,maintaining,config­
uring,andterminatinglinks.
Italsoprovidesnegotiationmechanismstosetoptions
betweenthetwoendpoints.Bothendpoints
ofthelinkmustreachanagreementabout
theoptionsbeforethelinkcanbeestablished.SeeFigure11.35.
AllLCPpacketsarecarriedinthepayloadfield
ofthePPPframewiththeprotocol
fieldsettoC021inhexadecimal.
Thecodefielddefinesthetype
ofLCPpacket.Thereare 11typesofpacketsas
showninTable11.2.

SECTION11.7POINT-TO-POINTPROTOCOL 351
Figure11.35 LCPpacketencapsulatedin aframe
Variable
Infonnation
Payload
(andpadding)
Table11.2 LCPpackets
Code PacketType Description
OxOl Coofigure-requestContainsthelist ofproposedoptionsandtheirvalues
Ox02 Configure-ack Acceptsalloptionsproposed
Ox03 Configure-nak Announcesthatsomeoptionsareootacceptable
Ox04 Configure-rejectAnnouncesthatsomeoptionsarenotrecognized
Ox05 Terminate-requestRequesttoshutdowntheline
Ox06 Terminate-ack Accepttheshutdownrequest
Ox07 Code-reject Announcesanunknowncode
Ox08 Protocol-reject Announcesanunknownprotocol
Ox09 Echo-request Atypeofhellomessagetocheck iftheotherendisalive
OxOA Echo-reply Theresponsetotheecho-requestmessage
OxOB Discard-request Arequesttodiscardthepacket
Therearethreecategories ofpackets.Thefirstcategory,comprisingthefirstfour
packettypes,isusedforlinkconfigurationduringtheestablishphase.Thesecondcate­
gory,comprisingpackettypes5and6,isusedforlinktenninationduringthetermina­
tionphase.Thelastfivepacketsareusedforlinkmonitoringanddebugging.
TheIDfieldholdsavaluethatmatchesarequestwithareply.Oneendpointinserts
avalueinthisfield,whichwillbecopiedintothereplypacket.Thelengthfielddefines
thelength
oftheentireLCPpacket.Theinformationfieldcontainsinformation,suchas
options,neededforsomeLCPpackets.
Therearemanyoptionsthatcanbenegotiatedbetweenthetwoendpoints.Options
areinsertedintheinformationfield
oftheconfigurationpackets.Inthiscase,theinfor­
mationfieldisdividedintothreefields:optiontype,optionlength,and optiondata.We
listsome
ofthemostcommonoptionsinTable11.3.
Table11.3 Commonoptions
Option Default
Maximumreceiveunit(payloadfieldsize)1500
Authenticationprotocol None
Protocolfieldcompression
Off
Addressandcontrolfieldcompression Off

352 CHAPTER 11DATALINKCONTROL
AuthenticationProtocols
AuthenticationplaysaveryimportantroleinPPPbecausePPPisdesignedforuseover
dial-uplinkswhereverification
ofuseridentityisnecessary. Authenticationmeansvali­
datingtheidentity
ofauserwhoneeds toaccessaset ofresources.PPPhascreatedtwo
protocolsforauthentication:PasswordAuthenticationProtocolandChallengeHandshake
AuthenticationProtocol.Notethattheseprotocolsareusedduringtheauthenticationphase.
PAPThePasswordAuthenticationProtocol(PAP) isasimpleauthenticationpro­
cedurewithatwo-stepprocess:
1.Theuserwhowants toaccessasystemsendsanauthenticationidentification
(usuallytheusername)andapassword.
2.Thesystemchecksthevalidity oftheidentificationandpasswordandeitheraccepts
ordeniesconnection.
Figure11.36showsthethreetypes
ofpackets usedbyPAPandhowtheyareactually
exchanged.WhenaPPPframeiscarryinganyPAPpackets,thevalue
oftheprotocol
fieldisOxC023.ThethreePAPpacketsareauthenticate-request,authenticate-ack,and
authenticate-nak.Thefirstpacketisusedbytheuser
tosendtheusernameandpass­
word.Thesecondisusedbythesystemtoallowaccess.Thethirdisusedbythesystem
todenyaccess.
Figure11.36 PAPpacketsencapsulated inaPPPframe
System
User
r
Authenticate-request
Authenticate-ackorauthenticate-nak
PAPpackets
I
cc__-
-----
FlagAddressIControlI~O2316
Payload
FeS
I
Flag
II --
(andpadding)
CHAPTheChallengeHandshakeAuthenticationProtocol(CHAP) isathree-way
hand-shakingauthenticationprotocolthatprovidesgreatersecuritythan
PAP.Inthis
method,thepasswordiskeptsecret;itisneversentonline.

SECTION11.7POINT-TO-POINTPROTOCOL 353
1.Thesystemsendstheuserachallengepacketcontainingachallengevalue,usually
afewbytes.
2.Theuserappliesapredefinedfunctionthattakesthechallengevalueandtheuser's
ownpasswordandcreatesaresult.Theusersendstheresultintheresponsepacket
tothesystem.
3.Thesystemdoesthesame. Itappliesthesamefunctiontothepasswordoftheuser
(knowntothesystem)andthechallengevaluetocreatearesult.
Iftheresultcreatedis
thesame
astheresultsentintheresponsepacket,accessisgranted;otherwise,itis
denied.CHAPismoresecurethan
PAP,especiallyifthesystemcontinuouslychanges
thechallengevalue.Even
iftheintruderlearnsthechallengevalueandtheresult,the
passwordisstillsecret.Figure11.37showsthepacketsandhowtheyareused.
Figure11.37 CHAPpacketsencapsulated inaPPPframe
User
r~
=-
Challenge
Response
Successorfailure
System
~
2 VariableVariable
Address -~J)l{623 s_,
-,:. :::~~--.:<-
....,--
Payload
(andpadding)
CHAPpackets
FCS Flag
CHAPpacketsareencapsulatedinthePPPframewiththeprotocolvalueC223in
hexadecimal.TherearefourCHAPpackets:challenge,response,success,andfailure.
Thefirstpacketisusedbythesystemtosendthechallengevalue.Thesecond
isusedby
theusertoreturntheresult
ofthecalculation.Thethirdisusedbythesystemtoallow
accesstothesystem.Thefourthisusedbythesystem
todenyaccesstothesystem.
NetworkControlProtocols
PPPisamultiple-networklayerprotocol.Itcancarryanetworklayerdatapacketfrom
protocolsdefinedbytheInternet,OSI,Xerox,DECnet,AppleTalk,Novel,andsoon.

354 CHAPTER 11DATALINKCONTROL
Todothis,PPPhasdefinedaspecificNetworkControlProtocolforeachnetworkpro­
tocol.Forexample,IPCP(InternetProtocolControlProtocol)configuresthelinkfor
carryingIPdatapackets.XeroxCPdoesthesamefortheXeroxprotocoldatapackets,
andsoon.
NotethatnoneoftheNCPpacketscarry network layerdata;they just
configurethelinkatthenetworklayerfortheincomingdata.
IPCPOneNCPprotocolisthe InternetProtocolControlProtocol(IPCP).This
protocolconfiguresthelinkusedtocarryIPpacketsintheInternet.IPCPisespecially
ofinteresttous.Theformat ofanIPCPpacketisshowninFigure11.38.Notethatthe
value
oftheprotocolfieldinhexadecimalis8021.
Figure11.38fPCPpacketencapsulatedinPPPframe
Variable
Payload
(andpadding)
FCS Flag
IPCPdefinessevenpackets,distinguishedby theircodevalues,asshownin
Table
11.4.
Table11.4 Codevalue forIPCPpackets
Code IPCPPacket
OxO! Configure-request
Ox02 Configure-ack
Ox03 Configure-nak
Ox04 Configure-reject
Ox05 Terminate-request
Ox06 Terminate-ack
Ox07 Code-reject
OtherProtocolsThereareotherNCPprotocolsforothernetworklayerprotocols.
TheOSINetworkLayerControlProtocolhasaprotocolfieldvalue
of8023;theXerox
NSIDPControlProtocolhasaprotocolfieldvalue
of8025;andsoon.Thevalue ofthe
codeandtheformat
ofthepacketsfortheseotherprotocolsarethesame asshownin
Table
11.4.
Data/romtheNetworkLayer
Afterthenetworklayerconfigurationiscompletedbyone oftheNCPprotocols,the
userscanexchangedatapacketsfromthenetworklayer.Hereagain,therearedifferent

SECTION11.7POINT-TO-POINTPROTOCOL 355
protocolfieldsfordifferentnetworklayers.Forexample, ifPPPiscarryingdatafrom
theIPnetworklayer,thefieldvalue
is0021(notethatthethreerightmostdigitsarethe
sameasforIPCP).
IfPPPiscarryingdatafromtheOSInetworklayer,thevalue ofthe
protocolfieldis0023,andsoon.Figure11.39showstheframeforIP.
Figure11.39IPdatagramencapsulated inaPPPframe
Userdata
Payload
(andpadding)
FCS Flag
MultilinkPPP
PPPwasoriginallydesignedforasingle-channelpoint-to-pointphysicallink.Theavail­
ability
ofmultiplechannelsinasinglepoint-to-pointlinkmotivatedthedevelopment of
MultilinkPPP.Inthiscase,alogicalPPPframeisdividedintoseveralactualPPP
frames.Asegment
ofthelogicalframeiscarriedinthepayload ofanactualPPPframe,
asshowninFigure11.40.
ToshowthattheactualPPPframeiscarryingafragment ofa
Figure11.40MultilinkPPP
Channel2
Channell
PPP
Logical
PPP
O
r-----
. Payload
PPP
Protocolfiled:Ox003d
logicalPPPframe,theprotocolfieldissetto Ox003d.Thisnewdevelopmentaddscom­
plexity.Forexample,asequencenumberneeds
tobeaddedtotheactualPPPframeto
showafragment'spositioninthelogicalframe.
Example11.12
Letusgothroughthephasesfollowedbyanetworklayerpacket asitistransmittedthrougha
PPPconnection.Figure11.41showsthesteps.Forsimplicity,weassumeunidirectionalmove­
ment
ofdatafromtheusersitetothesystemsite(such assendingane-mailthroughanISP).

356 CHAPTER11DATALINKCONTROL
Figure11.41 Anexample
User
[I
~
System
i
.Configure-request
~ Options
. LeI'
Authenticate-ack
§ITIr]Name
PAP
Authenticate-request
C023-~ NameO-P-a-ss-w-o-rd-I
PAP
Configure-request·:
gOZL~ Options
IPCp·
Terminate-request
.CQ21:-~ Options
LCP
[
y
Time
y
Time

SECTION11.9KEYTERMS 357
Thefirsttwoframesshowlinkestablishment. Wehavechosentwooptions(notshowninthe
figure):usingPAPforauthenticationandsuppressingtheaddresscontrolfields.Frames3and4
areforauthentication.Frames5and6establishthenetworklayerconnectionusingIPCP.
ThenextseveralframesshowthatsomeIPpacketsareencapsulatedinthePPPframe.The
system(receiver)mayhavebeenrunningseveralnetworklayerprotocols,butitknowsthatthe
incomingdatamustbedeliveredtotheIPprotocolbecausetheNCPprotocolusedbeforethedata
transferwasIPCP.
Afterdatatransfer,theuserthenterminatesthedatalinkconnection,whichisacknowledged
bythesystem.
OfCOUrsetheuserorthesystemcouldhavechosentoterminatethenetworklayer
IPCPandkeepthedatalinklayerrunningif
itwantedtorunanotherNCPprotocol.
Theexampleistrivial,butitpointsout
thesimilaritiesofthepacketsinLCP, AP,and
NCP.
Italsoshowstheprotocolfieldvaluesandcodenumbersforparticularprotocols.
11.8RECOMMENDED READING
Formoredetailsaboutsubjectsdiscussedinthischapter,werecommendthefollowing
books.Theitemsinbrackets[
...]refertothereferencelistatthe endofthetext.
Books
Adiscussionofdatalinkcontrolcanbefoundin[GW04],Chapter3 of[Tan03],Chapter7
of[Sta04],Chapter 12of[Kes97],andChapter2 of[PD03].Moreadvancedmaterialscan
befoundin[KMK04].
11.9KEYTERMS
acknowledgment(ACK)
asynchronousbalancedmode(ABM)
automaticrepeatrequest(ARQ)
bandwidth-delayproduct
bit-orientedprotocol
bitstuffing
bytestuffing
ChallengeHandshakeAuthentication
Protocol(CHAP)
character-orientedprotocol
datalinkcontrol
errorcontrol
escapecharacter(ESC)
event
fixed-sizeframing
flag
flowcontrol
framing
Go-Back-NARQProtocol
High-levelDataLinkControl(HDLC)
informationframe(I-frame)
InternetProtocolControlProtocol(IPCP)
LinkControlProtocol(LCP)
negativeacknowledgment(NAK)
noiseless channel
noisychannel
normalresponsemode(NRM)
PasswordAuthenticationProtocol(PAP)
piggybacking
pipelining
Point-to-PointProtocol(PPP)
primarystation

358 CHAPTER 11DATALINKCONTROL
receiveslidingwindow
secondarystation
SelectiveRepeatARQ
Protocol
sendslidingwindow
sequencenumber
SimplestProtocol
slidingwindow
Stop-and-WaitARQProtocol
Stop-and-WaitProtocol
supervisoryframe(S-frame)
transitionphase
unnumberedframe(D-frame)
variable-sizeframing
11.10SUMMARY
oDatalinkcontroldealswiththedesignandproceduresforcommunicationbetween
twoadjacentnodes:node-to-nodecommunication.
oFraminginthedatalinklayerseparatesamessagefromonesourcetoadestination,
orfromothermessagesgoingfromothersourcestootherdestinations,
oFramescanbe offixedorvariablesize.Infixed-sizeframing,thereisnoneedfor
definingtheboundaries
offrames;invariable-sizeframing,weneedadelimiter
(flag)todefinetheboundary
oftwoframes.
oVariable-sizeframingusestwocategories ofprotocols:byte-oriented(orcharacter­
oriented)andbit-oriented.Inabyte-orientedprotocol,thedatasection
ofaframe
isasequence
ofbytes;inabit-orientedprotocol,thedatasection ofaframeisa
sequence
ofbits.
oInbyte-oriented(orcharacter-oriented)protocols,weusebytestuffing;aspecial
byteaddedtothedatasection
oftheframewhenthereisacharacterwiththesame
pattern
astheflag.
oInbit-orientedprotocols,weusebitstuffing;anextra0 isaddedtothedatasection
oftheframewhenthereisasequence ofbitswiththesamepatternastheflag.
oFlowcontrolreferstoaset ofproceduresusedtorestricttheamount ofdatathatthe
sendercansendbeforewaitingforacknowledgment.Errorcontrolreferstomethods
oferrordetectionandcorrection.
oForthenoiselesschannel,wediscussedtwoprotocols:theSimplestProtocoland
theStop-and-WaitProtocol.Thefirstprotocolhasneitherflownorerrorcontrol;
thesecondhasnoerrorcontrol.IntheSimplestProtocol,thesendersendsits
framesoneafteranotherwithnoregardstothereceiver.
IntheStop-and-WaitPro­
tocol,thesendersendsoneframe,stopsuntilitreceivesconfirmationfromthe
receiver,andthensendsthenextframe.
DForthenoisychannel,wediscussedthreeprotocols:Stop-and-WaitARQ, 00­
Back-N,andSelectiveRepeatARQ.TheStop-and-WaitARQProtocol,addsa
simpleerrorcontrolmechanismtotheStop-and-WaitProtocol.Inthe
Oo-Back-N
ARQProtocol,wecansendseveralframesbeforereceivingacknowledgments,
improvingtheefficiency
oftransmission.IntheSelectiveRepeatARQprotocol we
avoidunnecessarytransmissionbysendingonlyframesthatarecorrupted.
DBothOo-Back-NandSelective-RepeatProtocolsuseaslidingwindow.In 00­
Back-NARQ,ifmisthenumberofbitsforthesequencenumber,thenthesize of

SECTION11.11PRACTICESET 359
thesendwindowmustbelessthan 2
m
;
thesizeofthereceiverwindowisalways 1.
InSelectiveRepeatARQ,thesize ofthesenderandreceiverwindowmustbeat
mostone-half
of2
m
.
oAtechniquecalledpiggybackingisusedtoimprovetheefficiency ofthebidirec­
tionalprotocols.Whenaframe
iscarryingdatafromAto B,itcanalsocarrycontrol
informationaboutframesfromB;whenaframe
iscarryingdatafromBtoA,itcan
alsocarrycontrolinformationaboutframesfrom
A.
oHigh-levelDataLinkControl(HDLC)isabit-orientedprotocolforcommunication
overpoint-to-pointandmultipointlinks.However,themostcommonprotocolsfor
point-to-pointaccessisthePoint-to-PointProtocol(PPP),whichisabyte-oriented
protocol.
11.11PRACTICESET
ReviewQuestions
1.Brieflydescribetheservicesprovidedbythedatalinklayer.
2.Defineframingandthereasonforitsneed.
3.Compareandcontrastbyte-orientedandbit-orientedprotocols.Whichcategory
hasbeenpopularinthepast(explainthereason)?Whichcategoryispopularnow
(explainthereason)?
4.Compareandcontrastbyte-stuffingandbit-stuffing.Whichtechniqueisusedin
byte-orientedprotocols?Whichtechnique
isusedinbit-orientedprotocols?
5.Compareandcontrastflowcontrolanderrorcontrol.
6.Whatarethetwoprotocolswediscussedfornoiselesschannelsinthischapter?
7.Whatarethethreeprotocolswediscussedfornoisychannelsinthischapter?
8.ExplainthereasonformovingfromtheStop-and-WaitARQProtocoltothe 00­
Back-NARQProtocol.
9.CompareandcontrasttheGo-Back-NARQProtocolwithSelective-RepeatARQ.
10.CompareandcontrastHDLCwithPPP.Whichoneisbyte-oriented;whichoneis
bit-oriented?
11.Definepiggybackinganditsusefulness.
12.Whichoftheprotocolsdescribedinthischapterutilizepipelining?
Exercises
13.Byte-stuffthedatainFigure11.42.
Figure11.42Exercise13

360 CHAPTER 11DATALINKCONTROL
14.Bit-stuffthedatainFigure11.43.
Figure11.43 Exercise14
1000111111100111110100011111111111000011111I
15.Designtwosimplealgorithmsforbyte-stuffing.Thefirstaddsbytesatthesender;
thesecondremovesbytes
atthereceiver.
16.Designtwosimplealgorithmsforbit-stuffing.Thefirstaddsbitsatthesender;the
secondremovesbitsatthereceiver.
17.Asendersendsaseries ofpacketstothesamedestinationusing5-bitsequence
numbers.
Ifthesequencenumberstartswith0,whatisthesequencenumberafter
sending100packets?
18.Using5-bitsequencenumbers,whatisthemaximumsize
ofthesendandreceive
windowsforeach
ofthefollowingprotocols?
a.Stop-and-WaitARQ
b.Go-Back-NARQ
c.Selective-RepeatARQ
19.DesignabidirectionalalgorithmfortheSimplestProtocolusingpiggybacking.
Notethatthebothpartiesneedtousethesamealgorithm.
20.DesignabidirectionalalgOIithmfortheStop-and-WaitProtocolusingpiggybacking.
Notethatbothpartiesneedtousethesamealgorithm.
21.DesignabidirectionalalgorithmfortheStop-and-WaitARQProtocolusingpiggy­
backing.Note thatbothpartiesneedtousethesamealgorithm.
22.DesignabidirectionalalgorithmfortheGo-Back-NARQProtocolusingpiggy­
backing.Notethatbothpartiesneedtousethesamealgorithm.
23.DesignabidirectionalalgorithmfortheSelective-RepeatARQProtocolusingpiggy­
backing.Notethatbothpartiesneedtousethesamealgorithm.
24.Figure11.44showsastatediagramtosimulatethebehavior
ofStop-and-WaitARQ
atthesendersite.
Figure11.44 Exercise24
A
Thestateshaveavalue ofSn(0or1).Thearrowsshowsthetransitions.Explainthe
eventsthatcausethetwotransitionslabeledAand
B.

SECTION11.11PRACTICESET 361
25.Figure11.45showsastatediagramtosimulatethebehavior ofStop-and-Wait
ARQatthereceiversite.
Figure11.45Exercise25
A
Thestateshaveavalue ofR
n
(0or1).Thearrowsshowsthetransitions.Explain
theeventsthatcausethetwotransitionslabeledAand
B.
26.InStop-and-WaitARQ,wecancombinethestatediagrams ofthesenderand
receiverinExercises24and
25.Onestatedefinesthecombinedvalues ofR
n
and
Sn­
Thismeansthatwecanhavefourstates,eachdefinedby (x,y),wherexdefinesthe
value
ofSnandydefinesthevalue of
R
w
Inotherwords,wecanhavethefour
statesshowninFigure11.46.Explaintheeventsthatcausethefourtransitions
labeled
A,B, C,andD.
Figure11.46Exercise26
27.Thetimer ofasystemusingtheStop-and-WaitARQProtocolhasatime-out of6ms.
DrawtheflowdiagramsimilartoFigure11.11forfourframes
iftheroundtripdelay
is4ms.Assumenodataframeorcontrolframeislostordamaged.
28.RepeatExercise27 ifthetime-outis4msandtheroundtripdelayis 6.
29.RepeatExercise27 ifthefirstframe (frame 0)islost.
30.AsystemusestheStop-and-WaitARQProtocol.
Ifeachpacketcarries1000bits of
data,howlongdoesittaketosend1millionbits ofdataifthedistancebetweenthe
senderandreceiver
is5000KInandthepropagationspeedis2 x10
8
m?Ignoretrans­
mission,waiting,andprocessingdelays.
Weassumenodataorcontrolframeislost
ordamaged.
31.RepeatExercise30usingthe Go-back-NARQProtocolwithawindowsize of7.
Ignoretheoverheadduetotheheaderandtrailer.
32.RepeatExercise30usingtheSelective-RepeatARQProtocolwithawindow
size
of4.Ignoretheoverheadduetotheheaderandthetrailer.

CHAPTER12
MultipleAccess
InChapter11wediscusseddatalinkcontrol,amechanismwhichprovidesalinkwith
reliablecommunication.Intheprotocolswedescribed,weassumedthatthereisan
availablededicatedlink(orchannel)betweenthesenderandthereceiver.Thisassump­
tion
mayormaynotbetrue. If,indeed,wehaveadedicatedlink, aswhenweconnect
totheInternetusingPPP
asthedatalinkcontrolprotocol,thentheassumptionistrue
andwedonotneedanythingelse.
Ontheotherhand,ifweuseourcellularphonetoconnecttoanothercellularphone,
thechannel(thebandallocatedtothevendorcompany)isnotdedicated.Apersonafew
feetawayfromusmaybeusingthesamechanneltotalktoherfriend.
Wecanconsiderthedatalinklayer astwosublayers.Theuppersublayerisresponsi­
blefordatalinkcontrol,andthelowersublayer
isresponsibleforresolvingaccesstothe
sharedmedia.
Ifthechannelisdedicated,wedonotneedthelowersublayer.Figure 12.1
showsthesetwosublayersinthedatalinklayer.
Figure12.1Datalinklayerdividedintotwofunctionality-orientedsublayers
Datalinklayer
Datalinkcontrol
Multiple-accessresolution
WewillseeinChapter 13thattheIEEEhasactuallymadethisdivisionforLAN s.
Theuppersublayerthatisresponsiblefor flowanderrorcontroliscalledthelogical
linkcontrol(LLC)layer;thelowersublayerthat
ismostlyresponsibleformultiple­
accessresolutioniscalledthemediaaccesscontrol(MAC)layer.
Whennodesorstationsareconnectedanduseacommonlink,calledamultipoint
orbroadcastlink,
weneedamultiple-accessprotocoltocoordinateaccesstothelink.
Theproblem
ofcontrollingtheaccesstothemediumissimilartotherulesofspeaking
363

364 CHAPTER 12MULTIPLEACCESS
inanassembly.Theproceduresguaranteethattherighttospeakisupheldandensure
thattwopeopledonotspeakatthesametime,donotinterrupteachother,donot
monopolizethediscussion,andsoon.
Thesituationissimilarformultipointnetworks.Manyformalprotocolshavebeen
devisedtohandleaccesstoasharedlillieWecategorizethemintothreegroups.Protocols
belongingtoeachgroupareshowninFigure12.2.
Figure12.2 Taxonomyofmultiple-accessprotocolsdiscussed
inthischapter
12.1
ALOHA
CSMA
CSMA/CD
CSMA/CA
RANDOM ACCESS
Reservation
Polling
Tokenpassing FDMA
TDMA
CDMA
Inrandomaccessorcontentionmethods,nostationissuperiortoanotherstationand
noneisassignedthecontroloveranother.Nostationpermits,ordoesnotpermit,
anotherstationtosend.Ateachinstance,astationthathasdatatosendusesaprocedure
definedbytheprotocoltomakeadecisiononwhetherornottosend.Thisdecision
depends
onthestateofthemedium(idleorbusy).Inotherwords,eachstationcan
transmitwhenitdesiresontheconditionthatitfollowsthepredefinedprocedure,
includingthetesting
ofthestateofthemedium.
Twofeaturesgivethismethoditsname.First,thereisnoscheduledtimeforastation
totransmit.Transmissionisrandomamongthestations.Thatiswhythesemethodsare
called
randomaccess. Second,norulesspecifywhichstationshouldsendnext.Stations
competewithoneanothertoaccessthemedium.That
iswhythesemethodsarealso
called
contentionmethods.
Inarandomaccessmethod,eachstationhastherighttothemediumwithoutbeing
controlledbyanyotherstation.However,
ifmorethanonestationtriestosend,thereis
anaccess
conflict-collision-andtheframeswillbeeitherdestroyedormodified. To
avoidaccessconflictortoresolveitwhenithappens,eachstationfollowsaprocedure
thatanswersthefollowingquestions:
oWhencanthestationaccessthemedium?
oWhatcanthestationdo ifthemediumisbusy?
oHowcanthestationdeterminethesuccessorfailure ofthetransmission?
oWhatcanthestationdo ifthereisanaccessconflict?

SECTION12.1RANDOMACCESS 365
Therandomaccessmethodswestudyinthischapterhaveevolvedfromavery
interestingprotocolknown
asALOHA,whichusedaverysimpleprocedurecalled
multipleaccess(MA).Themethodwasimprovedwiththeadditionofaprocedurethat
forcesthestationtosensethemediumbeforetransmitting.Thiswascalledcarriersense
multipleaccess.Thismethodlaterevolvedintotwoparallelmethods:
carriersense
multipleaccesswithcollisiondetection(CSMAlCD)and
carriersensemultipleaccess
withcollisionavoidance
(CSMA/CA).CSMA/CDtellsthestationwhattodowhena
collision
isdetected.CSMA/CAtriestoavoidthecollision.
ALOHA
ALOHA,theearliestrandomaccessmethod,wasdevelopedattheUniversityofHawaii
inearly1970.
Itwasdesignedforaradio(wireless)LAN,butitcanbeusedonany
sharedmedium.
Itisobviousthattherearepotentialcollisionsinthisarrangement.Themediumis
sharedbetweenthestations.Whenastationsendsdata,anotherstationmayattemptto
do
soatthesametime.Thedatafromthetwostationscollideandbecomegarbled.
PureALOHA
TheoriginalALOHAprotocoliscalled pureALOHA.Thisisasimple,butelegant
protocol.Theideaisthateachstationsendsaframewheneverithasaframetosend.
However,sincethereisonlyonechanneltoshare,there
isthepossibilityofcollision
betweenframesfromdifferentstations.Figure
12.3showsanexampleofframecollisions
inpureALOHA.
Figure12.3Framesinapure ALOHAnetwork
[J
Station1
~I Frame1.11 JFrame1.21 ~
Time
[J
Station2~ JFrame2.1L -'Frame2.2L ~
Time
[]
Station3~ -1Frame3.11 JFrame3.2I__~
Time
[]
Station4~ JFrame4.1L JFrame4.21 ~
Time
Collision
duration
Collision
duration
Therearefourstations(unrealisticassumption)thatcontendwithoneanotherfor
accesstothesharedchannel.Thefigureshowsthateachstationsendstwoframes;there
areatotalofeightframesonthesharedmedium.Someoftheseframescollidebecause
multipleframesareincontentionforthesharedchannel.Figure12.3showsthatonly

366 CHAPTER 12MULTIPLEACCESS
twoframessurvive:frame 1.1fromstation1 andframe3.2fromstation 3.Weneedto
mentionthateven
ifonebitofaframecoexistsonthechannelwithonebitfrom
anotherframe,thereisacollisionandbothwillbedestroyed.
Itisobviousthatweneedtoresendtheframesthathavebeendestroyedduring
transmission.ThepureALOHAprotocolreliesonacknowledgmentsfromthereceiver.
Whenastationsendsaframe,itexpectsthereceivertosendanacknowledgment.
Ifthe
acknowledgmentdoesnotarriveafteratime-outperiod,thestationassumesthatthe
frame(ortheacknowledgment)hasbeendestroyedandresendstheframe.
Acollisioninvolvestwo
ormorestations.Ifallthesestationstrytoresendtheir
framesafterthetime-out,theframeswillcollideagain.PureALOHAdictatesthat
whenthetime-outperiodpasses,eachstationwaitsarandomamount
oftimebefore
resendingitsframe.Therandomnesswillhelpavoidmorecollisions.
Wecallthistime
theback-offtime
T
B
.
PureALOHAhasasecondmethodtopreventcongestingthechannelwithretrans­
mittedframes.Afteramaximumnumber
ofretransmissionattempts K
max
'
astation
mustgiveupand
trylater.Figure12.4showstheprocedureforpureALOHAbasedon
theabovestrategy.
Figure12.4ProcedureforpureALOHAprotocol
K:Numberofattempts
T
p
:
Maximumpropagationtime
T
fr
:Averagetransmissiontimeforaframe
T
B
:
Back-offtime
WaitTBtime
(Ta=RxTporR
xT
fr
)
Choosearandom
number
Rbetween
oand2
K
-1
Stationhas___--aframetosend
Sendtheil:ame
Waittime-Quttime
(2XT
p
)
K
ma
,is
normally15
K=K+1
Thetime-outperiodisequaltothemaximumpossibleround-trippropagationdelay,
which
istwicetheamount oftimerequiredtosendaframebetweenthetwomostwidely
separatedstations
(2xT
p
)'Theback-offtime T
Bisarandomvaluethatnormallydepends
on
K(thenumberofattemptedunsuccessfultransmissions).Theformulafor T
B
dependson
theimplementation.Onecommonformulaisthe
binaryexponentialback-off. Inthis

SECTION12.1RANDOMACCESS 367
method,foreachretransmission,amultiplierintherange0to 2
K
-
1israndomlychosen
andmultipliedby
T
p
(maximumpropagationtime)or Trr
(theaveragetimerequiredto
sendoutaframe)tofind
TB'Notethatinthisprocedure,therange oftherandomnumbers
increasesaftereachcollision.Thevalue
ofK
max
isusuallychosenas 15.
Example12.1
ThestationsonawirelessALOHAnetworkareamaximumof 600kmapart.Ifweassumethat
signalspropagate
at3x10
8
mis,wefindT
p
=(600x10
5
) /
(3x10
8
)
=2ms.Nowwecanfindthe
valueof T
B
fordifferentvaluesof K.
a.ForK=1,therangeis{O,I}.Thestationneeds togeneratearandomnumberwitha
valueof
0or1.Thismeansthat T
Biseither°ms(0x2)or2ms(lx2),basedonthe
outcomeoftherandomvariable.
b.ForK
=2,therangeis {O,1,2,3}.Thismeansthat TBcanbe0,2,4,or6ms,basedon
theoutcomeoftherandomvariable.
c.ForK=3,therangeisto,1,2,3,4,5,6,7}.Thismeansthat T
B
canbe0,2,4,...,14ms,
basedontheoutcomeoftherandomvariable.
d.Weneedtomentionthatif K>10,itisnormallyset to10.
Vulnerabletime Letusfindthelength oftime,the vulnerabletime, inwhichthere
isapossibility
ofcollision.Weassumethatthestationssendfixed-lengthframeswith
eachframetaking
T
fr
Stosend.Figure12.5showsthevulnerabletimeforstationA.
Figure12.5 Vulnerabletime forpureALOHAprotocol
B'send
collideswith
A'sbeginning
t
A'send
collideswith
C'sbeginning
t,
,
,
IE B ~I j
.:...:..-------.,--1- ,
Ic!~~c;~c:s~~~J~~~~,~::~~c~cJl
::1 --:::-~--':------
I!.C &1

Vulnerabletime =2XT
fr
Time
StationAsendsaframeattime t.NowimaginestationBhasalreadysentaframe
between
t-Tfrandt.ThisleadstoacollisionbetweentheframesfromstationAand
stationB.Theend
ofB'sframecollideswiththebeginning ofA'sframe.Ontheother
hand,supposethatstationCsendsaframebetween
tandt+T
fr
.Here,thereisacolli­
sionbetweenframesfromstationAandstation
C.ThebeginningofC'sframecollides
withthe
endofA'sframe.

368 CHAPTER 12MULTIPLEACCESS
LookingatFigure12.5,weseethatthevulnerabletime,duringwhichacollision
mayoccurinpureALOHA,is2timestheframetransmissiontime.
PureALOHAvulnerabletime =2
xT
fr
Example12.2
ApureALOHAnetworktransmits200-bitframesonasharedchannel of200kbps.Whatisthe
requirementtomakethisframecollision-free?
Solution
Averageframetransmissiontime T
fr
is200bits/200kbpsor1ms.Thevulnerabletimeis2
x
1ms=2ms.Thismeansnostationshouldsendlaterthan1msbeforethisstationstartstransmis­
sionandnostationshouldstartsendingduringtheoneI-msperiodthatthisstationissending.
ThroughputLetuscallGtheaveragenumber offramesgeneratedbythesystem
duringoneframetransmissiontime.Thenitcanbeprovedthattheaveragenumberof
successfultransmissionsforpureALOHA
isS=G
xe-
2G
.
Themaximumthroughput
Smaxis0.184,forG =
1.Inotherwords, ifone-halfaframeisgeneratedduringone
2
frametransmissiontime(inotherwords,oneframeduringtwoframetransmission
times),then18.4percentoftheseframesreachtheirdestinationsuccessfully.Thisisan
expectedresultbecausethevulnerabletimeis2timestheframetransmissiontime.
Therefore,ifastationgeneratesonlyoneframeinthisvulnerabletime(and
noothersta­
tionsgenerateaframeduringthis time),theframewillreachitsdestinationsuccessfully.
Thethroughputfor pureALOHAis S=Gxe-2G.
ThemaximumthroughputSmax=0.184whenG =(1/2).
Example12.3
ApureALOHAnetworktransmits200-bitframesonasharedchannel of200kbps.Whatisthe
throughput
ifthesystem(allstationstogether)produces
a.1000framespersecond
b.500framespersecond
c.250framespersecond
Solution
Theframetransmissiontimeis 2001200kbpsor1ms.
a.Ifthesystemcreates1000framespersecond,thisis1framepermillisecond.Theloadis
1.InthiscaseS =G xe-
2G
orS=0.135(13.5percent).Thismeansthatthethroughputis
1000
X0.135=135frames.Only 135framesout of1000willprobablysurvive.
b.Ifthesystemcreates500framespersecond,thisis(1/2)framepermillisecond.The load
is
(112).InthiscaseS =G xe-
2G
orS=0.184(18.4percent).Thismeansthatthe
throughputis500x0.184
=92andthatonly92framesout of500willprobablysurvive.
Notethatthis
isthemaximumthroughputcase,percentagewise.
c.Ifthesystemcreates250framespersecond,thisis(1/4)framepermillisecond.Theload
is(1/4).InthiscaseS
=G xe-
2G
orS=0.152(15.2percent).Thismeansthatthe
throughput
is250x0.152 =38.Only38framesout of250willprobablysurvive.

SECTION/2.1RANDOMACCESS 369
SlottedALOHA
PureALOHAhasavulnerabletime of2 xT
fr
.Thisissobecausethereisnorulethat
defines
whenthestationcansend.Astation maysendsoonafteranotherstationhas
started
orsoonbeforeanotherstationhasfinished.Slotted ALOHAwasinvented to
improvetheefficiency ofpureALOHA.
InslottedALOHAwedividethetimeintoslots ofT
fr
sandforcethestationto
sendonlyatthebeginning ofthetimeslot.Figure12.6shows anexampleofframe
collisions
inslottedALOHA.
Figure12.6Framesinaslotted ALOHAnetwork
CollisionCollision
durationduration
[J
Station]~_ Frame1.] Frame1.2
-----------------------~
Time
Station2
-
Frame2.1 Frame2.2
-:------ --,....--- ---------------+
Time
a--
Station3 Frame3.1 Frame3.2
------
...,,_....._---------------- ---~
Time
&--
Station4 Frame4.1 Frame4.2
------.....,_......_--- ------ ---------~
Time
Slot1 510t2 Slot3 510t4 Slot5 Slot6
Becauseastationisallowedtosendonlyatthebeginning ofthesynchronizedtime
slot,
ifastationmissesthismoment,itmustwaituntilthebeginning ofthenexttime
slot.Thismeansthatthestationwhichstartedatthebeginning
ofthisslothasalready
finishedsendingitsframe.
Ofcourse,thereisstillthepossibility ofcollisioniftwosta­
tionstrytosendatthebeginning
ofthesametimeslot.However,thevulnerabletimeis
nowreducedtoone-half,equalto
T
fr
Figure12.7showsthesituation.
Figure12.7showsthatthevulnerabletimeforslotted
ALOHAisone-halfthat of
pureALOHA.
SlottedALOHAvulnerabletime
=T
fr
ThroughputItcanbeprovedthattheaverage numberofsuccessfultransmissionsfor
slotted
ALOHAisS=G xe-
G
.
ThemaximumthroughputSmaxis0.368,whenG=1.
Inotherwords, ifaframeisgeneratedduringoneframetransmissiontime, then36.8
percent
oftheseframesreachtheirdestinationsuccessfully.Thisresult canbeexpected
becausethevulnerabletimeisequaltotheframetransmissiontime.Therefore,
ifasta­
tiongeneratesonlyoneframeinthisvulnerabletime(and
nootherstationgeneratesa
frameduringthistime),theframewillreachitsdestinationsuccessfully.
ThethroughputforslottedALOHAis
S
=:G xe-G.
Themaximumthroughput Smax==0.368whenG =1.

370 CHAPTER 12MULTIPLEACCESS
Figure12.7Vulnerabletime forslottedALOHAprotocol
AcollideswithC
t
r
I
f
I-..,E.,..-----B----~~l
If....
c
~I
I,
Vulnerabletime =T
fr
Time
Example12.4
AslottedALOHAnetworktransmits200-bitframesusingasharedchannelwitha200-kbps
bandwidth.Findthethroughput
ifthesystem(allstationstogether)produces
a.1000framespersecond
b.500framespersecond
c.250framespersecond
Solution
Thissituationissimilar tothepreviousexerciseexceptthatthenetworkisusingslottedALOHA
instead
ofpureALOHA.Theframetransmissiontimeis 200/200kbpsor1ms.
a.InthiscaseGis 1.SoS=G xe-
G
orS=0.368(36.8percent).Thismeansthatthe
throughput
is1000x0.0368 =368frames.Only368out of1000frameswillprobably
survive.Notethatthisisthemaximumthroughputcase,percentagewise.
b.HereGis
~.InthiscaseS =G xe-
G
orS=0.303(30.3percent).Thismeansthatthe
throughput
is500x0.0303=151.Only 151framesout of500willprobablysurvive.
c.NowGis
1.InthiscaseS =G xe-
G
orS=0.195(19.5percent).Thismeansthatthe
throughput
4
is250x0.195 =49.Only49framesout of250willprobablysurvive.
CarrierSenseMultipleAccess(CSMA)
Tominimizethechance ofcollisionand,therefore,increasetheperformance,the CSMA
methodwasdeveloped.Thechanceofcollisioncan bereducedifastationsensesthe
mediumbeforetryingtouseit.
Carriersensemultipleaccess(CSMA)requiresthateach
stationfirstlistentothemedium(orcheckthestate
ofthemedium)beforesending.Inother
words,
CSMAisbasedontheprinciple"sensebeforetransmit" or"listen beforetalk."
CSMAcanreducethepossibilityofcollision,butitcannoteliminateit. Thereason
forthisisshown inFigure12.8,aspaceand timemodelofaCSMAnetwork.Stations
are
connectedtoasharedchannel(usuallyadedicatedmedium).
Thepossibilityofcollisionstillexistsbecause ofpropagationdelay;whenastation
sendsaframe,
itstilltakestime(althoughveryshort)forthefirstbittoreacheverystation

SECTION12.1RANDOMACCESS 371
Figure12.8Space/timemodel ofthecollisioninCSMA
Bstarts
attime
11
Cstarts
attime
1
2
Areawhere
A'ssignalexists
Areawhere
bothsignalsexist
Time Time
andforeverystationtosense it.Inotherwords,astationmaysensethemediumandfind
itidle,onlybecausethefirstbitsentbyanotherstationhasnotyetbeenreceived.
Attime
tI'stationBsensesthemediumandfindsitidle,soitsendsaframe.Attime
t2(t2>tI)'stationCsensesthemediumandfindsitidlebecause,atthistime,thefirst
bitsfromstationBhavenotreachedstation
C.StationCalsosendsaframe.Thetwo
signalscollideandbothframesaredestroyed.
VulnerableTime
ThevulnerabletimeforCSMAisthe
propagationtimeT
p
.
Thisisthetimeneededfor
asignaltopropagatefromoneend
ofthemediumtotheother.Whenastationsendsa
frame,andanyotherstationtriestosendaframeduringthistime,acollisionwill
result.But
ifthefirstbitoftheframereachestheend ofthemedium,everystationwill
alreadyhaveheardthebitandwillrefrainfromsending.Figure12.9showstheworst
Figure12.9Vulnerabletime inCSMA
Bsenses
here
Ill~~~~~~~
Framepropagation
Time
]
Vulnerabletime
propagationtime
Time

372 CHAPTER12MULTIPLEACCESS
case.The leftmoststationAsendsaframeattime tl'whichreachestherightmoststa­
tionDattime
tl+T
p
.
Thegrayareashowsthevulnerableareaintimeandspace.
PersistenceMethods
Whatshouldastationdo ifthechannelisbusy?Whatshouldastationdoifthechannel
isidle?Threemethodshavebeendevisedtoanswerthesequestions:theI-persistent
method,thenonpersistentmethod,andthep-persistentmethod.Figure12.10showsthe
behavior
ofthreepersistencemethodswhenastationfindsachannelbusy.
Figure12.10 Behaviorofthreepersistencemethods
Sense
andtransmit
~I ------~~ :-Time
Busy
3.I-persistent
Sense
Sense
andtransmit
Sense
I~:.::::::::w;::::a::::it:::::,~------,w..:..::a::..:.it 't
~C_===.===!:=J=::J.r------------~ ..Time
Busy
b.Nonpersistent
Transmit
I I I
l l
---------------)..~Time
Probabilityoutcome
doesnotallowtransmission.
I I I
Continuouslysense I I I
~
ITimeslotITimeslotITimeslot
I-I .1III .1.
Busy
c.p-persistent
Figure12.11showsthe flowdiagramsforthesemethods.
I-PersistentTheI-persistentmethod issimpleandstraightforward. Inthismethod,
afterthestationfindsthelineidle,itsendsitsframeimmediately(withprobabilityI).
Thismethodhasthehighestchance
ofcollisionbecausetwoormorestationsmayfind
thelineidleandsendtheirframesimmediately.
WewillseeinChapter 13thatEthernet
usesthismethod.
NonpersistentInthenonpersistentmethod, astationthathasaframetosend
sensestheline.Ifthelineisidle,itsendsimmediately.
Ifthelineisnotidle,itwaitsa

SECTION12.1RANDOMACCESS 373
Figure12.11 Flowdiagram forthreepersistencemethods
Stationcantransmit.
a.1-persistent
Useback-offprocess
asthoughcollisionoccurred.
c.p-persistent
Stationcantransmit.
b.Nonpersistent
Idle
Stationcantransmit.
randomamount oftime andthensensesthelineagain.Thenonpersistentapproach
reducesthechance
ofcollisionbecauseitisunlikelythattwoormorestationswillwait
thesameamount
oftimeandretrytosendsimultaneously.However,thismethod
reducestheefficiencyofthenetworkbecausethemediumremainsidlewhentheremay
bestationswithframestosend.
p-PersistentThep-persistentmethod isusedifthechannelhastimeslotswithaslot
durationequaltoorgreaterthanthemaximumpropagationtime.Thep-persistentapproach
combinestheadvantages
oftheothertwostrategies.Itreducesthechanceofcollisionand
improvesefficiency.
Inthismethod,afterthestationfindsthelineidleitfollowsthesesteps:
1.Withprobabilityp,thestationsendsitsframe.
2.Withprobabilityq=1 -p,thestationwaitsforthebeginning ofthenexttimeslot
andchecksthelineagain.
a.Iftheline isidle,itgoestostep 1.
b.Ifthelineisbusy,itactsasthoughacollisionhasoccurredandusestheback­
offprocedure.
CarrierSenseMultipleAccesswithCollisionDetection(CSMA/CD)
TheCSMAmethoddoesnotspecifytheprocedurefollowingacollision.Carriersense
multipleaccesswithcollisiondetection(CSMA/CD)augmentsthealgorithmtohandle
thecollision.

374 CHAPTER12MULTIPLEACCESS
Inthismethod,astationmonitorsthemediumafteritsendsaframetosee ifthe
transmissionwassuccessful.
Ifso,thestationisfinished. If,however,thereisacolli­
sion,theframeissentagain.
TobetterunderstandCSMA/CD,let uslookatthefirstbitstransmittedbythetwo
stationsinvolvedinthecollision.Althougheachstationcontinuestosendbitsinthe
frameuntilitdetectsthecollision,weshowwhathappensasthefirstbitscollide.In
Figure12.12,stationsAandCareinvolvedinthecollision.
Figure12.12CollisionofthefirstbitinCSMAlCD
FirstbitofA
~_----FFii;'rs;;t b;it~(JfC C'scollris-io--n;;";;';;"':"':":~l
detectionand
Collisionabortion
occursA'scollision
detection
andabortion
[
t
l
Transmission
time
1
4
Time Time
Attimet1,stationAhasexecuteditspersistenceprocedureandstartssendingthe
bits
ofitsframe.Attime t2,stationChasnotyetsensedthefirstbitsentby A.StationC
executesitspersistenceprocedureandstartssendingthebitsinitsframe,whichpropa­
gatebothtotheleftandtotheright.Thecollisionoccurssometimeaftertime
t2'StationC
detectsacollisionattime
t3whenitreceivesthefirstbit ofA'sframe.StationCimmedi­
ately(orafterashorttime,butweassumeimmediately)abortstransmission.StationA
detectscollisionattime
t4whenitreceivesthefirstbit ofC'sframe;italsoimmediately
abortstransmission.Lookingatthefigure,weseethatAtransmitsfortheduration
t4-tl;
Ctransmitsfortheduration t3-t2' Laterweshowthat,fortheprotocoltowork,the
length
ofanyframedivided bythebitrateinthisprotocolmustbemorethaneither of
thesedurations.Attime t4,thetransmissionof
A:sframe,thoughincomplete,isaborted;
attime
t
3
,
thetransmissionofB'sframe,thoughincomplete,isaborted.
Nowthatweknowthetimedurationsforthetwotransmissions,wecanshowa
morecompletegraphinFigure12.13.
MinimumFrameSize
ForCSMAlCDtowork,weneedarestrictionontheframesize.Beforesendingthelast
bit
oftheframe,thesendingstationmustdetectacollision, ifany,andabortthetransmis­
sion.Thisissobecausethestation,oncetheentireframeissent,doesnotkeepacopyof
theframeanddoesnotmonitorthelineforcollisiondetection.Therefore,theframetrans­
missiontime
Tfrmust beatleasttwotimesthemaximumpropagationtime T
p
.
Tounder­
standthereason,letusthinkabouttheworst-casescenario.
Ifthetwostationsinvolvedin
acollisionarethemaximumdistanceapart,thesignalfromthefirsttakestime
T
p
toreach
thesecond,andtheeffect
ofthecollisiontakesanothertime Tptoreachthefirst.Sothe
requirementisthatthefirststationmuststillbetransmitting after
2T
p
.

SECTION12.1RANDOMACCESS 375
Figure12.13Collisionandabortion inCSMAlCD
Collision
Transmission
[1[
~~;!~~i~~i~~~~I~~~~112 ]~ransmission
tIme 1
3tIme
t4*~~
Adetects
collisionand
aborts
Time
Cdetects
collision
andaborts Time
Example12.5
Anetworkusing CSMA/CDhasabandwidth of10Mbps.Ifthemaximumpropagationtime
(includingthedelaysinthedevicesandignoringthetimeneeded
tosendajammingsignal,aswe
seelater)
is
25.611S,whatistheminimumsize oftheframe?
Solution
Theframetransmissiontimeis T
fr=2 xT
p=51.2~s.Thismeans,intheworstcase,astation
needs
totransmitforaperiod of51.2
~stodetectthecollision.Theminimumsize oftheframe
is
10Mbpsx51.2
!-ls=512bitsor64bytes.Thisisactuallytheminimumsize oftheframefor
StandardEthernet,
aswewillseeinChapter 13.
Procedure
Nowlet uslookattheflowdiagramfor CSMAlCDinFigure12.14.Itissimilartothe
onefortheALOHAprotocol,buttherearedifferences.
Thefirstdifferenceistheaddition
ofthepersistenceprocess. Weneedtosensethe
channelbeforewestartsendingtheframebyusingone
ofthepersistenceprocesseswe
discussedpreviously(nonpersistent,I-persistent,orp-persistent).Thecorresponding
boxcanbereplacedbyone
ofthepersistenceprocessesshowninFigure 12.11.
Theseconddifferenceistheframetransmission.InALOHA,wefirsttransmitthe
entireframeandthenwaitforanacknowledgment.In
CSMA/CD,transmissionand
collisiondetectionisacontinuousprocess.
Wedonotsendtheentireframeandthen
lookforacollision.Thestationtransmitsandreceivescontinuouslyandsimultaneously
(usingtwodifferentports).
Weusealooptoshowthattransmissionisacontinuous
process.
Weconstantlymonitorinordertodetectone oftwoconditions:eithertrans­
missionisfinishedoracollisionisdetected.Eithereventstopstransmission.Whenwe
comeout
oftheloop,ifacollisionhasnotbeendetected, itmeansthattransmissionis
complete;theentireframeistransmitted.Otherwise,acollisionhasoccurred.
Thethirddifferenceisthe sending
ofashortjammingsignalthatenforcesthecolli­
sionincaseotherstationshavenotyetsensedthecollision.
EnergyLevel
Wecansaythatthelevel ofenergyinachannelcanhavethreevalues:zero,normal,
andabnormal.Atthezerolevel,thechannelisidle.
Atthenormallevel,astationhas

376 CHAPTER 12MULTIPLEACCESS
Figure12.14 FlowdiagramfortheCSMAlCD
K:Numberofattempts
T
p
:
Maximumpropagationtime
T
fr
:Averagetransmissiontimeforaframe
Tn:Back-offtime
Stationhas
a
frametosend
Applyone
ofthe
persistencemethods
(I-persistent,nonpersistent,
orp-persistent)
WaitTBtime
(T
B
=Rxr"orRXT
fr
)
Choosearandom
number
Rbetween
oand2
K
-l
K
ma
\
is
normally15
K=K+I
Eligihlcfurtransmission
Send
a
jamming
signal
successfullycapturedthechannelandissendingitsframe.Attheabnormallevel,there
isacollisionandthelevel oftheenergyistwicethenormallevel.Astationthathasa
frametosendorissendingaframeneedstomonitortheenergyleveltodetermine
if
thechannelisidle,busy,orincollisionmode.Figure12.15showsthesituation.
Figure12.15 Energylevelduringtransmission,idleness, orcollision
Energy
Collision
Frametransmission
Idle
Frametransmission
Time
Throughput
ThethroughputofCSMAlCDisgreaterthanthat ofpureorslottedALOHA.Themaxi­
mumthroughputoccursatadifferentvalue
ofG andisbasedonthepersistencemethod

SECTION12.1RANDOMACCESS 377
andthevalue ofpinthep-persistentapproach.ForI-persistentmethodthemaximum
throughputisaround50percentwhenG
=1.Fornonpersistentmethod,themaximum
throughputcangoupto90percentwhenGisbetween3and
8.
CarrierSenseMultipleAccesswith
CollisionAvoidance(CSMA/CA)
Thebasicideabehind CSMA/CDisthatastationneedstobeabletoreceivewhile
transmittingtodetectacollision.Whenthereisnocollision,thestationreceivesone
signal:itsownsignal.Whenthereisacollision,thestationreceivestwosignals:itsown
signalandthesignaltransmittedbyasecondstation.
Todistinguishbetweenthesetwo
cases,thereceivedsignalsinthesetwocasesmustbesignificantlydifferent.Inother
words,thesignalfromthesecondstationneedstoaddasignificantamount
ofenergyto
theonecreatedbythefirststation.
Inawirednetwork,thereceivedsignalhasalmostthesameenergy
asthesentsig­
nalbecauseeitherthelength
ofthecableisshortortherearerepeatersthatamplifythe
energybetweenthesenderandthereceiver.Thismeansthatinacollision,thedetected
energyalmostdoubles.
However,inawirelessnetwork,muchofthesentenergyislostintransmission.The
receivedsignalhasverylittleenergy.Therefore,acollisionmayaddonly5to10percent
additionalenergy.This
isnotusefulforeffectivecollisiondetection.
Weneedtoavoidcollisionsonwirelessnetworksbecausetheycannotbedetected.
Carriersensemultipleaccesswithcollisionavoidance
(CSMAlCA)wasinventedforthis
network.Collisionsareavoidedthroughtheuse
ofCSMAICA'sthreestrategies:theinter­
framespace,thecontentionwindow,andacknowledgments,
asshowninFigure12.16.
Figure12.16TiminginCSMAICA
Size:
-Found
idle l1Jillill1binaryexponential
~~~u~,'i ~'~~l. ~. ~__-----,
~ L-. -'HC==:J~
Busy Contentionwindow SendframeTime-outTime
InterframeSpace(IFS)
First,collisionsareavoidedbydeferringtransmissioneven ifthechannelisfoundidle.
Whenanidlechannel
isfound,thestationdoesnotsendimmediately. Itwaitsfora
period
oftimecalledthe interframespaceorIFS.Eventhoughthechannelmay
appearidlewhenitissensed,adistantstationmayhavealreadystartedtransmitting.
Thedistantstation'ssignalhasnotyetreachedthisstation.TheIFStimeallowsthe
front
ofthetransmittedsignalbythedistantstationtoreachthisstation. IfaftertheIFS
timethechannelisstillidle,thestationcansend,butitstillneedstowaitatimeequal
tothecontentiontime(describednext).TheIFSvariablecanalsobeusedtoprioritize

378 CHAPTER12MULTIPLEACCESS
stationsorframetypes.Forexample,astationthatisassignedashorterIFShasa
higherpriority.
InCSMAlCA,theIFScanalsobeusedtodefine
thepriorityofastation
oraframe.
ContentionWindow
Thecontentionwindowisanamount oftimedividedintoslots.Astationthat isready
tosendchoosesarandomnumber
ofslotsasitswaittime.Thenumber ofslotsinthe
windowchangesaccordingtothebinaryexponentialback-offstrategy.Thismeansthat
itisset
tooneslotthefirsttimeandthendoubleseachtimethestationcannotdetectan
idlechannelaftertheIFStime.Thisisverysimilartothep-persistentmethodexcept
thatarandomoutcomedefinesthenumber
ofslotstakenbythewaitingstation.One
interestingpointaboutthecontentionwindowisthatthestationneedstosensethe
channelaftereachtimeslot.However,
ifthestationfindsthechannelbusy,itdoesnot
restarttheprocess;itjuststopsthetimerandrestartsitwhenthechannel
issensedas
idle.Thisgivesprioritytothestationwiththelongestwaitingtime.
InCSMAlCA,ifthestationfindsthechannelbusy,
itdoesnotrestartthetimer
ofthecontentionwindow;
itstopsthetimerandrestartsitwhenthechannelbecomesidle.
Acknowledgment
Withalltheseprecautions,therestillmaybeacollisionresultingindestroyeddata.
Inaddition,thedatamaybecorruptedduringthetransmission.Thepositiveacknowl­
edgmentandthetime-outtimercanhelpguaranteethatthereceiverhasreceivedthe
frame.
Procedure
Figure12.17showstheprocedure.Notethatthechannelneedstobesensedbeforeand
aftertheIFS.Thechannelalsoneedstobesensedduringthecontentiontime.Foreach
timeslotofthecontentionwindow,thechannel
issensed.Ifitisfoundidle,thetimer
continues;
ifthechannelisfoundbusy,thetimerisstoppedandcontinuesafterthe
timerbecomesidleagain.
CSMAICAandWirelessNetworks
CSMAICAwasmostlyintendedforuseinwirelessnetworks.Theproceduredescribed
above,however,isnotsophisticatedenoughtohandle someparticularissuesrelatedto
wirelessnetworks,suchashiddenterminalsorexposedterminals.Wewillseehow
theseissuesaresolvedbyaugmentingtheaboveprotocolwithhand-shakingfeatures.
Theuse
ofCSMNCAinwirelessnetworkswillbediscussedinChapter 14.

SECTION12.2CONTROLLEDACCESS 379
Figure12.17 FlowdiagramforCSMAICA
12.2
Contentionwindow
sizeis
ZK-1.
Aftereachslot, ifidle,
continue;ifbusy,halt
and
continuewhenidle.
No
K=K+I
CONTROLLED ACCESS
Choosearandom
number
Rbetween
oandZK-I
Incontrolledaccess, thestationsconsultoneanothertofindwhichstationhastheright
tosend.Astationcannotsendunlessithasbeenauthorized
byotherstations.Wediscuss
threepopularcontrolled-accessmethods.
Reservation
Inthereservationmethod,astationneedstomakeareservationbeforesendingdata.
Timeisdividedintointervals.Ineachinterval,areservationframeprecedesthedata
framessentinthatinterval.

380 CHAPTER 12MULTIPLEACCESS
Ifthereare Nstationsinthesystem,thereareexactly Nreservationminislotsinthe
reservationframe.Eachminislotbelongstoastation.Whenastationneedstosenda
dataframe,itmakesareservationinitsownminislot.Thestationsthathavemaderes­
ervationscansendtheirdataframesafterthereservationframe.
Figure12.18showsasituationwithfivestationsandafive-minislotreservation
frame.Inthefirstinterval,onlystations
1,3,and4havemadereservations.Inthesec­
ondinterval,onlystation1hasmadeareservation.
Figure12.18 Reservationaccessmethod
1 23451 234512345
B!m,.------,r,....,--,----,---,,------,r------,'--.-_-J'-T.L...J..,..J-rI-l
Reservation
frame
Polling
Pollingworkswithtopologiesinwhichonedeviceisdesignated asaprimarystation
andtheotherdevicesare secondarystations.Alldataexchangesmustbemade
throughtheprimarydeviceevenwhentheultimatedestination
isasecondarydevice.
Theprimarydevicecontrolsthelink;thesecondarydevicesfollowitsinstructions.
It
isuptotheprimarydevicetodeterminewhichdeviceisallowedtousethechannelat
agiventime.Theprimarydevice,therefore,isalwaystheinitiator
ofasession(see
Figure12.19).
Figure12.19 Selectandpollfunctionsinpollingaccessmethod
Poll
1....------1ACK1------,
Primary Primary
SELr-----'~
1-+----""1ACK1-----""1
Select
r------lDatar----l~
Iftheprimarywantstoreceivedata,itasksthesecondaries iftheyhaveanythingto
send;thisiscalledpollfunction.Iftheprimarywantstosenddata,ittellsthesecondary
togetreadytoreceive;thisiscalledselectfunction.

SECTION12.2CONTROLLEDACCESS 381
Select
Theselectfunctionisusedwhenevertheprimarydevicehassomethingtosend.
Rememberthattheprimarycontrolsthelink.
Iftheprimaryisneithersendingnor
receivingdata,itknowsthelinkisavailable.
Ifithassomethingtosend,theprimarydevicesendsit.Whatitdoesnotknow,
however,iswhetherthetargetdeviceispreparedtoreceive.Sotheprimarymustalert
thesecondarytotheupcomingtransmissionandwaitforanacknowledgment
ofthe
secondary'sreadystatus.Beforesendingdata,theprimarycreatesandtransmitsa
select(SEL)frame,onefield
ofwhichincludestheaddress oftheintendedsecondary.
Poll
Thepollfunctionisusedbytheprimarydevicetosolicittransmissionsfromthesec­
ondarydevices.Whentheprimaryisreadytoreceivedata,itmustask(poll)each
deviceinturn
ifithasanythingtosend.Whenthefirstsecondaryisapproached,it
respondseitherwithaNAKframe
ifithasnothingtosendorwithdata(intheform of
adataframe) ifitdoes.Iftheresponseisnegative(aNAKframe),thentheprimary
pollsthenextsecondaryinthesamemanneruntilitfindsonewithdatatosend.When
theresponseispositive(adataframe),theprimaryreadstheframeandreturnsan
acknowledgment(ACKframe),verifyingitsreceipt.
TokenPassing
Inthetoken-passingmethod,thestationsinanetworkareorganizedinalogicalring.
Inotherwords,foreachstation,thereisa
predecessorandasuccessor.Thepredecessor
isthestationwhichislogicallybeforethestationinthering;thesuccessoristhestation
whichisafterthestationinthering.Thecurrentstationistheonethatisaccessingthe
channel
now.Therighttothisaccesshasbeenpassedfromthepredecessortothecur­
rentstation.Therightwillbepassedtothesuccessorwhenthecurrentstationhasno
moredatatosend.
Buthowistherighttoaccessthechannelpassedfromonestationtoanother?In
thismethod,aspecialpacketcalleda
tokencirculatesthroughthering.Theposses­
sion
ofthetokengivesthestationtherighttoaccessthechannelandsenditsdata.
Whenastationhassomedatatosend,itwaitsuntilitreceivesthetokenfromitspre­
decessor.
Itthenholdsthetokenandsendsitsdata.Whenthestationhasnomoredata
tosend,itreleasesthetoken,passingittothenextlogicalstationinthering.Thesta­
tioncannotsenddatauntilitreceivesthetokenagaininthenextround.Inthisprocess,
whenastationreceivesthetokenandhasnodatatosend,itjustpasses thedatatothe
nextstation.
Tokenmanagement
isneededforthisaccessmethod.Stationsmustbelimitedin
thetimetheycanhavepossessionofthetoken.Thetokenmustbemonitoredtoensure
ithasnotbeenlostordestroyed.Forexample,
ifastationthatisholdingthetokenfails,
thetokenwilldisappearfromthenetwork.Anotherfunction
oftokenmanagementis
toassignprioritiestothestationsandtothetypes
ofdatabeingtransmitted.Andfinally,
tokenmanagementisneededtomakelow-prioritystationsreleasethetokentohigh­
prioritystations.

382 CHAPTER 12MULTIPLEACCESS
LogicalRing
Inatoken-passingnetwork,stationsdonothavetobephysicallyconnectedinaring;
theringcanbealogicalone.Figure12.20showfourdifferentphysicaltopologiesthat
cancreatealogicalring.
Figure12.20 Logicalring andphysicaltopologyintoken-passingaccessmethod
a.Physicalring
1
1
1
1
1
1
1
1-
c.Busring
b.Dualring
d. Starring
Inthephysicalringtopology,whenastationsendsthetokentoitssuccessor,the
tokencannotbeseenbyotherstations;thesuccessoristhenextoneinline.Thismeans
thatthetokendoesnothavetohavetheaddress
ofthenextsuccessor.Theproblemwith
thistopologyisthat
ifoneofthelinks-themediumbetweentwoadjacent stations­
fails,thewholesystemfails.
Thedualringtopologyusesasecond(auxiliary)ringwhichoperatesinthereverse
directioncomparedwiththemainring.Thesecondring
isforemergenciesonly(such as
asparetireforacar).Ifoneofthelinksinthemainringfails,thesystemautomatically
combinesthetworingstoformatemporaryring.Afterthefailedlinkisrestored,the
auxiliaryringbecomesidleagain.Notethatforthistopology
towork,eachstationneeds
tohavetwotransmitterportsandtworeceiverports.Thehigh-speedTokenRingnetworks
calledFDDI(FiberDistributedDataInterface)andCDDI(CopperDistributedData
Interface)usethistopology.
Inthebusringtopology,alsocalledatokenbus,thestationsareconnectedtoasin­
glecablecalledabus.They,however,makealogicalring,becauseeachstationknows
theaddress
ofitssuccessor(andalsopredecessorfortokenmanagementpurposes).
Whenastationhasfinishedsendingitsdata,itreleasesthetokenandinsertstheaddress
of
itssuccessorinthetoken.Onlythestationwiththeaddressmatchingthedestination
address
ofthetokengetsthetokentoaccessthesharedmedia.TheTokenBusLAN,
standardizedbyIEEE,usesthistopology.
Inastarringtopology,thephysicaltopologyisastar.There
isahub,however,that
acts
astheconnector.Thewiringinsidethehubmakesthering;thestationsarecon­
nectedtothisringthroughthetwowireconnections.Thistopologymakesthenetwork

SECTION12.3CHANNELIZATION 383
lesspronetofailurebecause ifalinkgoesdown,itwillbebypassedbythehubandthe
rest
ofthestationscanoperate.Alsoaddingandremovingstationsfromthering iseasier.
ThistopologyisstillusedintheTokenRingLANdesigned
byIBM.
12.3CHANNELIZATION
Channelizationisamultiple-accessmethodinwhichtheavailablebandwidth ofalink
issharedintime,frequency,orthroughcode,betweendifferentstations.Inthissection,
wediscussthreechannelizationprotocols:FDMA,TDMA,andCDMA.
Weseetheapplicationofallthesemethodsin Chapter16
whenwediscusscellularphonesystems.
Frequency-DivisionMultipleAccess(FDMA)
Infrequency-divisionmultipleaccess(FDMA),theavailablebandwidthisdivided
intofrequencybands.Eachstationisallocatedabandtosenditsdata.Inotherwords,
eachbandisreservedforaspecificstation,anditbelongs
tothestationallthetime.
Eachstationalsousesabandpassfiltertoconfinethetransmitterfrequencies.
Topre­
ventstationinterferences,theallocatedbandsareseparatedfromoneanotherbysmall
guardbands. Figure12.21showstheidea ofFDMA.
Figure12.21Frequency-divisionmultipleaccess(FDMA)
Data Data
Silent
f~ •••
~
t
f~C
--------_______.J
_______ .J•••
--------
t
Data
"I
f~
--------
========_______.J•••
-------­
_______..J
-.--,--"----
t
Common
channel
Data
InFDMA,theavailablebandwidth ofthecommonchannel
isdividedintobands
thatareseparatedby guardbands.

384 CHAPTER 12MULTIPLEACCESS
FDMAspecifiesapredeterminedfrequencybandfortheentireperiod ofcommu­
nication.Thismeansthatstreamdata(acontinuousflow
ofdatathatmaynotbepack­
etized)caneasilybeusedwithFDMA.
WewillseeinChapter16howthisfeaturecan
beusedincellulartelephonesystems.
WeneedtoemphasizethatalthoughFDMAandFDMconceptuallyseemsimilar,
therearedifferencesbetweenthem.FDM,aswesawinChapter6,
isaphysicallayer
techniquethatcombinestheloadsfromlow-bandwidthchannelsandtransmitsthemby
usingahigh-bandwidthchannel.Thechannelsthatarecombinedarelow-pass.The
multiplexermodulatesthesignals,combinesthem,andcreatesabandpasssignal.The
bandwidth
ofeachchannelisshiftedbythemultiplexer.
FDMA,ontheotherhand,
isanaccessmethodinthedatalinklayer.Thedatalink
layerineachstationtellsitsphysicallayertomakeabandpasssignalfromthedata
passed
toit.Thesignalmustbecreatedintheallocatedband.Thereis nophysicalmul­
tiplexeratthephysicallayer.Thesignalscreatedateachstationareautomatically
bandpass-filtered.Theyaremixedwhentheyaresenttothecommonchannel.
Time-DivisionMultipleAccess(TDMA)
Intime-divisionmultipleaccess(TDMA), thestationssharethebandwidth ofthe
channelintime.Eachstationisallocatedatimeslotduringwhichitcansenddata.
Eachstationtransmitsitsdatainisassignedtimeslot.Figure12.22showstheidea
behindTDMA.
Figure12.22 Time-divisionmultipleaccess(TDMA)
Data Data
f
~-.;"-I,--
I::::I···
IIII,r
f
-, II
, "
, IIII···
t I'II
Data
Common
channel
f
I
I :•••
,'
Silent
f
-I~-ll-­
II II
IJIII
IIIII
Data
ThemainproblemwithTDMAliesinachievingsynchronizationbetweenthedifferent
stations.Eachstationneedstoknowthebeginning
ofitsslotandthelocation ofitsslot.
Thismaybedifficultbecause
ofpropagationdelaysintroducedinthesystem ifthesta­
tionsarespreadoveralargearea.
Tocompensateforthedelays,wecaninsert guard

SECTION12.3CHANNELIZATION 385
times.Synchronizationisnormallyaccomplishedbyhavingsomesynchronizationbits
(normallyrefenedtoaspreamblebits)atthebeginning
ofeachslot.
InTDMA,thebandwidthis justonechannelthatis
timesharedbetweendifferentstations.
WealsoneedtoemphasizethatalthoughTDMAandTDMconceptuallyseemthe
same,therearedifferencesbetweenthem.TDM,aswesawinChapter6,isaphysical
layer techniquethatcombinesthedatafromslowerchannelsandtransmitsthemby
usingafasterchannel.Theprocessusesaphysicalmultiplexerthatinterleavesdata
unitsfromeachchannel.
TDMA,ontheotherhand,isanaccessmethodinthedatalinklayer.Thedatalink
layerineachstationtellsitsphysicallayertousetheallocatedtimeslot.Thereisno
physicalmultiplexeratthephysicallayer.
Code-DivisionMultipleAccess(CDMA)
Code-divisionmultipleaccess(CDMA)wasconceivedseveraldecadesago.Recent
advancesinelectronictechnologyhavefinallymadeitsimplementationpossible.
CDMAdiffersfromFDMAbecauseonlyonechanneloccupiestheentirebandwidth
of
thelink.ItdiffersfromTDMAbecauseallstationscansenddatasimultaneously;there
isnotimesharing.
InCDMA,onechannelcarriesalltransmissionssimultaneously.
Analogy
Letusfirstgiveananalogy.CDMAsimplymeanscommunicationwithdifferentcodes.
Forexample,
inalargeroomwithmanypeople,twopeoplecantalkinEnglish if
nobodyelseunderstandsEnglish.AnothertwopeoplecantalkinChinese iftheyare
theonlyoneswhounderstandChinese,andsoon.Inotherwords,thecommonchannel,
thespace
oftheroominthiscase,caneasilyallowcommunicationbetweenseveral
couples,butindifferentlanguages(codes).
Idea
Letusassumewehavefourstations 1,2,3,and4connectedtothesamechannel.The
datafromstation1are
d
l
,
fromstation2are d
2
,
andsoon.Thecodeassignedtothe
firststationis
cI,tothesecondis c2,andsoon.Weassumethattheassignedcodeshave
twoproperties.
1.Ifwemultiplyeachcodebyanother,weget O.
2.Ifwemultiplyeachcodebyitself,weget4(thenumber ofstations).
Withthesetwopropertiesinmind,letusseehowtheabovefourstationscansenddata
usingthesamecommonchannel,
asshowninFigure12.23.
Station1mUltiplies(aspecialkind
ofmultiplication,aswewillsee)itsdatabyits
codetogetd
l
.
Cl'Station2multipliesitsdatabyitscodetoget d
2
.c2'
Andsoon.The

386 CHAPTER 12MULTIPLEACCESS
Figure12.23 Simpleidea ofcommunicationwithcode
Id,'(',+d2•c2+d3•('3+d4•('4I
Data
Common
channel
datathatgoonthechannelarethe sumofalltheseterms,asshowninthebox.Any
stationthatwants toreceivedatafromone
oftheotherthreemultipliesthedataonthe
channelbythecode
ofthesender.Forexample,supposestations1and2aretalkingto
eachother.Station2wantstohearwhatstationIissaying.
Itmultipliesthedataonthe
channel
bycl'thecodeofstation1.
Because(cl.cl)is4,but (c2.cI),(c3.cI),and(c4.cl)areallOs,station2divides
theresultby4togetthedatafromstation
1.
data=(d}
.Cj+d
z
.
Cz+d
3
.
C3+d
4
.
c4).Cl
=dj•Cl.Cj+dz.
Cz.Cl+d
3
.
C3.Cl+d
4
.
C4'CI=4Xd
1
Chips
CDMAisbasedoncodingtheory.Eachstationisassignedacode,whichisasequence
ofnumberscalledchips,asshowninFigure12.24. Thecodesarefortheprevious
example.
Figure12.24 Chipsequences
C
3
I[+1+1+1+11I1[+1-1+1-I)II[+1+\-I-11II[+\-1-1+IJI
Laterinthischapterweshowhowwechosethesesequences.Fornow,weneedto
knowthatwe
didnotchoosethesequencesrandomly;theywerecarefullyselected.
Theyarecalled
orthogonalsequences andhavethefollowingproperties:
1.Eachsequence ismadeofNelements,where Nisthenumber ofstations.

SECTION12.3CHANNELIZATION 387
2.Ifwemultiplyasequencebyanumber,everyelementinthesequenceismultiplied
bythatelement.Thisiscalledmultiplication
ofasequencebyascalar.Forexample,
2.[+1+1-1-1]=[+2+2-2-2]
3.Ifwemultiplytwoequalsequences,elementbyelement,andaddtheresults,we
get
N,whereNisthenumber ofelementsintheeachsequence.Thisiscalledthe
innerproductoftwoequalsequences.Forexample,
[+1+1-1
-n·[+1+1-1-1]= 1 + 1 + 1 + 1 = 4
4.Ifwemultiplytwodifferentsequences,elementbyelement,andaddtheresults,
weget
O.Thisiscalledinnerproduct oftwodifferentsequences.Forexample,
[+1+1
-1-1]•[+1+1+1+1]= 1 + 1-1-1 = 0
5.Addingtwosequencesmeansaddingthecorrespondingelements.Theresultis
anothersequence.Forexample,
[+1+1-1-1]+[+1+1+1+1]=[+2+200]
DataRepresentation
Wefollowtheserulesforencoding: Ifastationneedstosenda 0bit,itencodesitas -1;
ifitneedstosenda 1bit,itencodesit as+1.Whenastation isidle,itsendsnosignal,
whichisinterpretedasa
O.TheseareshowninFigure12.25.
Figure12.25DatarepresentationinCDMA
I
Databit0--.~-IIIDatabitI----1.~ +1I!Silence----I.~ 0I
EncodingandDecoding
Asasimpleexample,weshowhowfourstationssharethe linkduringaI-bitinterval.
Theprocedurecaneasilyberepeatedforadditionalintervals.
Weassumethatstations1
and2aresendinga 0bitandchannel4issendinga 1bit.Station3issilent.Thedataat
thesendersitearetranslatedto
-1, -1,0,and+1.Eachstationmultipliesthecorrespond­
ingnumberbyitschip(itsorthogonalsequence),whichisuniqueforeachstation.The
result
isanewsequencewhichissenttothechannel.Forsimplicity,weassumethatall
stationssendtheresultingsequencesatthesametime.Thesequenceonthechannelis
thesum
ofallfoursequences asdefinedbefore.Figure12.26showsthesituation.
Nowimaginestation3,whichwesaid
issilent,islistening tostation2.Station3mul­
tipliesthetotaldataonthechannelbythecodeforstation2,whichis
[+1-1+1-1],toget
[-1-1-3+1]·[+1-1+1-1]=-4/4=-1
......bit1

388 CHAPTER 12MULTIPLEACCESS
Figure12.26SharingchannelinCDMA
Bita Bita
C
1
1+1+1+1+IJ
d
1

c
1
[-1-I-I-I]
C
2
1+1-I+1-1]
[-1-1-3+1]
Data
Common
channel
c
.-
[+1+1-1-11
C
4
1+1-I-1+11
Silent Bit1
SignalLevel
Theprocesscanbebetterunderstood
ifweshowthedigitalsignalproducedbyeach
stationandthedatarecoveredatthedestination(seeFigure12.27).Thefigureshowsthe
correspondingsignalsforeachstation(usingNRZ-Lforsimplicity)andthesignalthat
isonthecommonchannel.
Figure12.27Digitalsignalcreatedby fourstationsinCDMA
BitO
~ 1-1-1-I-I]
BitO~ 1-1+1-I+1]
Silent~ [00 0 0]
BitI~ 1+1-I-I+1]
Dataonthechannel
Time
Time
Time
Time
Time
Figure12.28showshowstation3candetectthedatasentbystation2byusingthe
codeforstation
2.Thetotaldataonthechannelaremultiplied(innerproductopera­
tion)bythesignalrepresentingstation2chipcodetogetanewsignal.Thestationthen
integratesandaddstheareaunderthesignal,
togetthevalue -4,whichisdividedby4
andinterpretedasbit
O.

SECTION12.3CHANNELIZATION 389
Figure12.28 Decodingofthecompositesignal foroneinCDMA
Dataonthechannel
Time
Station
2'scode
m [+1-I+1-1]
Innerproductresult
Summingthevalues
Time
Time
Time
-4
~-4/4~-I~BitO
SequenceGeneration
Togeneratechipsequences,weusea Walshtable, whichisatwo-dimensionaltablewith
anequalnumber
ofrowsandcolumns,asshowninFigure12.29.
Figure12.29 Generalrule andexamplesofcreatingWalshtables
a.Twobasicrules
WI=
[+1J
+1+1 +1+1
+1-1+1-1
W
4=
[+1+1J
+1 +1 -1 -1
Wz=
+1-1 +1-1-1+1
b.GenerationofWI' Wz,andW
4
IntheWalshtable,eachrow isasequenceofchips.WIforaone-chipsequencehas
onerowandonecolumn.
Wecanchoose-lor+1forthechipforthistrivialtable(we
chose
+1).AccordingtoWalsh, ifweknowthetablefor NsequencesWN'wecancreate
thetablefor
2NsequencesW
2N
,asshowninFigure12.29.The W
Nwiththeoverbar W
N
standsforthecomplement ofWN'whereeach +1ischangedto -1andviceversa.
Figure12.29alsoshowshowwecancreate
W
2andW
4fromWI'Afterweselect WI,W
2

390 CHAPTER12MULTIPLEACCESS
canbemadefromfour Wj's,withthelastonethecomplement ofWl'AfterW
2
isgener­
ated,
W
4canbemade offourW
2's,withthelastonethecomplement ofW
2
.
Ofcourse,
W
s
iscomposedoffourW
4
's,andsoon.Note thatafter W
N
ismade,eachstation is
assignedachipcorresponding toarow.
Somethingweneedtoemphasizeisthatthenumber ofsequencesNneedstobea
power
of2.Inotherwords,weneedtohave N=2
m
.
ThenumberofsequencesinaWalshtableneedstobeN=2
m
.
Example12.6
Findthechipsforanetworkwith
a.Twostations
b.Fourstations
Solution
Wecanusetherowsof W
2
andW
4
inFigure12.29:
a.Foratwo-stationnetwork,wehave[+1 + 1]and[+1 -1].
b.Forafour-stationnetworkwehave [+1+1+1+1],[+1-1+1-1],[+1+1-1
-1],and
[+1-1-1+1].
Example12.7
Whatisthenumber ofsequencesifwehave90stationsinournetwork?
Solution
Thenumber ofsequencesneedstobe 2
m
.
Weneedtochoose m=7andN=2
7
or128.Wecan
thenuse90
ofthesequencesasthechips.
Example12.8
Provethatareceivingstationcangetthedatasentbyaspecificsenderifitmultipliestheentire
dataonthechannelbythesender'schipcodeandthendividesitbythenumber
ofstations.
Solution
Letusprovethisforthefirststation,usingourpreviousfour-stationexample. Wecansaythatthe
dataonthechannelD
=Cd
l
.
("1+d
2
.
("2+d
3
.
("3+d
4
.
("4)'Thereceiverwhichwantstogetthe
datasentbystationImultipliesthesedataby
("I'
D.("1=(d
1

("1+d
2
.
("2+d
3
.
("3+d
4
.
("4). ("1
=d
1
.
("1.("1+d
2
.
("2. ("1+d
3
.
("3.("1+d
4
.
("4. ("1
=dI XN+d
2
X0+d
3
X0+d
4
X0
=d
lxN
Whenwedividetheresultby N,wegetdI'
12.4RECOMMENDED READING
Formoredetailsaboutsubjectsdiscussedinthischapter,werecommendthefollowing
books.Theitemsinbrackets[
...Jrefertothereferencelistattheend ofthetext.

SECTION12.6SUMMARY 391
Books
Multipleaccess isdiscussedinChapter4 of[Tan03],Chapter16of[Sta04],Chapter6 of
[GW04],andChapter8 of[For03].Moreadvancedmaterialscanbefoundin[KMK04].
12.5KEYTERMS
I-persistentmethod
ALOHA
binaryexponentialbackup
carriersensemultipleaccess(CSMA)
carriersensemultipleaccesswith
collisionavoidance
(CSMAlCA)
carriersensemultipleaccesswith
collisiondetection
(CSMAlCD)
channelization
code-divisionmultipleaccess(CDMA)
collision
contention
controlledaccess
frequency-divisionmultipleaccess
(FDMA)
innerproduct
interframespace(IFS)
jammingsignal
multipleaccess(MA)
nonpersistentmethod
orthogonalsequence
polling
p-persistentmethod
primarystation
propagationtime
pureALOHA
randomaccess
reservation
secondarystation
slottedALOHA
time-divisionmultipleaccess
(TDMA)
token
tokenpassing
vulnerabletime
Walshtable
12.6SUMMARY
oWecanconsiderthedata linklayerastwosublayers.Theuppersublayerisresponsible
fordatalinkcontrol,andthelowersublayerisresponsibleforresolvingaccesstothe
sharedmedia.
UManyformalprotocolshavebeendevisedtohandleaccesstoasharedlink. Wecate­
gorizethemintothreegroups:randomaccessprotocols,controlledaccessprotocols,
andchannelizationprotocols.
oInrandomaccessorcontentionmethods,nostationissuperiortoanotherstation
andnoneisassignedthecontroloveranother.
oALOHAallowsmultipleaccess(MA)tothesharedmedium.Therearepotential
collisionsinthisarrangement.Whenastationsendsdata,anotherstationmayattempt
todo
soatthesametime.Thedatafromthetwostationscollideandbecomegarbled.
oTominimizethechance ofcollisionand,therefore,increasetheperformance,the
CSMAmethodwasdeveloped.Thechance
ofcollisioncanbereduced ifastation

392 CHAPTER 12MULTIPLEACCESS
sensesthemediumbeforetryingtouse it.Carriersensemultipleaccess(CSMA)
requiresthateachstationfirstlistentothemediumbeforesending.Threemethods
havebeendevisedforcarriersensing:I-persistent,nonpersistent,andp-persistent.
oCarriersensemultipleaccesswithcollisiondetection(CSMA/CD)augmentsthe
CSMAalgorithm
tohandlecollision.Inthismethod,astationmonitorsthemedium
afteritsendsaframetosee
ifthetransmissionwassuccessful. Ifso,thestationis
finished.If,however,thereisacollision,theframeissentagain.
DToavoidcollisionsonwirelessnetworks,carriersensemultipleaccesswithcollision
avoidance(CSMA/CA)wasinvented.Collisionsareavoidedthroughtheusethree
strategies:theinterframespace,thecontentionwindow,andacknowledgments.
oIncontrolledaccess,thestationsconsultoneanothertofindwhichstationhasthe
righttosend.Astationcannotsendunlessithasbeenauthorizedbyotherstations.
Wediscussedthreepopularcontrolled-accessmethods:reservation,polling,and
tokenpassing.
oInthereservationaccessmethod,astationneedstomakeareservationbefore
sendingdata.Time
isdividedintointervals.Ineachinterval,areservationframe
precedesthedataframessentinthatinterval.
oInthepollingmethod,alldataexchangesmustbemadethroughtheprimarydevice
evenwhentheultimatedestination
isasecondarydevice.Theprimarydevicecontrols
thelink;thesecondarydevicesfollowitsinstructions.
DInthetoken-passingmethod,thestationsinanetworkareorganizedinalogical
ring.Eachstationhasapredecessorandasuccessor.Aspecialpacketcalleda
tokencirculatesthroughthering.
oChannelizationisamultiple-accessmethod inwhichtheavailablebandwidth ofa
link
issharedintime,frequency,orthrough
code,betweendifferentstations. We
discussedthreechannelizationprotocols:FDMA,TDMA,andCDMA.
DInfrequency-divisionmultipleaccess(FDMA),theavailablebandwidth isdivided
intofrequencybands.Eachstation
isallocatedabandtosenditsdata.Inotherwords,
eachbandisreservedforaspecificstation,anditbelongstothestationallthetime.
DIntime-divisionmultipleaccess(TDMA),thestationssharethebandwidth ofthe
channelintime.Eachstationisallocatedatimeslotduringwhichitcansenddata.
Eachstationtransmitsitsdata
initsassignedtimeslot.
oIncode-divisionmultipleaccess(CDMA),thestationsusedifferentcodestoachieve
multipleaccess.CDMAisbasedoncodingtheoryandusessequences
ofnumbers
calledchips.ThesequencesaregeneratedusingorthogonalcodessuchtheWalsh
tables.
12.7PRACTICESET
ReviewQuestions
1.Listthreecategories ofmultipleaccessprotocolsdiscussedinthischapter.
2.Definerandomaccessandlistthreeprotocolsinthiscategory.

SECTION12.7PRACTICESET 393
3.Definecontrolledaccessandlistthreeprotocolsinthiscategory.
4.Definechannelizationandlistthreeprotocolsinthiscategory.
5.Explainwhycollisionisanissueinarandomaccessprotocolbutnotin controlled
accessorchannelizingprotocols.
6.Compareandcontrastarandomaccessprotocolwithacontrolledaccessprotocol.
7.Compareandcontrastarandomaccessprotocolwithachannelizingprotocol.
8.Compareandcontrastacontrolledaccessprotocolwithachannelizingprotocol.
9.Doweneedamultipleaccessprotocolwhenweusethe1 ocalloopofthetelephone
companytoaccesstheInternet?Why?
10.DoweneedamultipleaccessprotocolwhenweuseoneCATVchanneltoaccess
theInternet?Why?
Exercises
11.WehaveapureALOHAnetworkwith100stations. IfT
fr
=1
}.is,whatisthenumber
offrames/seachstationcansendtoachievethemaximumefficiency.
12.RepeatExercise 11forslottedALOHA.
13.OnehundredstationsonapureALOHAnetworkshareal-Mbpschannel. Ifframes
are1000bitslong,findthethroughput
ifeachstationissending10frames per
second.
14.RepeatExercise 13forslottedALOHA.
15.InaCDMAlCDnetwork withadatarate of10Mbps,theminimumframesizeis
foundtobe512bitsforthecorrectoperation
ofthecollisiondetectionprocess.What
shouldbetheminimumframesize ifweincreasethe datarateto100 Mbps?To
1Gbps?To10Gbps?
16.InaCDMAlCDnetworkwithadatarate of10Mbps,themaximumdistance
betweenanystationpairisfoundtobe2500mforthecorrectoperation
ofthe
col­
lisiondetectionprocess. Whatshouldbethemaximumdistance ifweincreasethe
datarateto100Mbps?To1Gbps?To10Gbps?
17.InFigure12.12,thedatarateis 10Mbps,thedistancebetweenstationAandCis
2000m,andthepropagationspeedis2 x10
8
mls.StationAstartssendingalong
frameattime
t1=0;stationCstartssendingalongframeattime t2=3
}.is.The
sizeoftheframeislongenoughtoguaranteethedetection ofcollisionbyboth
stations.Find:
a.ThetimewhenstationChearsthecollision (t3)'
b.ThetimewhenstationAhearsthecollision (t4)'
c.Thenumber ofbitsstationAhassentbeforedetectingthecollision.
d.Thenumber
ofbitsstationChassentbeforedetectingthecollision.
18.RepeatExercise 17ifthedatarateis100Mbps.
19.CalculatetheWalshtable
Ws
fromW
4
inFigure12.29.
20.Recreatethe
W
2
andW
4
tablesinFigure12.29using WI=[-1].Comparetherecre­
atedtableswiththeonesinFigure12.29.
21.Provethethirdandfourthorthogonalproperties
ofWalshchipsfor W
4
inFigure12.29.

394 CHAPTER 12MULTIPLEACCESS
22.Provethethirdandfourthorthogonalproperties ofWalshchipsfor W
4
recreatedin
Exercise20.
23.RepeatthescenariodepictedinFigures12.27to12.28
ifbothstations1and3are
silent.
24.Anetworkwithoneprimaryandfoursecondarystationsusespolling.Thesize ofa
dataframeis1000bytes.Thesize
ofthepoll,ACK,andNAKframesare32bytes
each.Eachstationhas5frames
tosend.Howmanytotalbytesareexchanged ifthere
isnolimitationonthenumber
offramesastationcansendinresponse toapoll?
25.RepeatExercise24
ifeachstationcansendonlyoneframeinresponsetoapoll.
ResearchActivities
26.CanyouexplainwhythevulnerabletimeinALOHAdependsonTpf'butinCSMA
dependson
T
p
?
27.InanalyzingALOHA,weuseonlyoneparameter,time;inanalyzingCSMA,we
usetwoparameters,spaceandtime.Canyouexplainthereason?

CHAPTER13
WiredLANs:Ethernet
InChapter1,welearnedthatalocalareanetwork(LAN)isacomputernetworkthatis
designedforalimitedgeographicareasuchasabuilding
oracampus.AlthoughaLAN
canbeused
asanisolatednetworktoconnectcomputersinanorganizationforthesole
purpose
ofsharingresources,mostLANstodayarealsolinkedtoawideareanetwork
(WAN)ortheInternet.
TheLANmarkethasseenseveraltechnologiessuchasEthernet,TokenRing,
TokenBus,FDDI,andATMLAN.Some
ofthesetechnologiessurvivedforawhile,but
Ethernetisbyfarthedominanttechnology.
Inthischapter,wefirstbrieflydiscusstheIEEEStandardProject802,designed
to
regulatethemanufacturingandinterconnectivitybetweendifferentLANs. Wethen
concentrateontheEthernetLANs.
AlthoughEthernethasgonethroughafour-generationevolutionduringthelast
fewdecades,themainconcepthasremained.Ethernethaschanged
tomeetthemarket
needsand
tomakeuse ofthenewtechnologies.
13.1IEEESTANDARDS
In1985,theComputerSociety oftheIEEEstartedaproject,called Project802, toset
standardstoenableintercommunicationamongequipmentfromavariety
ofmanufac­
turers.Project802doesnotseek
toreplaceanypart oftheOSIortheInternetmodel.
Instead,itisaway
ofspecifyingfunctions ofthephysicallayerandthedatalinklayer
ofmajorLANprotocols.
ThestandardwasadoptedbytheAmericanNationalStandardsInstitute(ANSI).In
1987,theInternationalOrganizationforStandardization(ISO)alsoapproveditasan
internationalstandardunderthedesignationISO8802.
Therelationship
ofthe802Standard tothetraditionalOSImodelisshowninFig­
ure13.1.TheIEEEhassubdividedthedatalinklayerintotwosublayers:
logicallink
control(LLC)
andmediaaccesscontrol(MAC). IEEEhasalsocreatedseveralphys­
icallayerstandardsfordifferentLANprotocols.
395

396 CHAPTER 13WIREDLANs:ETHERNET
Figure13.1IEEEstandardforLANs
LLC:Logicallinkcontrol
MAC:Mediaaccesscontrol
Upperlayers Upperlayers
Datalinklayer
Physical
layer
Ethernet
MAC
Ethernet
physicallayers
(several)
TokenRing
MAC
Token
Ring
physicallayer
TokenBus
MAC
TokenBus
physicallayer
...
.',:""
OSlorInternetmodel IEEEStandard
DataLinkLayer
Aswementionedbefore,thedatalinklayerintheIEEEstandardisdividedintotwo
sublayers:LLCandMAC.
LogicalLinkControl(LLC)
InChapterII,wediscusseddatalinkcontrol.Wesaidthatdatalinkcontrolhandles
framing,flowcontrol,anderrorcontrol.InIEEEProject802,flowcontrol,errorcon­
trol,andpart
oftheframingdutiesarecollectedintoonesublayercalledthelogicallink
control.FramingishandledinboththeLLCsublayerandtheMACsublayer.
TheLLCprovidesonesingledatalinkcontrolprotocolforallIEEELANs.Inthis
way,theLLCisdifferentfromthemediaaccesscontrolsublayer,whichprovidesdiffer­
entprotocolsfordifferentLAN
s.AsingleLLCprotocolcanprovideinterconnectivity
betweendifferentLANsbecauseitmakestheMACsublayertransparent.Figure13.1
showsonesingleLLCprotocolservingseveralMACprotocols.
FramingLLCdefinesaprotocol dataunit(PDU)thatissomewhatsimilartothat of
HDLC.TheheadercontainsacontrolfieldliketheoneinHDLC;thisfieldisusedfor
flowand
errorcontrol.Thetwootherheaderfieldsdefinetheupper-layerprotocol
atthesourceanddestinationthatusesLLC.Thesefieldsarecalledthe
destination
serviceaccess point(DSAP)andthe sourceserviceaccess point(SSAP).Theother
fieldsdefinedinatypicaldatalinkcontrolprotocolsuchasHDLCaremovedtothe
MACsublayer.Inotherwords,aframedefinedinHDLCisdividedintoaPDUatthe
LLCsublayerandaframeattheMACsublayer,asshowninFigure
13.2.
NeedforLLCThepurpose oftheLLCistoprovideflowanderrorcontrolforthe
upper-layerprotocolsthatactuallydemandtheseservices.Forexample,
ifaLANor
severalLANsareusedinanisolatedsystem,LLCmaybeneededtoprovideflowand
errorcontrolfortheapplicationlayerprotocols.However,mostupper-layerprotocols

SECTION13.2STANDARDETHERNET 397
Figure13.2 HDLCframecomparedwithLLC andMACframes
LLCPDD
I_h...ea...de...r....f...:.......p_y .......·....H
co
SSAP:Sourceserviceacces,point
D S
Upper-layerS
S
A A
Control
data
p p
Upper-layer
I ,
AddressControl FCS -
I I
data
I I
I I
I I
HDLCframe MAC
..
..
....
~I
...-
MACaluad
DSAP'Destinationserviceaccesspoint
MACframe
suchasIP(discussedinChapter20),donotusetheservices ofLLC.Forthisreason,
weendourdiscussion
ofLLC.
MediaAccessControl(MAC)
InChapter12,wediscussedmultipleaccessmethodsincludingrandomaccess,con­
trolledaccess,andchannelization.IEEEProject802hascreatedasublayercalled
mediaaccesscontrolthatdefinesthespecificaccessmethodforeachLAN.Forexam­
ple,itdefines
CSMA/CDasthemediaaccessmethodforEthernetLANsandthe
token­
passingmethodforTokenRingandTokenBusLANs.Aswediscussedintheprevious
section,part
oftheframingfunctionisalsohandledbytheMAClayer.
IncontrasttotheLLCsublayer,theMACsublayercontainsanumber ofdistinct
modules;eachdefinestheaccessmethodandtheframingformatspecifictothecorre­
spondingLANprotocol.
PhysicalLayer
Thephysicallayerisdependentontheimplementationandtype ofphysicalmedia
used.IEEEdefinesdetailedspecificationsforeachLANimplementation.Forexample,
althoughthereisonlyoneMACsublayerforStandardEthernet,thereisadifferent
physicallayerspecificationsforeachEthernetimplementations
aswewillseelater.
13.2STANDARDETHERNET
TheoriginalEthernetwascreatedin1976atXerox'sPaloAltoResearchCenter(PARC).
Sincethen,ithasgonethroughfourgenerations:
StandardEthernet(lotMbps),Fast
Ethernet
(100Mbps),GigabitEthernet (lGbps),and Ten-GigabitEthernet (l0Gbps),
asshown
inFigure13.3.Webrieflydiscussallthesegenerationsstartingwiththefirst,
Standard(ortraditional)Ethernet.
tEthernetdefinedsomeI-Mbpsprotocols,buttheydidnotsurvive.

398 CHAPTER 13WIREDLANs: ETHERNET
Figure13.3 Ethernetevolutionthrough fourgenerations
HIl\Ibps 100Mbps 10Gbp~
MACSublayer
InStandardEthernet,theMACsublayergovernstheoperationoftheaccessmethod. It
alsoframesdatareceivedfromtheupperlayerandpassesthemtothephysicallayer.
FrameFormat
TheEthernetframecontainssevenfields:preamble,SFD,DA,SA,lengthortypeof
protocoldataunit(PDU),upper-layerdata,andthe
CRe.Ethernetdoesnotprovideany
mechanismforacknowledgingreceivedframes,makingitwhat
isknownasanunreli­
ablemedium.Acknowledgmentsmustbeimplementedatthehigherlayers.Theformat
oftheMACframeisshown inFigure13.4.
Figure13.4 802.3MACframe
Pr~amble: 56bitsofalternating1sandas.
SFD:Startframedelimiter,flag(10101011)
I.7bytes1byte.1
Physicallayer
header
6bytes 6 bytes
Dataandpadding
DPreamble.Thefirstfield ofthe802.3framecontains 7bytes(56bits)ofalternat­
ing
OsandIsthatalertsthereceivingsystemtothecomingframeandenablesitto
synchronizeitsinputtiming.Thepatternprovidesonlyanalertandatimingpulse.
The56-bitpatternallowsthestationstomisssomebitsatthebeginningofthe
frame.The
preambleisactuallyaddedatthephysicallayerand isnot(formally)
partoftheframe.
DStartframedelimiter(SFD). Thesecondfield (lbyte:10101011)signalsthe
beginningoftheframe.TheSFDwarnsthestationorstationsthatthisisthelast
chanceforsynchronization.Thelast2bitsis
11andalertsthereceiverthatthenext
fieldisthedestinationaddress.

SECTION13.2STANDARDETHERNET 399
oDestinationaddress(DA).TheDAfieldis6bytesandcontainsthephysical
address
ofthedestinationstationorstationstoreceivethepacket. Wewilldiscuss
addressingshortly.
oSourceaddress(SA).TheSAfieldisalso6bytesandcontainsthephysical
address
ofthesenderofthepacket.Wewilldiscussaddressingshortly.
oLengthortype.Thisfieldisdefined asatypefieldorlengthfield.Theoriginal
Ethernetusedthisfieldasthetypefieldtodefinetheupper-layerprotocolusingthe
MACframe.TheIEEEstandarduseditasthelengthfieldtodefinethenumber
of
bytesinthedatafield.Bothusesarecommontoday.
oData.Thisfieldcarriesdataencapsulatedfromtheupper-layerprotocols. Itisa
minimumof46andamaximum
of1500bytes, aswewillseelater.
oCRC.Thelastfieldcontainserrordetectioninformation,inthiscaseaCRC-32
(seeChapter10).
FrameLength
Ethernethasimposedrestrictionsonboththeminimumandmaximumlengthsofaframe,
asshowninFigure13.5.
Figure13.5
Minimumandmaximumlengths
Minimumpayloadlength:46bytes
I-
Maximumpayloadlength:1500bytes_I
Destination Source Length
Dataandpadding
CRC
address address PDU
6bytes 6bytes 2bytes 4bytes
Minimumframelength:512bits
or64bytes
MaXImumframelength.12,144bIts
or1518bytes
Theminimumlengthrestrictionisrequiredforthecorrectoperation ofCSMAlCD
aswewillseeshortly.AnEthernetframeneedstohaveaminimumlength of512bits
or64bytes.Part
ofthislengthistheheaderandthetrailer. Ifwecount18bytesof
headerandtrailer
(6bytesofsourceaddress,6bytesofdestinationaddress,2bytesof
lengthortype,and4bytes
ofCRC),thentheminimumlengthofdatafromtheupper
layeris64-
18=46bytes.Iftheupper-layerpacketislessthan46bytes,paddingis
added
tomakeupthedifference.
Thestandarddefinesthemaximumlength
ofaframe(withoutpreambleandSFD
field)
as1518bytes.Ifwesubtractthe18bytes ofheaderandtrailer,themaximum
lengthofthepayloadis1500bytes.Themaximumlengthrestrictionhastwohistorical
reasons.First,memorywasveryexpensivewhenEthernetwasdesigned:amaximum
lengthrestrictionhelped
toreducethesizeofthebuffer.Second,themaximumlength
restrictionpreventsonestationfrommonopolizingthesharedmedium,blockingother
stationsthathavedatatosend.

400 CHAPTER13WIREDLANs: ETHERNET
Framelength:
Minimum:64bytes(512bits) Maximum:1518bytes(12,144bits)
Addressing
EachstationonanEthernetnetwork(such
asaPC,workstation,orprinter)hasitsown
networkinterface card(NIC).TheNICfitsinsidethestationandprovidesthestation
witha6-bytephysicaladdress.AsshowninFigure13.6,theEthernetaddress
is6bytes
(48bits),nonnallywrittenin
hexadecimalnotation, withacolonbetweenthebytes.
Figure13.6 ExampleofanEthernetaddressinhexadecimalnotation
06:01:02:01:2C:4B
6bytes=12hexdigits=48bits
Unicast,Multicast, andBroadcastAddresses Asourceaddressisalwaysaunicast
address-theframecomesfromonlyonestation.Thedestinationaddress,however,
canbeunicast,multicast,orbroadcast.Figure13.7showshowtodistinguishaunicast
addressfromamulticastaddress.
Iftheleastsignificantbit ofthefirstbyteinadestina­
tionaddressis
0,theaddressisunicast;otherwise,itismulticast.
Figure13.7 Unicastandmulticastaddresses
Unicast:
0;multicast:1
~
;"' I
¥~ ~~" .&W",.
-----
ByteI Byte2
...
Byte6
Theleastsignificantbitofthefirstbytedefines thetypeofaddress.
Ifthebitis0,theaddressisunicast;otherwise, itismulticast.
Aunicastdestinationaddressdefinesonlyonerecipient;therelationshipbetween
thesenderandthereceiver
isone-to-one.Amulticastdestinationaddressdefinesagroup
ofaddresses;therelationshipbetweenthesenderandthereceiversisone-to-many.
Thebroadcastaddress
isaspecialcase ofthemulticastaddress;therecipientsare
allthestationsontheLAN.Abroadcastdestinationaddressisforty-eightIs.
Thebroadcastdestinationaddressisaspecialcase of
themulticastaddressinwhichallbits areIs.

SECTION13.2STANDARDETHERNET 401
Example13.1
Definethetypeofthefollowingdestinationaddresses:
a.4A:30:10:21:1O:1A
b.47:20:1B:2E:08:EE
c.FF:FF:FF:FF:FF:FF
Solution
Tofindthetypeof theaddress,weneedtolookatthesecondhexadecimaldigitfrom theleft.Ifit
iseven,theaddressisunicast.If itisodd,theaddressismulticast.Ifalldigits areF's,theaddress
isbroadcast.Therefore, wehavethefollowing:
a.ThisisaunicastaddressbecauseA inbinaryis1010(even).
b.Thisisamulticastaddressbecause 7inbinaryis0111(odd).
c.Thisisabroadcastaddressbecause alldigitsareF's.
Thewaytheaddressesaresentout
onlineisdifferentfromthewaytheyarewritten
inhexadecimalnotation.
Thetransmissionisleft-to-right,byte bybyte;however,for
eachbyte,theleastsignificantbitissentfirstandthemostsignificantbitissentlast.
Thismeansthatthebitthatdefinesanaddressasunicast
ormulticastarrivesfirstatthe
receIver.
Example13.2
Showhowtheaddress47:20:1B:2E:08:EEissentoutonline.
Solution
Theaddressissentleft-to-right,byte bybyte;for eachbyte,it issentright-to-Ieft,bit bybit,as
shownbelow:
~ 111000100000010011011000011101000001000001110111
AccessMethod:CSMAICD
StandardEthernetusesI-persistent CSMAlCD(seeChapter12).
SlotTimeInanEthernetnetwork,theround-triptimerequiredforaframetotravel
fromoneend
ofamaximum-lengthnetwork totheotherplusthetimeneededtosend
the
jamsequenceiscalledtheslottime.
Slottime
=round-triptime+timerequiredtosendthejamsequence
Theslottime
inEthernetisdefinedinbits. Itisthetimerequiredforastationto
send512bits.Thismeansthattheactualslottimedepends
onthedatarate;fortradi­
tional
10-MbpsEthernetitis51.2
I1s.
SlotTimeandCollisionThechoice ofa512-bitslottimewasnotaccidental.Itwas
chosentoallowtheproperfunctioning
ofCSMAlCD.Tounderstandthesituation,let
usconsidertwocases.
Inthefirstcase,weassumethatthesendersendsaminimum-sizepacket
of512bits.
Beforethesendercansendtheentirepacketout,thesignaltravelsthroughthenetwork

402 CHAPTER 13WIREDLANs:ETHERNET
andreachestheend ofthenetwork.Ifthereisanothersignalattheend ofthenetwork
(worstcase),acollisionoccurs.Thesenderhastheopportunitytoabortthesending
of
theframeandtosenda jamsequencetoinformotherstations ofthecollision.The
round-triptimeplusthetimerequiredtosendthejamsequenceshouldbelessthanthe
timeneededforthesendertosendtheminimumframe,512bits.Thesenderneedsto
beaware
ofthecollisionbeforeitistoolate,thatis,beforeithassenttheentireframe.
Inthesecondcase,the sendersendsa framelargerthantheminimumsize
(between512and1518bits).Inthiscase,
ifthestationhassentoutthefirst512bitsand
hasnotheardacollision,itisguaranteedthatcollisionwillneveroccurduringthe
transmission
ofthisframe.Thereasonisthatthesignalwillreachtheend ofthenet­
workinlessthanone-halftheslottime.
Ifallstationsfollowthe CSMA/CDprotocol,
theyhavealreadysensedtheexistence
ofthesignal(carrier)onthelineandhave
refrainedfromsending.
Iftheysentasignalonthelinebefore
one-halfoftheslottime
expired,acollisionhasoccurredandthesenderhassensedthecollision.Inother
words,collisioncanonlyoccurduringthefirsthalf
oftheslottime,and ifitdoes,itcan
besensedbythesenderduringtheslottime.Thismeansthatafterthesendersendsthe
first512bits,itisguaranteedthatcollisionwillnotoccurduringthetransmission
of
thisframe.Themediumbelongstothesender,andnootherstationwilluseit.Inother
words,thesenderneedstolistenforacollisiononlyduringthetimethefirst512bits
aresent.
Ofcourse,alltheseassumptionsareinvalid ifastationdoesnotfollowthe CSMAlCD
protocol.Inthiscase,wedonothaveacollision,wehaveacorruptedstation.
SlotTime
andMaximumNetworkLengthThereisarelationshipbetweentheslot
timeandthemaximumlength
ofthenetwork(collisiondomain).Itisdependentonthe
propagationspeed
ofthesignalintheparticularmedium.Inmosttransmissionmedia,
thesignalpropagatesat2
x10
8
rnls(two-thirdsoftherateforpropagationinair).For
traditionalEthernet,wecalculate
MaxLength
:::::PropagationSpeedxSlotTime
2
MaxLength:::;(2xto
8
)
X(5L2X
10-6(2)=5120m
Ofcourse,weneedtoconsiderthedelaytimesinrepeatersandinterfaces,andthe
timerequiredtosendthe
jamsequence.Thesereducethemaximum-length ofatradi­
tionalEthernetnetworkto2500
m,just48percent ofthetheoreticalcalculation.
MaxLength
=2500ill
PhysicalLayer
TheStandardEthernetdefinesseveralphysicallayerimplementations;four ofthemost
common,areshowninFigure13.8.
EncodingandDecoding
Allstandardimplementationsusedigitalsignaling(baseband)at10Mbps.Atthesender,
dataareconvertedtoadigitalsignalusingtheManchesterscheme;atthereceiver,the

SECTION13.2STANDARDETHERNET 403
Figure13.8 CategoriesofStandardEthernet
StandardEthernet
common
implementations
Rus. Bus,
thickcoaxialthincoaxial
Star, UTP
Star,
fiber
Transceivercable
maximum50m
receivedsignal isinterpretedasManchesteranddecodedintodata.AswesawinChapter 4,
Manchesterencodingisself-synchronous,providingatransitionateachbitinterval.
Figure13.9showstheencodingschemeforStandardEthernet.
Figure13.9
EncodinginaStandardEthernetimplementation
10Mbpsdata 10Mbpsdata
t t
Manchester Manchester
encoder decoder
Station
I I
I
I I
Twistedpairsorfibers
lOBase5:ThickEthernet
Thefirstimplementationiscalled
10BaseS,thickEthernet, orThicknet.Thenick­
namederivesfromthesize
ofthecable,whichisroughlythesize ofagardenhose
andtoostifftobendwithyourhands.lOBaseSwasthefirstEthernetspecificationto
useabustopologywithanexternaltransceiver(transmitter/receiver)connectedviaa
taptoathickcoaxialcable.Figure13.10showsaschematicdiagram
ofalOBase5
implementation.
Figure13.10
IOBase5implementation
gOBf4l
10Mbps 500m
Baseband Cable Cable
(digital) end1f;;=.~=.~===h·;;;;k==·====4"'="''''';;;;jI end
TransceiverT
ICcoaXialcable
maximum500m

404 CHAPTER 13WIREDLANs: ETHERNET
Thetransceiverisresponsiblefortransmitting,receiving,anddetectingcollisions.
The
transceiverisconnectedtothestationviaatransceivercablethatprovidessepa­
ratepathsforsendingandreceiving.Thismeansthatcollisioncanonlyhappeninthe
coaxialcable.
Themaximumlength
ofthecoaxialcablemustnotexceed 500m,otherwise,there
isexcessivedegradation ofthesignal.Ifalengthofmorethan 500misneeded,upto
fivesegments,eacha
maximumofSOO-meter,canbeconnectedusingrepeaters.
RepeaterswillbediscussedinChapter
15.
10Base2:ThinEthernet
Thesecondimplementationiscalled lOBase2,thinEthernet,orCheapernet.IOBase2
alsousesabustopology,butthecableismuchthinnerandmoreflexible.Thecablecan
bebenttopassveryclosetothestations.Inthiscase,thetransceiverisnormallypart
of
thenetworkinterfacecard(NIC),whichisinstalledinsidethestation.Figure13.11
showstheschematicdiagram
ofaIOBase2implementation.
Figure13.11lOBase2implementation
gOBa~
10Mbps 185m~
Baseband
(digital)
Cable
end
Thincoaxialcable,
maximum
185m
Notethatthecollisionhereoccursinthethincoaxialcable.Thisimplementationis
morecosteffectivethan10BaseSbecausethincoaxialcableislessexpensivethanthick
coaxialandtheteeconnectionsaremuchcheaperthantaps.Installationissimpler
becausethethincoaxialcableisveryflexible.However,thelength
ofeachsegment
cannotexceed
185m(closeto200m)duetothehighlevel ofattenuationinthincoaxial
cable.
lOBase-T:Twisted-PairEthernet
Thethirdimplementationiscalled lOBase-T ortwisted-pairEthernet.1 OBase-Tuses
aphysicalstartopology.Thestationsareconnectedtoahubviatwopairs
oftwisted
cable,asshowninFigure13.12.
Notethattwopairs
oftwistedcablecreatetwopaths(oneforsendingandonefor
receiving)betweenthestationandthehub.Anycollisionherehappensinthehub.
ComparedtolOBaseSorlOBase2,wecanseethatthehubactuallyreplacesthecoaxial

SECTION13.2STANDARDETHERNET 405
Figure13.12IOBase-Timplementation
~OBr'Q
10Mbps Twistedpair
Baseband
(digital)
i
I~I
miTwopairsof
~ ~UTPcable
I[Q][QJ...~I
lOBase-Thub
cableasfarasacollisionisconcerned.Themaximumlength ofthetwistedcablehere
isdefinedas100m, tominimizetheeffect ofattenuationinthetwistedcable.
lOBase-F:FiberEthernet
Althoughthereareseveraltypes ofopticalfiberlO-MbpsEthernet,themostcommonis
called10Base-F.lOBase-Fusesastartopologytoconnectstationstoahub.Thestations
areconnectedtothehubusingtwofiber-opticcables,
asshowninFigure 13.13.
Figure13.13IOBase-Fimplementation
~OBr~
] 0Mbps Fiber
Baseband
(digital)
lOBase-F
hub
Twofiber-optic
cables
Summary
Table
13.1showsasummary ofStandardEthernetimplementations.
Table13.1
SummaryofStandardEthernetimplementations
Characteristics lOBase5 lOBase2 lOBase-T IOBase-F
Media Thick Thin 2UTP 2Fiber
coaxialcablecoaxialcable
Maximumlength
500m 185m 100m 2000m
Lineencoding ManchesterManchesterManchester Manchester

406 CHAPTER 13WIREDLANs:ETHERNET
13.3CHANGESIN THESTANDARD
The10-MbpsStandardEthernethasgonethroughseveralchangesbeforemovingtothe
higherdatarates.Thesechangesactuallyopenedtheroadtotheevolution
oftheEthernet
tobecomecompatiblewithotherhigh-data-rateLANs.
Wediscusssome ofthesechanges
inthissection.
BridgedEthernet
ThefirststepintheEthernetevolutionwasthedivision ofaLANby bridges.Bridges
havetwoeffectsonanEthernetLAN:Theyraisethebandwidthandtheyseparatecolli­
siondomains.
WediscussbridgesinChapter 15.
RaisingtheBandwidth
InanunbridgedEthernetnetwork,thetotalcapacity(10Mbps)issharedamongallsta­
tionswithaframetosend;thestationssharethebandwidth
ofthenetwork.Ifonlyone
stationhasframestosend,itbenefitsfromthetotalcapacity(10Mbps).But
ifmore
thanonestationneedstousethenetwork,thecapacityisshared.Forexample,
iftwo
stationshavealot
offramestosend,theyprobablyalternateinusage.Whenonestation
issending,theotheronerefrainsfromsending.
Wecansaythat,inthiscase,eachsta­
tiononaverage,sendsatarate
of5Mbps.Figure13.14showsthesituation.
Figure13.14 Sharingbandwidth
Rate
One One One One
frameframeframeframe
10Mbps-
r--r---
5Mbps---------- -
...
Time
Rate
10Mbps
5Mbps
One One One One
frameframeframeframe
Time
a.
Firststation b.Secondstation
Thebridge,aswewilllearninChapter 15,canhelphere.Abridgedividesthenet­
workintotwoormorenetworks.Bandwidth-wise,eachnetworkisindependent.For
example,inFigure13.15,anetworkwith12stationsisdividedintotwonetworks,each
with6stations.Noweachnetworkhasacapacity
of10Mbps.ThelO-Mbpscapacityin
eachsegmentisnowsharedbetween6stations(actually7becausethebridgeactsasa
stationineachsegment),not12stations.Inanetworkwithaheavyload,eachstation
theoreticallyisoffered10/6Mbpsinstead
of10/12Mbps,assumingthatthetrafficis
notgoingthroughthebridge.
Itisobviousthat ifwefurtherdividethenetwork,wecangainmorebandwidthfor
eachsegment.Forexample,
ifweuseafour-portbridge,eachstationisnowoffered
10/3Mbps,whichis4timesmorethananunbridgednetwork.

SECTION13.3CHANGESINTHESTANDARD 407
Figure13.15 Anetworkwith andwithoutabridge
a.Withoutbridging
b.
Withbridging
SeparatingCollisionDomains
Anotheradvantageofabridgeistheseparationofthecollisiondomain.Figure13.16
showsthecollisiondomainsforanunbridgedandabridgednetwork.
Youcanseethat
thecollisiondomainbecomesmuchsmallerandtheprobabilityofcollisionisreduced
tremendously.Withoutbridging,
12stationscontendforaccesstothemedium;with
bridgingonly3stationscontendforaccesstothemedium.
Figure13.16
Collisiondomains
inanunbridgednetwork andabridgednetwork
Domain
r---~----------~-~-~------------~--~------------------ --------~----------------------------
a.Withoutbridging
Domain Domain
Domain
---------------------,
,
I
,
'aaa'
, ,
, ,
1""""'-:'=-:.=-:.1
~ .1
I
'aaa:
, , I
, ,
1=-1.;;=........="'"":1
~ ~ 1
Domain
l--------------~~----J, ,
i-~-a-~-!
1--------------------1
, ,
:~"a~:
, ,
1""",, =_ I
:_---~~-~- -~--- -~-_:
b.Withbridging
SwitchedEthernet
TheideaofabridgedLANcanbeextendedtoaswitchedLAN.Insteadofhavingtwo
tofournetworks,whynothave Nnetworks,where Nisthenumber ofstationsonthe
LAN?Inotherwords,
ifwecanhaveamultiple-portbridge,whynothavean N-port

408 CHAPTER 13WIREDIANs:ETHERNET
switch?Inthisway,thebandwidthissharedonlybetweenthestationandtheswitch
(5Mbpseach).Inaddition,thecollisiondomain isdividedinto Ndomains.
Alayer2switch
isanN-portbridgewithadditionalsophisticationthatallowsfaster
handling
ofthepackets.EvolutionfromabridgedEthernettoaswitched Ethernetwas
abigstepthatopenedthewaytoanevenfasterEthernet,aswewillsee.Figure13.17
showsaswitchedLAN.
Figure13.17SwitchedEthernet
,-
\, ---Domain
.._--
Domain
Domain--
,'-..... \
, ,
-,-
Domain:riiI-"i:-:r----~-+--El C3--I-~--____,,-~- :Domain
, --==""'''''- --_ I
\~~-~- --~__'
Full-DuplexEthernet
Oneofthelimitationsof10Base5andlOBase2isthatcommunicationishalf-duplex
(lOBase-T
isalwaysfull-duplex);astationcaneithersendorreceive,butmaynotdoboth
atthesametime.Thenextstepintheevolutionwas
tomovefromswitchedEthernetto
full-duplexswitched
Ethernet.Thefull-duplexmodeincreasesthecapacity ofeach
domainfrom
10to20Mbps.Figure13.18showsaswitchedEthernetinfull-duplex
mode.Notethatinstead
ofusingonelinkbetweenthestationandtheswitch,thecon­
figurationusestwolinks:onetotransmitandonetoreceive.
Figure13.18Full-duplexswitchedEthernet
Switch
~ -E-I(_T_ra_ns_m_it_·_1II_Trno,mit•~_
~ Receive Receive~~
Iflf~0~>
a
NoNeedforCSMAICD
Infull-duplexswitchedEthernet,thereisnoneedforthe
CSMAICDmethod.Inafull­
duplexswitchedEthernet,eachstation
isconnectedtotheswitchviatwoseparatelinks.

SECTION13.4FASTETHERNET 409
Eachstationorswitchcansendandreceiveindependentlywithoutworryingaboutcol­
lision.Eachlinkisapoint-to-pointdedicatedpathbetweenthestationandtheswitch.
There
isnolongeraneedforcarriersensing;thereisnolongeraneedforcollision
detection.The
joboftheMAClayerbecomesmucheasier.Thecarriersensingandcol­
lisiondetectionfunctionalities
oftheMACsublayercanbeturnedoff.
MACControlLayer
StandardEthernetwasdesigned asaconnectionlessprotocolattheMACsublayer.
There
isnoexplicitflowcontrolorerrorcontroltoinformthesenderthattheframehas
arrivedatthedestinationwithouterror.Whenthereceiverreceivestheframe,itdoes
notsendanypositiveornegativeacknowledgment.
Toprovideforflowanderrorcontrolinfull-duplexswitchedEthernet,anew
sublayer,calledtheMACcontrol,isaddedbetweentheLLCsublayerandtheMAC
sublayer.
13.4FASTETHERNET
FastEthernetwasdesignedtocompetewith LANprotocolssuchasFDDIorFiber
Channel(orFibreChannel,asit
issometimesspelled).IEEEcreatedFastEthernetunder
thename802.3u.FastEthernetisbackward-compatiblewithStandardEthernet,butit
cantransmitdata10timesfasteratarate
of100Mbps.Thegoals ofFastEthernetcanbe
summarized
asfollows:
1.Upgradethedatarateto100Mbps.
2.MakeitcompatiblewithStandardEthernet.
3.Keepthesame48-bitaddress.
4.Keepthesameframeformat.
5.Keepthesameminimumandmaximumframelengths.
MACSublayer
Amainconsiderationintheevolution ofEthernetfrom10to100Mbpswastokeepthe
MACsublayeruntouched.However,adecisionwasmadetodropthebustopologies
andkeeponlythestartopology.Forthestartopology,therearetwochoices,
aswesaw
before:halfduplexandfullduplex.Inthehalf-duplexapproach,thestationsarecon­
nectedviaahub;inthefull-duplexapproach,theconnectionismadeviaaswitchwith
buffersateachport.
Theaccessmethodisthesame
(CSMAlCD)forthehalf-duplexapproach;forfull­
duplexFastEthernet,thereisnoneedfor
CSMAlCD.However,theimplementations
keep
CSMA/CDforbackwardcompatibilitywithStandardEthernet.
Autonegotiatioll
AnewfeatureaddedtoFastEthernetiscalled autonegotiation.Itallowsastationora
hubarange
ofcapabilities.Autonegotiationallowstwodevicestonegotiatethemode

410 CHAPTER13WIREDLANs: ETHERNET
ordatarateofoperation.Itwasdesignedparticularlyforthefollowingpurposes:
oToallowincompatibledevicestoconnecttooneanother.Forexample,adevicewith
amaximumcapacity
of10Mbpscancommunicatewithadevicewitha100Mbps
capacity(butcanworkatalowerrate).
oToallowonedevicetohavemultiplecapabilities.
oToallowastationtocheckahub'scapabilities.
PhysicalLayer
ThephysicallayerinFastEthernetismorecomplicatedthantheone inStandardEthernet.
Webrieflydiscusssomefeatures
ofthislayer.
Topology
FastEthernetisdesignedtoconnecttwoormorestationstogether. Ifthereareonlytwo
stations,theycanbeconnectedpoint-to-point.Threeormorestationsneedtobecon­
nectedinastartopologywithahuboraswitchatthecenter,asshowninFigure13.19.
Figure13.19 FastEthernettopology
a.Point-to-point
Implementation
FastEthernetimplementationatthephysicallayercanbecategorizedaseithertwo-wire
orfour-wire.Thetwo-wireimplementationcanbeeithercategory5UTP(lOOBase-TX)
orfiber-opticcable(lOOBase-FX). Thefour-wireimplementationisdesignedonly
forcategory3
UTP(l00Base-T4).SeeFigure13.20.
Figure13.20FastEthernetimplementations
Twowires
category5
UTP
Twowires
fiber Fourwires
category
3UTP

SECTION13.4FASTETHERNET 411
Encoding
Manchesterencodingneedsa200-Mbaudbandwidthforadatarate of100Mbps,which
makesitunsuitableforamediumsuch
astwisted-paircable.Forthisreason,theFast
Ethernetdesignerssoughtsomealternativeencoding/decodingscheme.However,
itwas
foundthatoneschemewouldnotperformequallywellforallthreeimplementations.
Therefore,threedifferentencodingschemeswerechosen(seeFigure13.21).
Figure13.21EncodingforFastEthernetimplementation
100Base-TX 100Base-FX
4
x25Mbps 4x25Mbps 4x25Mbps 4x25Mbps
t
Stationt
Station
TwoUTPcategory5 Twofibers
100Base-T4
100Mbps
~
100Mbps
t
,.....:;~~-..
~;;;iiR/6T~~ ~,:8B.i~:a~der <~
~~:;C<~~Jl"~A .~~...
IL.-....-~It--------J
1
I
t
Station
1 r
-
4category3 UTP
lOOBase-TXusestwopairsoftwisted-paircable(eithercategory5UTPorSTP).
Forthisimplementation,the
MLT-3schemewasselectedsinceithasgoodbandwidth
performance(seeChapter4).However,since
MLT-3isnotaself-synchronouslinecod­
ingscheme,4B/5Bblockcodingisusedtoprovidebitsynchronizationbypreventing
theoccurrence
ofalongsequence ofOsandIs(seeChapter4).Thiscreatesadatarate
of125Mbps,whichisfedinto MLT-3forencoding.
lOOBase-FXusestwopairsoffiber-opticcables.Opticalfibercaneasilyhandlehigh
bandwidthrequirementsbyusingsimpleencodingschemes.Thedesigners
of100Base-FX
selectedtheNRZ-Iencodingscheme(seeChapter4)forthisimplementation.However,
NRZ-Ihasabitsynchronizationproblemforlongsequencesof
Os(orIs,basedonthe
encoding),
aswesawinChapter4. Toovercomethisproblem,thedesignersused4B/5B

412 CHAPTER 13WIREDLANs: ETHERNET
blockencodingaswedescribedforI OOBase-TX.Theblockencodingincreasesthebitrate
from100to125Mbps,whichcaneasilybehandledbyfiber-opticcable.
A 1
OOBase-TXnetworkcanprovideadatarate of100Mbps,butitrequirestheuse of
category5UTPorSTPcable.This isnotcost-efficientforbuildingsthathavealreadybeen
wiredforvoice-gradetwisted-pair(category3).Anewstandard,called
lOOBase-T4,was
designedtousecategory3orhigher
UTP.TheimplementationusesfourpairsofUTPfor
transmitting100Mbps.Encoding/decodingin100Base-T4ismorecomplicated.Asthis
implementationusescategory3UTP,eachtwisted-paircannoteasilyhandlemorethan
25Mbaud.Inthisdesign,onepairswitchesbetweensendingandreceiving.Threepairsof
UTPcategory3,however,canhandleonly
75Mbaud(25Mbaud)each. Weneedtousean
encodingschemethatconverts100Mbpstoa75Mbaudsignal.AswesawinChapter4,
8B/6Tsatisfiesthisrequirement.In8B/6T,eightdataelementsareencoded
assixsignal
elements.Thismeansthat100Mbpsusesonly(6/8)
x100Mbps,or75Mbaud.
Summary
Table13.2isasummary oftheFastEthernetimplementations.
Table13.2
SummaryofFastEthernetimplementations
Characteristics lOOBase-TX lOOBase-FX 100Base-T4
Media Cat5UTPorSTP Fiber Cat4UTP
Number
ofwires 2 2 4
Maximumlength
100m 100m 100m
Blockencoding 4B/5B 4B/5B
Lineencoding
MLT-3 NRZ-I 8B/6T
13.5GIGABITETHERNET
Theneedforanevenhigherdatarateresultedinthedesign oftheGigabitEthernet
protocol(1000Mbps).TheIEEEcommitteecallstheStandard802.3z.Thegoals
ofthe
GigabitEthernetdesigncanbesummarizedasfollows:
1.Upgradethedatarateto1Gbps.
2.MakeitcompatiblewithStandard orFastEthernet.
3.Usethesame48-bitaddress.
4.Usethesameframeformat.
5.Keepthesameminimumandmaximumframelengths.
6.TosupportautonegotiationasdefinedinFastEthernet.
MACSublayer
Amainconsiderationintheevolution ofEthernetwastokeeptheMAC sublayer
untouched.However,toachieveadatarate1Gbps,thiswasnolongerpossible.Gigabit
Ethernethastwodistinctiveapproachesformediumaccess:half-duplexandfull-duplex.

SECTION13.5GIGABITETHERNET 413
Almostallimplementations ofGigabitEthernetfollowthefull-duplexapproach.How­
ever,webrieflydiscussthehalf-duplexapproachtoshowthatGigabitEthernetcanbe
compatiblewiththepreviousgenerations.
Full-DuplexMode
Infull-duplexmode,thereisacentralswitchconnectedtoallcomputersorother
switches.Inthismode,eachswitchhasbuffersforeachinputportinwhichdataare
storeduntiltheyaretransmitted.There
isnocollisioninthismode, aswediscussed
before.Thismeansthat
CSMAlCDisnotused.Lack ofcollisionimpliesthatthemax­
imumlength
ofthecableisdeterminedbythesignalattenuationinthecable,notbythe
collisiondetectionprocess.
Inthefull-duplexmode ofGigabitEthernet,thereisnocollision;
themaximumlength
ofthecableisdeterminedbythesignalattenuationinthecable.
Half-DuplexMode
GigabitEthernetcanalsobeusedinhalf-duplexmode,althoughitisrare.Inthiscase,
aswitchcanbereplacedbyahub,whichacts
asthecommoncableinwhichacollision
mightoccur.Thehalf-duplexapproachuses
CSMAlCD.However,aswesawbefore,
themaximumlength
ofthenetworkinthisapproachistotallydependentontheminimum
framesize.Threemethodshavebeendefined:traditional,carrierextension,andframe
bursting.
TraditionalInthetraditionalapproach,wekeeptheminimumlength oftheframeas
intraditionalEthernet(512bits).However,becausethelength
ofabitis11100shorter
inGigabitEthernetthaninlO-MbpsEthernet, theslottimeforGigabitEthernetis
512bitsx
111000JlS,whichisequalto0.512 JlS.Thereducedslottimemeansthatcolli­
sion
isdetected100timesearlier.Thismeansthatthemaximumlength ofthenetworkis
25m.Thislengthmaybesuitable ifallthestationsareinoneroom,butitmaynoteven
belongenoughtoconnectthecomputersinonesingleoffice.
CarrierExtensionToallowforalongernetwork,weincreasetheminimumframe
length.The
carrierextensionapproachdefinestheminimumlength ofaframeas512bytes
(4096bits).Thismeansthattheminimumlengthis8timeslonger.Thismethodforces
astationtoaddextensionbits(padding)
toanyframethatislessthan4096bits.Inthis
way,themaximumlength
ofthenetworkcanbeincreased8timestoalength of200m.
Thisallowsalength of100mfromthehubtothestation.
FrameBurstingCarrierextensionisveryinefficient ifwehaveaseries ofshort
framestosend;eachframecarriesredundantdata.
Toimproveefficiency, framebursting
wasproposed.Instead
ofaddinganextensiontoeachframe,multiple framesaresent.
However,tomakethesemultipleframeslooklikeoneframe,paddingisaddedbetween
theframes(thesameasthatusedforthecarrierextensionmethod)
sothatthechannel
isnotidle.Inotherwords,themethoddeceivesotherstationsintothinkingthatavery
largeframehasbeentransmitted.

414 CHAPTER 13WIREDLANs: ETHERNET
PhysicalLayer
ThephysicallayerinGigabitEthernetismorecomplicatedthanthatinStandardorFast
Ethernet.
Webrieflydiscusssomefeatures ofthislayer.
Topology
GigabitEthernet isdesignedtoconnecttwoormorestations. Ifthereareonlytwosta­
tions,theycanbeconnectedpoint-to-point.Threeormorestationsneed
tobeconnected
inastartopologywithahuboraswitchatthecenter.Anotherpossibleconfigurationis
toconnectseveralstartopologiesorletastartopologybepart
ofanotherasshownin
Figure13.22.
Figure13.22 TopologiesofGigabitEthernet
a-a
a.Point-to-point
ffi·
r~ r
="""":. = '""":. ="""':.
c.Twostars
d.Hierarchy
ofstars
ffi
rj r 3
=. roul;:;;:;]",":=-:.
Implementation
GigabitEthernetcanbecategorized aseitheratwo-wireorafour-wireimplementation.
Thetwo-wireimplementationsusefiber-opticcable
(1000Base-SX,short-wave, or
lOOOBase-LX,long-wave), orSTP(1000Base-CX).Thefour-wireversionusescate­
gory5twisted-paircable
(lOOOBase-T).Inotherwords,wehavefourimplementations,
asshowninFigure13.23.lOOOBase-Twasdesignedinresponsetothoseuserswho

SECTION13.5GIGABITETHERNET 415
hadalreadyinstalledthiswiringforotherpurposessuchasFastEthernetortelephone
serVIces.
Figure13.23 GigabitEthernetimplementations
Two-wire Two-wire Two-wire
short-wave
tiberlong-wavetibercopper(STP)
Four-wire
UTP
Encoding
Figure13.24showstheencoding/decodingschemesforthefourimplementations.
Figure13.24 EncodinginGigabitEthernetimplementations
IOOOBase-SX.lOOOBase-LX,andIOOOBase-CX IOOOBase-T
4D-PAM5decoder
8
x125Mbps 8x125Mbps
Stationt
8x125Mbps 8x125Mbps
Station
TwofibersortwoSTPs 4UTPcables
GigabitEthernetcannotusetheManchesterencodingschemebecauseitinvolvesa
veryhighbandwidth(2GBaud).Thetwo-wireimplementationsuseanNRZscheme,but
NRZdoesnotself-synchronizeproperly.
Tosynchronizebits,particularlyatthishigh
datarate,8BIl
OBblockencoding,discussedinChapter4,isused.
Thisblockencodingpreventslongsequences
ofOsorIsinthestream,buttheresult­
ingstreamis1.25Gbps.Notethatinthisimplementation,onewire(fiberorSTP)is
usedforsendingandoneforreceiving.
Inthefour-wireimplementationitisnotpossibletohave2wiresforinputand2for
output,becauseeachwirewouldneedtocarry500Mbps,whichexceedsthecapacity
forcategory5
UTP.Asasolution,4D-PAM5encoding,asdiscussedinChapter4,isused
toreducethebandwidth.Thus,allfourwiresareinvolvedinbothinputandoutput;each
wirecarries250Mbps,whichisintherangeforcategory5UTP
cable_

416 CHAPTER 13WIREDIANs:ETHERNET
Summary
Table13.3isasummaryoftheGigabitEthernetimplementations.
Table13.3
SummaryofGigabitEthernetimplementations
Characteristics lOOOBase-SXlOOOBase-LXlOOOBase-CX lOOOBase-T
:
Media Fiber Fiber STP Cat5UTP I
I
short-wave long-wave
Number
ofwires 2 2 2 4
Maximumlength 550m 5000m 25m 100m
Blockencoding 8B/lOB 8B/lOB 8B/lOB
Lineencoding NRZ NRZ NRZ 4D-PAM5
Ten-GigabitEthernet
TheIEEEcommitteecreatedTen-GigabitEthernetandcalled
itStandard802.3ae.The
goals
oftheTen-GigabitEthernetdesigncanbesummarized asfollows:
1.Upgradethedatarate to10Gbps.
2.Make
itcompatiblewithStandard,Fast,andGigabitEthernet.
3.Usethesame48-bitaddress.
4.Usethesameframeformat.
S.Keepthesameminimumandmaximumframelengths.
6.Allowtheinterconnection ofexistingLANsintoametropolitanareanetwork(MAN)
orawideareanetwork(WAN).
7.MakeEthernetcompatiblewithtechnologiessuchasFrameRelayandATM(see
Chapter18).
MACSublayer
Ten-GigabitEthernetoperatesonlyinfullduplexmodewhichmeansthere
isnoneed
forcontention;
CSMA/CDisnotused
inTen-GigabitEthernet.
PhysicalLayer
ThephysicallayerinTen-GigabitEthernet isdesignedforusingfiber-opticcableoverlong
distances.Threeimplementationsarethemostcommon:lOGBase-S,lOGBase-L,and
lOGBase-E.Table13.4showsasummary
oftheTen-GigabitEthernetimplementaions.
Table13.4
SummaryofTen-GigabitEthernetimplementations
Characteristics lOGBase-S lOGBase-L lOGBase-E
Media Short-wave Long-wave Extended
S50-nrn 131O-nrn 1550-mrn
rnultimode singlemode singlemode
Maximumlength
300m lOkm 40km

SECTION13.8SUMMARY 417
13.6RECOMMENDED READING
Formoredetailsaboutsubjectsdiscussedinthischapter,werecommendthefollowing
books.Theitemsinbrackets[
...]refertothereferencelistattheend ofthetext.
Books
EthernetisdiscussedinChapters10,11,and12 of[For03],Chapter5 of[Kei02],Sec­
tion4.3
of[Tan03],andChapters 15and16 of[Sta04].[SpuOO]isabookaboutEthernet.
Acompletediscussion
ofGigabitEthernetcanbefoundin[KCK98]and[Sau98].
Chapter2
of[IzzOO]hasagoodcomparisonbetweendifferentgenerations ofEthernet.
13.7KEYTERMS
1000Base-CX
1000Base-LX
1000Base-SX
1000Base-T
100Base-FX
100Base-T4
100Base-TX
10Base2
lOBase5
lOBase-F
10Base-T
10GBase-E
lOGBase-L
10GBase-S
autonegotiation
bridge
carrierextension
Cheapernet
collisiondomain
destinationserviceaccesspoint(DSAP)
FastEthernet
framebursting
full-duplexswitchedEthernet
GigabitEthernet
hexadecimalnotation
logical
linkcontrol(LLC)
mediaaccesscontrol(MAC)
networkinterfacecard(NIC)
preamble
Project802
sourceserviceaccesspoint(SSAP)
StandardEthernet
switch
switchedEthernet
Ten-GigabitEthernet
thickEthernet
Thicknet
thinEthernet
transceiver
twisted-pairEthernet
13.8SUMMARY
oEthernetisthemostwidelyusedlocalareanetworkprotocoL
oTheIEEE802.3StandarddefinesI-persistent CSMA/CDastheaccessmethodfor
first-generation10-MbpsEthernet.
oThedatalinklayer ofEthernetconsists oftheLLCsublayerandtheMACsublayer.

418 CHAPTER13WIREDfANs:ETHERNET
oTheMACsublayerisresponsiblefortheoperationofthe CSMAlCDaccess
methodandframing.
oEachstationonanEthernetnetworkhasaunique48-bitaddressimprintedonits
networkinterfacecard(NIC).
oTheminimumframelengthforlO-MbpsEthernetis64bytes;themaximumis
1518bytes.
oThecommonimplementations oflO-MbpsEthernetarelOBase5(thickEthernet),
10Base2(thinEthernet),
lOBase-T(twisted-pairEthernet),andlOBase-F(fiber
Ethernet).
oThe10Base5implementation ofEthernetusesthickcoaxialcable.lOBase2uses
thincoaxialcable.lOBase-Tusesfourtwisted-pair cablesthatconnecteachstation
toacommonhub.lOBase-Fusesfiber-opticcable.
oAbridgecanincreasethebandwidthandseparatethecollisiondomainson an
EthernetLAN.
oAswitchallowseachstationonanEthernetLANtohavetheentirecapacity ofthe
networktoitself.
oFull-duplexmodedoublesthecapacity ofeachdomainandremovestheneedfor
the
CSMAlCDmethod.
oFastEthernethasadatarate of100Mbps.
oInFastEthernet,autonegotiationallowstwodevicestonegotiatethemodeordata
rate
ofoperation.
oThecommonFastEthernetimplementationsare1 OOBase-TX(twopairs oftwisted­
paircable),lOOBase-FX(twofiber-opticcables),and100Base-T4(fourpairs
of
voice-grade,orhigher,twisted-paircable).
oGigabitEthernethasadatarate of1000Mbps.
oGigabitEthernetaccessmethodsincludehalf-duplexmodeusing traditional CSMAI
CD(notcommon)andfull-duplexmode(mostpopularmethod).
oThecommonGigabitEthernetimplementationsare1000Base-SX(twoopticalfibers
andashort-wavelasersource),1000Base-LX(twoopticalfibersandalong-wave
lasersource),and1000Base-T(fourtwistedpairs).
oThelatestEthernetstandardisTen-GigabitEthernetthatoperatesat10Gbps.The
threecommonimplementationsarelOGBase-S,10GBase-L,and10GBase-E.These
implementationsusefiber-opticcablesinfull-duplexmode.
13.9PRACTICESET
ReviewQuestions
1.HowisthepreamblefielddifferentfromtheSFDfield?
2.Whatisthepurpose ofanNIC?
3.Whatisthedifferencebetweenaunicast,multicast,andbroadcastaddress?
4.Whataretheadvantages
ofdividinganEthernetLANwithabridge?
5.Whatistherelationshipbetweenaswitchandabridge?

SECTION13.9PRACTICESET 419
6.Whyisthere noneedfor CSMAlCDonafull-duplexEthernetLAN?
7.ComparethedataratesforStandardEthernet,FastEthernet,GigabitEthernet,and
Ten-GigabitEthernet.
8.WhatarethecommonStandardEthernetimplementations?
9.WhatarethecommonFastEthernetimplementations?
10.WhatarethecommonGigabitEthernetimplementations?
11.WhatarethecommonTen-GigabitEthernetimplementations?
Exercises
12.Whatisthehexadecimalequivalent ofthefollowingEthernetaddress?
010110100001000101010101000110001010101000001111
13.HowdoestheEthernetaddresslA:2B:3CAD:5E:6Fappearonthelineinbinary?
14.IfanEthernetdestinationaddress is07:01:02:03:04:05,what isthetypeofthe
address(unicast,multicast,orbroadcast)?
15.Theaddress43:7B:6C:DE:10:00hasbeenshown asthesourceaddressin anEthernet
frame.Thereceiverhasdiscardedtheframe.Why?
16.AnEthernetMACsublayerreceives42bytes ofdatafromtheupperlayer.How
manybytes
ofpaddingmustbeadded tothedata?
17.AnEthernetMACsublayerreceives1510bytes ofdatafromtheupperlayer.Can
thedatabeencapsulatedinoneframe?
Ifnot,howmanyframesneed tobesent?
Whatisthesize
ofthedataineachframe?
18.WhatistheratioofusefuldatatotheentirepacketforthesmallestEthernetframe?
Whatistheratioforthelargestframe?
19.Supposethelength ofalOBase5cableis2500 m.Ifthespeedofpropagationina
thickcoaxialcableis200,000,000m!s,howlongdoesittakeforabittotravel
fromthebeginningtotheendofthenetwork?Assumethereare10
/lsdelayinthe
equipment.
20.Thedatarate
oflOBase5is10Mbps.Howlongdoesittaketocreatethesmallest
frame?Showyourcalculation.

CHAPTER14
WirelessLANs
Wirelesscommunicationisone ofthefastest-growingtechnologies.Thedemandfor
connectingdeviceswithouttheuse
ofcablesisincreasingeverywhere.WirelessLANs
canbefound oncollegecampuses,inofficebuildings,andinmanypublicareas.
Inthischapter,weconcentrateontwopromisingwirelesstechnologiesforLANs:
IEEE802.11wirelessLANs,sometimescalledwirelessEthernet,andBluetooth,a
technologyforsmallwirelessLANs.Althoughbothprotocolsneedseverallayersto
operate,weconcentratemostlyonthephysicalanddatalinklayers.
14.1IEEE802.11
IEEEhasdefinedthespecificationsforawirelessLAN,called IEEE802.11,which
coversthephysicalanddatalinklayers.
Architecture
Thestandarddefinestwokinds ofservices:thebasicserviceset(BSS)andtheextended
serviceset(ESS).
BasicServiceSet
IEEE802.11definesthe basicserviceset(BSS)asthebuildingblock ofawireless
LAN.Abasicservicesetismade
ofstationaryormobilewirelessstationsand anoptional
centralbasestation,known
astheaccesspoint(AP).Figure 14.1showstwosetsinthis
standard.
TheBSSwithout
anAPisastand-alonenetworkandcannotsenddatatootherBSSs.
Itiscalledan adhocarchitecture.Inthisarchitecture,stationscanformanetwork
withouttheneed
ofanAP;theycan locateoneanotherandagreetobepart ofaBSS.A
BSSwith
anAPissometimesreferredtoasan infrastructurenetwork.
ABSSwithoutanAPiscalledanadhocnetwork;
aBSSwith anAPiscalledaninfrastructurenetwork.
421

422 CHAPTER 14WIRELESSLANs
Figure14.1 Basicservicesets(BSSs)
AP
Station
-------------------
1
&i
Station:
I
I
&i
Station Station I
------------------~
Infrastructure(BSSwith anAP)
1-------------------I
:1h!1.., Igl..,:
1 • • 1
1
Station Station 1
I I
I I
ir! ~i
I~ ~I
IStation Station 1l ~
Adhocnetwork(SSSwithoutan AP)
BSS:Basicserviceset
AP:Accesspoint
ExtendedServiceSet
Anextendedserviceset(ESS) ismadeup oftwoormoreBSSswithAPs.Inthis
case,theBSSsareconnectedthroughadistributionsystem,whichisusuallyawired
LAN.ThedistributionsystemconnectstheAPsintheBSSs.IEEE802.11doesnot
restrictthedistributionsystem;itcanbeanyIEEELANsuch
asanEthernet.Notethat
theextendedservicesetusestwotypes
ofstations:mobileandstationary.Themobile
stationsarenormalstationsinsideaBSS.ThestationarystationsareAPstationsthat
arepart
ofawiredLAN.Figure14.2showsanESS.
Figure14.2 Extendedservicesets(ESSs)
--------
ESS:Extendedserviceset
BSS:Basicserviceset
AP:Accesspoint
r--------jc:u:w:J
/,,'-Distributionsystem-"~
\.. ) Serveror
Gateway
BSS BSS BSS
WhenBSSsareconnected,thestationswithinreach ofoneanothercancommuni­
catewithouttheuse
ofanAP.However,communicationbetweentwostationsintwo
differentBSSsusuallyoccursviatwoAPs.Theidea
issimilartocommunicationina
cellularnetwork
ifweconsidereachBSStobeacellandeachAPtobeabasestation.
Notethatamobilestationcanbelong
tomorethanoneBSSatthesametime.
StationTypes
IEEE802.11definesthreetypes
ofstationsbasedontheirmobilityinawirelessLAN:
no-transition,BSS·transition, andESS-transitionmobility. Astationwithno-transition

SECTION14.1IEEE802.11423
mobilityiseitherstationary(notmoving)ormovingonlyinsideaBSS.Astationwith
BSS-transitionmobilitycanmovefromoneBSStoanother,butthemovementiscon­
finedinsideoneESS.AstationwithESS-transitionmobility
canmovefromoneESSto
another.However,IEEE802.11doesnotguaranteethatcommunicationiscontinuous
duringthemove.
MACSublayer
IEEE802.11definestwoMACsublayers:thedistributedcoordinationfunction(DCF)
andpointcoordinationfunction(PCF).Figure
14.3showstherelationshipbetweenthe
twoMACsublayers,theLLCsublayer,andthephysicallayer.Wediscussthephysical
layerimplementationslaterinthechapterandwill nowconcentrateontheMAC
sublayer.
Figure14.3MAClayers inIEEE802.11standard
Datalink
layer
MAC
sublayer
Pointcoordinationfunction(PCF)
Distrilmtedcoordinationfunction(DC:P)
Contention
service
Physical
layer
802.Ila802.l1g
OFDM DSSS
DistributedCoordinationFunction
OneofthetwoprotocolsdefinedbyIEEEattheMACsublayeriscalledthe distributed
coordinationfunction(DCF).DCFusesCSMAICA(asdefinedinChapter12)asthe
accessmethod.WirelessLANscannotimplement
CSMAfCDforthreereasons:
I.Forcollisiondetectionastationmust beabletosenddataandreceivecollision
signalsatthesametime.Thiscan
meancostlystationsandincreasedbandwidth
requirements.
2.Collisionmaynotbedetectedbecause ofthehiddenstationproblem.Wewilldiscuss
thisproblemlater
inthechapter.
3.Thedistancebetweenstationscanbegreat.Signalfadingcouldpreventastationat
oneendfromhearingacollisionattheotherend.
ProcessFlowchartFigure14.4showstheprocessflowchartfor CSMAICAasused
inwirelessLANs.Wewillexplainthestepsshortly.
FrameExchangeTimeLineFigure14.5showstheexchange ofdataandcontrol
framesintime.

424 CHAPTER14WIRELESSLANs
Figure14.4 CSMAICAflowchart
Waitback-off
time
Time
Increment
back-off
Time Time Time

SECTION14.1IEEE802.11425
I.Beforesendingaframe,thesourcestationsensesthemediumbycheckingthe
energylevelatthecarrierfrequency.
a.Thechannelusesapersistencestrategywithback-offuntilthechannel isidle.
b.Afterthestationisfoundtobeidle,thestationwaitsforaperiod oftimecalled
the
distributedinterframespace(DIFS);thenthestationsendsacontrol
framecalledtherequesttosend(RTS).
2.Afterreceivingthe RTSandwaitingaperiod oftimecalledthe shortinterframe
space(SIFS),thedestinationstationsendsacontrolframe,calledtheclearto
send(CTS),tothesourcestation.Thiscontrolframeindicatesthatthedestination
stationisreadytoreceivedata.
3.Thesourcestationsendsdataafterwaitinganamount oftimeequaltoSIFS.
4.Thedestinationstation,afterwaitinganamount oftimeequaltoSIFS,sendsan
acknowledgmenttoshowthattheframehasbeenreceived.Acknowledgmentis
neededinthisprotocolbecausethestationdoesnothaveanymeanstocheckfor
thesuccessfularrival
ofitsdataatthedestination.Ontheotherhand,thelack of
collisionin CSMAlCDisakindofindicationtothesourcethatdatahavearrived.
NetworkAllocationVectorHowdootherstationsdefersendingtheirdata ifone
stationacquiresaccess?Inotherwords,how
isthecollisionavoidance aspectofthis
protocolaccomplished?Thekey
isafeaturecalledNA V.
Whenastationsendsan RTSframe,itincludestheduration oftimethatitneedsto
occupythechannel.Thestationsthatareaffectedbythistransmissioncreateatimer
calleda
networkallocationvector(NAV)thatshowshowmuchtimemustpassbefore
thesestationsareallowedtocheckthechannelforidleness.Eachtimeastation
accessesthesystemandsendsan
RTSframe,otherstationsstarttheirNA V.Inother
words,eachstation,beforesensingthephysicalmediumtoseeifitisidle,firstchecks
its
NAVtoseeifithasexpired.Figure14.5showstheidea ofNAV.
CollisionDuringHandshakingWhathappens ifthereiscollisionduringthetime
when
RTSorCTScontrolframesareintransition,oftencalledthehandshakingperiod?
Twoormorestationsmaytrytosend RTSframesatthesametime.Thesecontrolframes
maycollide.However,becausethere
isnomechanismforcollisiondetection,thesender
assumestherehasbeenacollision
ifithasnotreceivedaCTSframefromthereceiver.
Theback-offstrategyisemployed,andthesendertriesagain.
PointCoordinationFunction(PCP)
Thepointcoordinationfunction(PCF)isanoptionalaccessmethodthatcanbeimple­
mentedinaninfrastructurenetwork(notinan adhocnetwork).
Itisimplementedontop
oftheDCFandisusedmostlyfortime-sensitivetransmission.
PCFhasacentralized,contention-freepollingaccessmethod.TheAPperforms
pollingforstationsthatarecapable
ofbeingpolled.Thestationsarepolledoneafter
another,sendinganydatatheyhavetothe
AP.
Togivepriorityto PCFoverDCF,anotherset ofinterframespaceshasbeen
defined:PIFSandSIFS.TheSIFS
isthesameasthatinDCF,butthePIFS(PCFIFS) is
shorterthantheDIFS.Thismeansthatif,atthesametime,astationwants touseonly
DCFandanAPwantstousePCF,theAPhaspriority.

426 CHAPTER 14WIRELESSLANs
Duetothepriority ofPCFoverDCF,stationsthatonlyuseDCFmaynotgain
accesstothemedium.
Topreventthis,arepetitionintervalhasbeendesignedtocover
bothcontention-free(PCF)andcontention-based(DCF)traffic.The
repetitioninterval,
whichisrepeatedcontinuously,startswithaspecialcontrolframe,calledabeaconframe.
Whenthestationshearthebeaconframe,theystarttheir
NAVfortheduration ofthe
contention-freeperiod
oftherepetitioninterval.Figure14.6showsanexample ofarep­
etitioninterval.
Figure14.6 Exampleofrepetitioninterval
B:Beaconframe
CF:Contention-free
AP
&
Polled
station
&
Others
&
&
..
Repetitioninterval
Contention-free Contention
PIFS SIFS ~-----
1----+
f--
~
ACK+I~
~;B ipoll• ••end
Time
SIFS
--
ACK+data
Time
}
~~c,~ ~ , '
DC:::NAV
~,~>:,' ~',,>; ~' ,,
Time
Duringtherepetitioninterval,thePC(pointcontroller)cansendapollframe,
receivedata,sendanACK,receiveanACK,ordoanycombination
ofthese(802.11
usespiggybacking).Attheend
ofthe contention-freeperiod,thePCsendsaCFend
(contention-freeend)frame
toallowthecontention-basedstationstousethemedium.
Fragmentation
Thewirelessenvironmentisverynoisy;acorruptframehastoberetransmitted.The
protocol,therefore,recommends
fragmentation-thedivisionofalargeframeinto
smallerones.Itismoreefficienttoresendasmallframethanalargeone.
FrameFormat
TheMAClayerframeconsists ofninefields,asshowninFigure14.7.
oFramecontrol(Fe).TheFCfield is2byteslonganddefinesthetype offrameand
somecontrolinformation.Table
14.1describesthesubfields. Wewilldiscusseach
frametypelaterinthischapter.

SECTION14.1IEEE802.11 427
Figure14.7Frameformat
2bytes2bytes6bytes 6bytes 6bytes2bytes6bytes oto2312bytes
Framebody
MoreWEPRsvd
data
2bits
2bits 4bits 1bit1bit1bit1bit1bit1bit1bit1bit
Table14.1 Subfieldsin FCfield
Field Explanation
Version Currentversionis0
Type Type
ofinformation:management(00),control(01),ordata(10)
Subtype Subtype
ofeachtype(seeTable14.2)
ToDS Definedlater
FromDS Definedlater
Moreflag Whensetto
1,meansmorefragments
Retry Whensetto
1,meansretransmittedframe
Pwrmgt Whensetto
1,meansstationisinpowermanagementmode
Moredata Whensetto
1,meansstationhasmoredatatosend
WEP Wiredequivalentprivacy(encryptionimplemented)
Rsvd Reserved
DD.Inallframetypesexceptone,thisfielddefinestheduration ofthetransmission
thatisusedtosetthevalue
ofNAY.Inonecontrolframe,thisfielddefinestheID
oftheframe.
DAddresses.Therearefouraddressfields,each6byteslong.Themeaning ofeach
addressfielddependsonthevalue
oftheToDSandFromDSsubfieldsandwill be
discussedlater.
DSequencecontrol.Thisfielddefinesthesequencenumber oftheframetobeused
in
flowcontrol.
DFramebody.Thisfield,whichcanbebetween0 and2312bytes,containsinfor­
mationbasedonthetypeandthesubtypedefinedintheFCfield.
DFCS.TheFCSfield is4byteslongandcontainsaCRC-32errordetectionsequence.
FrameTypes
AwirelessLANdefinedbyIEEE802.11hasthreecategories offrames:management
frames,controlframes,anddataframes.
ManagementFramesManagementframesareusedfortheinitialcommunication
betweenstationsandaccesspoints.

428 CHAPTER 14WIRELESSLANs
ControlFramesControlframesareusedforaccessingthechannelandacknowledg­
ingframes.Figure14.8showstheformat.
Figure14.8Controlframes
2bytes2bytes6
bytes 6bytes4bytes
~ Address1IAddress21FCS ..)
RTS
2bytes2bytes6bytes4bytes
~ Address1Ipcs:I
CTSorACK
Forcontrolframesthevalue ofthetypefieldis0I;thevalues ofthesubtypefields
forframeswehavediscussedareshowninTable14.2.
Table
14.2Valuesofsubfieldsincontrolframes
SubtypeMeaning
1011 Requesttosend(RTS)
1100 Cleartosend(CTS)
1101 Acknowledgment(ACK)
DataFramesDataframesareusedforcarryingdataandcontrolinformation.
AddressingMechanism
TheIEEE802.11addressingmechanismspecifiesfourcases,definedbythevalue ofthe
twoflagsintheFCfield,
ToDSandFromDS. Eachflagcanbeeither0orI,resultingin
fourdifferentsituations.Theinterpretation
ofthefouraddresses(addressItoaddress4)
intheMACframedependsonthevalue
oftheseflags,asshowninTable14.3.
Table
14.3Addresses
To From Address Address Address Address
DS DS
1 2 3 4
0 0 Destination Source BSSID N/A
0 1 Destination SendingAP Source N/A
1 0 ReceivingAP Source Destination N/A
1 1 ReceivingAP SendingAP Destination Source
Notethataddress1isalwaystheaddress ofthenextdevice.Address2isalways
theaddress
ofthepreviousdevice.Address3istheaddress ofthefinaldestinationsta­
tion
ifitisnotdefinedbyaddressI.Address4 istheaddressoftheoriginalsource
station
ifitisnotthesameasaddress2.
oCase1:00Inthiscase, ToDS=0 andFromDS=O.Thismeansthattheframeis
notgoingtoadistributionsystem
(ToDS=0)andisnotcomingfromadistribution

SECTION14.1IEEE802.11429
system(FromDS=0).TheframeisgoingfromonestationinaBSStoanother
withoutpassingthroughthedistributionsystem.The
ACKframeshouldbesentto
theoriginalsender.TheaddressesareshowninFigure14.9.
Figure14.9Addressingmechanisms
~ss---------------------
I BSS-ID
:,.a.~BIAdl a:
:_~ ~_~_~__~ ~_J
a.Case1
[~f~-d~~~~~1i~fi~l~s~
Bsi-ii~--BSS
a:: 3 4a
BII A
___~l _
c.Case3
b.Case2
d.Case4
oCase2:01Inthiscase, ToDS=0andFromDS=1.Thismeansthattheframeis
comingfromadistributionsystem
(FromDS=1).Theframeiscomingfroman
APandgoingtoastation.The ACKshouldbesenttothe AP.Theaddressesareas
showninFigure14.9.Notethataddress3containstheoriginalsender
oftheframe
(inanotherBSS).
oCase3:10Inthiscase, ToDS=1andFromDS=O.Thismeansthattheframeis
going
toadistributionsystem (ToDS=1).Theframeisgoingfromastationtoan AP.
TheACKissenttotheoriginalstation.Theaddressesare asshowninFigure14.9.
Notethataddress3containsthefinaldestination
oftheframe(inanotherBSS).
oCase4:11 Inthiscase,ToDS=1andFromDS=1.
TIusisthecaseinwhichthedistri­
butionsystemisalsowireless.Theframe
isgoingfromoneAP toanotherAPinawire­
lessdistributionsystem.
Wedonotneed todefineaddressesifthedistributionsystem is
awiredLANbecausetheframeinthesecaseshastheformatofawiredLANframe
(Ethernet,forexample).Here,weneedfouraddresses
todefinetheoriginalsender,the
finaldestination,andtwointermediateAPs.Figure14.9showsthesituation.
HiddenandExposedStation Problems
Wereferredtohiddenandexposedstationproblemsintheprevioussection. Itistime
nowtodicusstheseproblemsandtheireffects.
HiddenStationProblemFigure14.10shows anexampleofthehiddenstation
problem.StationBhasatransmissionrangeshownbytheleftoval(sphereinspace);
everystationinthisrangecanhearanysignaltransmittedbystationB.StationChas

430 CHAPTER 14WIRELESSLANs
Figure14.10 Hiddenstationproblem
Range
ofB
(]
~
B
&
c
Range
ofC
BandCarehiddentfromeachotherwithrespecttoA.
atransmissionrangeshownbytherightoval(sphereinspace);everystationlocated
inthisrangecanhearanysignaltransmittedby
C.StationCisoutsidethetransmis­
sionrange
ofB;likewise,stationBisoutsidethetransmissionrange ofC.StationA,
however,isintheareacoveredbyboth
BandC;itcanhearanysignaltransmittedby
BorC.
AssumethatstationB
issendingdatatostation A.Inthemiddle ofthistransmission,
stationCalsohasdatatosendtostation
A.However,stationCisoutofB'srangeand
transmissionsfromBcannotreach
C.ThereforeCthinksthemediumisfree.StationC
sendsitsdatato
A,whichresultsinacollisionatAbecausethisstationisreceivingdata
frombothBand
C.Inthiscase,wesaythatstations BandCarehiddenfromeachother
withrespectto
A.Hiddenstationscanreducethecapacityofthenetwork becauseofthe
possibilityofcollision.
Thesolutiontothehiddenstationproblem
istheuseofthehandshakeframes (RTS
andCTS)that wediscussedearlier.Figure14.11showsthatthe RTSmessagefromB
reachesA,butnot
C.However,becauseboth BandCarewithintherange ofA,the
CTSmessage,whichcontainsthedurationofdatatransmissionfromBtoAreaches
C.
StationCknowsthatsomehiddenstationisusingthechannelandrefrainsfrom
trans­
mittinguntilthatdurationisover.
TheCTS frameinCSMAICAhandshakecanpreventcollision
fromahiddenstation.
Figure14.11 Useofhandshakingtopreventhiddenstationproblem
B A C
r
CTS CTS
Time Time Time

SECTION14.1IEEE802.11431
ExposedStationProblemNowconsiderasituationthatistheinverse oftheprevi­
ousone:theexposedstationproblem.Inthis
problemastationrefrainsfromusinga
channelwhenitis,infact,available.
InFigure14.12,stationAistransmitting tostationB.
StationC
hassomedatatosendtostationD,whichcan besentwithoutinterfering
withthetransmissionfromAtoB.However,stationCisexposedtotransmissionfrom
A;
ithearswhatAissendingandthusrefrainsfromsending.Inotherwords,Cistoo
conservativeandwastesthecapacity
ofthechannel.
Figure14.12Exposedstationproblem
Range
ofA
-----~ -------------
Rang;---,
ofC ',
a&)
CD,'>
CisexposedtotransmissionfromAto B.
ThehandshakingmessagesRTSandCTScannothelpin thiscase,despitewhatyou
mightthink.StationChearstheRTSfromA,butdoesnotheartheCTSfrom
B.StationC,
afterhearingtheRTSfromA,canwaitforatimesothattheCTSfromBreaches
A;itthen
sendsanRTStoDtoshowthat
itneedstocommunicatewithD.BothstationsBandA
mayhearthisRTS,butstationAis
inthesendingstate,notthereceivingstate.StationB,
however,respondswithaCTS.Theproblemishere.
IfstationAhasstartedsendingits
data,stationCcannotheartheCTSfromstationDbecause
ofthecollision;itcannotsend
itsdatatoD.
ItremainsexposeduntilAfinishessendingitsdataasFigure14.13shows.
Figure14.13Useofhandshakinginexposedstationproblem
B
Time
A
Time
Exposedto
A'stransmission
C
RTS
Collision
here
Time
D
r
Time

125
MHz
432 CHAPTER i4WiRELESSLANs
PhysicalLayer
Wediscusssixspecifications, asshowninTable14.4.
Table14.4
Physicallayers
IEEE Technique Band Modulation Rate(Mbps)
802.11 FHSS 2.4GHz FSK 1and2
DSSS 2.4GHz PSK 1and2
Infrared PPM 1and2
802.11a OFDM 5.725GHz
PSKorQAM 6to54
802.l1b DSSS 2.4GHz PSK 5.5and 11
802.1Ig OFDM 2.4GHz Different 22and54
Allimplementations,excepttheinfrared,operateinthe industrial,scientific,
andmedical(ISM) band,whichdefinesthreeunlicensedbandsinthethreeranges
902-928MHz,2.400--4.835GHz,and5.725-5.850GHz,
asshowninFigure14.14.
Figure14.14
industrial,
scient(fic,andmedical(ISM)band
26 83.5
,MHz, MHz, ,
~ ~I.----'JI 1:1( "I
,",.-----''=.,.....--~--...,.,,'
~
'kV ; I'~:£--:}00_. ..:,,,,:,].
~;~~ ~~:-
<3A>,i1."< 1...- ----l.. I:.::;.:;.-l~--.:...~:::~-'~,L;~J '0-'.'.:...'.':.....'....:.,-"--"..:.....0.......'- ~.
9029282.4 2.4835 5.725 5.850Frequency
MHzMHz GHz GHz GHz GHz
IEEE802.11FHSS
IEEE802.11FHSSusesthefrequency-hoppingspreadspectrum(FHSS)method as
discussedinChapter 6.FHSSusesthe2.4-GHzISMband.Thebandisdividedinto
79subbands
of1MHz(andsomeguardbands).Apseudorandomnumbergenerator
selectsthehoppingsequence.Themodulationtechniqueinthisspecificationiseither
two-levelFSKorfour-levelFSKwithIor2bitslbaud,whichresults
inadatarate of1
or2Mbps,
asshowninFigure14.15.
IEEE802.11DSSS
IEEE802.11DSSSusesthedirectsequencespreadspectrum(DSSS)methodasdis­
cussedinChapter
6.DSSSuses the2.4-GHzISMband.Themodulationtechnique inthis
specificationisPSKat1Mbaud/s.Thesystemallows1or2bitslbaud(BPSKorQPSK),
whichresultsinadatarate
of1or2Mbps, asshowninFigure14.16.
IEEE802.11Infrared
IEEE802.11infraredusesinfraredlightintherange of800to950nm.Themodulation
techniqueiscalledpulsepositionmodulation(PPM).ForaI-Mbpsdatarate,a4-bit

SECTION14.1IEEE802.11433
Figure14.15 Physicallayer ofIEEE802.11FHSS
lor2Mbps
Modulator
Digital 2-Levelor4-1evell
data
FSK
I
t
Pseudorandom
1-+1
Frequency
I
sequence synthetizer
Figure14.16 Physicallayer ofIEEE802.11DSSS
lor2Mbps
Digital_~
data
I-MHz
Analog
signal
II-MHz
F-~~ Analog
signal
sequenceisfirstmappedintoa16-bitsequenceinwhichonlyonebitissetto1andthe
restaresetto
O.Fora2-Mbpsdatarate,a2-bitsequenceisfirstmappedintoa4-bit
sequenceinwhichonlyone
bitissetto1andtherestaresetto O.Themapped
sequencesarethenconvertedtoopticalsignals;thepresence
oflightspecifies1,the
absenceoflightspecifies
O.SeeFigure14.17.
Figure14.17 Physicallayer ofIEEE802.11infrared
lor2Mbps
Digital_~
data
.....,.....~Analog
signal
IEEE802.llaOFDM
IEEE802.IlaOFDMdescribesthe orthogonalfrequency-divisionmultiplexing
(OFDM)methodforsignalgenerationina5-GHzISMband.OFDMissimilarto
FDM
asdiscussedinChapter 6,withonemajordifference:Allthesubbandsareused
byonesourceatagiventime.Sourcescontendwithoneanotheratthedatalinklayer
foraccess.Thebandisdividedinto52subbands,with48subbandsforsending48
groupsofbitsatatimeand4subbandsforcontrolinformation.Theschemeissimilar
toADSL,
asdiscussedinChapter9.Dividingthebandintosubbandsdiminishesthe
effects
ofinterference.Ifthesubbandsareusedrandomly,securitycanalsobeincreased.

434 CHAPTER14WIRELESSLANs
OFDMusesPSKandQAMformodulation.Thecommondataratesare 18Mbps(PSK)
and54Mbps(QAM).
IEEE802.llbDSSS
IEEE802.11bDSSSdescribesthe high-ratedirectsequencespreadspectrum (HR­
DSSS)methodforsignalgenerationinthe2.4-GHzISMband.HR-DSSSissimilarto
DSSSexceptfortheencodingmethod,which
iscalledcomplementarycodekeying
(CCK).CCKencodes4or8bitstooneCCKsymbol. Tobebackwardcompatiblewith
DSSS,HR-DSSSdefinesfourdatarates:
1,2,5.5,and 11Mbps.Thefirsttwousethe
samemodulationtechniquesasDSSS.The5.5-MbpsversionusesBPSKandtransmits
at1.375Mbaudlswith4-bitCCKencoding.TheII-MbpsversionusesQPSKandtrans­
mitsat1.375Mbpswith8-bitCCKencoding.Figure14.18showsthemodulationtech­
niqueforthisstandard.
Figure14.18 Physicallayer ofIEEE802.11b
5.5or
IIMbps
Digital_~
data
MQiiulator
QPSK
ll-MHz
~~ Analog
signal
IEEE802.11g
ThisnewspecificationdefinesforwarderrorcorrectionandOFDMusingthe2.4-GHz
ISMband.Themodulationtechniqueachievesa22-or54-Mbpsdatarate.Itisbackward­
compatiblewith802.11b,butthemodulationtechniqueisOFDM.
14.2BLUETOOTH
BluetoothisawirelessLANtechnologydesignedtoconnectdevices ofdifferentfunc­
tionssuchastelephones,notebooks,computers(desktopandlaptop),cameras,printers,
coffeemakers,andso
on.ABluetoothLANisanadhocnetwork,whichmeansthatthe
networkisformedspontaneously;thedevices,sometimescalledgadgets,findeach
otherandmakeanetworkcalledapiconet.ABluetoothLANcanevenbeconnectedto
theInternet
ifoneofthegadgetshasthiscapability.ABluetoothLAN,bynature,can­
notbelarge.
Iftherearemanygadgetsthattrytoconnect,thereischaos.
Bluetoothtechnologyhasseveralapplications.Peripheraldevicessuch
asawire­
lessmouseorkeyboardcancommunicatewiththecomputerthroughthistechnology.
Monitoringdevicescancommunicatewithsensordevicesinasmallhealthcarecenter.
Homesecuritydevicescanusethistechnologytoconnectdifferentsensorstothemain

SECTION14.2BLUETOOTH 435
securitycontroller.Conferenceattendeescansynchronizetheirlaptopcomputersata
conference.
Bluetoothwasoriginallystarted
asaprojectbytheEricssonCompany. Itisnamed
forHaraldBlaatand,thekingofDenmark(940-981)whounitedDenmarkandNorway.
Blaatandtranslatesto BluetoothinEnglish.
Today,Bluetoothtechnologyistheimplementation
ofaprotocoldefinedbythe
IEEE802.15standard.Thestandarddefinesawirelesspersonal-areanetwork(PAN)
operableinanareathesize
ofaroomorahall.
Architecture
Bluetoothdefinestwotypesofnetworks:piconetandscatternet.
Piconets
ABluetoothnetworkiscalleda piconet,orasmallnet.Apiconetcanhave uptoeight
stations,one
ofwhichiscalledthe primary;ttherestarecalled secondaries.Allthe
secondarystationssynchronizetheirclocksandhoppingsequencewiththeprimary.
Notethatapiconetcanhaveonlyoneprimarystation.Thecommunicationbetweenthe
primaryandthesecondarycanbeone-to-oneorone-to-many.Figure14.19showsa
piconet.
Figure14.19 Piconet
Piconet
-----------------------------
I
SecondarySecondarySecondarySecondary
Althoughapiconetcanhaveamaximum ofsevensecondaries,anadditionaleight
secondariescanbeinthe
parkedstate. Asecondaryinaparkedstateissynchronized
withtheprimary,butcannottakepartincommunicationuntilitismovedfromthe
parkedstate.Becauseonlyeightstationscanbeactiveinapiconet,activatingastation
fromtheparkedstatemeansthatanactivestationmustgototheparkedstate.
Scat/ernet
Piconetscanbecombinedtoformwhat iscalleda scatternet.Asecondarystationin
onepiconetcanbetheprimaryinanotherpiconet.Thisstationcanreceivemessages
tTheliteraturesometimesusesthetermsmasterandslaveinstead ofprimaryandsecondary.Wepreferthelatter.

436 CHAPTER14WIRELESSLANs
fromtheprimaryinthefirstpiconet(asasecondary)and,actingasaprimary,deliver
themtosecondariesinthesecondpiconet.Astationcanbeamember
oftwopiconets.
Figure14.20illustratesascatternet.
Figure14.20Scatternet
Piconet
SecondarySecondarySecondary
Primary/
Secondary
Secondary
Secondary---------------------t=========--~
Piconet
BluetoothDevices
ABluetoothdevicehasabuilt-inshort-rangeradiotransmitter.Thecurrentdatarate is
1Mbpswitha2.4-GHzbandwidth.Thismeansthatthereisapossibility ofinterference
betweentheIEEE802.11bwirelessLANsandBluetoothLANs.
BluetoothLayers
Bluetoothusesseverallayersthatdonotexactlymatchthose oftheInternetmodelwe
havedefinedinthisbook.Figure14.21showstheselayers.
Figure14.21Bluetoothlayers
Applications
I
ProfilesI
0
I~I
g
"6
::>
~
<t:
0
u
I L2CAPIayer I
Basebandlayer
Radiolayer
RadioLayer
Theradiolayer isroughlyequivalenttothephysicallayer oftheInternetmodel.Bluetooth
devicesarelow-powerandhavearange
of10m.

SECTION14.2BLUETOOTH 437
Band
Bluetoothusesa2.4-GHzISMbanddividedinto 79channelsof1MHzeach.
FHSS
Bluetoothusesthefrequency-hopping spreadspectrum(FHSS)methodinthephys­
icallayertoavoidinterferencefromotherdevicesorothernetworks.Bluetooth
hops1600timespersecond,whichmeansthateachdevicechangesitsmodulationfre­
quency1600timespersecond. Adeviceusesafrequencyforonly625Ils(1/1600s)
beforeithopstoanotherfrequency;thedwelltimeis625Ils.
Modulation
Totransformbitstoasignal,Bluetoothusesasophisticatedversion ofFSK,called
GFSK(FSKwithGaussianbandwidthfiltering;adiscussionofthistopicisbeyondthe
scopeofthisbook).GFSKhasacan'ierfrequency.Bit1isrepresentedbyafrequency
deviationabovethecarrier;bit
aisrepresentedbyafrequencydeviationbelowthe
carrier.Thefrequencies,
inmegahertz,aredefinedaccordingtothefollowingformula
foreachchannel:
fc=2402+n n
=0,1,2,3,...,78
Forexample,thefirstchannelusescarrierfrequency2402MHz(2.402GHz),andthe
secondchannelusescarrierfrequency2403MHz(2.403GHz).
BasebandLayer
ThebasebandlayerisroughlyequivalenttotheMACsublayerinLAN s.Theaccess
methodisTDMA(seeChapter12).Theprimaryandsecondarycommunicatewith
eachotherusingtimeslots.Thelengthofatimeslotisexactlythesameasthedwell
time,625
Ils.Thismeansthatduringthetimethatonefrequencyisused,asendersends
aframe
toasecondary,orasecondarysendsaframe totheprimary.Notethatthecom­
municationisonlybetweentheprimaryandasecondary;secondariescannotcommuni­
catedirectlywithoneanother.
TDMA
BluetoothusesaformofTDMA(seeChapter 12)thatiscalledTDD-TDMA (time­
divisionduplexTDMA).TDD-TDMAisakind
ofhalf-duplexcommunicationin
whichthesecondaryandreceiversendandreceivedata,butnotatthesametime(half­
duplex);however,thecommunicationforeachdirectionusesdifferenthops.Thisis
similartowalkie-talkiesusingdifferentcarrierfrequencies.
Single-SecondaryCommunicationIfthepiconet
hasonlyonesecondary, theTDMA
operationisverysimple.Thetime
isdividedintoslotsof 625
Ils.Theprimaryuseseven­
numberedslots(0,2,4,
...);thesecondaryusesodd-numberedslots(1,3, 5,...).
TDD-TDMAallowstheprimaryandthesecondary tocommunicateinhalf-duplexmode.

fO
438 CHAPTER14WIRELESSLANs
Inslot0,theprimarysends,andthesecondaryreceives; inslot1,thesecondarysends,and
theprimaryreceives.Thecycleisrepeated.Figure14.22showstheconcept.
Figure14.22Single-secondarycommunication
I
625Jls I
i' ~i
I, .1 I
:366JlsI: I I
r-rr---:----iHopI r-rr---lHop:
Primary-+LL---JL...----;i--------lI-LL-----JL...----+,------+---l.~
l
it1 I Time
,I:ii,
Secondary~----_crr=J_H_O_P--l:----~OCJ_H-O-p_+i ---l'~
I I I I Time
I fl! f2 ! f3 !
Multiple-SecondaryCommunicationTheprocessisalittlemoreinvolved ifthereis
morethanonesecondaryinthepiconet.Again,theprimaryusestheeven-numberedslots,
butasecondarysendsinthenextodd-numberedslot
ifthepacketinthepreviousslotwas
addressedtoit.Allsecondarieslistenoneven-numberedslots,butonlyonesecondary
sendsinanyodd-numberedslot.Figure14.23showsascenario.
Figure14.23Multiple-secondarycommunication
I I I I
-OCJ
HOP
: CIT=]Hop!

Primary I
j
I
1
I
Time
I I
I
I
I I
I I
I I
I
I
I I
I
Hop I
Secondary1
I
I
Time
I
I
I
I
I
I
I
Secondary2
trr=JHOp
•I
I
f3
Time
fO fl f2 J
Letuselaborateonthefigure.
1.Inslot0,theprimarysendsaframetosecondary 1.
2.Inslot1,onlysecondaryIsendsaframetotheprimarybecausethepreviousframe
wasaddressedtosecondary
1;othersecondariesaresilent.

SECTION14.2BLUETOOTH 439
3.Inslot2,theprimarysendsaframetosecondary 2.
4.Inslot3,onlysecondary2sendsaframetotheprimarybecausethepreviousframe
wasaddressedtosecondary2;othersecondariesaresilent.
5.Thecyclecontinues.
Wecansaythatthisaccessmethodissimilartoapoll/selectoperationwithreservations.
Whentheprimaryselectsasecondary,italsopollsit.Thenexttimeslotisreservedfor
thepolledstationtosenditsframe.
Ifthepolledsecondaryhasnoframetosend,the
channelissilent.
PhysicalLinks
Twotypes oflinkscanbecreatedbetweenaprimaryandasecondary:SCQlinksand
ACLlinks.
scaAsynchronousconnection-oriented (SeQ)linkisusedwhenavoidinglatency
(delayindatadelivery)ismoreimportantthanintegrity(error-freedelivery).Inan
SCQlink,aphysicallink
iscreatedbetweentheprimaryandasecondarybyreserving
specificslotsatregularintervals.Thebasicunit
ofconnectionistwoslots,oneforeach
direction.
Ifapacketisdamaged,it isneverretransmitted.SCQ isusedforreal-time
audiowhereavoidingdelay
isall-important.AsecondarycancreateuptothreeSCQ
linkswiththeprimary,sendingdigitizedaudio (PCM)at64kbpsineachlink.
ACLAnasynchronousconnectionlesslink(ACL)isusedwhendataintegrityis
moreimportantthanavoidinglatency.Inthistype
oflink,ifapayloadencapsulated
intheframeiscorrupted,itisretransmitted.AsecondaryreturnsanACLframein
theavailableodd-numberedslot
ifandonly ifthepreviousslothasbeenaddressed
toit.ACLcanuseone,three,ormoreslotsandcanachieveamaximumdatarate
of
721kbps.
FrameFormat
Aframeinthebasebandlayercanbeone ofthreetypes:one-slot,three-slot,orfive-slot.
Aslot,
aswesaidbefore, is625
~s.However,inaone-slotframeexchange,259~sis
neededforhoppingandcontrolmechanisms.Thismeansthataone-slotframecanlast
only625-259,or366~s.WithaI-MHzbandwidthand1bit/Hz,thesize ofaone-slot
frame
is366bits.
Athree-slotframeoccupiesthreeslots.However,since 259
~sisusedforhopping,
thelength
oftheframeis3 x625-259 =1616
~sor1616bits.Adevicethatusesa
three-slotframeremains
atthesamehop(atthesamecarrierfrequency)forthreeslots.
Evcnthoughonlyonchopnumbcr
isused,threehopnumbersareconsumed.Thatmeans
thehopnumberforeachframeisequaltothefirstslot
oftheframe.
Afive-slotframealsouses259bitsforhopping,whichmeansthatthelength
ofthe
frame
is5 x625-259 =2866bits.
Figure14.24showstheformat
ofthethreeframetypes.
Thefollowingdescribeseachfield:
oAccesscode.This72-bitfieldnormallycontainssynchronizationbitsandthe
identifier
oftheprimarytodistinguishtheframe ofonepiconetfromanother.

440 CHAPTER 14WIRELESSLANs
Figure14.24Framefannattypes
72bits54bits otoNbits
••__....N=240forI-sIalframe
N=1490for3-slotframe
'-3-bi-
ts
..l..-4-bl-·ls....l...l.......l....-S-b-it-s--N=2740for5-slotframe
ThisIS-bitpart
isrepeated3times.
:JHeader.This54-bitfieldisarepeatedI8-bitpattern.Eachpatternhasthefollow­
ingsubfields:
1.Address.The3-bitaddresssubfieldcandefineuptosevensecondaries (lto7).
Iftheaddressiszero,itisusedforbroadcastcommunicationfromtheprimary
toallsecondaries.
2.Type.The4-bittypesubfielddefinesthetype ofdatacomingfromtheupper
layers.
Wediscussthesetypeslater.
3.F.ThisI-bitsubfieldisforflowcontrol.Whenset(I),itindicatesthatthe device
isunabletoreceivemoreframes(bufferisfull).
4.A.ThisI-bitsubfield isforacknowledgment.BluetoothusesStop-and-Wait
ARQ;Ibitissufficientforacknowledgment.
5.S.ThisI-bitsubfieldholdsasequencenumber.BluetoothusesStop-and-Wait
ARQ;Ibitissufficientforsequencenumbering.
6.HEC.The8-bitheadererrorcorrectionsubfieldisachecksumtodetecterrors
ineach18-bitheadersection.
Theheaderhasthreeidentical18-bitsections.Thereceivercomparesthesethree
sections,bitbybit.
Ifeachofthecorrespondingbitsisthesame,thebitisaccepted;
ifnot,themajorityopinionrules.Thisisaform offorwarderrorcorrection(forthe
headeronly).Thisdoubleerrorcontrolisneededbecausethenature
ofthecommu­
nication,viaair,isverynoisy.Notethatthere
isnoretransmissioninthissublayer.
oPayload.Thissubfieldcanbe0to2740bitslong. Itcontainsdataorcontrol
informationcorningfromtheupperlayers.
L2CAP
TheLogicalLinkControlandAdaptationProtocol,or L2CAP(L2heremeansLL),
isroughlyequivalenttotheLLCsublayerinLANs.
Itisusedfordataexchange onan
ACLlink;SCQchannelsdonotuseL2CAP.Figure14.25showstheformatofthedata
packetatthislevel.
TheI6-bitlengthfielddefinesthesize
ofthedata,inbytes,comingfromtheupper
layers.Datacanbeupto65,535bytes.ThechannelID(CID)definesauniqueidenti­
fierforthevirtualchannelcreatedatthislevel(seebelow).
TheL2CAPhasspecificduties:multiplexing,segmentationandreassembly,quality
ofservice(QoS),andgroupmanagement.

SECTION14.3RECOMMENDED READING 441
Figure14.25L2CAPdata packetfarmat
2bytes 2bytes 0to65,535bytes
LengthIChannelID1 D_at_a_an_d_co_n_tro_l _
Multiplexing
TheL2CAPcandomultiplexing.Atthesendersite,itacceptsdatafromone ofthe
upper-layerprotocols,framesthem,anddeliversthemtothebasebandlayer.Atthe
receiversite,itacceptsaframefromthebasebandlayer,extractsthedata,anddelivers
themtotheappropriateprotocollayer.
Itcreatesakind ofvirtualchannelthatwewill
discussinlaterchapters onhigher-levelprotocols.
SegmentationandReassembly
Themaximumsize ofthepayloadfieldinthebasebandlayeris2774bits,or343bytes.
Thisincludes4bytestodefinethepacketandpacketlength.Therefore,thesize
ofthe
packetthatcanarrivefrom
anupperlayercanonlybe339bytes.However,application
layerssometimesneedtosendadatapacketthatcanbeupto65,535bytes(anInternet
packet,forexample).TheL2CAPdividestheselargepacketsintosegmentsandadds
extrainformationtodefinethelocation
ofthesegmentsintheoriginalpacket.The
L2CAPsegmentsthepacketatthesourceandreassemblesthematthedestination.
QoS
Bluetoothallowsthestationstodefineaquality-of-servicelevel. Wediscussquality of
serviceinChapter24.Forthemoment,itissufficienttoknowthat ifnoquality-of-service
level
isdefined,Bluetoothdefaultstowhatiscalled best-effortservice;itwilldoitsbest
underthecircumstances.
GroupManagement
Anotherfunctionality ofL2CAPis toallowdevicestocreateatype oflogicaladdressing
betweenthemselves.Thisissimilartomulticasting.Forexample,twoorthreesecondary
devicescanbepart
ofamulticastgrouptoreceivedatafromtheprimary.
OtherUpperLayers
Bluetoothdefinesseveralprotocolsfortheupperlayersthatusetheservices ofL2CAP;
theseprotocolsarespecificforeachpurpose.
14.3RECOMMENDED READING
Formoredetailsaboutsubjectsdiscussedinthischapter,werecommendthefollow­
ingbooksandsites.Theitemsinbrackets[
...]refertothereferencelistattheend of
thetext.

442 CHAPTER 14WIRELESSLANs
Books
WirelessLANsandBluetootharediscussedinseveralbooksincluding[Sch03]and
[Gas02].WirelessLANsarediscussedinChapter
15of[For03],Chapter 17of[Sta04],
Chapters13and14
of[Sta02],andChapter8 of[Kei021.Bluetoothisdiscussedin
Chapter
15of[Sta02]andChapter 15of[For03].
14.4KEYTERMS
accesspoint(AP)
asynchronousconnectionlesslink
(ACL)
basicserviceset
(BSS)
beaconframe
Bluetooth
BSS-transitionmobility
complementarycodekeying(CCK)
directsequencespreadspectrum(OSSS)
distributedcoordinationfunction(OCF)
distributedinterframespace(OIFS)
ESS-transitionmobility
extendedserviceset(ESS)
frequency-hoppingspreadspectrum
(FHSS)
handshakingperiod
high-ratedirectsequencespreadspectrum
(HR-OSSS)
IEEE802.11
LogicalLinkControlandAdaptation
Protocol(L2CAP)
networkallocationvector
(NAV)
no-transitionmobility
orthogonalfrequency-division
multiplexing(OFOM)
piconet
pointcoordinationfunction(PCF)
primary
pulsepositionmodulation(PPM)
repetitioninterval
scatternet
secondary
shortinterframespace(SIFS)
synchronousconnection-oriented
(SCO)
TDD-TOMA(time-divisionduplex
TOMA)
wirelessLAN
14.5SUMMARY
oTheIEEE802.11standardforwirelessLANsdefinestwoservices:basicservice
set(BSS)andextendedserviceset(ESS).
oTheaccessmethodusedinthedistributedcoordinationfunction(OCF)MACsub­
layeris
CSMAICA.
oTheaccessmethodusedinthepointcoordinationfunction(PCF)MACsublayeris
polling.
oThenetworkallocationvector(NAV)isatimerusedforcollisionavoidance.
oTheMAClayerframehasninefields.Theaddressingmechanismcanincludeupto
fouraddresses.
oWirelessLANsusemanagementframes,controlframes,anddataframes.

SECTION14.6PRACTICESET 443
oIEEE802.11definesseveralphysicallayers,with differentdataratesandmodulating
techniques.
oBluetoothisawireless LANtechnologythatconnectsdevices(calledgadgets)ina
smallarea.
oABluetoothnetworkiscalledapiconet.Multiplepiconets fonnanetworkcalleda
scatternet.
oABluetoothnetworkconsists ofoneprimarydeviceanduptosevensecondary
devices.
14.6PRACTICESET
ReviewQuestions
1.WhatisthedifferencebetweenaBSSandan ESS?
2.Discussthethreetypes ofmobilityinawirelessLAN.
3.Howis OFDMdifferentfromFDM?
4.WhatistheaccessmethodusedbywirelessLANs?
5.Whatisthepurpose oftheNAV?
6.Compareapiconetandascatternet.
7.MatchthelayersinBluetoothandtheInternetmodel.
8.Whatarethetwotypes oflinksbetweenaBluetoothprimaryandaBluetooth
secondary?
9.Inmultiple-secondarycommunication,whousestheeven-numberedslotsandwho
usestheodd-numberedslots?
10.HowmuchtimeinaBluetoothone-slotframeisusedforthehoppingmechanism?
Whataboutathree-slotframeandafive-slotframe?
Exercises
1].Compareandcontrast CSMAlCDwithCSMAICA.
12.UseTable14.5tocompareandcontrastthefields inIEEE802.3and802.11.
Table
14.5Exercise12
Fields IEEE802.3FieldSize IEEE802.11FieldSize
Destinationaddress
Sourceaddress
Address1
Address2
Address3
Address4
FC

444 CHAPTER14WIRELESSLANs
Table14.5 Exercise12(continued)
",',.,,..~-~,..~'~'~ -."".-_.__.__._-*~-
Fields IEEE802.3FieldSize IEEE802.11FieldSize
D/ID
SC
PDUlength
Dataandpadding
Framebody
FCS(CRC)

CHAPTER15
ConnectingLANs,Backbone
Networks,
andVirtualLANs
LANsdonotnormallyoperate inisolation.Theyareconnectedtooneanotherortothe
Internet.
ToconnectLANs,orsegmentsofLANs,weuseconnectingdevices.Connecting
devicescanoperate
indifferentlayers oftheInternetmodel. Inthischapter,wediscuss
onlythosethatoperate
inthephysicalanddatalinklayers;wediscussthosethatoperate
inthefirstthreelayersinChapter
19.
Afterdiscussingsomeconnectingdevices,weshowhowtheyareusedtocreate
backbonenetworks.Finally,wediscussvirtuallocalareanetworks(VLANs).
15.1CONNECTING DEVICES
Inthissection,wedivide connectingdevices intofivedifferentcategoriesbasedonthe
layer
inwhichtheyoperate inanetwork,asshown inFigure15.1.
Figure15.1 Fivecategoriesofconnectingdevices
Application Application
Gateway
Transport Transport
Network Network
Datalink Datalink
Physical Physical
Thefivecategoriescontaindeviceswhichcanbedefinedas
1.Thosewhichoperatebelowthephysicallayersuch asapassivehub.
2.Thosewhichoperateatthephysicallayer(arepeateroranactivehub).
3.Thosewhichoperateatthephysicalanddatalinklayers(abridgeoratwo-layer
switch).
445

446 CHAPTER 15CONNECTINGLANs,BACKBONENETWORKS, ANDVIRTUALLANs
4.Thosewhichoperateatthephysical,datalink,andnetworklayers(arouterora
three-layerswitch).
5.Thosewhichcanoperateatall fivelayers(agateway).
PassiveHubs
Apassivehubisjustaconnector.Itconnectsthewirescomingfromdifferentbranches.
Inastar-topologyEthernetLAN,apassivehubisjustapointwherethesignalscoming
fromdifferentstationscollide;thehubisthecollisionpoint.Thistype
ofahubispart
ofthemedia;itslocationintheInternetmodelisbelowthephysicallayer.
Repeaters
Arepeaterisadevicethatoperatesonlyinthephysicallayer.Signalsthatcarryinfor­
mationwithinanetworkcantravelafixeddistancebeforeattenuationendangersthe
integrity
ofthedata.Arepeaterreceivesasignaland,beforeitbecomestooweakor
corrupted,regeneratestheoriginalbitpattern.Therepeaterthensendstherefreshed
signal.Arepeatercanextendthephysicallength
ofaLAN,asshowninFigure15.2.
Figure15.2 Arepeaterconnectingtwosegments ofaLAN
5 5
4 4
3 3
2 2
I 1
SegmentI Segment2
ArepeaterdoesnotactuallyconnecttwoLANs;itconnectstwosegments ofthe
sameLAN.Thesegmentsconnectedarestillpart
ofonesingleLAN.Arepeater isnot
adevicethatcanconnecttwoLANs
ofdifferentprotocols.
Arepeaterconnectssegments ofaLAN.
Arepeatercanovercomethe10Base5Ethernetlengthrestriction.Inthisstandard,
thelength
ofthecableislimitedto500 m.Toextendthislength,wedividethecable
intosegmentsandinstallrepeatersbetweensegments.Notethatthewholenetwork
is
stillconsideredoneLAN,buttheportionsofthenetworkseparatedbyrepeatersare
calledsegments.Therepeateractsasatwo-portnode,butoperatesonlyinthephysical
layer.Whenitreceivesaframefromany
oftheports,itregeneratesandforwards itto
theotherport.

SECTION15.1CONNECTINGDEVICES 447
Arepeaterforwardseveryframe; ithasnofilteringcapability.
Itistemptingtocomparearepeatertoanamplifier,butthecomparisonisinaccurate.
Anamplifiercannotdiscriminatebetweentheintendedsignalandnoise;itamplifies
equallyeverythingfedinto
it.Arepeaterdoesnotamplifythesignal;itregeneratesthe
signal.Whenitreceivesaweakenedorcorruptedsignal,
itcreatesacopy,bitforbit,at
theoriginalstrength.
Arepeaterisaregenerator,notanamplifier.
Thelocationofarepeaterona linkisvital.Arepeatermustbeplacedsothatasig­
nalreachesitbeforeanynoisechangesthemeaning
ofanyofitsbits.Alittlenoisecan
altertheprecision
ofabit'svoltagewithoutdestroyingitsidentity(seeFigure15.3).If
thecorruptedbittravelsmuchfarther,however,accumulatednoisecanchangeits
meaningcompletely.Atthatpoint,theoriginalvoltageisnotrecoverable,andtheerror
needstobecorrected.Arepeaterplacedonthelinebeforethelegibility
ofthesignal
becomeslostcanstill readthesignalwellenoughtodeterminetheintendedvoltages
andreplicatethemintheiroriginalform.
Figure15.3
Functionofarepeater
;:;::::·J,*lI(-~cJ"--'---""'.cJ---,--(lrr~
signal signal
a.Right-to-tefttransmission.
b.Left-to·righttransmission.
ActiveHubs
Anactivehubisactuallyamultipartrepeater. Itisnormallyusedtocreateconnections
betweenstationsinaphysicalstartopology.
Wehaveseenexamples ofhubsinsome
Ethernetimplementations(lOBase-
T,forexample).However,hubscanalsobeusedto
createmultiplelevels
ofhierarchy,asshowninFigure15.4.Thehierarchicaluse of
hubsremovesthelengthlimitation of10Base-T(100m).
Bridges
Abridgeoperatesinboththephysicalandthedatalinklayer.Asaphysicallayer
device,itregeneratesthesignalitreceives.Asadatalinklayerdevice,thebridgecan
checkthephysical(MAC)addresses(sourceanddestination)containedintheframe.

448 CHAPTER 15CONNECTINGLANs,BACKBONENETWORKS, ANDVIRTUALLANs
Figure15.4Ahierarchyofhubs
Filtering
Onemayask,What isthedifferenceinfunctionalitybetweenabridgeandarepeater?
Abridgehasfilteringcapability.
Itcancheckthedestinationaddress ofaframeand
decide
iftheframeshouldbeforwardedordropped. Iftheframeistobeforwarded,the
decisionmustspecifytheport.Abridgehasatablethatmapsaddressestoports.
Abridgehasatablensedinfilteringdecisions.
Letusgiveanexample.InFigure15.5,twoLANsareconnectedbyabridge. Ifa
framedestinedforstation712B13456142arrivesatport
1,thebridgeconsultsitstableto
findthedepartingport.Accordingtoitstable,framesfor
7l2B13456142leavethrough
port
1;therefore,thereisnoneedforforwarding,andtheframeisdropped.Onthe
otherhand,
ifaframefor712B13456141arrivesatport 2,thedepartingportisport1
Figure15.5AbridgeconnectingtwoLANs
5
4
3
2
1
2 2
1
f-+,---l1-l1
5
4
3
2
I
Address Port
71:2B:13:45:61:411
71:2B:13:45:61:42
1
64:2B:13:45:61:122
64:28:13:45:61:132
BridgeTable
64:2B:13:45:61:1264:2B:13:45:61: 13
LAN2LAN1
71:28:13:45:61:4171:2B:13:45:61:42
r r 0

SECTION15.1CONNECTINGDEVICES 449
andtheframe isforwarded.Inthefirstcase,LAN2remainsfree oftraffic;inthesec­
ondcase,bothLANshavetraffic.Inourexample,
weshowatwo-portbridge;inreality
abridgeusuallyhasmoreports.
Notealsothatabridgedoesnotchangethephysicaladdressescontainedinthe
frame.
Abridgedoes notchangethephysical(MAC)addresses inaframe.
TransparentBridges
Atransparentbridgeisabridgeinwhichthestationsarecompletelyunaware ofthe
bridge'sexistence.Ifabridgeisaddedordeletedfromthesystem,reconfiguration
of
thestationsisunnecessary.AccordingtotheIEEE802.1dspecification,asystem
equippedwithtransparentbridgesmustmeetthreecriteria:
I.Framesmustbeforwardedfromonestationtoanother.
2.Theforwardingtableisautomaticallymadebylearningframemovementsinthe
network.
3.Loopsinthesystemmustbeprevented.
ForwardingAtransparentbridgemustcorrectlyforwardtheframes, asdiscussedin
theprevioussection.
LearningTheearliestbridgeshadforwardingtablesthatwerestatic.Thesystems
administratorwouldmanuallyentereachtableentryduringbridgesetup.Althoughthe
processwassimple,itwasnotpractical.
Ifastationwasaddedordeleted,thetablehad to
bemodifiedmanually.Thesamewastrue ifastation'sMACaddresschanged,which is
notarareevent.Forexample,puttinginanewnetworkcardmeansanewMACaddress.
Abettersolutiontothestatictableisadynamictablethatmapsaddressestoports
automatically.
Tomakeatabledynamic,weneedabridgethatgraduallylearnsfrom
theframemovements.
Todothis,thebridgeinspectsboththedestinationandthe
sourceaddresses.Thedestinationaddressisusedfortheforwardingdecision(table
lookup);thesourceaddress
isusedforaddingentries tothetableandforupdatingpur­
poses.LetuselaborateonthisprocessbyusingFigure15.6.
1.WhenstationAsendsaframetostationD,thebridgedoesnothaveanentryfor
eitherDor
A.Theframegoesoutfromallthreeports;theframefloodsthenet­
work.However,bylookingatthesourceaddress,thebridgelearnsthatstationA
mustbelocatedontheLANconnectedtoport
1.Thismeansthatframesdestined
for
A,inthefuture,mustbesentoutthroughport 1.Thebridgeaddsthisentryto
itstable.Thetablehasitsfirstentry
now.
2.WhenstationEsendsaframetostationA,thebridgehas anentryforA,soitfor­
wardstheframeonly
toport1.Thereis noflooding.Inaddition,itusesthesource
address
oftheframe,E,toaddasecondentrytothetable.
3.WhenstationBsendsaframetoC,thebridgehasnoentryforC,soonceagainit
floodsthenetworkandaddsonemoreentrytothetable.
4.Theprocessoflearningcontinues asthebridgeforwardsframes.

450 CHAPTER 15CONNECTINGLANs, BACKBONENETWORKS,ANDVIRTUALLANs
Figure15.6 Alearningbridge andtheprocessoflearning
r-------JL------,3
1--------1
LAN2D-'""'T"--"---'""'T"--c:;]
LAN1D-......I.--~-.....L._-c;;]
LAN3
AddressPort AddressPort
A 1
AddressPort
A
1
E 3
AddressPort
A
1
E 3
B I
a.Original b.AfterAsends
aframetoD
c.AfterEsends
a
frametoA
d.AfterBsends
a frametoC
LoopProblemTransparentbridgesworkfineaslongastherearenoredundant
bridgesinthesystem.Systemsadministrators,however,liketohaveredundantbridges
(morethanonebridgebetweenapair
ofLANs)tomakethesystemmorereliable. Ifa
bridgefails,anotherbridgetakesoveruntilthefailedoneisrepairedorreplaced.
Redundancycancreateloopsinthesystem,whichisveryundesirable.Figure15.7
showsaverysimpleexample
ofaloopcreatedinasystemwithtwoLANsconnected
bytwobridges.
1.StationAsendsaframetostation D.Thetablesofbothbridgesareempty.Both
forwardtheframeandupdatetheirtablesbasedonthesourceaddress
A.
2.Nowtherearetwocopies oftheframeonLAN 2.Thecopysentoutbybridge1 is
receivedbybridge 2,whichdoesnothaveanyinformationaboutthedestination
address
D;itfloodsthebridge.Thecopysentoutbybridge2isreceivedbybridge1
andissentoutforlack
ofinformationabout D.Notethateachframeishandled
separatelybecausebridges,
astwonodesonanetworksharingthemedium,usean
accessmethodsuchasCSMA/CD.Thetables
ofbothbridgesareupdated,butstill
thereisnoinformationfordestination
D.
3.Nowtherearetwocopies oftheframeonLAN 1.Step2isrepeated,andbothcopies
floodthenetwork.
4.Theprocesscontinuesonandon.Notethatbridgesarealsorepeatersandregen­
erateframes.Soineachiteration,therearenewlygeneratedfreshcopies
ofthe
frames.
Tosolvetheloopingproblem,theIEEEspecificationrequiresthatbridgesusethe
spanningtreealgorithmtocreatealooplesstopology.

SECTION15.1CONNECTING DEVICES 451
Figure15.7 Loopprobleminalearningbridge
LAN1 LAN1
LAN2 LAN2
a.StationAsendsaframetostationD b.Bothbridgesforwardtheframe
c.Bothbridgesforwardtheframe d.Bothbridgesforwardtheframe
SpanningTree
Ingraphtheory,a spanningtree isagraphinwhichthereisnoloop.Inabridged
LAN,thismeanscreatingatopologyinwhicheachLANcanbereachedfromany
otherLANthroughonepathonly(noloop).
Wecannotchangethephysicaltopology of
thesystembecause ofphysicalconnectionsbetweencablesandbridges,butwecan
createalogicaltopologythatoverlaysthephysicalone.Figure15.8showsasystem
withfourLANsandfivebridges.
Wehaveshownthephysicalsystemanditsrepresen­
tationingraphtheory.AlthoughsometextbooksrepresenttheLANsasnodesandthe
bridges
astheconnectingarcs,wehaveshownbothLANsandbridges asnodes.The
connectingarcsshowtheconnection
ofaLANtoabridgeandviceversa.Tofind
thespanningtree,weneedtoassignacost(metric)toeacharc.Theinterpretation
of
thecostisleftuptothesystemsadministrator. Itmaybethepathwithminimumhops
(nodes),thepath withminimumdelay,orthepathwithmaximumbandwidth.
Iftwo
portshavethesameshortestvalue,thesystemsadministratorjustchoosesone.
Wehave
chosentheminimumhops.However,aswewillseeinChapter22,thehopcountisnor­
mally1fromabridgetotheLANand 0inthereversedirection.
Theprocesstofindthespanningtreeinvolvesthreesteps:
1.Everybridgehasabuilt-inID(normallytheserialnumber,whichisunique).Each
bridgebroadcaststhisID
sothatallbridgesknowwhichonehasthesmallestID.
ThebridgewiththesmallestIDisselectedasthe
rootbridge(root ofthetree).We
assumethatbridgeB1hasthesmallestID. Itis,therefore,selectedastheroot
bridge.

452 CHAPTER15CONNECTINGLANs,BACKBONENETWORKS, ANDVIRTUALLANs
Figure15.8AsystemofconnectedLANsanditsgraphrepresentation
LAN2 LAN3
a.Actualsystem
~o
1----+-
!----+- 0----+-
f---...:...----{LAN1}---'------l
~O ~l
f---";"!----+------(LAN4r--O-----+------l
~O ~!
o----+­
LAN2)-------{
~l
b.Graphrepresentationwithcostassignedtoeach arc
2.Thealgorithmtriestofindtheshortestpath(apathwiththeshortestcost)fromtheroot
bridgetoeveryotherbridgeorLAN.Theshortestpathcanbefound
byexaminingthe
totalcostfromtherootbridgetothedestination.Figure15.9showstheshortestpaths.
3.Thecombinationoftheshortestpathscreatestheshortesttree,whichisalsoshown
inFigure15.9.
4.Basedonthespanning
tree,wemarktheportsthatarepart ofthespanningtree,the
forwardingports,whichforwardaframethatthebridgereceives.Wealsomark
thoseportsthatarenotpart
ofthespanningtree,theblocking ports,whichblock
theframesreceivedbythebridge.Figure15.10showsthephysicalsystems
of
LANswithforwardingpoints(solidlines)andblockingports(brokenlines).
Notethatthereisonlyonesinglepathfromany
LANtoanyother LANinthe
spanningtreesystem.Thismeans thereisonlyonesinglepathfromoneLANtoany
otherLAN.Noloopsarecreated.
Youcanprovetoyourselfthatthereisonlyonepath
fromLAN1toLAN
2,LAN3,orLAN4.Similarly,thereisonlyonepathfromLAN2
toLAN
1,LAN3,andLAN4.ThesameistrueforLAN3andLAN 4.
DynamicAlgorithmWehavedescribedthespanningtreealgorithmasthoughit
requiredmanualentries.Thisisnottrue.Eachbridgeisequippedwithasoftwarepack­
agethatcarriesoutthisprocessdynamically.Thebridgessendspecialmessagestoone
another,calledbridgeprotocoldataunits(BPDUs),toupdatethespanningtree.The
spanningtreeisupdatedwhenthereisachangeinthesystemsuchasafailure
ofa
bridgeoranadditionordeletion
ofbridges.

SECTION15.1CONNECTINGDEVICES 453
Figure15.9 Findingtheshortestpaths andthespanningtreeinasystem ofbridges
,
y
---~2
'-- - - -------- -~1
m~!a-------< LAN1j------j
,,
,,
, , :yLAN2j------j
I I 11
, :t LAN4~------i
, , 1
~~:::::::::::::::::::::~-~-- - - - - - - - - ----~2
a.Shortest
paths
Rootof
spanningtree
------(LAN1
}-------\
j--------!B3
-~-
1--------(LAN4}-------\B5
b.Spanningtree
Figure15.10 Forwardingandblockingportsafterusingspanningtreealgorithm
LANl
Rootbridge
LAN2
1
Igf
';l2
10

1i=Q
1
LAN4
LAN3
Ports2and3 ofbridgeB3areblockingports(noframeissentout oftheseports).
Port1
ofbridgeB5isalsoablockingport(noframeissentout ofthisport).
SourceRoutingBridges
Anotherwaytopreventloopsinasystemwithredundantbridgesistouse sourcerouting
bridges.Atransparentbridge'sdutiesincludefilteringframes,forwarding,andblocking.
Inasystemthathassourceroutingbridges,thesedutiesareperformed
bythesource
stationand,tosomeextent,thedestinationstation.

454 CHAPTER15CONNECTINGLANs,BACKBONENE7WORKS, ANDVIRTUALLANs
Insourcerouting,asendingstationdefinesthebridgesthattheframemustvisit.
Theaddresses
ofthesebridgesareincludedintheframe.Inotherwords,theframecon­
tainsnotonlythesourceand destinationaddresses,butalsotheaddresses
ofallbridges
tobevisited.
Thesourcegetsthesebridgeaddressesthroughtheexchange
ofspecialframes
withthedestinationpriortosending thedataframe.
SourceroutingbridgesweredesignedbyIEEEtobeusedwithTokenRingLANs.
TheseLANsarenotverycommontoday.
BridgesConnectingDifferent LANs
TheoreticallyabridgeshouldbeabletoconnectLANsusingdifferentprotocolsatthe
datalinklayer,suchasanEthernetLANtoawirelessLAN.However,therearemany
issuestobeconsidered:
oFrameformat. EachLANtypehasitsownframeformat(compareanEthernet
framewithawirelessLANframe).
DMaximumdata size.Ifanincomingframe'ssizeistoolargeforthedestination
LAN,thedatamustbefragmentedintoseveralframes.Thedatathenneedtobe
reassembledatthedestination.However,noprotocolatthedatalinklayerallows
thefragmentationandreassembly
offrames.WewillseeinChapter 19thatthisis
allowedinthenetworklayer.Thebridgemustthereforediscardanyframestoo
largeforitssystem.
oDatarate. EachLANtypehasitsowndatarate.(Comparethe10-Mbpsdatarate
ofanEthernetwiththeI-Mbpsdatarate ofawirelessLAN.)Thebridgemust
buffertheframetocompensateforthisdifference.
DBitorder.EachLANtypehasitsownstrategyinthesending ofbits.Somesend
themostsignificantbitinabytefirst;otherssendtheleastsignificantbitfirst.
oSecurity.SomeLAN s,suchaswirelessLAN s,implementsecuritymeasuresin
thedatalinklayer.OtherLANs,suchasEthernet,donot.Securityofteninvolves
encryption(seeChapter30).WhenabridgereceivesaframefromawirelessLAN,
itneedstodecryptthemessagebeforeforwardingitto
anEthernetLAN.
DMultimediasupport. SomeLANssupportmultimediaandthequality ofservices
neededforthistype
ofcommunication;othersdonot.
Two-LayerSwitches
Whenweusetheterm switch,wemustbecarefulbecauseaswitchcanmeantwodif­
ferentthings.
Wemustclarifythetermbyaddingthelevelatwhichthedeviceoperates.
Wecanhaveatwo-layerswitch orathree-layerswitch.A three-layerswitch isusedat
thenetworklayer;itisakind
ofrouter.The two-layerswitch performsatthephysical
anddatalinklayers.
Atwo-layerswitchisabridge,abridgewithmanyportsandadesignthatallows
better(faster)performance.A bridgewithafewportscan connectafewLANs
together.Abridgewithmanyportsmaybeabletoallocateauniqueporttoeachstation,
witheachstationonitsown independententity.Thismeansnocompetingtraffic(no
collision,aswesawinEthernet).

SECTION15.1CONNECTING DEVICES 455
Atwo-layerswitch,asabridgedoes,makesafilteringdecisionbasedonthe MAC
address
oftheframeitreceived.However,atwo-layerswitchcanbemoresophisti­
cated.Itcanhaveabuffertoholdtheframesforprocessing.
Itcanhaveaswitchingfac­
torthatforwardstheframesfaster.Somenewtwo-layerswitches,called
cut-through
switches,havebeendesignedtoforwardtheframeassoonastheycheckthe MAC
addressesintheheader
oftheframe.
Routers
Arouterisathree-layerdevicethatroutespacketsbasedontheirlogicaladdresses
(host-to-hostaddressing).ArouternormallyconnectsLANsandWANsintheInternet
andhasaroutingtablethatisusedformakingdecisionsabouttheroute.Therouting
tablesarenormallydynamicandareupdatedusingroutingprotocols.
Wediscussrout­
ersandroutingingreaterdetailinChapters
19and21.Figure15.11showsapart ofthe
Internet thatusesrouterstoconnectLANsandWANs.
Figure15.11 Routersconnectingindependent LANsandWANs
WAN
----------------------~
Totherest
ofthe Internet
Three-LayerSwitches
Athree-layerswitch isarouter,butafasterandmoresophisticated.Theswitchingfabric
inathree-layerswitchallowsfastertablelookupandforwarding.Inthisbook,weuse
theterms
routerandthree-layerswitch interchangeably.
Gateway
Althoughsometextbooksusetheterms gatewayandrouterinterchangeably,most ofthe
literaturedistinguishesbetweenthetwo.Agatewayisnormallyacomputerthatoperates
inallfivelayers
oftheInternetorsevenlayers ofOSImodel.Agatewaytakesan
applicationmessage,readsit,andinterpretsit.Thismeansthat
itcanbeusedasa
connectingdevicebetweentwointernetworksthatusedifferentmodels.Forexample,
anetworkdesignedtousetheOSImodelcanbeconnectedtoanothernetworkusing
theInternetmodel.Thegatewayconnectingthetwosystemscantakeaframeas
itarrivesfromthefirstsystem,moveituptotheOSIapplicationlayer,andremovethe
message.

456 CHAPTER 15CONNECTINGLANs,BACKBONENETWORKS, ANDVIRTUALLANs
Gatewayscanprovidesecurity.InChapter32,welearnthatthegatewayisusedto
filterunwantedapplication-layermessages.
15.2BACKBONENETWORKS
SomeconnectingdevicesdiscussedinthischaptercanbeusedtoconnectLANsina
backbonenetwork.AbackbonenetworkallowsseveralLANstobeconnected.Ina
backbonenetwork,nostationisdirectlyconnectedtothebackbone;thestationsare
part
ofaLAN,andthebackboneconnectstheLANs.ThebackboneisitselfaLAN
thatusesaLANprotocolsuch
asEthernet;eachconnectiontothebackboneisitself
anotherLAN.
Althoughmanydifferentarchitecturescanbeusedforabackbone,wediscussonly
thetwomostcommon:thebusandthestar.
BusBackbone
Inabus backbone,thetopologyofthebackboneisabus.Thebackboneitselfcanuse
one
oftheprotocolsthatsupportabustopologysuch aslOBase5orlOBase2.
Inabusbackbone,thetopology ofthebackboneisabus.
Busbackbonesarenormallyused asadistributionbackbonetoconnectdifferent
buildingsinanorganization.EachbuildingcancompriseeitherasingleLANor
anotherbackbone(normallyastarbackbone).Agoodexample
ofabusbackbone is
onethatconnectssingle-ormultiple-floorbuildingsonacampus.Eachsingle-floor
buildingusuallyhasasingleLAN.Eachmultiple-floorbuildinghasabackbone(usu­
allyastar)thatconnectseachLANonafloor.Abusbackbonecaninterconnectthese
LANsandbackbones.Figure15.12showsanexample
ofabridge-basedbackbonewith
fourLANs.
Figure15.12
Busbackbone

SECTION15.2BACKBONENETWORKS 457
InFigure15.12,ifastationinaLANneedstosendaframetoanotherstationin
thesameLAN,thecorrespondingbridgeblockstheframe;theframeneverreaches
thebackbone.However,
ifastationneedstosendaframetoastationinanotherLAN,the
bridgepassestheframetothebackbone,whichisreceivedbytheappropriatebridge
andisdeliveredtothedestinationLAN.Eachbridgeconnectedtothebackbonehasa
tablethatshowsthestationsontheLANside
ofthebridge.Theblockingordelivery of
aframeisbasedonthecontentsofthistable.
StarBackbone
Inastarbackbone,sometimescalledacollapsedorswitchedbackbone,thetopology
ofthebackboneisastar.Inthisconfiguration,thebackboneisjustoneswitch(thatis
whyitiscalled,erroneously,acollapsedbackbone)thatconnectstheLANs.
Inastarbackbone,thetopology ofthebackboneisa star;
thebackboneisjustoneswitch.
Figure15.13showsastarbackbone.Notethat,inthisconfiguration,theswitch
doesthejobofthebackboneandatthesametimeconnectstheLANs.
Figure15.13Starbackbone
Backbone
Switch
Starbackbonesaremostlyused asadistributionbackboneinsideabuilding.Ina
multifloorbuilding,weusuallyfindoneLANthatserveseachparticularfloor.Astar
backboneconnectstheseLANs.Thebackbonenetwork,which
isjustaswitch,canbe
installedinthebasementorthefirstfloor,andseparatecablescanrunfromtheswitch
toeachLAN.
IftheindividualLANshaveaphysicalstartopology,eitherthehubs(or
switches)canbeinstalledinaclosetonthecorrespondingfloor,
orallcanbeinstalled
closetotheswitch.
Weoftenfindarackorchassisinthebasementwherethebackbone
switchandallhubsorswitchesareinstalled.
ConnectingRemoteLANs
AnothercommonapplicationforabackbonenetworkistoconnectremoteLANs.
Thistype
ofbackbonenetworkisusefulwhenacompanyhasseveralofficeswith
LANsandneedstoconnectthem.Theconnectioncanbedonethroughbridges,

458 CHAPTER 15CONNECTINGIANs,BACKBONENETWORKS,ANDVIRTUAL IANs
sometimescalled remotebridges. Thebridgesact asconnectingdevicesconnecting
LANsandpoint-to-pointnetworks,suchasleasedtelephonelinesorADSLlines.
Thepoint-to-pointnetworkinthiscaseisconsideredaLANwithoutstations.The
point-to-pointlinkcanuseaprotocolsuchas
PPP.Figure15.14showsabackbone
connectingremoteLANs.
Figure15.14 Connectingremote IANswithbridges
Point-to-pointlink
Bridge
LAN2
Apoint-to-pointlinkactsasaLAN inaremotebackboneconnectedbyremotebridges.
15.3VIRTUAL LANs
Astationisconsideredpart ofaLANifitphysicallybelongstothatLAN.Thecriterion
ofmembershipisgeographic.Whathappensifweneedavirtualconnectionbetween
twostationsbelonging
totwodifferentphysicalLANs? Wecanroughlydefinea virtual
local
areanetwork(VLAN)asalocalareanetworkconfiguredbysoftware,notby
physicalwiring.
Letususeanexampletoelaborateonthisdefinition.Figure15.15showsa
switchedLAN
inanengineeringfirminwhich 10stationsaregroupedintothreeLANs
thatareconnectedbyaswitch.Thefirstfourengineersworktogether
asthefirstgroup,
thenextthreeengineersworktogether
asthesecondgroup,andthelastthreeengineers
worktogetherasthethirdgroup.TheLANisconfiguredtoallowthisarrangement.
Butwhatwouldhappen
iftheadministratorsneeded tomovetwoengineersfrom
thefirstgroup
tothethirdgroup, tospeeduptheprojectbeingdonebythethirdgroup?
TheLANconfigurationwouldneedtobechanged.Thenetworktechnicianmust
rewire.Theproblemisrepeatedif,inanotherweek,thetwoengineersmovebackto
theirpreviousgroup.InaswitchedLAN,changesintheworkgroupmeanphysical
changesinthenetworkconfiguration.

SECTION15.3VIRTUALLANs 459
Figure15.15 AswitchconnectingthreeLANs
Switch
Group1 Group2 Group3
Figure15.16showsthesameswitchedLANdividedintoVLANs.Thewholeidea
ofVLANtechnologyistodivideaLANintological,instead ofphysical,segments.A
LANcanbedividedintoseverallogicalLANscalledVLANs.EachVLAN
isawork
groupintheorganization.
Ifapersonmovesfromonegrouptoanother,thereisnoneed
tochangethephysicalconfiguration.ThegroupmembershipinVLANsisdefinedby
software,nothardware.AnystationcanbelogicallymovedtoanotherVLAN.Allmem­
bersbelongingtoaVLANcanreceivebroadcastmessagessent
tothatparticularVLAN.
Figure15.16 AswitchusingVLANsoftware
SwitchwithVLANsoftware
VLANI
VLAN2
VLAN3

460 CHAPTER15CONNECTINGLANs,BACKBONENETWORKS, ANDVIRTUALLANs
Thismeans ifastationmovesfromVLAN1toVLAN2,itreceivesbroadcastmessages
senttoVLAN
2,butnolongerreceivesbroadcastmessagessenttoVLAN 1.
Itisobviousthattheprobleminourpreviousexamplecaneasilybesolvedby
usingVLANs.Movingengineersfromonegrouptoanotherthroughsoftware
iseasier
thanchangingtheconfiguration
ofthephysicalnetwork.
VLANtechnologyevenallowsthegrouping
ofstationsconnectedtodifferent
switchesinaVLAN.Figure15.17showsabackbonelocalareanetworkwithtwo
switchesandthreeVLANs.StationsfromswitchesAandBbelong
toeachVLAN.
Figure15.17 TwoswitchesinabackboneusingVLANsoftware
...... """"Backbone1- -,
switch
SwitchA SwitchB
VLANI
VLAN2
VLAN3
Thisisagoodconfigurationforacompanywithtwoseparatebuildings.Each
buildingcanhaveitsownswitchedLANconnectedbyabackbone.Peopleinthefirst
buildingandpeopleinthesecondbuildingcanbeinthesameworkgroupeventhough
theyareconnectedtodifferentphysicalLANs.
Fromthesethreeexamples,wecandefineaVLANcharacteristic:
VLANscreatebroadcastdomains.
VLANsgroupstationsbelongingtooneormorephysicalLANsintobroadcast
domains.
ThestationsinaVLANcommunicatewithoneanotherasthoughthey
belongedtoaphysicalsegment.

SECTION15.3VIRTUALLANs 461
Membership
WhatcharacteristiccanbeusedtogroupstationsinaVLAN?Vendorsusedifferent
characteristicssuchasportnumbers,MACaddresses,IPaddresses,IPmulticast
addresses,oracombination
oftwoormore ofthese.
PortNumbers
SomeVLANvendorsuseswitchportnumbersasamembershipcharacteristic.For
example,theadministratorcandefinethatstationsconnectingtoports
1,2,3,and 7
belongtoVLAN
1;stationsconnectingtoports4, 10,and12belongtoVLAN 2;and
soon.
MACAddresses
SomeVLANvendorsusethe48-bitMACaddressasamembershipcharacteristic.For
example,theadministratorcanstipulatethatstationshavingMACaddressesE21342A12334
andF2A123BCD341belong
toVLAN1.
IPAddresses
SomeVLANvendorsusethe32-bitIPaddress(seeChapter 19)asamembershipchar­
acteristic.Forexample,theadministratorcanstipulatethatstationshavingIPaddresses
181.34.23.67,181.34.23.72,181.34.23.98,and181.34.23.112belongtoVLAN
1.
MulticastIPAddresses
SomeVLANvendorsusethemulticastIPaddress(seeChapter19)asamembership
characteristic.MulticastingattheIPlayer
isnowtranslatedtomulticastingatthedata
linklayer.
Combination
Recently,thesoftwareavailablefromsomevendorsallowsallthesecharacteristicsto
becombined.Theadministratorcanchooseoneormorecharacteristicswheninstalling
thesoftware.Inaddition,thesoftwarecanbereconfiguredtochangethesettings.
Configuration
HowarethestationsgroupedintodifferentVLANs?Stationsareconfiguredinone of
threeways:manual,semiautomatic,andautomatic.
ManualConfiguration
Inamanualconfiguration,thenetworkadministratorusestheVLANsoftwaretoman­
uallyassignthestationsintodifferentVLANsatsetup.Latermigrationfromone
VLAN
toanotherisalsodonemanually.Notethatthisisnotaphysicalconfiguration;
itisalogicalconfiguration.Theterm
manuallyheremeansthattheadministrator
typestheportnumbers,theIPaddresses,orothercharacteristics,usingtheVLAN
software.

462 CHAPTER 15CONNECTINGLANs,BACKBONENETWORKS, ANDVIRTUALLANs
AutomaticConfiguration
Inanautomaticconfiguration,thestationsareautomaticallyconnectedordisconnected
fromaVLANusingcriteriadefinedbytheadministrator.Forexample,theadministra­
torcandefinetheprojectnumber
asthecriterionforbeingamember ofagroup.When
auserchangestheproject,heorsheautomaticallymigratestoanewVLAN.
SemiautomaticConfiguration
Asemiautomaticconfigurationissomewherebetweenamanualconfigurationandan
automaticconfiguration.Usually,theinitializingisdonemanually,withmigrations
doneautomatically.
CommunicationBetweenSwitches
Inamultiswitchedbackbone,eachswitchmustknownotonlywhichstationbelongsto
whichVLAN,butalsothemembership
ofstationsconnectedtootherswitches.For
example,inFigure15.17,switchAmustknowthemembershipstatus
ofstationscon­
nectedtoswitchB,andswitchBmustknowthesameaboutswitch
A.Threemethods
havebeendevisedforthispurpose:tablemaintenance,frametagging,andtime-division
multiplexing.
TableMaintenance
Inthismethod,whenastationsendsabroadcastframetoitsgroupmembers,the
switchcreatesanentryinatableandrecordsstationmembership.Theswitchessend
theirtablestooneanotherperiodicallyforupdating.
FrameTagging
Inthismethod,whenaframeistravelingbetweenswitches,anextraheaderisaddedto
theMACframetodefinethedestinationVLAN.Theframetagisusedbythereceiving
switchestodeterminetheVLANstobereceivingthebroadcastmessage.
Time-DivisionMultiplexing(TDM)
Inthismethod,theconnection(trunk)betweenswitchesisdividedintotimeshared
channels(seeTDMinChapter6).Forexample,
ifthetotalnumber ofVLANsina
backboneisfive,eachtrunkisdividedintofivechannels.Thetrafficdestinedfor
VLAN1travelsin
channell,thetrafficdestinedforVLAN2travelsinchannel2,and
soon.ThereceivingswitchdeterminesthedestinationVLANbycheckingthechannel
fromwhichtheframearrived.
IEEEStandard
In1996,theIEEE802.1subcommitteepassedastandardcalled802.1Qthatdefinesthe
formatforframetagging.Thestandardalsodefinestheformattobeusedinmulti­
switchedbackbonesandenablestheuse
ofmultivendorequipmentinVLANs.IEEE
802.1
Qhasopenedthewayforfurtherstandardizationin otherissuesrelatedto
VLAN
s.Mostvendorshavealreadyacceptedthestandard.

SECTION15.5KEY7ERMS 463
Advantages
ThereareseveraladvantagestousingVLANs.
CostandTimeReduction
VLANscanreducethemigrationcost ofstationsgoingfromonegrouptoanother.
Physicalreconfigurationtakestime and
iscostly.Instead ofphysicallymovingonesta­
tion
toanothersegment oreventoanotherswitch,itismucheasierandquicker tomove
itbyusingsoftware.
CreatingVirtualWorkGroups
VLANscanbeusedtocreatevirtualworkgroups.Forexample,inacampusenviron­
ment,professorsworkingonthesameprojectcansendbroadcastmessagestoone
anotherwithoutthenecessity
ofbelongingtothesamedepartment.Thiscanreduce
traffic
ifthemulticastingcapability ofIPwaspreviouslyused.
Security
VLANsprovideanextrameasure ofsecurity.Peoplebelonging tothesamegroupcan
sendbroadcastmessageswiththeguaranteedassurancethatusersinothergroupswill
notreceivethesemessages.
15.4RECOMMENDED READING
Formoredetailsaboutsubjectsdiscussedinthischapter,werecommendthefollowing
booksandsites.Theitemsinbrackets[
...]refertothereferencelistattheend ofthetext.
Books
Abookdevotedtoconnectingdevicesis [PerOO].ConnectingdevicesandVLANsare
discussedinSection4.7
of[Tan03].Switches,bridges,andhubsarediscussedin[Sta03]
and[Sta04].
Site
oIEEE802LAN/MANStandardsCommittee
15.5KEYTERMS
amplifier
blockingport
bridge
busbackbone
connectingdevice
filtering
forwardingport
hub
remotebridge
repeater
router
segment

464 CHAPTER 15CONNECTINGLANs,BACKBONENETWORKS, ANDVIRTUALLANs
sourceroutingbridge
spanningtree
starbackbone
three-layerswitch
transparentbridge
two-layerswitch
virtuallocalareanetwork
(VLAN)
15.6SUMMARY
oArepeaterisaconnectingdevicethatoperatesinthephysicallayeroftheInternet
model.Arepeaterregeneratesasignal,connectssegments
ofaLAN,andhasno
filteringcapability.
oAbridgeisaconnectingdevicethatoperatesinthephysicalanddatalinklayers of
theInternetmodel.
oAtransparentbridgecanforwardandfilterframesandautomaticallybuildits
forwardingtable.
oAbridgecanusethespanningtreealgorithmtocreatealooplesstopology.
oAbackboneLANallowsseveralLANstobeconnected.
oAbackboneisusuallyabusorastar.
oAvirtuallocalareanetwork(VLAN) isconfiguredbysoftware,notbyphysical
wiring.
oMembershipinaVLANcanbebasedonportnumbers,MACaddresses,IP
addresses,IPmulticastaddresses,oracombination
ofthesefeatures.
oVLANsarecost-andtime-efficient,canreducenetworktraffic,andprovidean
extrameasure
ofsecurity.
15.7PRACTICESET
ReviewQuestions
1.Howisarepeaterdifferentfromanamplifier?
2.Whatdowemeanwhenwesaythatabridgecanfiltertraffic?Why
isfiltering
important?
3.Whatisatransparentbridge?
4.Howdoesarepeaterextendthelength ofaLAN?
5.Howisahubrelatedtoarepeater?
6.Whatisthedifferencebetweenaforwardingportandablockingport?
7.Whatisthedifferencebetweenabusbackboneandastarbackbone?
8.HowdoesaVLANsaveacompanytimeandmoney?
9.HowdoesaVLANprovideextrasecurityforanetwork?
10.HowdoesaVLANreducenetworktraffic?
11.WhatisthebasisformembershipinaVLAN?

SECTION15.7PRACTICESET 465
Exercises
12.CompletethetableinFigure15.6aftereachstationhassentapackettoanother
station.
13.FindthespanningtreeforthesysteminFigure15.7.
14.FindthespanningtreeforthesysteminFigure15.8 ifbridgeB5isremoved.
15.FindthespanningtreeforthesysteminFigure15.8 ifbridgeB2isremoved.
16.FindthespanningtreeforthesysteminFigure15.8 ifB5isselectedastheroot
bridge.
17.InFigure15.6,weareusingabridge.Canwereplacethebridgewitharouter?
Explaintheconsequences.
18.Abridgeusesafilteringtable;arouterusesaroutingtable.Canyouexplainthe
difference?
19.Createasystem ofthreeLANswithfourbridges.Thebridges (B1toB4)connect
theLANs
asfollows:
a.B1connectsLAN1andLAN 2.
b.B2connectsLAN1andLAN 3.
c.B3connectsLAN2andLAN 3.
d.B4connectsLAN 1,LAN2,andLAN 3.
ChooseBIastherootbridge.Showtheforwardingandblockingports,after
applyingthespanningtreeprocedure.
20.Whichonehasmoreoverhead,abridgeorarouter?Explainyouranswer.
21.Whichonehasmoreoverhead,arepeaterorabridge?Explainyouranswer.
22.Whichonehasmoreoverhead,arouteroragateway?Explainyouranswer.

CHAPTER16
WirelessWANs:CellularTelephone
andSatelliteNetworks
WediscussedwirelessLANsinChapter 14.Wirelesstechnology isalsousedincellular
telephonyandsatellitenetworks.
Wediscusstheformerinthischapter aswellasexam­
ples
ofchannelizationaccessmethods(seeChapter12). Wealsobrieflydiscusssatellite
networks,atechnologythateventuallywillbelinkedtocellulartelephonytoaccessthe
Internetdirectly.
16.1
CELY",ULARlELEPHONY
Cellulartelephonyisdesignedtoprovidecommunicationsbetweentwomoving
units,calledmobilestations(MSs),
orbetweenonemobileunitandonestationary
unit,oftencalledalandunit.Aserviceprovidermustbeabletolocateandtracka
caller,assignachanneltothecall,andtransferthechannelfrombasestationtobase
station
asthecallermovesout ofrange.
Tomakethistrackingpossible,eachcellularserviceareaisdividedintosmall
regionscalledcells.EachcellcontainsanantennaandiscontrolledbyasolarorAC
pow­
erednetworkstation,calledthebasestation(BS).Eachbasestation,intum,iscontrolled
byaswitchingoffice,calledamobileswitching
center(MSC).TheMSCcoordinates
communicationbetweenallthebasestationsandthetelephonecentraloffice.Itisacom­
puterizedcenterthatisresponsibleforconnectingcalls,recordingcallinformation,and
billing(seeFigure16.1).
Cellsizeisnotfixedandcanbeincreased
ordecreaseddependingonthepopula­
tion
ofthearea.Thetypicalradius ofacellis1to12mi.High-densityareasrequire
more,geographicallysmallercellstomeettrafficdemandsthandolow-densityareas.
Oncedetermined,cellsizeisoptimizedtopreventtheinterference
ofadjacentcell
signals.Thetransmissionpower
ofeachcelliskeptlowtopreventitssignalfrominter­
feringwiththose
ofothercells.
Frequency-ReusePrinciple
Ingeneral,neighboringcellscannotusethesameset offrequenciesforcommunication
becauseitmaycreateinterferencefortheuserslocatednearthecellboundaries.How­
ever,theset
offrequenciesavailable islimited,andfrequenciesneedtobereused.A
467

468 CHAPTER16WIRELESSWANs:CELLULARTELEPHONE ANDSATELLITENETWORKS
Figure16.1 Cellularsystem
Mobileswitching
center1-------1:....---l:f,
(MSC)
MS
Stationary
phone
Publicswitched
telephonenetwork
(PSTN)
Cell
frequencyreusepatternisaconfiguration ofNcells,Nbeingthe reusefactor, inwhich
eachcellusesaunique set
offrequencies.Whenthepatternisrepeated,thefrequencies
canbereused.Thereareseveraldifferentpatterns.Figure16.2showstwo
ofthem.
Figure16.2 Frequencyreusepatterns
a.Reusefactorof4 b.Reusefactor of7
Thenumbersinthecellsdefinethepattern.Thecellswiththesamenumberina
patterncanusethesamesetoffrequencies.
Wecallthesecellsthe reusingcells. AsFig­
ure16.2shows,inapatternwithreusefactor4,onlyonecellseparatesthecellsusing
thesameset
offrequencies.Inthepatternwithreusefactor 7,twocellsseparatethe
reusingcells.
Transmitting
Toplaceacallfromamobilestation,thecallerentersacode of7or10digits(aphone
number)andpressesthesendbutton.Themobilestationthenscanstheband,seekinga
setupchannelwithastrongsignal,andsendsthedata(phonenumber)
totheclosest
basestationusingthatchannel.ThebasestationrelaysthedatatotheMSC.TheMSC

SECTION16.1CELLULARTELEPHONY 469
sendsthedataontothetelephonecentraloffice. Ifthecalledpartyisavailable,acon­
nectionismadeandtheresultisrelayedback
totheMSC.Atthispoint,theMSC
assignsanunusedvoicechanneltothecall,andaconnectionisestablished.The
mobilestationautomaticallyadjustsitstuningtothenewchannel,andcommunication
canbegin.
Receiving
Whenamobilephoneiscalled,thetelephonecentralofficesendsthenumbertothe
MSC.TheMSCsearchesforthelocation
ofthemobilestationbysendingquerysig­
nalstoeachcellinaprocesscalled
paging.Oncethemobilestationisfound,theMSC
transmitsaringingsignaland,whenthemobile stationanswers,assignsavoicechan­
neltothecall,allowingvoicecommunicationtobegin.
Handoff
Itmayhappenthat,duringaconversation,themobilestationmovesfromonecellto
another.Whenitdoes,thesignalmaybecomeweak.
Tosolvethisproblem,theMSC
monitorsthelevelofthesignaleveryfewseconds.
Ifthestrengthofthesignaldimin­
ishes,theMSCseeksanewcellthatcanbetteraccommodatethecommunication.The
MSCthenchangesthechannelcarryingthecall(handsthesignalofffromtheold
channeltoanewone).
HardHandoffEarlysystemsusedahardhandoff.Inahardhandoff,amobilestation
onlycommunicateswithonebasestation.WhentheMSmovesfromonecell
toanother,
communicationmustfirstbebrokenwiththepreviousbasestationbeforecommunication
canbeestablishedwiththenewone.Thismaycreatearoughtransition.
Soft
HandoffNewsystemsuseasofthandoff.Inthiscase,amobilestationcan
communicatewithtwobasestationsatthesametime.Thismeansthat,duringhandoff,
amobilestationmaycontinuewiththenewbasestationbeforebreakingofffromthe
oldone.
Roaming
Onefeatureofcellulartelephonyiscalledroaming.Roamingmeans,inprinciple,that
ausercanhaveaccesstocommunicationorcanbereachedwherethere
iscoverage.A
serviceproviderusuallyhaslimitedcoverage.Neighboringserviceproviderscanpro­
videextendedcoveragethrougharoamingcontract.Thesituationissimilartosnail
mailbetweencountries.Thechargefordelivery
ofaletterbetweentwocountriescan
bedivideduponagreementbythetwocountries.
FirstGeneration
Cellular
teleph!Jnyisnowinitssecondgenerationwiththethirdonthehorizon.The
firstgenerationwasdesignedforvoicecommunicationusinganalogsignals.
Wediscuss
onefirst-generationmobile systemusedinNorthAmerica,AMPS.

470 CHAPTER 16WIRELESSWANs:CELLULARTELEPHONE ANDSATELLITENETWORKS
AMPS
AdvancedMobilePhone System(AMPS) isoneoftheleadinganalogcellularsys­
temsinNorthAmerica.
ItusesFDMA(seeChapter12)toseparatechannelsinalink.
AMPSis ananalogcellularphonesystemusingFDMA.
BandsAMPSoperates intheISM800-MHzband.Thesystemusestwoseparate
analogchannels,oneforforward(basestationtomobilestation)communicationand
oneforreverse(mobilestationtobasestation)communication.Thebandbetween824
and849MHzcarriesreversecommunication;thebandbetween869and894MHzcarries
forwardcommunication(seeFigure16.3).
Figure16.3
Cellularbands forAMPS
Eachbandis25MHz,
madeof8323D-kHzanalogchannels
Forwardcommunication:basetomobile

849
MHz
Reversecommunication:mobiletobase

Eachbandisdividedinto832channels.However,twoproviderscanshareanarea,
whichmeans416channelsineachcellforeachprovider.Outofthese416,
21channels
areusedforcontrol,whichleaves395channels.AMPShasafrequencyreusefactor
of7;thismeansonlyone-seventhofthese395trafficchannelsareactuallyavailablein
acell.
TransmissionAMPSusesFMandFSKformodulation.Figure16.4showsthetrans­
missioninthereversedirection.VoicechannelsaremodulatedusingFM,andcontrol
channelsuseFSKtocreate30-kHzanalogsignals.AMPSusesFDMAtodivideeach
25-MHzbandinto3D-kHzchannels.
SecondGeneration
Toprovidehigher-quality(lessnoise-prone)mobilevoicecommunications,thesecond
generation
ofthecellularphonenetworkwasdeveloped.Whilethefirstgenerationwas
designedforanalogvoicecommunication,thesecondgenerationwasmainlydesigned
fordigitizedvoice.Threemajorsystemsevolvedinthesecondgeneration,
asshownin
Figure16.5.
Wewilldiscusseachsystemseparately.

SECTION16.1CELLULARTELEPHONY 471
Figure16.4 AMPSreversecommunicationband
,--...;--,,.....-..
....I lJ 1..".I \
(-"".......,
FDMA
1-----------------1
I30 1
Iklli 1
I
I
---:;;...:...:;::..::;:.,.---T....IiiW-....----l.........---'-_~_'_ I
I
30kHz
Analog
,._........J'....~.. ..-.....,--....
I Ii I....I 11 I....
1. 25-MHzband .1
Figure16.5 Second-generationcellularphonesystems
TDMA-FDMA
D-AMPS
TheproductoftheevolutionoftheanalogAMPSintoadigitalsystemis digitalAMPS
(D-AMPS).D-AMPSwasdesignedtobebackward-compatiblewithAMPS.This
meansthatinacell,onetelephonecanuseAMPSandanotherD-AMPS.D-AMPSwas
firstdefinedbyIS-54(InterimStandard54)andlaterrevisedbyIS-136.
BandD-AMPSusesthesamebandsandchannels asAMPS.
TransmissionEachvoicechannelisdigitizedusingaverycomplexPCMandcom­
pressiontechnique.Avoicechannel
isdigitizedto7.95kbps.Three7.95-kbpsdigital
voicechannelsarecombinedusingTDMA.Theresultis48.6kbps
ofdigitaldata;much
ofthisisoverhead.AsFigure16.6shows,thesystemsends25framespersecond,with
1944bitsperframe.Eachframelasts40ms(1/25)andisdividedintosixslotsshared
bythreedigitalchannels;eachchannelisallottedtwoslots.
Eachslotholds324bits.However,only
159bitscomesfromthedigitizedvoice;
64bitsareforcontroland
101bitsareforerrorcorrection.Inotherwords,eachchannel
drops159bits
ofdataintoeach ofthetwochannelsassignedtoit.Thesystemadds
64controlbitsand
101error-correctingbits.

472 CHAPTER 16WIRELESSWANs: CEllULARTELEPHONEANDSATELLITENETWORKS
Figure16.6 D-AMPS
,---------..7.95kbps
~~--l
7.95kbps
,---------..7.95kbps
--;:"'~--l I------+--+---r--+--+---,
FDMA
------------------,
48.6kbps~ :30kHz I
I QPSK
30
kHz:
l;?(--"..."--V--',...,,--',i
--....." I~.,''''"I
I I
~PSK
30kHz:(--\A...(--',"._',...,'--',!
Channel002------"1 .'dlllWll!"!1
I I
I:' I
I • I
Channel832
------"1~ 30kHz:t-v--':..·,ry--,;...0 ~
IIj 25-MHzbandIj
, •j
I -----------~
Theresulting48.6kbps ofdigitaldatamodulatesacarrierusingQPSK;theresult
isa3D-kHzanalogsignal.Finally,the3D-kHzanalogsignalssharea25-MHzband
(FDMA).D-AMPShasafrequencyreusefactor
of7.
D-AMPS,or18-136,isa digitalcellularphonesystemusingTDMA andFDMA.
GSM
TheGlobalSystemforMobileCommunication(GSM)isaEuropeanstandardthat
wasdeveloped
toprovideacommonsecond-generationtechnologyforallEurope.The
aimwas
toreplaceanumberofincompatiblefirst-generationtechnologies.
BandsGSMusestwobandsforduplexcommunication.Eachbandis25MHz
inwidth,shiftedtoward900MHz,
asshowninFigure16.7.Eachbandisdividedinto
124channels
of200kHzseparatedbyguardbands.
Figure16.7
GSMbands
Band=25MHz =124channels
1
1
890 Reverseband:124channels 915
MHz MHz
------_-1~
935 Forwardband:124channels 960
MHz MHz

SECTION16.1CELLULARTELEPHONY 473
TransmissionFigure16.8showsaGSMsystem.Eachvoicechannelisdigitizedand
compressedtoa13-kbpsdigitalsignal.Eachslotcarries156.25bits(seeFigure16.9).Eight
slotsshareaframe(TDMA).Twenty-sixframesalsoshareamultiframe(TDMA).
We
cancalculatethebitrate ofeachchannel asfollows:
Channeldata
rate=(11120IDS)x20X8X156.25:;:::270.8kbps
Figure16.8 GSM
Channel001
8Users
13
,------,.kbps
M!-------l t--"'------.....,
13
1:iI-.=...:::~,------,. kbps
-----------------------
rY-"'-'-I""""T""'1""""" :T
,
:D
I
:M
:A
Channel002------1..:....---------:..---
1
~;P••~~"":~"••••~~•••~'
Channel124--------1.
l
+-
I
.--...:..
z
-s--
MHz
,-'-b-an.md-m,~l-> ~i
--~--~----------~
Each270.8-kbpsdigitalchannelmodulatesacarrierusing GMSK(aformof
FSKusedmainlyinEuropeansystems);theresultisa200-kHzanalogsignal.Finally
124analogchannels
of200kHzarecombinedusingFDMA.Theresultisa25-MHz
band.Figure16.9showstheuserdataandoverheadinamultiframe.
Thereadermayhavenoticedthelargeamount
ofoverheadinTDMA.Theuser
dataareonly
65bitsperslot.Thesystemaddsextrabitsforerrorcorrectiontomakeit
114bitsperslot.
Tothis,controlbitsareaddedtobringitupto156.25bitsperslot.
Eightslotsareencapsulatedinaframe.Twenty-fourtrafficframesandtwoadditional
controlframesmakeamultiframe.Amultiframehasaduration
of120ms.However,
thearchitecturedoesdefinesuperframesandhyperframesthatdonotaddanyoverhead;
wewillnotdiscussthemhere.
Reuse
FactorBecauseofthecomplexerrorcorrectionmechanism,GSMallowsa
reusefactoraslow
as3.

474 CHAPTER16WIRELESSWANs:CELLULARTELEPHONE ANDSATELLITENETWORKS
Figure16.9 Multiframecomponents
165bits1Userdata
II
114bitsIUserdata plu.s
___.errorcontrolbits
I
IIUserdataplus
156.25bitserrorcontrolbitsand
f----------:.....=-"'""TDMAcontrolbits
--
bllrrm...rnmrn
,,,~rame=8slots Frame =8slot~///
1multiframe'"26frames
24trafficframes+2controlframes
I,
120ms
GSMisadigitalcellularphonesystemusingTDMA andFDMA.
IS-95
Oneofthedominantsecond-generationstandardsinNorthAmericais InterimStan­
dard95(IS-95).ItisbasedonCDMAandDSSS.
BandsandChannelsIS-95usestwobandsforduplexcommunication.Thebands
canbethetraditionalISM800-MHzbandortheISM1900-MHzband.Eachband
is
dividedinto20channelsof1.228MHzseparatedbyguardbands.Eachserviceprovider
isallotted
10channels.IS-95canbeusedinparallelwithAMPS.EachIS-95channel is
equivalentto 41AMPSchannels (41x30
kHz;::::1.23MHz).
SynchronizationAllbasechannelsneedtobesynchronizedtouseCDMA.
Topro­
videsynchronization,basesusetheservices
ofGPS(GlobalPositioningSystem),a
satellitesystemthat
wediscussinthenextsection.
ForwardTransmissionIS-95hastwodifferenttransmissiontechniques:oneforuse
intheforward(basetomobile)directionandanotherforuseinthereverse(mobileto
base)direction.Intheforwarddirection,communicationsbetweenthebaseandall
mobilesaresynchronized;thebasesendssynchronizeddatatoallmobiles.Figure16.10
showsasimplifieddiagramfortheforwarddirection.
Eachvoicechannel
isdigitized,producingdataatabasicrate of9.6kbps.After
addingerror-correctingandrepeatingbits,andinterleaving,theresultisasignalof
19.2ksps(kilosignalspersecond).Thisoutputisnowscrambledusinga19.2-ksps
signal.Thescramblingsignalisproducedfromalongcodegeneratorthatusestheelec­
tronicserialnumber(ESN)ofthemobilestationandgenerates2
42
pseudorandomchips,
eachchiphaving42bits.Notethatthechipsaregeneratedpseudorandomly,notran­
domly,becausethepatternrepeatsitself.Theoutputofthelongcodegeneratorisfedto
adecimator,whichchooses1bitoutof64bits.Theoutputofthedecimatorisusedfor
scrambling.Thescrambling
isusedtocreate
privacy~theESNisuniqueforeachstation.

SECTION16.1CEILULARTELEPHONY 475
Figure16.10 IS-95forwardtransmission
25-MHzband
FDMA
I
I
Il.Z28
IMHz
I~
.--------.:~:.~." ...~...,,'.-~---":
Ililillillili&i$j\L.'•
ch'-ann-el-OZ.....i;"...-':-...:------':
I
I
I
I :•••"-••~: - -~•".•":'+.
ChannelZO~-----~~'T-I
Digitalchannel63
ESN
,-_--,.9.6 19.Z
kbpsErrorcon:ecting.ksps
repeatmg,
interleaving
CDMA
-------~-..,
wo
TheresultofthescrambleriscombinedusingCDMA.Foreachtrafficchannel,
oneWalsh64x64rowchip
isselected.Theresultisasignal of1.228Mcps(megachips
persecond).
19.2kspsx64cps =1.228Mcps
ThesignalisfedintoaQPSKmodulatortoproduceasignal of1.228MHz.The
resultingbandwidthisshiftedappropriately,usingFDMA.Ananalogchannelcreates
64digitalchannels,
ofwhich55channelsaretrafficchannels(carryingdigitizedvoice).
Ninechannelsareusedforcontrolandsynchronization:
oChannel0isapilotchannel.Thischannelsendsacontinuousstream of1stomobile
stations.Thestreamprovidesbitsynchronization,servesasaphasereferencefor
demodulation,andallowsthemobilestationtocomparethesignalstrength
of
neighboringbasesforhandoffdecisions.
oChannel32givesinformationaboutthesystemtothemobilestation.
oChannels1to7areusedforpaging,tosendmessagestooneormoremobile
stations.
oChannels8to 31and33to 63aretrafficchannelscarryingdigitizedvoicefromthe
basestationtothecorrespondingmobilestation.
ReverseTransmission
TheuseofCDMAintheforwarddirectionispossible
becausethepilotchannelsendsacontinuoussequence ofIstosynchronizetransmis­
sion.Thesynchronizationisnotusedinthereversedirectionbecauseweneedanentity
todothat,whichisnotfeasible.Instead
ofCDMA,thereversechannelsuseDSSS
(directsequencespreadspectrum),whichwediscussed
inChapter8.Figure16.11shows
asimplifieddiagramforreversetransmission.

476 CHAPTER 16WIRELESSWANs:CELLULARTELEPHONEAND SATELliTENETWORKS
Figure16.11 IS-95reversetransmission
I: I
II I
I II I
L !:::::.eo..!
Channel20:I I:
I
25·MHzband I
• •I
L _
DSSS
r-------------I
I 1.228 I
I
1.228 MHz I FDMA
IMcps
~ r----------------
::1.228 :
I II,MHz.I I
II I
II :•••: ",:
.'I
Eachvoicechannelisdigitized,producingdataatarate of9.6kbps.However,
afteraddingerror-correctingandrepeatingbits,plusinterleaving,theresult
isasignal
of28.8ksps.Theoutputisnowpassedthrougha6/64symbolmodulator.Thesymbols
aredividedintosix-symbolchunks,andeachchunkisinterpreted
asabinarynumber
(from0to63).Thebinarynumberisusedastheindextoa64x64Walshmatrixfor
selection
ofarowofchips.NotethatthisprocedureisnotCDMA;eachbitisnot
multipliedbythechipsinarow.Eachsix-symbolchunkisreplacedbya64-chip
code.Thisisdonetoprovideakind
oforthogonality;itdifferentiatesthestreams of
chipsfromthedifferentmobilestations.Theresultcreatesasignal of307.2kcpsor
(28.8/6)x64.
Spreadingisthenextstep;eachchip
isspreadinto 4.AgaintheESN ofthemobile
stationcreatesalongcode
of42bitsatarate of1.228Mcps,whichis4times307.2.
Afterspreading,eachsignalismodulatedusingQPSK,whichisslightlydifferentfrom
theoneusedintheforwarddirection;we
donotgointodetailshere.Notethatthereis
nomultiple-accessmechanismhere;allreversechannelssendtheiranalogsignalinto
theair,butthecorrectchipswillbereceivedbythebasestationdue
tospreading.
Althoughwecancreate2
42
-
1digitalchannelsinthereversedirection(becauseof
thelongcodegenerator),normally94channelsareused;62aretrafficchannels,and
32arechannelsusedtogainaccesstothebasestation.
IS-95isadigitalcellularphonesystemusingCDMAlDSSS andFDMA.
TwoDataRateSetsIS-95definestwodataratesets,withfourdifferentratesineach
set.Thefirstsetdefines9600,4800,2400,and1200bps.
If,forexample,theselected
rateis1200bps,eachbitisrepeated8timestoprovidearate
of9600bps.Thesecond
setdefines14,400,7200,3600,and1800bps.Thisispossiblebyreducingthenumber
ofbitsusedforerrorcorrection.Thebitrates inasetarerelatedtothe activity ofthe
channel.
Ifthechannelissilent,only1200bitscanbetransferred,whichimprovesthe
spreadingbyrepeatingeachbit8times.
Frequency-ReuseFactorInan
IS-95system,thefrequency-reusefactorisnormally1
becausetheinterferencefromneighboringcellscannotaffectCDMAorDSSStransmission.

SECTION16.1 CELLUlARTELEPHONY 477
SoftHandoffEverybasestationcontinuouslybroadcastssignalsusingitspilot
channel.Thismeansamobilestationcandetectthepilotsignalfromitscellandneigh­
boringcells.Thisenablesamobilestationtodoasofthandoffincontrasttoahard
handoff.
pes
Beforeweleavethediscussionofsecond-generationcellulartelephones,let usexplain
atermgenerallyheardinrelationtothisgeneration:PCS.Personalcommunications
system
(peS)doesnotrefertoasingletechnologysuch asGSM,18-136,or18-95. Itis
agenericnameforacommercialsystemthatoffersseveralkinds
ofcommunication
services.Commonfeatures
ofthesesystemscanbesummarized:
1.Theymayuseanysecond-generationtechnology(GSM,IS-136,orIS-95).
2.Theyusethe1900-MHzband,whichmeansthatamobilestationneedsmorepower
becausehigherfrequencieshaveashorterrangethanlowerones.However,sincea
station'spowerislimitedbytheFCC,thebasestationandthemobilestationneed
tobeclose
toeachother(smallercells).
3.Theyoffercommunicationservicessuch asshortmessageservice(SMS)andlimited
Internetaccess.
ThirdGeneration
Thethirdgeneration ofcellulartelephonyreferstoacombinationoftechnologiesthat
provideavariety
ofservices.Ideally,whenitmatures,thethirdgenerationcanprovide
bothdigitaldataandvoicecommunication.Usingasmallportabledevice,aperson
shouldbeabletotalktoanyoneelseintheworldwithavoicequalitysimilartothat
of
theexistingfixedtelephonenetwork.Apersoncandownloadandwatchamovie,can
downloadandlistentomusic,cansurftheInternet
orplaygames,canhaveavideo
conference,andcandomuchmore.One
oftheinterestingcharacteristics ofathird­
generationsystemisthattheportabledeviceisalwaysconnected;youdonotneedto
dialanumbertoconnecttotheInternet.
Thethird-generationconceptstartedin1992,whenITUissuedablueprintcalled
the
InternetMobileCommunication2000(IMT-2000).Theblueprintdefinessome
criteriaforthird-generationtechnology
asoutlinedbelow:
oVoicequalitycomparabletothat oftheexistingpublictelephonenetwork.
oDatarateof144kbpsforaccessinamovingvehicle(car),384kbpsforaccess as
theuserwalks(pedestrians),and2Mbpsforthestationaryuser(officeorhome).
oSupportforpacket-switchedandcircuit-switcheddataservices.
oAbandof2GHz.
oBandwidthsof2MHz.
oInterfacetotheInternet.
Themaingoal ofthird-generationcellulartelephonyistoprovide
universalpersonalcommunication.

478 CHAPTER 16WIRELESSWANs: CELLUlARTELEPHONEANDSATELLITENETWORKS
IMT-2000RadioInterface
Figure16.12showstheradiointerfaces(wirelessstandards)adoptedby1MT-2000.All
fivearedevelopedfromsecond-generationtechnologies.Thefirsttwoevolvefrom
COMAtechnology.Thethirdevolvesfromacombination
ofCOMAandTOMA.The
fourthevolvesfromTOMA,andthelastevolvesfrombothFOMAandTOMA.
Figure16.12 IMT-2000radio
inteifaces
IMT-SC IMT-FT
SinglecarrierFrequencytime
CDMA
IMT-TC
Timecode
CDMA&TDMA TDMA TDMA&FDMA
IMT-DSThisapproachusesaversion ofCOMAcalledwidebandCOMAorW-COMA.
W-COMAusesa5-MHzbandwidth.
ItwasdevelopedinEurope,anditiscompatible
withtheCOMAusedinIS-95.
IMT-MC ThisapproachwasdevelopedinNorthAmericaandisknownasCOMA
2000.
ItisanevolutionofCOMAtechnologyusedinIS-95channels. Itcombinesthe
newwideband(I5-MHz)spreadspectrumwiththenarrowband(l.25-MHz)COMA
of
IS-95.Itisbackward-compatiblewithIS-95. Itallowscommunicationonmultiple
1.25-MHzchannels
(l,3,6,9,12times),upto 15MHz.Theuse ofthewiderchannels
allowsit
toreachthe2-Mbpsdataratedefinedforthethirdgeneration.
IMT-TCThisstandardusesacombination ofW-COMAandTDMA.Thestandard
tries
toreachtheIMT-2000goalsbyaddingTOMAmultiplexingtoW-COMA.
IMT-SCThisstandardonlyusesTOMA.
IMT-FTThisstandardusesacombination ofFDMAandTOMA.
16.2SATELLITENETWORKS
Asatellitenetwork isacombinationofnodes,some ofwhicharesatellites,thatprovides
communicationfromonepointontheEarth
toanother.Anodeinthenetworkcanbea
satellite,anEarthstation,oranend-userterminalortelephone.Althoughanaturalsatel­
lite,suchastheMoon,canbeusedasarelayingnodeinthenetwork,theuse
ofartificial
satellitesispreferredbecausewecaninstallelectronicequipmentonthesatellite
toregen­
eratethesignalthathaslostitsenergyduringtravel.Anotherrestrictiononusingnatural
satellitesistheirdistancesfromtheEarth,whichcreatealongdelayincommunication.
Satellitenetworksarelikecellularnetworksinthattheydividetheplanetintocells.
SatellitescanprovidetransmissioncapabilitytoandfromanylocationonEarth,no
matterhowremote.Thisadvantagemakeshigh-qualitycommunicationavailableto

SECTION16.2SATELLITENETWORKS 479
undevelopedpartsoftheworldwithoutrequiringahugeinvestmentinground-based
infrastructure.
Orbits
Anartificialsatelliteneedstohavean
orbit~thepathinwhichittravelsaroundtheEarth.
Theorbitcanbeequatorial,inclined,orpolar,
asshowninFigure16.13.
Figure16.13 Satelliteorbits
Orbit
Orbit
Orbit
a.Equatorial-orbitsatellite b.Inclined-orbitsatellite c.Polar-orbitsatellite
Theperiodofasatellite,thetimerequiredforasatellitetomakeacompletetrip
aroundtheEarth,isdeterminedbyKepler'slaw,whichdefinestheperiod
asafunction
ofthedistanceofthesatellitefromthecenteroftheEarth.
Example16.1
What
istheperiodoftheMoon,accordingtoKepler'slaw?
Period::::C
xdistance1.5
HereC isaconstantapproximatelyequalto1/100.Theperiodisinsecondsandthedistancein
kilometers.
Solution
TheMoon
islocatedapproximately384,000kmabovetheEarth.Theradius oftheEarthis
6378km.Applyingtheformula,weget
Period
=_1_(384,000+6378)1.5=2,439,090s =1month
100
Example16.2
AccordingtoKepler's
law,whatistheperiod ofasatellitethatislocatedatanorbitapproximately
35,786
kmabovetheEarth?
Solution
Applyingtheformula,weget
Period
=
1~(35,786 +6378/
5
=86,579s =24h

480 CHAPTER 16WIRELESSWANs:CELLULARTELEPHONE ANDSATELLITENETWORKS
Thismeansthatasatellitelocatedat35,786kmhasaperiod of24h,whichisthesameasthe
rotationperiod
oftheEarth.Asatellitelikethisissaid tobestationarytotheEarth.Theorbit, as
wewillsee,iscalledageosynchronousorbit.
Footprint
Satellites processmicrowaveswithbidirectionalantennas(line-of-sight).Therefore,the
signalfromasatellite
isnormallyaimedataspecificareacalledthefootprint.Thesig­
nalpoweratthecenter
ofthefootprintismaximum.Thepowerdecreasesaswemove
outfromthefootprintcenter.Theboundary
ofthefootprintisthelocationwherethe
powerlevel
isatapredefinedthreshold.
ThreeCategoriesofSatellites
Basedonthelocation oftheorbit,satellitescanbedividedintothreecategOlies:geosta­
tionary
Earthorbit(GEO),low-Earth-orbit(LEO),andmiddle-Earth-orbit(MEO).
Figure16.14showsthetaxonomy.
Figure16.14Satellitecategories
Figure16.15showsthesatellitealtitudeswithrespecttothesurface oftheEarth.
Thereisonlyoneorbit,atanaltitude
of35,786kInfortheOEOsatellite.MEOsatellites
arelocatedataltitudesbetween5000and15,000
kIn.LEOsatellitesarenormallybelow
analtitude
of2000km.
Figure16.15Satelliteorbitaltitudes
Altitude
(km)
35,786
-~~~-GEO
UpperVanAllenbelt
15,000
~~~ ~MEa
5000
Lower
VanAllenbelt
0
~~~qf'~ ~LEO

SECTION16.2SATELLITENETWORKS 481
Onereasonforhavingdifferentorbitsisduetotheexistence oftwoVanAllen
belts.AVanAllenbeltisalayerthatcontainschargedparticles.Asatelliteorbitingin
one
ofthesetwobeltswouldbetotallydestroyedbytheenergeticchargedparticles.
TheMEOorbitsarelocatedbetweenthesetwobelts.
FrequencyBands forSatelliteCommunication
Thefrequenciesreservedforsatellitemicrowavecommunicationareinthegigahertz
(OHz)range.Eachsatellitesendsandreceivesovertwodifferentbands.Transmission
fromtheEarth
tothesatelliteiscalledtheuplink.Transmissionfromthesatellite totheEarth
iscalledthedownlink.Table16.1givesthebandnamesandfrequenciesforeachrange.
Table16.1
Satellitefrequencybands
Band Downlink,GHz Uplink,GHz Bandwidth,MHz
L 1.5 1.6 15
S 1.9 2.2 70
C 4.0 6.0 500
Ku 11.0 14.0 500
Ka 20.0 30.0 3500
GEOSatellites
Line-of-sightpropagationrequiresthatthesendingandreceivingantennasbelocked
ontoeachother'slocationatalltimes(oneantennamusthavetheotherinsight).For
thisreason,asatellitethatmovesfasterorslowerthanthe
Earth'srotationisuseful
onlyforshortperiods.Toensureconstantcommunication,thesatellitemustmoveat
thesamespeedastheEarthsothatitseemstoremainfixedaboveacertainspot.Such
satellitesarecalledgeostationary.
Becauseorbitalspeedisbasedonthedistancefromtheplanet,onlyoneorbitcanbe
geostationary.Thisorbitoccursattheequatorialplaneandisapproximately22,000
mi
fromthesurface oftheEarth.
ButonegeostationarysatellitecannotcoverthewholeEarth.Onesatelliteinorbit
hasline-of-sightcontactwithavastnumber
ofstations,butthecurvature oftheEarth
stillkeepsmuch
oftheplanetout ofsight.Ittakesaminimum ofthreesatellitesequi­
distantfromeachotheringeostationaryEarthorbit(OEO)toprovidefullglobaltransmis­
sion.Figure16.16showsthreesatellites,each120°fromanotheringeosynchronous
orbitaroundtheequator.Theview
isfromtheNorthPole.
MEOSatellites
Medium-Earth-orbit(MEO)satellitesarepositionedbetweenthetwoVanAllen
belts.Asatelliteatthisorbittakesapproximately
6-8hourstocircletheEarth.
GlobalPositioningSystem
Oneexample ofaMEOsatellitesystemistheGlobalPositioningSystem(GPS),con­
stractedandoperatedbytheUSDepartment
ofDefense,orbitingatanaltitudeabout

482 CHAPTER16WIRELESSWANs:CELLULARTELEPHONE ANDSATELLITENETWORKS
Figure16.16Satellitesingeostationaryorbit
18,000km(11,000mi)abovetheEarth.Thesystemconsists of24satellitesandisusedfor
land,sea,andairnavigationtoprovidetimeandlocationsforvehiclesandships.GPS
uses24satellitesinsixorbits,asshowninFigure16.17.Theorbitsandthelocations
of
thesatellitesineachorbitaredesignedinsuchawaythat,atanytime,foursatellites
arevisiblefromanypointonEarth.AGPSreceiverhasanalmanacthattellsthecurrent
position
ofeachsatellite.
Figure16.17Orbitsforglobalpositioningsystem(GP S)satellites
TrilaterationGPSisbased onaprinciplecalled trilateration.tOnaplane, ifwe
knowourdistancefromthreepoints,weknowexactlywhereweare.Letussay thatwe
are10milesawayfrompointA,12milesawayfrompointB,and
15milesawayfrom
point
C.IfwedrawthreecircleswiththecentersatA,B,andC,wemustbesomewhere
oncircleA,somewhereoncircleB,andsomewhereoncircleC.Thesethreecirclesmeet
atonesinglepoint(ifourdistancesarecorrect),
ourposition.Figure16.18ashowsthe
concept.
Inthree-dimensionalspace,thesituationisdifferent.Threespheresmeetintwo
pointsasshowninFigure16.18b.Weneedatleastfourspherestofindourexactposition
inspace(longitude,latitude,andaltitude).However,
ifwehaveadditionalfactsabout
ourlocation(forexample,weknowthatwearenotinsidetheocean orsomewherein
tThetennstrilaterationandtriangulationarenonnallyusedinterchangeably. Weusetheword trilateration,
whichmeansusingthreedistances,insteadoftriangulation,whichmaymeanusingthreeangles.

SECTION16.2SATELliTENETWORKS 483
Figure16.18Trilaterationonaplane
" "-
/ B \
I l.--
\-///--,
" I/ \
~/ \
" I~'eC \
/ \ I
I \ \
I
\
Ae',I /
\ .....1.-._...."
" /
.....--
a.Two-dimensionaltrilateration b.Three-dimensionaltrilateration
space),threespheresareenough,becauseone ofthetwopoints,wherethespheresmeet,
issoimprobablethattheothercanbeselectedwithoutadoubt.
MeasuringtheDistanceThetrilaterationprinciplecanfindourlocationontheearth
if
weknowourdistancefromthreesatellitesandknowtheposition ofeachsatellite.The
position
ofeachsatellitecanbecalculatedbyaGPSreceiver(usingthepredeterminedpath
ofthesatellites).TheGPSreceiver,then,needs tofinditsdistancefrom atleastthreeGPS
satellites(center
ofthespheres).Measuringthedistanceisdoneusingaprinciple called
one-wayranging.Forthemoment,letusassumethatallGPSsatellitesandthereceiveron
theEartharesynchronized.Each
of24satellitessynchronouslytransmitsacomplexsignal
eachhavingauniquepattern.Thecomputeronthereceivermeasuresthedelaybetweenthe
signalsfromthesatellitesanditscopy
ofsignalstodeterminethedistancestothesatellites.
SynchronizationThepreviousdiscussionwasbasedontheassumptionthatthesat­
ellites'clockaresynchronizedwitheachotherandwiththereceiver'sclock.Satellites
useatomicclockthatarepreciseandcanfunctionsynchronouslywitheachother.The
receiver'sclockhowever,isanormalquartzclock(anatomicclockcostsmorethat
$50,000),andthereisnowaytosynchronizeitwiththesatelliteclocks.Thereisan
unknownoffsetbetweenthesatelliteclocksandthereceiverclockthatintroducesa
correspondingoffsetinthedistancecalculation.Because
ofthisoffset,themeasured
distanceiscalledapseudorange.
GPSusesanelegantsolutiontotheclockoffsetproblem,byrecognizingthattheoff­
set'svalueisthesameforallsatellitebeingused.Thecalculationofpositionbecomesfind­
ingfourunknowns:the
xpYPzpcoordinatesofthereceiver,andcommonclockoffset dt.
Forfindingthesefourunknownvalues, weneedatleastfourequations.Thismeansthat
weneedtomeasurepesudorangesfromfoursatelliteinstead
ofthree.Ifwecallthefour
measuredpseudoranges
PRI,PR2,PR3andPR4andthecoordinates ofeachsatellite
Xi,yj,andZj(fori =1to4),wecanfindthefourpreviouslymentionedunknownvalues
usingthefollowingfour equations(thefourunknownvaluesareshownincolor).
PR
I
=[(Xl- x
r
)2
+(YI-Yr)2 +(zl-zr)zJlIZ+c Xdt
PR
z=[(xz- x
r
)2+(yz-Yr)z +(zz-zr)2JI/Z+exdt
PR
3=[(x3- xr)z+(Y3-Yr)z+(z3-zr)ZJ1/2+exdt
PR
4=[(x4
-xrP+(Y4-Yr)z+(z4-zr)ZJI/Z+exdt

484 CHAPTER16WIRELESSWANs:CELLULARTELEPHONE ANDSATELLITENETWORKS
ThecoordinatesusedintheaboveformulasareinanEarth-CenteredEarth-Fixed
(ECEF)referenceframe,whichmeansthattheorigin
ofthecoordinatespaceisatthe
center
oftheEarthandthecoordinatespacerotatewiththeEarth.Thisimpliesthatthe
ECEFcoordinatesofafixedpoint onthesurfaceoftheearthdo notchange.
ApplicationGPSisusedbymilitaryforces. Forexample,thousands ofportableGPS
receiverswereusedduringthePersian
Gulfwarbyfootsoldiers,vehicles,andhelicop­
ters.Anotheruse
ofGPSisinnavigation. Thedriverofacarcanfindthelocation of
thecar.Thedrivercanthenconsultadatabaseinthememory oftheautomobiletobe
directedtothedestination.
Inotherwords,GPSgivesthelocation ofthecar,andthe
databaseusesthisinformationtofindapathtothedestination.Averyinterestingappli­
cationisclocksynchronization.As
wementionedpreviously,theIS-95cellulartelephone
systemusesGPStocreatetimesynchronizationbetweenthebasestations.
LEOSatellites
Low-Earth-orbit(LEO)satelliteshave polarorbits.Thealtitudeis between500and
2000km,witharotationperiod of90to120min. Thesatellitehasaspeed of20,000to
25,000km/h.An
LEOsystemusuallyhasacellulartype ofaccess,similartothecellu­
lartelephonesystem.
Thefootprintnormallyhasadiameter of8000km.Because LEO
satellitesareclosetoEarth,theround-triptimepropagationdelayisnormallylessthan
20ms,whichisacceptableforaudiocommunication.
AnLEOsystemismade ofaconstellationofsatellitesthatworktogetherasanetwork;
eachsatelliteactsasaswitch.Satellitesthatareclosetoeachotherareconnectedthrough
intersatellitelinks(ISLs).Amobilesystemcommunicateswiththesatellitethroughauser
mobilelink(UML).AsatellitecanalsocommunicatewithanEarthstation(gateway)
throughagatewaylink(GWL).Figure16.19showsatypicalLEOsatellitenetwork.
Figure16.19 LEOsatellitesystem
ISL
~ ... I)~
;7!--~~~- -~i--~
~:~,- ~:~--~) -i)
--___ Footprint-~__.:::-::.--Footprint ----
--------------------
LEOsatellitescanbedividedintothreecategories:littleLEOs,bigLEOs,andbroad­
bandLEOs.
ThelittleLEOsoperateunder1GHz.Theyaremostly usedforlow-data-rate
messaging.ThebigLEOsoperatebetween1and3GHz.GlobalstarandIridiumsystems
areexamples
ofbigLEOs. ThebroadbandLEOsprovidecommunicationsimilartofiber­
opticnetworks.ThefirstbroadbandLEOsystemwasTeledesic.

SECTION16.2SATELLITENETWORKS 485
IridiumSystem
TheconceptoftheIridiumsystem,a77-satellitenetwork,wasstartedbyMotorola in
1990.Theprojecttookeightyearstomaterialize.Duringthisperiod,thenumber ofsatel­
liteswasreduced.Finally,
in1998,theservicewasstartedwith66satellites.Theoriginal
name,Iridium,camefromthename
ofthe77thchemicalelement;a mOreappropriate
nameisDysprosium(thename
ofelement66).
Iridiumhasgonethroughroughtimes.Thesystemwashaltedin1999duetofinan­
cialproblems;itwassoldandrestartedin2001undernewownership.
Thesystemhas66satellitesdividedintosixorbits, with
11satellitesineachorbit.
Theorbitsareatanaltitude
of750km.Thesatellitesineachorbitareseparatedfrom
oneanotherbyapproximately32°
oflatitude.Figure16.20showsaschematicdiagram
oftheconstellation.
Figure16.20Iridiumconstellation
TheIridiumsystemhas66satellitesinsix LEOorbits,each atanaltitudeof750kIn.
Sinceeachsatellitehas48spotbeams,thesystemcanhaveupto3168beams.How­
ever,some
ofthebeamsareturnedoff asthesatelliteapproachesthepole.Thenumber of
activespotbeamsatanymomentisapproximately2000.Eachspotbeamcoversacellon
Earth,whichmeansthatEarthisdividedintoapproximately2000(overlapping)cells.
IntheIridiumsystem,communicationbetweentwouserstakesplacethroughsatel­
lites.Whenausercallsanotheruser,thecallcangothroughseveralsatellitesbefore
reachingthedestination.Thismeansthatrelayingisdoneinspaceandeachsatellite
needstobesophisticatedenoughtodorelaying.Thisstrategyeliminatestheneedfor
manyterrestrialstations.
Thewholepurpose
ofIridiumistoprovidedirectworldwidecommunicationusing
handheldterminals(sameconcept
ascellulartelephony).Thesystemcanbeusedfor
voice,data,paging,fax,andevennavigation.Thesystemcanprovideconnectivity
betweenusersatlocationswhereothertypes
ofcommunicationarenotpossible.Thesys­
temprovides2.4-to4.8-kbpsvoiceanddatatransmissionbetweenportabletelephones.
Transmissionoccursinthe1.616-
to1.6126-GHzfrequencyband.Intersatellitecommu­
nicationoccursinthe23.18-to23.38-GHzfrequencyband.

486 CHAPTER 16WIRELESSWANs:CELLULARTELEPHONE ANDSATELLITENETWORKS
Iridiumisdesignedtoprovidedirectworldwidevoice anddatacommunication using
handheldterminals,aservicesimilartocellulartelephony
butonaglobalscale.
Globalstar
GlobalstarisanotherLEOsatellitesystem.Thesystemuses48satellitesinsixpolar
orbitswitheachorbithostingeightsatellites.Theorbitsarelocatedatanaltitude
of
almost1400lan.
TheGlobalstarsystemissimilartotheIridiumsystem;themaindifferenceistherelay­
ingmechanism.CommunicationbetweentwodistantusersintheIridiumsystemrequires
relayingbetweenseveralsatellites;Globalstarcommunicationrequiresbothsatellitesand
Earthstations,whichmeansthatgroundstationscancreatemorepowerfulsignals.
Teledesic
Teledesicisasystem ofsatellitesthatprovidesfiber-optic-like(broadbandchannels,
lowerrorrate,andlowdelay)communication.Itsmainpurposeistoprovidebroadband
Internetaccessforusers
allovertheworld.Itissometimescalled"Internetinthesky."
Theprojectwasstartedin1990byCraigMcCawandBillGates;later,otherinvestors
joinedtheconsortium.Theprojectisscheduledtobefullyfunctionalinthenearfuture.
ConstellationTeledesicprovides288satellitesin12polarorbits
witheachorbit
hosting24satellites.Theorbitsareatanaltitude
of1350lan,asshowninFigure16.21.
Figure16.21Teledesic
Teledesichas288satellitesin12 LEOorbits,each atanaltitudeof1350kIn.
CommunicationThesystemprovidesthreetypesofcommunication.Intersatellitecom­
municationallowseightneighboringsatellitestocommunicatewithoneanother.Com­
municationisalsopossiblebetweena'satelliteandanEarthgatewaystation.Userscan
communicatedirectlywiththenetworkusingterminals.Earthisdividedintotens
ofthou­
sandsofcells.Eachcellisassignedatimeslot,andthesatellitefocusesitsbeamtothecell

SECTION16.5SUMMARY 487
atthecorrespondingtimeslot.Thetenninalcansenddataduringitstimeslot.Atenninal
receivesallpacketsintendedforthecell,butselectsonlythoseintendedforitsaddress.
BandsTransmissionoccursintheKabands.
DataRate Thedatarateisup to155Mbpsfortheuplinkandupto1.2Gbpsforthe
downlink.
16.3RECOMMENDED READING
Formoredetailsaboutsubjectsdiscussedinthischapter,werecommendthefollowing
books.Theitemsinbrackets[
...]refertothereferencelistattheend ofthetext.
Books
WirelessWANsarecompletelycoveredin[Sta02],[Jam03],[AZ03],and[Sch03].Com­
municationsatellitesarediscussedinSection2.4
of[Tan03]andSection8.5 of[CouOl].
Mobiletelephonesystem
isdiscussedinSection2.6 of[Tan03]andSection8.8 of[CouOl].
16.4KEYTERMS
AdvancedMobilePhoneSystem(AMPS)
cellulartelephony
digitalAMPS(D-AMPS)
downlink
footprint
geostationaryEarthorbit(GEO)
GlobalPositioningSystem(GPS)
GlobalSystemforMobile
Communication(GSM)
Globalstar
handoff
InterimStandard95(IS-95)
InternetMobileCommunication2000
(IMT-2000)
Iridium
low-Earth-orbit(LEO)
medium-Earth-orbit(MEO)
mobileswitchingcenter(MSC)
orbit
personalcommunicationssystem
(PCS)
reusefactor
roamIng
satellitenetwork
Teledesic
triangulation
trilateration
uplink
16.5SUMMARY
oCellulartelephonyprovidescommunicationbetweentwodevices.Oneorbothmay
bemobile.
oAcellularserviceareaisdividedintocells.
oAdvancedMobilePhoneSystem(AMPS)isafirst-generationcellularphone
system.

WIRELESSWANs:CELLULARTELEPHONE ANDSATELLITENETWORKS
DigitalAMPS CD-AMPS)isasecond-generationcellularphonesystemthatisa
digitalversion
ofAMPS.
GlobalSystemforMobileCommunication
CGSM)isasecond-generationcellular
phonesystemusedinEurope.
InterimStandard95
CIS-95)isasecond-generationcellularphonesystembasedon
CDMAandDSSS.
Thethird-generationcellularphonesystemwillprovideuniversalpersonal
communication.
Asatellitenetworkusessatellitestoprovidecommunicationbetweenanypoints
onEarth.
AgeostationaryEarthorbit
CGEO)isattheequatorialplaneandrevolvesinphase
withEarth.
GlobalPositioningSystem
CGPS)satellitesaremedium-Earth-orbit(MEO)satellites
thatprovidetimeandlocationinformationforvehiclesandships.
Iridiumsatellitesarelow-Earth-orbit(LEO)satellitesthatprovidedirectuniversal
voiceanddatacommunicationsforhandheldterminals.
Teledesicsatellitesarelow-Earth-orbitsatellitesthatwillprovideuniversal
broadbandInternetaccess.
488 CHAPTER16
0
0
0
0
0
0
0
0
0
16.6PRACTICESET
ReviewQuestions
1.Whatistherelationshipbetweenabasestationandamobileswitchingcenter?
2.Whatarethefunctions ofamobileswitchingcenter?
3.Whichisbetter,alowreusefactor orahighreusefactor?Explainyouranswer.
4.Whatisthedifferencebetweenahardhandoffandasofthandoff?
5.WhatisAMPS?
6.WhatistherelationshipbetweenD-AMPSandAMPS?
7.WhatisGSM?
8.WhatisthefunctionoftheCDMAinIS-95?
9.Whatarethethreetypes oforbits?
10.Whichtype oforbitdoesaGEOsatellitehave?Explainyouranswer.
1
1.Whatisafootprint?
12.Whatistherelationshipbetweenthe VanAllenbeltsandsatellites?
13.Compareanuplinkwithadownlink.
14.WhatisthepurposeofGPS?
15.WhatisthemaindifferencebetweenIridiumandGlobalstar?
Exercises
16.Drawacellpatternwithafrequency-reusefactor of3.
17.Whatisthemaximumnumber ofcallersineachcellinAMPS?

SECTION16.6PRACTICESET 489
18.Whatisthemaximumnumberofsimultaneouscalls ineachcellinan15-136
(D-AMPS)system,assumingnoanalogcontrolchannels?
19.Whatisthemaximumnumber ofsimultaneouscallsineachcellina GSMassuming
noanalogcontrolchannels?
20.Whatisthe
maximumnumberofcanersineachcellinanIS-95system?
21.Findtheefficiency
ofAMPSintermsofsimultaneouscalls permegahertzofband­
width.Inotherwords,findthenumber
ofcallsthatcanbeusedin I-MHzbandwidth
allocation.
22.RepeatExercise
21forD-AMPS.
23.RepeatExercise21forGSM.
24.RepeatExercise21forIS-95.
25.Guesstherelationshipbetweena3-kHzvoicechannelanda30-kHzmodulated
channelinasystemusingAMPS.
26.Howmanyslotsaresenteachsecond
inachannelusingD-AMPS?Howmanyslots
aresentbyeachuserin
1s?
27.
UseKepler'sformulatochecktheaccuracy ofagivenperiodandaltitudefora
GPSsatellite.
28.UseKepler'sformulatocheck theaccuracy
ofagivenperiodandaltitudeforan
Iridiumsatellite.
29.UseKepler'sformulatocheck theaccuracy
ofagivenperiodandaltitudefora
Globalstarsatellite.

CHAPTER17
SONETISDH
Inthischapter,weintroduceawideareanetwork(WAN),SONET,thatisused asa
transportnetworktocarryloadsfromotherWANs.
WefirstdiscussSONET asaprotocol,
andwethenshowhowSONETnetworkscanbeconstructedfromthestandardsdefined
intheprotocol.
Thehighbandwidths
offiber-opticcablearesuitable fortoday'shigh-data-rate
technologies(such
asvideoconferencing)andforcarryinglargenumbers oflower-rate
technologiesatthesametime.Forthisreason,theimportance
offiberopticsgrowsin
conjunctionwiththedevelopment
oftechnologiesrequiringhighdataratesorwide
bandwidthsfortransmission.Withtheirprominencecameaneedforstandardization.
TheUnitedStates(ANSI)andEurope(ITU-T)haverespondedbydefiningstandards
that,thoughindependent,arefundamentallysimilarandultimatelycompatible.The
ANSIstandardiscalledthe
SynchronousOpticalNetwork(SONET).TheITU-T
standardiscalledthe
SynchronousDigitalHierarchy(SOH).
SONETwasdevelopedbyANSI;SDHwasdevelopedbylTV·T.
SONET/SDHisasynchronousnetworkusingsynchronousTDMmultiplexing.
Allclocks
inthesystemarelockedtoamasterclock.
17.1ARCHITECTURE
LetusfirstintroducethearchitectureofaSONETsystem:signals,devices, and
connections.
Signals
SONETdefinesahierarchy ofelectricalsignalinglevelscalled synchronoustransport
signals(STSs).EachSTSlevel(STS-ltoSTS-192)supportsacertaindatarate,speci­
fied
inmegabitspersecond(seeTable17.1).Thecorrespondingopticalsignalsare
calledoptical
carriers(OCs).SDHspecifiesasimilarsystemcalleda synchronous
transportmodule(STM).STMisintendedtobecompatiblewithexistingEuropean
491

492 CHAPTER 17SONETISDH
hierarchies,suchasElines,andwithSTSlevels. Tothisend,thelowestSTMlevel,
STM-l,isdefinedas155.520Mbps,whichisexactlyequaltoSTS-3.
Table17.1
SONETISDHrates
STS OC Rate(Mbps) STM
STS-l OC-l 51.840
STS-3 OC-3 155.520
STM-l
STS-9 OC-9 466.560 STM-3
STS-12 OC-12 622.080 STM-4
STS-18 OC-lS 933.120 STM-6
STS-24 OC-24 1244.160 STM-8
STS-36 OC-36 1866.230 STM-12
STS-48 OC-48 2488.320 STM-16
STS-96 OC-96 4976.640 STM-32
STS-I92 OC-I92 9953.280 STM-64
AglancethroughTable17.1revealssomeinterestingpoints.First,thelowestlevel
inthishierarchyhasadatarate
of51.840Mbps,whichisgreaterthanthat oftheDS-3
service(44.736Mbps).Infact,the
STS-lisdesignedtoaccommodatedataratesequiv­
alenttothose
oftheDS-3.Thedifferenceincapacityisprovidedtohandletheoverhead
needs
oftheopticalsystem.
Second,theSTS-3rateisexactlythreetimesthe
STS-lrate;andtheSTS-9rate is
exactlyone-halftheSTS-18rate.Theserelationshipsmeanthat 18STS-lchannelscan
bemultiplexedintooneSTS-18,sixSTS-3channelscanbemultiplexedintooneSTS-18,
andsoon.
SONETDevices
Figure17.1showsasimplelinkusingSONETdevices.SONETtransmissionrelieson
threebasicdevices:STSmultiplexers/demultiplexers,regenerators,add/dropmulti­
plexersandterminals.
STSMultiplexer/Demultiplexer
STSmultiplexers/demultiplexersmarkthebeginningpointsandendpoints ofaSONET
link.Theyprovidetheinterfacebetweenanelectricaltributarynetworkandtheoptical
network.An
STSmultiplexermultiplexessignalsfrommultipleelectricalsourcesand
createsthecorrespondingOCsignal.An
STSdemultiplexer demultiplexesanoptical
OCsignalintocorrespondingelectricsignals.
Regenerator
Regeneratorsextendthelength ofthelinks.A regeneratorisarepeater(seeChapter 15)
thattakesareceivedopticalsignal (OC-n),demodulatesitintothecorrespondingelec­
tricsignal
(STS-n),regeneratestheelectricsignal,andfinallymodulatestheelectric

SECTION17.1ARCHITECTURE 493
Figure17.1Asimplenetworkusing SONETequipment
ADM:Add/dropmultiplexer R:Regenerator
STSMUX:Synchronoustransportsignalmultiplexer T:Terminal
STSDEMUX:Synchronoustransportsignaldemultiplexer
tDrop
_~__J J
Section Section
t J
Line
______ _ J
Section Section Section
l ~
Line
R R R
1---~![>----cJ.~[>-~.~1 ADM 1------l~[>----i.~1
Path
signalintoitscorrespondent OC-nsignal.ASONETregeneratorreplacessome ofthe
existingoverheadinformation(headerinformation)withnewinformation.
Add/dropMultiplexer
Add/dropmultiplexersallowinsertionandextraction
ofsignals.An add/dropmulti­
plexer(ADM)
canaddSTSscomingfromdifferentsourcesintoagivenpath orcan
removeadesiredsignalfromapathandredirect
itwithoutdemultiplexingtheentire
signal.Instead
ofrelyingontimingandbitpositions,add/dropmultiplexersuseheader
informationsuchasaddressesandpointers(describedlaterinthissection)toidentify
individualstreams.
InthesimpleconfigurationshownbyFigure17.1,anumber
ofincomingelectronic
signalsarefedintoanSTSmultiplexer,wheretheyarecombinedintoasingleoptical
signal.Theopticalsignalistransmittedtoaregenerator,whereitisrecreatedwithout
thenoiseithaspickedupintransit.Theregeneratedsignalsfromanumber
ofsources
arethenfedintoanadd/dropmultiplexer.Theadd/dropmultiplexerreorganizesthese
signals,
ifnecessary,andsendsthemout asdirectedbyinformationinthedataframes.
Theseremultiplexedsignalsaresenttoanotherregeneratorandfromtheretothe
receivingSTSdemultiplexer,wheretheyarereturnedtoaformatusablebythereceiving
links.
Terminals
Aterminalisadevicethatusestheservices ofaSONETnetwork.Forexample,inthe
Internet,aterminalcanbearouterthatneedstosendpacketstoanotherrouteratthe
otherside
ofaSONETnetwork.
Connections
Thedevicesdefinedintheprevioussectionareconnectedusingsections,lines,and
paths.

494 CHAPTER 17SONETISDH
Sections
Asectionistheopticallinkconnectingtwoneighbordevices:multiplexertomulti­
plexer,multiplexertoregenerator,orregeneratortoregenerator.
Lines
Alineistheportion ofthenetworkbetweentwomultiplexers:STSmultiplexertoadd/
dropmultiplexer,twoadd/dropmultiplexers,ortwoSTSmultiplexers.
Paths
Apathistheend-to-endportion ofthenetworkbetweentwoSTSmultiplexers.Ina
simpleSONEToftwoSTSmultiplexerslinkeddirectlytoeachother,thesection,line,
andpatharethesame.
17.2SONETLAYERS
TheSONETstandardincludesfourfunctionallayers:thephotonic,thesection,the
line,andthepathlayer.Theycorrespondtoboththephysicalandthedatalinklayers
(seeFigure17.2).Theheadersaddedtotheframeatthevariouslayersarediscussed
laterinthischapter.
SONETdefinesfourlayers: path,line,section,andphotonic.
Figure17.2 SONETlayerscomparedwithOSI ortheInternetlayers
Pathlayer
Linelayer
Datalink
Physical
Sectionlayer
Photonic
layerI
PathLayer
Thepathlayerisresponsibleforthemovement ofasignalfromitsopticalsourcetoits
opticaldestination.Attheopticalsource,thesignalischangedfromanelectronicform
intoanopticalform,multiplexedwithothersignals,andencapsulatedinaframe.Atthe
opticaldestination,thereceivedframeisdemultiplexed,andtheindividualopticalsig­
nalsarechangedbackintotheirelectronicforms.Pathlayeroverheadisaddedatthis
layer.STSmultiplexersprovidepathlayerfunctions.

SECTION17.2 SONETLAYERS 495
LineLayer
Thelinelayerisresponsibleforthemovement ofasignalacrossaphysicalline.Line
layeroverheadisaddedtotheframeatthislayer.STSmultiplexersandadd/dropmulti­
plexersprovidelinelayerfunctions.
SectionLayer
Thesectionlayer isresponsibleforthemovement ofasignalacrossaphysicalsection.
Ithandlesframing,scrambling,anderrorcontrol.Sectionlayeroverheadisaddedto
theframeatthislayer.
PhotonicLayer
Thephotoniclayer correspondstothephysicallayer oftheOSImodel.Itincludes
physicalspecificationsfortheopticalfiberchannel,thesensitivity
ofthereceiver,mul­
tiplexingfunctions,andsoon.SONETusesNRZencodingwiththepresence
oflight
representing1 andtheabsence
oflight representingO.
Device-LayerRelationships
Figure17.3showstherelationshipbetweenthedevicesusedinSONETtransmission
andthefourlayers
ofthestandard.Asyoucansee,anSTSmultiplexerisafour-layer
device.Anadd/dropmultiplexerisathree-layerdevice.Aregeneratorisatwo-layer
device.
Figure17.3 Device-layerrelationshipin SONET
Electricsignal
Path
~-~----I
Line
Section
Photonic
Opticalsignal
Electricsignal
Path
~-:i--:----I
Line
Section
Photonic
OpticalsignalOpticalsignalOpticalsignal
Regenerator
Add/drop
multiplexer
Regenerator

496 CHAPTER 17SONETISDH
17.3SONETFRAMES
Eachsynchronoustransfersignal STS-niscomposedof8000frames.Eachframe isa
two-dimensionalmatrix
ofbyteswith9rowsby90x ncolumns.Forexample,STS-l
frameis9rowsby90columns(810bytes),andanSTS-3
is9rowsby270columns
(2430bytes).Figure17.4showsthegeneralformat
ofanSTS-landan STS-n.
Figure17.4 AnSTS-landanSTS-nframe
90bytes 90x 11bytes
I
...'__8_10_b)_'te_s__"II9b
Y
,,,1_' 8_IO_X_lIb_)'t_es 'I}~,
a.STS-lframe b.STS-nframe
Frame,Byte,andBitTransmission
OneoftheinterestingpointsaboutSONETisthateach STS-nsignalistransmitted
atafixedrate
of8000framespersecond.Thisistherateatwhichvoiceisdigitized
(seeChapter4).Foreachframethebytesaretransmittedfromthelefttothe right,
toptothebottom.Foreachbyte,thebitsaretransmittedfromthemostsignificant
tothe
leastsignificant(lefttoright). Figure17.5showsthe orderofframeand
bytetransmission.
Figure17.5 STS-lframesintransition
a.Bytetransmission
Left toright
and
toptobottom
First---------,.
byte
'-- Last
byte
8000
frames/second
b.
Frametransmission
ASONET STS-nsignalistransmitted at8000frames persecond.
Ifwesampleavoicesignalanduse8bits (lbyte)foreachsample,wecansaythat
eachbyteinaSONETframecancarryinformationfromadigitizedvoicechanne1.In
otherwords,anSTS-lsignalcancarry774voicechannelssimultaneously(810minus
requiredbytesforoverhead).
EachbyteinaSONETframe cancarryadigitizedvoicechannel.

SECTION17.3SONETFRAMES 497
Example17.1
Findthedatarate ofanSTS-lsignal.
Solution
STS-l,likeotherSTSsignals,sends 8000framespersecond.Each STS-lframeismade of9by
(lX90)bytes.Eachbyteismade of8bits.Thedatarateis
STS~1datarate::::8000X9X(1X90)x8:;51.840Mbps
Example17.2
Findthedatarate ofanSTS-3signal.
Solution
STS-3,likeotherSTSsignals,sends8000framespersecond.EachSTS-3frameismade of9by
(3
X90)bytes.Eachbyteismade of8bits.Thedatarateis
.. .
.STS-3data
rate::::8000x 9 x(3 X90)x8::::155.52Mbps
NotethatinSONET,thereisanexactrelationshipbetweenthedatarates ofdifferentSTSsignals.
Wecouldhavefoundthedatarate
ofSTS-3byusingthedatarate of
STS-l(multiplythelatterby3).
InSONET,the datarateofanSTS-nsignalis ntimesthe
datarateofanSTS-lsignals.
Example17.3
Whatistheduration ofanSTS-lframe?STS-3frame? STS-nframe?
Solution
InSONET,8000framesaresentpersecond.Thismeansthattheduration ofanSTS-l,STS-3,or
STS-nframeisthesameandequalto1/8000 S,or125j..ls.
InSONET,theduration ofanyframeis 125j..ls.
STS-lFrameFormat
Thebasicformat ofanSTS-lframeisshowninFigure17.6.Aswesaidbefore,a
SONETframeisamatrixof9rows
of90bytes(octets)each,foratotal of810bytes.
Thefirstthreecolumns
oftheframeareusedforsectionandline overhead.The
upperthreerows
ofthefirstthreecolumnsareusedfor sectionoverhead(SOH). The
lowersixare
lineoverhead(LOH). Therestoftheframeiscalledthesynchronous
payloadenvelope(SPE).
Itcontainsuserdataand pathoverhead(POH) neededatthe
userdatalevel.
Wewilldiscusstheformat oftheSPEshortly.
SectionOverhead
Thesectionoverheadconsists ofnineoctets.Thelabels,functions,andorganization of
theseoctetsareshowninFigure17.7.

498 CHAPTER 17SONETISDH
Figure17.6STS-1frameoverheads
90octetsperrow
Section[
overhead
Line[
overhead
STS-ISPE
Userdataand
pathoverhead
9rowsx87columns
9rows
Figure17.7STS-1frame:sectionoverhead
AI,AZ:Alignment
HI:Paritybyte
C1:Identification
Dl,I)Z,D3:Management
EI:Orderwirebyte
FI:User
Al~A2CI
BI
ElFI
/
STS-ISPE
D1D2D3
oAlignmentbytes (AIandA2).BytesAlandA2areusedforframingandsyn­
chronizationandarecalledalignmentbytes.Thesebytesalertareceiverthata
frameisarrivingandgivethereceiverapredeterminedbitpatternonwhichtosyn­
chronize.ThebitpatternsforthesetwobytesinhexadecimalareOxF628.Thebytes
serveasaflag.
oSectionparitybyte(BI). ByteB1isforbitinterleavedparity(BIP-8).Itsvalue is
calculatedoverallbytes ofthepreviousframe.Inotherwords,theithbit ofthis
byteistheparitybitcalculatedoverallithbits
ofthepreviousSTS-nframe.The
value
ofthisbyteisfilledonlyforthefirst STS-linanSTS-nframe.Inother
words,althoughan
STS-nframehas nB1bytes,aswewillseelater,onlythefirst
bytehasthisvalue;therestarefilledwith
Os.
oIdentificationbyte (el).ByteClcarriestheidentityoftheSTS-lframe.Thisbyte is
necessarywhenmultipleSTS-lsaremultiplexedtocreateahigher-rateSTS(STS-3,
STS-9,STS-12,etc.).Informationinthisbyteallowsthevarioussignals
toberecog­
nizedeasilyupondemultiplexing.Forexample,inanSTS-3signal,thevalue
of
theC1byte is1forthefirstSTS-l;it is2forthesecond;andit is3forthethird.
oManagementbytes(DI,D2, andD3).Bytes
Dl,D2,andD3togetherforma
192-kbpschannel
(3x8000x 8)calledthedatacommunicationchannel.Thischan­
nelisrequiredforoperation,administration,andmaintenance(OA&M)signaling.
oOrderwirebyte (EI).ByteElistheorderwirebyte.Orderwirebytesinconsec­
utiveframesformachannel
of64kbps(8000framespersecondtimes8bitsper

SECTION17.3SONETFRAMES 499
frame).Thischannelisusedforcommunicationbetweenregenerators,orbetween
terminalsandregenerators.
oUser'sbyte (Fl).TheFIbytesinconsecutiveframesforma64-kbpschannelthat
isreservedforuserneedsatthesectionlevel.
Sectionoverheadisrecalculatedfor eachSONETdevice
(regeneratorsandmultiplexers).
LineOverhead
Lineoverheadconsists of18bytes.Thelabels,functions,andarrangement ofthese
bytesareshowninFigure17.8.
Figure17.8STS-lframe:lineoverhead
B2:Lineparitybyte
D4-DI2:Managementbytes
E2:Orderwirebyte HI,H2,H3:Pointers
Kl,K2:Automaticprotectionswitchingbytes
Zl,Z2:Growthbytes(reserved)
~
HIHZH3
B2KIK2
STS-ISPE
D4D5D6
D9D708
V
DIODllDI2
ZlZ2E2
oLineparitybyte(B2).ByteB2isforbitinterleavedparity. Itisforerrorcheck­
ing
oftheframeoveraline(betweentwomultiplexers).Inan STS-nframe,B2is
calculatedforallbytesinthepreviousSTS-IframeandinsertedattheB2byte
forthatframe.In
otherwords,inaSTS-3frame,therearethreeB2bytes,
eachcalculatedforoneSTS-Iframe.ContrastthisbytewithBIinthesection
overhead.
oDatacommunicationchannelbytes(D4toD12).ThelineoverheadDbytes(D4
toD12)inconsecutiveframesforma576-kbpschannelthatprovidesthesame
serviceasthe
DI-D3bytes(OA&M),butatthelineratherthanthesectionlevel
(betweenmultiplexers).
oOrderwirebyte(E2).TheE2bytesinconsecutiveframesforma64-kbpschan­
nelthatprovidesthesamefunctionsasthe
EIorderwirebyte,butatthelinelevel.
oPointerbytes (HI,82,and83).BytesHI,H2,andH3arepointers.Thefirsttwo
bytesareused
toshowtheoffsetoftheSPE intheframe;thethirdisusedforjustifi­
cation.
Weshowtheuse ofthesebyteslater.
oAutomaticprotectionswitchingbytes (KlandK2).TheKIand K2bytesincon­
secutiveframesformaI28-kbpschannelusedforautomaticdetectionofproblemsin

500 CHAPTER 17SONETISDH
line-terminatingequipment. Wediscussautomaticprotectionswitching(APS)later
inthechapter.
DGrowthbytes (ZlandZ2).TheZlandZ2bytesarereservedforfutureuse.
SynchronousPayloadEnvelope
Thesynchronouspayloadenvelope(SPE) containstheuserdataandthe overhead
related
totheuserdata(pathoverhead).OneSPEdoesnotnecessarily fititintooneSTS-l
frame;itmaybesplitbetweentwoframes,
aswewillseeshortly.Thismeansthatthe
pathoverhead,theleftmostcolumn
ofanSPE,doesnotnecessarilyalignwiththe
sectionorlineoverhead.Thepathoverheadmustbeaddedfirsttotheuserdatato
createanSPE,andthenanSPEcanbeinsertedintooneortwoframes.Pathoverhead
consistsof9bytes.Thelabels,functions,andarrangementofthesebytesareshown
inFigure17.9.
Figure17.9 STS-lframe:pathoverhead
11
B3
C2
Gl
F2
H4
B3:Pathparitybyte
C2:Pathsignallabelbyte
Gl:Pathstatusbyte
F2:Pathuserchannelbyte
Data
H4:Virtualtributaryindicator
J
1:Pathtracebyte
Z3,Z4,Z5:Growthbytes(reserved)
23
Z4
STS-ISPE
25 Path
overhead
DPathparitybyte(B3). ByteB3isforbitinterleavedparity,likebytes BlandB2,
butcalculatedoverSPEbits.
ItisactuallycalculatedoverthepreviousSPEinthe
stream.
DPathsignallabelbyte(C2). ByteC2isthepathidentificationbyte. Itisusedto
identifydifferentprotocolsusedathigherlevels(such asIPorATM)whosedata
arebeingcarriedintheSPE.
DPathuserchannelbyte(F2). TheF2bytesinconsecutiveframes,likethe FIbytes,
forma64-kbpschannelthatisreservedforuserneeds,butatthepathlevel.
DPathstatusbyte (Gl).ByteGIissentbythereceiver tocommunicateitsstatus
tothe sender.
Itissentonthereversechannelwhenthecommunicationisduplex.
Wewillseeitsuseinthelinearorringnetworkslaterinthechapter.
DMultiframeindicator (H4).ByteH4 isthemultiframeindicator. Itindicatespay­
loadsthatcannot
fitintoasingleframe.Forexample,virtualtributariescanbe

SECTION17.3SONETFRAMES 501
combinedtoformaframethatislargerthananSPEframeandneed tobedivided
intodifferentframes.Virtualtributariesarediscussedinthenextsection.
oPathtracebyte(JI).The11bytesinconsecutiveframesforma64-kbpschannel
usedfortrackingthepath.The
11bytesendsacontinuous64-bytestring toverify
theconnection.Thechoice
ofthestringisleft totheapplicationprogram.The
receivercompareseachpatternwiththepreviousone
toensurenothingiswrong
withthecommunicationatthepathlayer.
oGrowthbytes(Z3,Z4, andZ5).BytesZ3,Z4,andZ5arereservedforfutureuse.
Pathoverheadisonlycalculatedforend-to-end
(atSTSmultiplexers).
OverheadSummary
Table17.2comparesandsummarizestheoverheadsusedinasection,line,andpath.
Table17.2
SONETISDHrates
ByteFunction Section Line Path
Alignment Al,A2
Parity Bl B2 B3
Identifier
CI C2
OA&M
DI-D3 D4-DI2
Orderwire EI
User FI F2
Status
Gl
Pointers HI-H3 H4
Trace
11
Failuretolerance KI,K2
Growth(reservedforfuture) ZI,Z2 Z3-Z5
Example17.4
Whatistheuserdatarate ofanSTS-lframe(withoutconsideringtheoverheads)?
Solution
Theuserdata partinanSTS-Iframeismade of9rowsand 86columns.Sowehave
STS-l
userdatatate=8000x9><:,(1X86)x8c=49.536MbJls
Encapsulation
ThepreviousdiscussionrevealsthatanSPEneedstobeencapsulatedinanSTS-I
frame.EncapsulationmaycreatetwoproblemsthatarehandledelegantlybySONET
usingpointers(HI
toH3).Wediscusstheuse ofthesebytesinthissection.

502 CHAPTER 17SONETISDH
Offsetting
SONETallowsoneSPEtospantwoframes,part oftheSPE isinthefirstframeandpart
isinthesecond.ThismayhappenwhenoneSPEthat
istobeencapsulatedisnotaligned
time-wisewiththepassingsynchronizedframes.Figure17.10showsthissituation.SPE
bytesaredividedbetweenthetwoframes.Thefirstset
ofbytesisencapsulatedinthe
firstframe;thesecondsetisencapsulatedinthesecondframe.Thefigurealsoshowsthe
pathoverhead,which
isalignedwiththesection/lineoverhead ofanyframe.The
ques­
tionis,HowdoestheSONETmultiplexerknowwheretheSPEstarts orendsinthe
frame?Thesolutionistheuse
ofpointersHIandH2todefinethebeginning oftheSPE;
theendcanbefoundbecauseeachSPEhasafixednumber
ofbytes.SONETallows the
offsetting
ofanSPEwithrespecttoan STS-lframe.
Figure17.10 OffsettingofSPErelatedtoframeboundary
SPE
Data
I I
I
t
r--
r--
r--
r--
~
H
Frame1+1
Frameflow
Frame
1
Tofindthebeginning ofeachSPE inaframe,weneedtwopointers HIandH2in
thelineoverhead.Notethatthesepointersarelocatedinthelineoverheadbecausethe
encapsulationoccursatamultiplexer.Figure17.11showshowthese2bytespointto
Figure17.11 TheuseofHiandH2pointerstoshowthestart ofanSPEinaframe
Framei+l
Frameflow

SECTION17.4STSMULTIPLEXING 503
thebeginningoftheSPEs.Notethatweneed2bytestodefinetheposition ofabytein
aframe;aframehas810bytes,whichcannotbedefinedusing1byte.
Example17.5
Whatarethevalues ofHIandH2ifanSPEstartsatbytenumber650?
Solution
Thenumber650canbeexpressedinfourhexadecimaldigitsasOx028A.Thismeansthevalue of
HIisOx02andthevalue ofH2isOx8A.
Justification
Nowsupposethetransmissionrate
ofthepayloadis justslightlydifferentfromthe
transmissionrate
ofSONET.First,assumethattherate ofthepayloadishigher.This
meansthatoccasionallythereis1extrabytethatcannotfit
intheframe.Inthiscase,
SONETallowsthisextrabytetobeinserted
intheH3byte.Now,assumethattherate of
thepayloadislower.Thismeansthatoccasionally1byteneedstobeleftempty inthe
frame.SONETallowsthisbytetobethebyteaftertheH3byte.
17.4STS MULTIPLEXING
InSONET,frames oflowerratecanbesynchronouslytime-divisionmultiplexedintoa
higher-rateframe.Forexample,three
STS-lsignals(channels)canbecombinedinto
oneSTS-3signal(channel),four STS-3scanbemultiplexedintooneSTS-12,andsoon,
asshowninFigure17.12.
Figure17.12STSmultiplexing/demultiplexing
----+s;rs.:Jc+----1STS
MUX
STS-3 STSt----t&TS.l1--­
DEMUX
MultiplexingissynchronousTDM,andallclocksinthenetworkarelockedtoa
masterclocktoachievesynchronization.
InSONET,allclocksinthenetwork arelockedtoamasterclock.
Weneedtomentionthatmultiplexingcanalsotakeplaceatthehigherdatarates.
Forexample,fourSTS-3signalscanbemultiplexedintoanSTS-12signal.However,
theSTS-3signalsneedtofirstbedemultiplexedinto12
STS-lsignals,andthenthese

504 CHAPTER 17SONETISDH
twelvesignalsneedtobemultiplexedintoan STS-I2signal.Thereasonforthisextra
workwill
beclearafterourdiscussiononbyteinterleaving.
ByteInterleaving
SynchronousTDMmultiplexinginSONETisachievedbyusingbyteinterleaving.
Forexample,whenthreeSTS-IsignalsaremultliplexedintooneSTS-3signal,each
set
of3bytesintheSTS-3signalisassociatedwith1bytefromeachSTS-Isignal.Fig­
ure17.13showstheinterleaving.
Figure17.13Byteinterleaving
STS-l
90bytes
3j
270bytes
NotethatabyteinanSTS-Iframekeepsitsrowposition,butitismovedintoa
differentcolumn.Thereasonisthatwhileallsignalframeshavethesamenumber
of
rows(9),thenumber ofcolumnschanges.Thenumber ofcolumnsinan STS-nsignal
frameisntimesthenumber
ofcolumnsinan STS-Iframe.One STS-nrow,therefore,
canaccommodateall
nrowsintheSTS-Iframes.
Byteinterleaving alsopreservesthecorrespondingsectionandlineoverheadas
showninFigure17.14.Asthefigureshows,thesection overheadsfromthree
STS-l
framesareinterleavedtogethertocreateasectionoverheadforan STS-lframe.The
same
istrueforthelineoverheads.Eachchannel,however,keepsthecorrespondingbytes
thatareusedtocontrolthatchannel.Inotherwords,thesectionsandlineskeeptheirown
controlbytesforeachmultiplexedchannel.Thisinterestingfeaturewillallowtheuse
of
add/dropmultiplexers,asdiscussedshortly.Asthefigureshows,therearethree Albytes,
onebelongingtoeach
ofthethreemultiplexedsignals.TherearealsothreeA2bytes,
threeB1bytes,andsoon.
Demultiplexinghereiseasierthaninthestatistical
TDMwediscussedinChapter6
becausethedemultiplexer,withnoregardtothefunction
ofthebytes,removesthefirstA1
andassignsittothefirst
STS-I,removesthesecond AI,andassignsittosecond STS-l,
andremovesthethird Alandassignsittothethird STS-I.Inotherwords,thedemulti­
plexerdealsonlywiththeposition
ofthebyte,notitsfunction.
Whatwesaidaboutthesectionandlineoverheadsdoesnotexactlyapplytothepath
overhead.Thisisbecausethepathoverheadispart
oftheSPEthatmayhavesplittedinto
twoSTS-Iframes.Thebyteinterleaving,however,isthesameforthedatasectionofSPEs.

SECTION17.4STSMULTIPLEXING 505
Figure17.14AnSTS-3frame
9bytes
,"
ClCI
Fl,FI
D3'D3
H3H3
J9K2
D~,D9
, --t',~
261bytes
Sr8-3SPE
Int(lde~ving
bytesofthreeSPEs
·1
Thebyteinterleavingprocessmakesthemultiplexingathigherdataratesalittle
bitmorecomplex.HowcanwemultiplexfourSTS-3signalsintooneSTS-12signal?
Thiscanbedoneintwosteps:First,theSTS-3signalsmustbedemultiplexedtocreate
12STS-lsignals.The12STS-lsignalsarethenmultiplexedtocreateanSTS-12signal.
ConcatenatedSignal
Innormaloperation oftheSONET,an STS-nsignalismade ofnmultiplexedSTS-l
signals.Sometimes,wehaveasignalwithadataratehigherthanwhat anSTS-lcancarry.
Inthiscase,SONETallowsustocreatean
STS-nsignalwhichisnotconsideredas n
STS-lsignals;itisone
STS-nsignal (channel)thatcannotbedemultiplexedinto n
STS-lsignals. Tospecifythatthesignalcannotbedemultiplexed,thesuffixc(forconcate­
nated)isaddedtothename
ofthesignal.Forexample,STS-3c isasignalthatcannot
bedemultiplexedintothreeSTS-lsignals.However,weneedtoknowthatthewhole
payloadinanSTS-3csignalisoneSPE,whichmeansthatwehaveonlyonecolumn
(9bytes)ofpathoverhead.Theuseddatainthiscaseoccupy260columns,asshownin
Figure17.15.
ConcatenatedSignalsCarrying ATMCells
WewilldiscussATMandATMcellsinChapter 18.AnATMnetworkisacellnetwork
inwhicheachcellhasafixedsize
of53bytes.TheSPE ofanSTS-3csignalcanbea
carrier
ofATMcells.TheSPE ofanSTS-3ccancarry9 x260 =2340bytes,whichcan
accommodateapproximately
44ATMcells,each of53bytes.

506 CHAPTER17SONETISDH
Figure17.15AconcatenatedSTS-3csignal
I_10octets_I_
Pathoverhead
260
octets
STS-3cSPE
AnSTS-3csignal cancarry44ATMcellsasitsSPE.
AddlDropMultiplexer
MultiplexingofseveralSTS-1signalsintoan STS-nsignalisdoneattheSTSmulti­
plexer(atthepathlayer).Demultiplexing
ofanSTS-nsignalintoSTS-1components
isdoneattheSTSdemultiplexer.Inbetween,however,SONETusesadd/dropmulti­
plexersthatcanreplaceasignalwithanotherone.
Weneedtoknowthatthisisnot
demultiplexing/multiplexing
intheconventionalsense.Anadd/dropmultiplexer
operatesatthelinelayer.Anadd/dropmultiplexerdoesnotcreatesection,line,or
pathoverhead.Italmostactsasa
switch~itremovesoneSTS-1signalandadds
anotherone.Thetype
ofsignalattheinputandoutput ofanadd/dropmultiplexeris
thesame(bothSTS-3orbothSTS-12,forexample).Theadd/dropmultiplexer
(ADM)onlyremovesthecorrespondingbytesandreplacesthemwiththenewbytes
(includingthebytes
inthesectionandlineoverhead).Figure17.16showstheopera­
tion
ofanADM.
Figure17.16Droppingandadding STS-lframes
inanadd/dropmultiplexer
_L--_S_T_S-_3_S_PE_-----.J~ ADM
_
STS-3SPE
------'
ThirdSTS-l
isdropped
NewSTS-l
isadded

SECTION17.5SONETNETWORKS 507
17.5SONETNETWORKS
UsingSONETequipment,wecancreateaSONETnetworkthatcanbeused asahigh-speed
backbonecarryingloadsfromothernetworkssuchasATM(Chapter18)orIF(Chapter20).
WecanroughlydivideSONETnetworksintothreecategories:linear,ring,andmeshnet­
works,
asshowninFigure17.17.
Figure17.17TaxonomyofsoNETnetworks
BLSR!\Inltlpomt
SONET
networks
I
I I I
Linear Ring Mesh
networks networks networks
-Point-to-point
-
lJl>SR
-, -
LinearNetworks
AlinearSONETnetworkcanbepoint-to-point ormultipoint.
Point-to-PointNetwork
Apoint-to-pointnetworkisnormallymade ofanSTSmultiplexer,anSTSdemultiplexer,
andzeroormoreregeneratorswithnoadd/dropmultiplexers,asshowninFigure17.18.
Thesignalflowcan
beunidirectionalorbidirectional,althoughFigure17.18shows
onlyunidirectionalforsimplicity.
Figure17.18Apoint-to-pointSONETnetwork
,'.
MultipointNetwork
AmultipointnetworkusesADMstoallowthecommunicationsbetweenseveraltermi­
nals.AnADMremovesthesignalbelongingtotheterminalconnected
toitandadds
thesignaltransmittedfromanotherterminal.Eachterminalcansenddata
tooneormore
downstreamterminals.Figure17.19showsaunidirectionalschemeinwhicheachter­
minalcansenddataonlytothedownstreamterminals,buttheamultipointnetworkcan
bebidirectional,too.

50S CHAPTER17SONETISDH
Figure17.19 AmultipointSONETnetwork
STS
MUX
STS
DEMUX
InFigure17.19, TlcansenddatatoT2andT3simultaneously.T2,however,can
senddata onlytoT3.
Thefigureshowsaverysimpleconfiguration;innormalsitua­
tions,wehave
moreADMsandmoreterminals.
AutomaticProtectionSwitching
Tocreateprotectionagainstfailureinlinearnetworks,SONETdefines automaticpro­
tectionswitching(APS). APSinlinearnetworksisdefinedatthelinelayer,which
meanstheprotectionisbetweentwoADMsorapair
ofSTSmultiplexer/demultiplexers.
Theideaistoprovideredundancy;aredundantline(fiber)can
beusedincase offailure
inthemainone.
Themainlineisreferredtoastheworklineandtheredundantline
astheprotectionline.Threeschemesarecommonforprotectioninlinearchannels:
one-plus-one,one-to-one,andone-to-many.Figure17.20showsallthreeschemes.
Figure17.20 Automaticprotectionswitchinginlinearnetworks
-------------
~
STS
MUX
a.One-pIus-one
APS
ADM
b.One-to-oneAPS
Workingline
Protectionline
Workingline
Protectionline
Reverseline
STS
MUX
ADM
ADM
ADM
§E
Workinglines
8:§
0
Protectionline
---------------------->-
Reverseline
I..--
'-----
c.One-to-manyAPS
One-Plus-OneAPS Inthisscheme,therearenormallytwolines:oneworkingline
and
oneprotectionline. Bothlinesareactiveallthetime.Thesendingmultiplexer

SECTION17.5SONETNETWORKS 509
sendsthesamedataonbothlines;thereceivermultiplexermonitorsthelineand
choosestheonewiththebetterquality.
Ifoneofthelinesfails,itlosesitssignal,and, of
course,theotherlineisselectedatthereceiver.Although,thefailurerecoveryforthis
schemeisinstantaneous,theschemeisinefficientbecausetwotimesthebandwidthis
required.Notethatone-plus-oneswitchingisdoneatthepathlayer.
One-to-OneAPSInthisscheme,whichlooksliketheone-plus-onescheme,thereis
alsooneworkinglineandoneprotectionline.However,thedataarenormallysenton
theworkinglineuntilitfails.Atthistime,thereceiver,usingthereversechannel,
informsthesender
tousetheprotectionlineinstead.Obviously,thefailurerecoveryis
slowerthanthat
oftheone-plus-scheme,butthisschemeismoreefficientbecausethe
protectionlinecanbeusedfordatatransferwhenitisnotused
toreplacetheworking
line.Notethattheone-to-oneswitching
isdoneatthelinelayer.
One-to-ManyAPSThisschemeissimilartotheone-to-oneschemeexceptthat
thereisonlyoneprotectionlineformanyworkinglines.Whenafailureoccursinone
oftheworkinglines,theprotectionlinetakescontroluntilthefailedlineisrepaired.It
isnot
assecureastheone-to-oneschemebecause ifmorethanoneworkinglinefailsat
thesametime,theprotectionlinecanreplaceonlyone
ofthem.Notethatone-to-many
APSisdoneatthelinelayer.
RingNetworks
ADMsmakeitpossible tohaveSONETringnetworks.SONETringscanbeusedin
eitheraunidirectionalorabidirectionalconfiguration.
Ineachcase,wecanaddextra
rings
tomakethenetworkself-healing,capable ofself-recoveryfromlinefailure.
UnidirectionalPathSwitchingRing
Aunidirectionalpathswitchingring(UPSR)isaunidirectionalnetworkwithtwo
rings:oneringused
astheworkingringandtheother astheprotectionring.Theideais
similar
totheone-plus-oneAPSschemewediscussedinalinearnetwork.Thesame
signalflowsthroughbothrings,oneclockwiseandtheothercounterclockwise.
Itis
called
UPS~becausemonitoring isdoneatthepathlayer.Anodereceivestwocopies
oftheelectricalsignalsatthepathlayer,comparesthem,andchoosestheonewiththe
betterquality.Ifpart
ofaringbetweentwoADMsfails,theotherringstillcanguaran­
teethecontinuation
ofdataflow.UPSR,liketheone-plus-onescheme,hasfastfailure
recovery,butitisnotefficientbecause
weneedtohavetworingsthat dothejobofone.
Half
ofthebandwidthiswasted.Figure17.21showsaUPSRnetwork.
Althoughwehavechosenonesenderandthreereceiversinthefigure,therecanbe
manyotherconfigurations.Thesenderusesatwo-wayconnection
tosenddata toboth
ringssimultaneously;thereceiverusesselectingswitchestoselecttheringwithbetter
signalquality.
WehaveusedoneSTSmultiplexerandthreeSTSdemultiplexers to
emphasizethatnodesoperateonthepathlayer.
BidirectionalLineSwitchingRing
AnotheralternativeinaSONETringnetworkisbidirectionallineswitching ring
(BLSR).Inthiscase,communicationisbidirectional,whichmeansthatweneed

510 CHAPTER 17SONETISDH
Figure17.21Aunidirectionalpathswitchingring
Sender
.......------"""""-":"------------...
Receiver
,fI/'--
~
;
;
,
f
Protection
ring
Working
ring
I
TTSD~~
Receiver
tworingsforworkinglines. Wealsoneedtworingsforprotectionlines.Thismeans
BLSRusesfourrings.Theoperation,however,issimilartotheone-to-oneAPS
scheme.
Ifaworkingringinonedirectionbetweentwonodesfails,thereceivingnode
canusethereverseringtoinformtheupstreamnode
inthefaileddirectiontousethe
protectionring.Thenetworkcanrecoverinseveraldifferentfailuresituationsthat
we
donotdiscusshere.Notethatthediscovery ofafailureinBLSR isatthelinelayer,not
thepathlayer.TheADMsfindthefailureandinformtheadjacentnodestousethepro­
tectionrings.Figure17.22showsaBLSRring.
CombinationofRings
SONETnetworkstodayuseacombination ofinterconnectedringstocreateservicesin
awidearea.Forexample,aSONETnetworkmayhavearegionalring,severallocal
rings,andmanysiteringstogiveservicestoawidearea.TheseringscanbeUPSR,
BLSR,oracombination
ofboth.Figure17.23showstheidea ofsuchawide-arearing
network.
MeshNetworks
Oneproblemwithringnetworksisthelack ofscalability.Whenthetrafficinaring
increases,
weneedtoupgradenotonlythelines,butalsotheADMs. Inthissituation,a
meshnetworkwithswitchesprobablygivebetterperformance.Aswitchinanetwork
mesh
iscalledacross-connect.Across-connect,likeotherswitches wehaveseen,has
inputandoutputports.In
aninputport,theswitchtakes anOC-nsignal,changesit to
anSTS-nsignal,demultiplexesitintothecorresponding STS-1signals,andsendseach

SECTION17.5SONETNETWORKS 511
Figure17.22 Abidirectionallineswitchingring
Working
rings
I
• I
• I
• •
I •I I
..............""
--------",ADM
---------- -----~~~~
,#'IlI'...-------.......--.........,---~.... ......
:/ Protection",•
: : rings
::
• I • I
I •
.---..:.•......l...............L.....,
Figure17.23 AcombinationofringsinaSONETnetwork
Sitering
STS-1signaltotheappropriateoutputport. AnoutputporttakesSTS-1signalscoming
fromdifferentinputports,multiplexesthemintoan
STS-nsignal,andmakesan OC-n
signalfortransmission.Figure17.24showsameshSONETnetwork,andthestructure ofa
switch.

512 CHAPTER 17SONET/SDH
Figure17.24AmeshSONETnetwork
a.SONETmeshnetwork b.Cross-connectswitch
17.6VIRTUALTRIBUTARIES
SONETisdesignedtocarrybroadbandpayloads.Currentdigitalhierarchydatarates
(DS-I
toDS-3),however,arelowerthanSTS-l. TomakeSONETbackward-compatible
withthecurrenthierarchy,itsframedesignincludesasystem
of virtualtributaries
(VTs)(seeFigure17.25).Avirtualtributary isapartialpayloadthatcanbeinserted
intoanSTS-landcombinedwithotherpartialpayloadstofillouttheframe.Insteadof
usingall86payloadcolumns
ofanSTS-lframefordatafromonesource,wecansub­
dividetheSPEandcalleachcomponenta
VT.
Figure17.25 Virtualtributaries
VT VT VT VT
TypesofVTs
Fourtypes ofVTshavebeendefinedtoaccommodateexistingdigitalhierarchies(see
Figure17.26).Noticethatthenumber
ofcolumnsallowedforeachtype ofVTcanbe
determinedbydoublingthetypeidentificationnumber(VT1.5getsthreecolumns,VT2
getsfourcolumns,etc.).
oVT1.5accommodatestheU.S.DS-Iservice(1.544Mbps).
oVT2accommodatestheEuropeanCEPT-lservice(2.048Mbps).
oVT3accommodatestheDS-ICservice(fractional DS-l,3.152Mbps).
oVT6accommodatestheDS-2service(6.312Mbps).

SECTION17.8KEYTERMS 513
Figure17.26 Virtualtributarytypes
VT1.5=8000frames/s3columns9rows8bits =1.728Mbps
VT2
=8000frames/s4columns9rows8bits =2.304Mbps
VT3
=8000frarnes/s6columns9rows8bits =3.456Mbps
VT6
=8000frames/s 12columns9rows8bits =6.912Mbps
VT1.5 VT2 VT3 VT6
WhentwoormoretributariesareinsertedintoasingleSTS-1frame.theyare
interleavedcolumnbycolumn.SONETprovidesmechanismsforidentifyingeach
VTandseparatingthemwithoutdemultiplexingtheentirestream.Discussion
of
thesemechanismsandthecontrolissuesbehindthemisbeyondthescope ofthis
book.
17.7RECOMMENDED READING
For
moredetailsaboutsubjectsdiscussedinthischapter,werecommendthefollowing
books.Theitemsinbrackets[
...]refertothereferencelistattheend ofthetext.
Books
SONETisdiscussedinSection2.5 of[Tan03],Section15.2 of[Kes97],Sections4.2
and4.3of[GW04],Section8.2
of[Sta04],andSection5.2of [WVOOl
17.8KEYTERMS
add/dropmultiplexer(ADM)
automaticprotectionswitching(APS)
bidirectionallineswitchingring(BLSR)
byteinterleaving
line
linelayer
lineoverhead(LOH)
opticalcarrier
(Oe)
path
pathlayer
pathoverhead(POH)
photoniclayer
regenerator
section
sectionlayer
sectionoverhead(SOH)
STSdemultiplexer
STSmultiplexer
SynchronousDigitalHierarchy(SDH)
SynchronousOpticalNetwork(SONET)

514 CHAPTER17SONETISDH
synchronouspayloadenvelope(SPE)
synchronoustransportmodule(STM)
synchronoustransportsignal(STS)
terminal
unidirectionalpathswitchingring(UPSR)
virtualtributary(VT)
17.9SUMMARY
oSynchronousOpticalNetwork(SONET)isastandarddevelopedbyANSIfor
fiber-opticnetworks:SynchronousDigitalHierarchy(SDH)isasimilarstandard
developedbyITU-
T.
oSONEThasdefinedahierarchyofsignalscalledsynchronoustransportsignals
(STSs).SDHhasdefinedasimilarhierarchy
ofsignalscalledsynchronoustransfer
modules(STMs).
oAnOC-nsignalistheopticalmodulation ofanSTS-n(orSTM-n)signal.
oSONETdefinesfourlayers:path,line,section,andphotonic.
oSONETisasynchronousTDMsysteminwhichallclocksarelockedtoamaster
clock.
oASONETsystemcanusethefollowingequipment:
1.STSmultiplexers
2.STSdemultiplexers
3.Regenerators
4.Add/dropmultiplexers
5.Terminals
oSONETsends8000framespersecond;eachframelasts 125
IlS.
oAnSTS-Iframeismade of9rowsand90columns;an STS-nframeismade of
9rowsand nx90columns.
oSTSscanbemultiplexedtogetanewSTSwithahigherdatarate.
DSONETnetworktopologiescanbelinear,ring,ormesh.
oAlinearSONETnetworkcanbeeitherpoint-to-pointormultipoint.
DAringSONETnetworkcanbeunidirectionalorbidirectional.
oTomakeSONETbackward-compatiblewiththecurrenthierarchy,itsframedesign
includesasystem
ofvirtualtributaries(VTs).
17.10PRACTICESET
ReviewQuestions
I.WhatistherelationshipbetweenSONETandSDH?
2.WhatistherelationshipbetweenSTSandSTM?
3.HowisanSTSmultiplexerdifferentfromanadd/dropmultiplexersincebothcan
addsignalstogether?

SECTION17.10PRACTICE SET SIS
4.WhatistherelationshipbetweenSTSsignalsandOCsignals?
5.Whatisthepurposeofthepointer inthelineoverhead?
6.WhyisSONETcalledasynchronousnetwork?
7.WhatisthefunctionofaSONETregenerator?
8.WhatarethefourSONETlayers?
9.DiscussthefunctionsofeachSONETlayer.
10.Whatisavirtualtributary?
Exercises
II.Whataretheuserdatarates ofSTS-3,STS-9,andSTS-12?
12.ShowhowSTS-9'scanbemultiplexedtocreateanSTS-36.Isthere anyextra
overheadinvolvedinthistypeofmultiplexing?
13.AstreamofdataisbeingcarriedbySTS-lframes. Ifthedatarateofthestreamis
49.540Mbps,howmanySTS-lframespersecondmustlettheir
H3bytescarrydata?
14.AstreamofdataisbeingcarriedbySTS-lframes. Ifthedatarateofthestreamis
49.530Mbps,howmanyframespersecondshouldleaveoneemptybyteafterthe
H3byte?
IS.Table17.2showsthattheoverheadbytescanbecategorized asA,B, C,D,E,F,G,
H,J,K,andZbytes.
a.WhyaretherenoAbytesintheLOHorPOH?
b.WhyaretherenoCbytesintheLOH?
c.WhyaretherenoDbytesinthePOH?
d.WhyaretherenoEbytesintheLOHorPOR?
e.WhyaretherenoFbytesintheLOHorPOH?
f.WhyaretherenoGbytesintheSOHorLOH?
g.WhyaretherenoHbytesintheSOH?
h.Whyarethereno JbytesintheSOHorLOH?
i.WhyaretherenoKbytesintheSOHorPOH?
j.WhyaretherenoZbytesintheSOH?
16.WhyareBbytespresentinallthreeheaders?

CHAPTER18
Virtual-CircuitNetworks:
FrameRelay
andATM
InChapter8,wediscussedswitchingtechniques. Wesaidthattherearethreetypes of
switching:circuitswitching,packetswitching,andmessageswitching.Wealsomen­
tionedthatpacketswitchingcanusetwoapproaches:thevirtual-circuitapproachand
thedatagramapproach.
Inthischapter,weshowhowthevirtual-circuitapproachcanbeusedinwide-area
networks.TwocommonWANtechnologiesusevirtual-circuitswitching.FrameRelay
isarelativelyhigh-speedprotocolthatcanprovidesomeservicesnotavailableinother
WANtechnologiessuchasDSL,cable
TV,andTlines.ATM,asahigh-speedprotocol,
canbethesuperhighway
ofcommunicationwhenitdeploysphysicallayercarriers
suchasSONET.
WefirstdiscussFrameRelay.Wethendiscuss
ATMingreaterdetaiLFinally,we
showhow
ATMtechnology,whichwasoriginallydesignedasaWANtechnology,can
alsobeusedinLANtechnology,
ATMLANs.
18.1FRAMERELAY
FrameRelayisavirtual-circuitwide-areanetworkthatwasdesignedinresponseto
demandsforanewtype
ofWANinthelate1980sand early1990s.
1.PriortoFrameRelay,someorganizationswereusingavirtual-circuitswitching
networkcalledX.25thatperformedswitchingatthenetworklayer.Forexample,
theInternet,whichneedswide-areanetworkstocarryitspacketsfromoneplaceto
another,usedX.25.AndX.25isstillbeingusedbytheInternet,butitisbeing
replacedbyotherWANs.However,X.25hasseveraldrawbacks:
a.X.25hasalow64-kbpsdatarate.Bythe1990s,therewasaneedforhigher­
data-rateWANs.
b.X.25hasextensiveflowanderrorcontrolatboththedatalinklayerandthe
networklayer.ThiswassobecauseX.25wasdesignedinthe1970s,when
theavailabletransmissionmediaweremorepronetoerrors.Flowanderror
controlatbothlayerscreatealargeoverheadandslowdowntransmissions.X.25
requires acknowledgmentsforbothdatalinklayerframesandnetworklayer
packetsthataresentbetweennodesandbetweensourceanddestination.
517

518 CHAPTER 18ViRTUAL-CIRCUiTNETWORKS:FRAME RELAYANDATM
c.OriginallyX.25wasdesignedforprivatelise,notfortheInternet.X.25hasits
ownnetworklayer.Thismeansthattheuser'sdataareencapsulatedinthe
networklayerpackets
ofX.25.TheInternet,however,hasitsownnetwork
layer,whichmeans
iftheInternetwantstouseX.25,theInternetmustdeliver
itsnetworklayerpacket,calledadatagram,toX.25forencapsulationinthe
X.25packet.Thisdoublestheoverhead.
2.DisappointedwithX.25,someorganizationsstartedtheirownprivate WANby
leasingT-lor
T-3linesfrompublicserviceproviders.Thisapproachalsohassome
drawbacks.
a.Ifanorganizationhas nbranchesspreadoveranarea,itneeds n(n
-1)/2T-Ior
T-3lines.Theorganizationpaysforalltheselinesalthoughitmayusethelines
only
10percentofthetime.Thiscanbeverycostly:
b.TheservicesprovidedbyT-Iand T-3linesassumethattheuserhasfixed-rate
dataallthetime.Forexample,aT-lline
isdesignedforauserwhowantsto
usethelineataconsistent1.544Mbps.Thistypeofserviceisnotsuitablefor
themanyuserstodaythatneedtosend
burstydata. Forexample,ausermay
wanttosenddataat6Mbpsfor2s,0Mbps(nothing)for7
s,and3.44Mbps
for1 sforatotalof15.44Mbitsduringaperiodof
10s.Althoughtheaverage
datarateisstill1.544Mbps,theT-Ilinecannotacceptthistypeofdemand
becauseitisdesignedforfixed-ratedata,notburstydata.Burstydatarequire
whatiscalled
bandwidthondemand. Theuserneedsdifferentbandwidth
allocationsatdifferenttimes.
Inresponsetotheabovedrawbacks,FrameRelaywasdesigned.FrameRelay isawide­
areanetworkwiththefollowingfeatures:
1.FrameRelayoperatesatahigherspeed(1.544Mbpsandrecently44.376Mbps).
ThismeansthatitcaneasilybeusedinsteadofameshofT-Ior
T-3lines.
2.FrameRelayoperatesinjustthephysicalanddatalinklayers.Thismeansitcan
easilybeused
asabackbonenetworktoprovideservices toprotocolsthatalready
haveanetworklayerprotocol,such
astheInternet.
3.FrameRelayallowsburstydata.
4.FrameRelayallowsaframesizeof9000bytes,whichcanaccommodatealllocal­
areanetworkframesizes.
5.FrameRelay islessexpensivethanothertraditionalWANs.
6.FrameRelayhaserrordetectionatthedatalinklayeronly.Thereisno flowcontrol
orerrorcontrol.Thereisnotevenaretransmissionpolicy
ifaframeisdamaged;it
issilentlydropped.FrameRelaywasdesigned
inthiswaytoprovidefasttransmis­
sioncapabilityformorereliablemediaandforthoseprotocolsthathave
flowand
errorcontrolatthehigherlayers.
Architecture
FrameRelayprovidespermanentvirtualcircuitsandswitchedvirtualcircuits.Figure 18.1
showsanexampleofaFrameRelaynetworkconnectedtotheInternet.Theroutersare
used,
aswewillseeinChapter22,toconnectLANsandWANsintheInternet.Inthe
figure,theFrameRelayWANisused
asonelinkintheglobalInternet.

SECTION18.1FRAMERELAY 519
Figure18.1 FrameRelaynetwork
Totherestof
theInternet
VirtualCircuits
FrameRelay
isavirtualcircuitnetwork.AvirtualcircuitinFrameRelayisidentified
byanumbercalleda
datalinkconnectionidentifier(DLCI).
VCIsinFrameRelayarecalledDLCIs.
PermanentVersusSwitchedVirtualCircuits
Asourceandadestinationmaychoosetohavea
permanentvirtualcircuit(PVC). In
thiscase,theconnectionsetupissimple.Thecorrespondingtableentryisrecordedfor
allswitchesbytheadministrator(remotelyandelectronically,
ofcourse).Anoutgoing
DLCIisgiventothesource,andanincomingDLCIisgiventothedestination.
PVCconnectionshavetwodrawbacks.First,theyarecostlybecausetwoparties
payfortheconnectionallthetimeevenwhenitisnotinuse.Second,aconnectionis
createdfromonesourcetoonesingledestination.
Ifasourceneedsconnectionswith
severaldestinations,itneedsaPVCforeachconnection.Analternateapproachisthe
switched
virtualcircuit(SVC). TheSVCcreatesatemporary,shortconnectionthat
existsonlywhendataarebeingtransferredbetweensourceanddestination.AnSVC
requiresestablishingandterminatingphases
asdiscussedinChapter 8.
Switches
EachswitchinaFrameRelaynetworkhasatabletorouteframes.Thetablematches
anincomingport-DLCIcombinationwithanoutgoingport-DLCIcombinationaswe
describedforgeneralvirtual-circuitnetworksinChapter
8.Theonlydifference isthat
VCIsarereplacedbyDLCIs.
FrameRelayLayers
Figure18.2showstheFrameRelaylayers.FrameRelayhasonlyphysicalanddatalink
layers.

520 CHAPTER 18VIRTUAL-CIRCUITNETWORKS:FRAME RELAYANDATM
Figure18.2FrameRelaylayers
Datalink
PhsicalI
Simplifiedcorefunctions I
ofdatalinklayer
ANSIstandards
FrameRelayoperatesonly atthephysicalanddatalinklayers.
PhysicalLayer
NospecificprotocolisdefinedforthephysicallayerinFrameRelay.Instead,itisleft
totheimplementertousewhateverisavailable.FrameRelaysupportsany
oftheproto­
colsrecognizedbyANSI.
Data
LinkLayer
Atthedatalinklayer,FrameRelayusesasimpleprotocolthatdoesnotsupportflowor
errorcontrol.Itonlyhasanerrordetectionmechanism. Figure18.3showstheformat
ofaFrameRelayframe.TheaddressfielddefinestheDLCI aswellassomebitsusedto
controlcongestion.
Figure18.3FrameRelayframe
C/R:Command/response
EA:Extendedaddress
FECN:Forwardexplicitcongestionnotification
BECN:Backwardexplicitcongestionnotification
DE:Discardeligibility
DLCI:Datalinkconnectionidentifier
DLCI
6bits
Information
1bit1bit
DLCI
4bits
Thedescriptionsofthefieldsareasfollows:
oAddress(DLCI)field.Thefirst6bits ofthefirstbytemakesupthefirstpart ofthe
DLCI.Thesecondpart
oftheDLCIusesthefirst4bits ofthesecondbyte.These
bitsarepart
ofthelO-bitdatalinkconnectionidentifierdefinedbythestandard.
Wewilldiscussextendedaddressingattheend ofthissection.

SECTION18.1FRAMERELAY 521
oCommand/response(CIR). Thecommand/response(C/R)bitisprovided toallow
upperlayerstoidentifyaframeaseitheracommand
oraresponse.Itisnotused
bytheFrameRelayprotocol.
oExtendedaddress(EA). Theextendedaddress(EA)bitindicateswhetherthe
currentbyteisthefinalbyte
oftheaddress.An EAof0meansthatanotheraddress
byteis
tofollow(extendedaddressing isdiscussedlater).An EAof1meansthat
thecurrentbyteisthefinalone.
oForwardexplicitcongestionnotification(FECN). Theforwardexplicitcon­
gestionnotification(FECN)
bitcanbesetbyanyswitchtoindicatethattraffic
iscongested.Thisbitinformsthedestinationthatcongestionhasoccurred.Inthis
way,thedestinationknowsthatitshouldexpectdelayoraloss
ofpackets.Wewill
discusstheuse
ofthisbitwhenwediscusscongestioncontrolinChapter24.
oBackwardexplicitcongestionnotification(BECN). Thebackwardexplicitcon­
gestionnotification(BECN)
bitisset(inframesthattravelintheotherdirection)to
indicateacongestionprobleminthenetwork.Thisbitinformsthesenderthatcon­
gestionhasoccurred.Inthisway,thesourceknowsitneedstoslowdowntoprevent
theloss
ofpackets.Wewilldiscusstheuse of
thisbitwhenwediscusscongestion
controlinChapter24.
oDiscardeligibility(DE). Thediscardeligibility(DE) bitindicatesthepriority
level
oftheframe.Inemergencysituations,switchesmayhavetodiscardframes to
relievebottlenecksandkeepthenetworkfromcollapsingduetooverload.Whenset
(DE
1),thisbittellsthenetworktodiscard
thisframeifthereiscongestion.Thisbit
canbeseteitherbythesender
oftheframes(user)orbyanyswitchinthenetwork.
FrameRelaydoes notprovideflow orerrorcontrol;
they
mustbeprovidedbytheupper-layerprotocols.
ExtendedAddress
Toincreasetherange ofDLCIs,theFrameRelayaddresshasbeenextendedfromthe
original2-byteaddressto
3-or4-byteaddresses.Figure18.4showsthedifferent
addresses.Note thatthe
EAfielddefinesthenumber ofbytes;itis1inthelastbyte of
theaddress,anditis aintheotherbytes.Notethatinthe3-and4-byteformats,thebit
beforethelastbitissetto
O.
Figure18.4 Threeaddressformats
DLCI
a.Two-byteaddress(lO-bitDLCI)
DLCI
CIREA=O
OLCI IFECNIBECN DE EA=O
DLCI 0EA=I
b.Three-byteaddress(16-bitDLCI)
OLCI
ICIREA=O
OLCIIPECNIBECNIOE EA=O
DLCI EA=O
DLCI I0EA=1
c.Four-byteaddress(23-bitDLCI)

522 CHAPTER 18VIRTUAL-CIRCUITNETWORKS:FRAME RELAYANDATM
FRADs
Tohandleframesarrivingfromotherprotocols,FrameRelay usesadevicecalleda
FrameRelayassembler/disassembler(FRAD). AFRADassemblesanddisassembles
framescomingfromotherprotocols
toallowthemtobecarriedbyFrameRelayframes.
AFRADcanbeimplementedasaseparatedeviceor
aspartofaswitch.Figure18.5
showstwoFRADsconnected
toaFrameRelaynetwork.
Figure18.5 FRAD
X.25
ATM
ppp
VOFR
Frame
Relay
X.25
ATM
ppp
FrameRelaynetworksofferanoptioncalled VoiceOverFrameRelay(VOFR) that
sendsvoicethroughthenetwork.VoiceisdigitizedusingPCMandthencompressed.
Theresult
issentasdataframesoverthenetwork.Thisfeatureallowstheinexpensive
sending
ofvoiceoverlongdistances.However,notethatthequality ofvoiceisnot as
goodasvoiceoveracircuit-switchednetworksuch asthetelephonenetwork.Also,the
varyingdelaymentionedearliersometimescorruptsreal-timevoice.
LMI
FrameRelaywasoriginallydesignedtoprovidePVCconnections.Therewasnot,
therefore,aprovisionforcontrolling
ormanaginginterfaces. LocalManagement
Information(LMI) isaprotocoladdedrecentlytotheFrameRelayprotocoltopro­
videmoremanagementfeatures.Inparticular,LMIcanprovide
oAkeep-alivemechanism tocheckifdataareflowing.
oAmulticastmechanismtoallowalocalendsystemtosendframestomorethan
oneremoteendsystem.
oAmechanismtoallowanendsystemtocheckthestatus ofaswitch(e.g.,toseeif
theswitchiscongested).
CongestionControl andQualityofService
Oneofthenicefeatures ofFrameRelayisthatitprovides congestioncontrol and
qualityofservice(QoS). Wehavenotdiscussedthesefeaturesyet.InChapter24,we
introducethesetwoimportantaspectsofnetworkinganddiscusshowtheyareimple­
mentedinFrameRelayandsomeothernetworks.

SECTION18.2ATM 523
18.2ATM
AsynchronousTransferMode(ATM)isthecellrelayprotocoldesignedbythe ATM
ForumandadoptedbytheITU-T.Thecombination ofATMandSONETwillallow
high-speedinterconnection
ofalltheworld'snetworks.Infact, ATMcanbethought of
asthe"highway"oftheinformationsuperhighway.
DesignGoals
Amongthechallengesfacedbythedesigners ofATM,sixstandout.
1.Foremostistheneedforatransmissionsystemtooptimizetheuse ofhigh-data-rate
transmissionmedia,inparticularoptical
fiber.Inadditiontoofferinglargeband­
widths,newertransmissionmediaandequipmentaredramaticallylesssusceptible
tonoisedegradation.Atechnologyisneededtotakeadvantage
ofbothfactorsand
therebymaximizedatarates.
2.Thesystemmustinterfacewithexistingsystemsandprovidewide-areaintercon­
nectivitybetweenthemwithoutloweringtheireffectivenessorrequiringtheir
replacement.
3.Thedesignmustbeimplementedinexpensivelysothatcostwouldnotbeabarrier
toadoption.If
ATMistobecomethebackbone ofinternationalcommunications,
asintended,itmustbeavailableatlowcosttoeveryuserwhowantsit.
4.Thenewsystemmustbeabletoworkwithandsupporttheexistingtelecom­
municationshierarchies(localloops,localproviders,long-distancecarriers,and
soon).
5.Thenewsystemmustbeconnection-orientedtoensureaccurateandpredictable
delivery.
6.Lastbutnotleast,oneobjectiveistomove asmanyofthefunctionstohardware as
possible(forspeed)andeliminateasmanysoftwarefunctions aspossible(again
forspeed).
Problell,ls
Beforewediscussthesolutionstothesedesignrequirements,itisusefultoexaminesome
oftheproblemsassociatedwithexistingsystems.
FrameNetworks
BeforeATM,datacommunicationsatthedatalinklayerhadbeenbased
onframe
switchingandframenetworks.Differentprotocolsuseframes
ofvaryingsizeandintri­
cacy.Asnetworksbecomemorecomplex,theinformationthatmustbecarriedinthe
headerbecomesmoreextensive.Theresultislargerandlargerheadersrelativetothe
size
ofthedataunit.Inresponse,someprotocolshaveenlargedthesize ofthedataunit
tomakeheaderusemoreefficient(sendingmoredatawiththesame sizeheader).
Unfortunately,largedatafieldscreatewaste.
Ifthereisnotmuchinformationtotransmit,
much
ofthefieldgoesunused. Toimproveutilization,someprotocolsprovidevariable
framesizestousers.

524 CHAPTER 18VIRTUAL-CIRCUITNETWORKS:FRAMERElAYANDATM
MixedNetworkTraffic
Asyoucanimagine,thevariety
offramesizesmakestrafficunpredictable.Switches,
multiplexers,androutersmustincorporateelaboratesoftwaresystemstomanagethe
varioussizes
offrames.Agreatdeal ofheaderinformationmustberead,andeachbit
countedandevaluatedtoensuretheintegrity
ofeveryframe.Internetworkingamong
thedifferentframenetworksisslowandexpensiveatbest,andimpossibleatworst.
Anotherproblemisthat
ofprovidingconsistentdataratedeliverywhenframe
sizesareunpredictableandcanvarysodramatically.
Togetthemostout ofbroadband
technology,trafficmustbetime-divisionmultiplexedontosharedpaths.Imaginethe
results
ofmultiplexingframesfromtwonetworkswithdifferentrequirements(and
framedesigns)ontoonelink(seeFigure18.6).Whathappenswhenline1useslarge
frames(usuallydataframes)whileline2usesverysmallframes(thenormforaudio
andvideoinformation)?
Figure18.6 Multiplexingusingdifferentframesizes
x
2------------1
A x
01
Ifline1'sgiganticframeXarrivesatthemultiplexerevenamomentearlierthan
line2'sframes,themultiplexerputsframeXontothenewpathfirst.Afterall,even
if
line2'sframeshavepriority,themultiplexerhasnoway ofknowingtowaitforthem
andsoprocessestheframethathasarrived.FrameAmustthereforewaitfortheentire
Xbitstreamtomoveintoplacebeforeitcanfollow.Thesheersize
ofXcreatesan
unfairdelayforframeA.Thesameimbalancecanaffectalltheframesfromline
2.
Becauseaudioandvideoframesordinarilyaresmall,mixingthemwithconven­
tionaldatatrafficoftencreatesunacceptabledelays
ofthistypeandmakessharedframe
linksunusableforaudioandvideoinformation.Trafficmusttraveloverdifferentpaths,
inmuchthesamewaythatautomobileandtraintrafficdoes.Buttofullyutilizebroad
bandwidthlinks,weneedtobeabletosendallkinds
oftrafficoverthesamelinks.
CellNetworks
Many
oftheproblemsassociatedwithframeinternetworkingaresolvedbyadopting
aconceptcalledcellnetworking.Acellisasmalldataunit
offixedsize. Inacell
network,whichusesthe cellasthebasicunit ofdataexchange,alldataareloadedinto
identicalcellsthatcanbetransmittedwithcompletepredictabilityanduniformity.As
frames
ofdifferentsizesandformatsreachthecellnetworkfromatributarynetwork,
theyaresplitinto multiplesmalldataunits
ofequallengthandareloadedintocells.
Thecellsarethenmultiplexedwithothercellsandroutedthroughthecellnetwork.
Becauseeachcellisthesamesizeandallaresmall,theproblemsassociatedwith
multiplexingdifferent-sizedframesareavoided.

SECTION18.2ATM 525
Acellnetworkusesthecellas thebasicunitofdataexchange.
Acellisdefinedasasmall,fixed-sizeblock
ofinformation.
Figure18.7showsthemultiplexerfromFigure18.6withthetwolinessending
cellsinstead
offrames.FrameXhasbeensegmentedintothreecells:X, Y,andZ.Only
thefirstcellfromline1getsputonthelinkbeforethefirstcellfromline
2.Thecells
fromthetwolinesareinterleavedsothatnonesuffersalongdelay.
Figure18.7
Multiplexingusingcells
z y x
DOD
C B A
DOD
2------=-----;
C Z B Y A x
ClClDClClCl
Asecondpointinthissamescenarioisthatthehighspeed ofthelinkscoupled
withthesmallsize
ofthecellsmeansthat,despiteinterleaving,cellsfromeachline
arriveattheirrespectivedestinationsinanapproximation
ofacontinuousstream(much
asamovieappearstoyourbraintobecontinuousactionwheninfactitisreallyaseries
ofseparate,stillphotographs).Inthis way,a cellnetworkcanhandlereal-timetrans­
missions,such
asaphonecall,withoutthepartiesbeingaware ofthesegmentationor
multiplexingatall.
AsynchronousTDM
ATMusesasynchronoustime-divisionmultiplexing-thatiswhyit iscalledAsynchro­
nousTransfer
Mode-tomultiplexcellscorningfromdifferentchannels. Itusesfixed-size
slots(sizeofacell).
ATMmultiplexersfillaslotwithacellfromanyinputchannelthat
hasacell;theslot
isemptyifnoneofthechannelshasacelltosend.
Figure18.8showshowcellsfromthreeinputsaremultiplexed.Atthefirsttick
of
theclock:channel2hasnocell(emptyinputslot),sothemultiplexerfillstheslotwith
a cellfromthethirdchannel.Whenallthecellsfromallthechannelsaremultiplexed,
theoutputslotsareempty.
Figure18.8
ATMmultiplexing
A3A2Al
ggg
B281
10110lLJ
2--------1
C3 C2 Cl
101101101
3-==-=~~1/
C382A3C2BlA2ClAi
LJLJgggggggg

526 CHAPTER 18VIRTUAL-CIRCUITNETWORKS:FRAME RELAYANDATM
Architecture
ATMisacell-switchednetwork.Theuseraccessdevices,calledtheendpoints,are
connectedthrougha
user-to-networkinterface (UNI)totheswitchesinsidethenet­
work.Theswitchesareconnectedthrough
network-to-networkinterfaces (NNIs).
Figure18.9showsanexample
ofanATMnetwork.
Figure18.9
ArchitectureofanATMnetwork
Endpoints
VirtualConnection
Connectionbetweentwoendpointsisaccomplishedthroughtransmissionpaths(TPs),
virtualpaths(YPs),andvirtualcircuits(YCs).A
transmissionpath(TP)isthephysical
connection(wire,cable,satellite,andsoon)betweenanendpointandaswitchor
betweentwoswitches.Think
oftwoswitchesastwocities.Atransmissionpathisthe
set
ofallhighwaysthatdirectlyconnectthetwocities.
Atransmissionpathisdividedintoseveralvirtualpaths.A
virtualpath(VP)pro­
videsaconnectionoraset
ofconnectionsbetweentwoswitches.Think ofavirtualpath
asahighwaythatconnectstwocities.Eachhighwayisavirtualpath;theset ofall
highwaysisthetransmissionpath.
Cellnetworksarebasedon
virtualcircuits(VCs). Allcellsbelongingtoasingle
messagefollowthesamevirtualcircuitandremainintheiroriginalorderuntilthey
reachtheirdestination.Think
ofavirtualcircuit asthelanesofahighway(virtualpath).
Figure18.10showstherelationshipbetweenatransmissionpath(aphysical
connec­
tion),virtualpaths(acombination ofvirtualcircuitsthatarebundledtogetherbecause
parts
oftheirpathsarethesame),andvirtualcircuitsthatlogicallyconnecttwopoints.
Figure18.10
Tp,VPs,andVCs
VC
VC--t-I
VC
VC
VC~;:}.';'il~
VC
vc
vc
VC
VC
VC
VC

SECTION18.2ATM 527
TobetterunderstandtheconceptofVPsandVCs,lookatFigure18.11.Inthis
figure,eightendpointsarecommunicatingusingfourVCs.However,thefirsttwoVCs
seemtosharethesamevirtualpathfromswitchItoswitchIII,soitisreasonableto
bundlethesetwoVCstogethertoformone
VP.Ontheotherhand,itisclearthatthe
othertwoVCssharethesamepathfrom switchItoswitch
IV,soitisalsoreasonableto
combinethemtoformone
VP.
Figure18.11 ExampleofVPsandVCs
IdentifiersInavirtualcircuitnetwork,toroutedatafromoneendpointtoanother,
thevirtualconnectionsneed
tobeidentified.Forthispurpose,thedesignersof ATM
createdahierarchicalidentifierwithtwolevels:a virtualpathidentifier(VPI) anda
virtual-circuitidentifier (Vel).TheVPIdefinesthespecific VP,andtheVeldefinesa
particularVCinsidethe
VP.TheVPIisthesameforallvirtualconnectionsthatare
bundled(logically)intoone
VP.
Notethatavirtualconnection isdefinedbyapairofnumbers:theVPI andthevel.
Figure18.12showstheVPIsandVClsforatransmissionpath.Therationalefor
dividing
anidentifierintotwopartswillbecomeclearwhenwediscussroutinginan
ATMnetwork.
ThelengthsoftheVPIsforUNIsandNNIsaredifferent.InaUNI,theVPIis
8bits,whereasinanNNI,theVPIis
12bits.ThelengthoftheVCIisthesameinboth
interfaces(16bits).
Wethereforecansaythatavirtualconnectionisidentifiedby
24bitsinaUNIandby
28bitsinanNNI(seeFigure18.13).
Thewholeideabehinddividingavirtualcircuitidentifierintotwopartsistoallow
hierarchicalrouting.Most
oftheswitchesinatypical ATMnetworkareroutedusing
VPIs.Theswitchesattheboundariesofthenetwork,thosethatinteractdirectlywith
theendpointdevices,usebothVPIsandVCIs.
Cells
Thebasicdataunitinan ATMnetworkiscalledacell.Acell isonly53byteslongwith
5bytesallocatedtotheheaderand48bytescarryingthepayload(userdatamaybeless

528 CHAPTER 18VIRTUAL-CIRCUITNETWORKS:FRAME RELAYANDATM
Figure18.12 Connectionidentifiers
Thisvirtualconnectionis
uniquelydefinedusingthepair:
(14 21)
t t
VPlVCl
VCl=21
_....c.~~
VCl=32-+---I
VCl=45
VCl=70
VCl=74-+-l
VCl=45
Figure18.13 VirtualconnectionidentifiersinUNIs andNNIs
VCl=21
VCl=32
VCl=45
VCl=70
VCl=74
VCl=45
1L....-_V_P_l_-'- V_C_I 1
I- 24bits ·1
8bits 16bits 12bits 16bits
I
VPl VCl I
~~~ -----.J
I- 28bits -,
a.VPIandVCIinaUNI b. VPIandVCIinanNNI
than48bytes). Wewillstudyindetailthefieldsofacell,butforthemomentitsuffices
tosaythatmost
oftheheaderisoccupiedbytheVPIandVCIthatdefinethevirtual
connectionthroughwhichacellshouldtravelfromanendpointtoaswitchorfroma
switchtoanotherswitch.Figure18.14showsthecellstructure.
Figure18.14
AnATMcell
Header
-+1IVPIIVCII
I,5bytes
ConnectionEstablishment andRelease
53bytes
Payload
48bytes
LikeFrameRelay, ATMusestwotypes ofconnections:PVCand SVc.
PVCApermanentvirtual-circuitconnectionisestablishedbetweentwoendpointsby
thenetworkprovider.TheVPlsand
vcrsaredefinedforthepermanentconnections,
andthevaluesareenteredforthetables
ofeachswitch.

SECTION18.2ATM 529
SVCInaswitchedvirtual-circuitconnection,eachtimeanendpointwantstomakea
connectionwithanotherendpoint,anewvirtualcircuitmustbeestablished.
ATMcannot
dothejobbyitself,butneedsthenetworklayeraddressesandtheservicesofanotherpro­
tocol(suchasIP).Thesignalingmechanismofthisotherprotocolmakesaconnection
requestbyusingthenetworklayeraddressesofthetwoendpoints.Theactualmechanism
dependsonthenetworklayerprotocol.
Switching
ATMusesswitchestoroutethecellfromasourceendpointtothedestinationendpoint.
AswitchroutesthecellusingboththeVPlsandtheVCls.Theroutingrequiresthe
wholeidentifier.Figure18.15showshowaVPCswitchroutesthecell.Acellwitha
VPI
of153andVCI of67arrivesatswitchinterface(port) 1.Theswitchchecksits
switchingtable,whichstoressixpieces
ofinformationperrow:arrival
intetfacenum­
ber,incomingVPI,incomingVCI,correspondingoutgoinginterfacenumber,thenew
VPI,andthenewVCLTheswitchfindstheentrywiththeinterface
1,VPI153,and
VCI67anddiscoversthatthecombinationcorrespondstooutputinterface
3,VPI140,
andVCI92.
ItchangestheVPIandVCI intheheaderto140and92,respectively,and
sendsthecelloutthroughinterface
3.
Figure18.15Routingwithaswitch
VCI
~---
Input Output
Interface
VPIVCIInterfaceVPIVCI
1 15367 3 14092
.................... ........
~. ',o""';e'%~0" ..e,
.'''~~
VPI
153
4
..A..
C1 1
92
I
2
3
VPIV
~
SwitchingFabric
Theswitchingtechnologyhascreatedmanyinterestingfeaturestoincreasethespeed of
switchestohandledata.WediscussedswitchingfabricsinChapter 8.
ATMLayers
TheATMstandarddefinesthreelayers.Theyare,fromtoptobottom,theapplication
adaptationlayer,theATMlayer,andthephysicallayer(seeFigure18.16).
Theendpointsuseallthree layerswhiletheswitchesuseonlythetwobottomlayers
(seeFigure18.17).
PhysicalLayer
LikeEthernetandwirelessLAN s,ATMcellscanbecarriedbyanyphysicallayercarrier.

530 CHAPTER 18VIRTUAL-CIRCUITNETWORKS:FRAME RELAYANDATM
Figure18.16ATMlayers
AAL
AALl AAL2 AAL3/4 AAL5
ATMlayer I
------
Physicallayer I
----_----1
Figure18.17ATMlayersinendpointdevices andswitches
AAL
I
AAL
I
AJM ~ ArM~
ATM ATM
~
i ,
Physical,
I
Physical Physical
~
Physical
~
I I
I
I
I
c@~
I
I I
D
D
SONETTheoriginaldesign ofATMwasbasedon SONET(seeChapter 17)asthe
physicallayercarrier.SONETispreferredfortworeasons.First,thehighdatarate
ofSONET'scarrierreflectsthedesignandphilosophy ofATM.Second,inusing
SONET,theboundaries
ofcellscanbeclearlydefined.AswesawinChapter17,
SONETspecifiestheuse
ofapointertodefinethebeginning ofapayload.Ifthebegin­
ningofthefirst
ATMcellisdefined,therest ofthecellsinthesamepayloadcaneasily
beidentifiedbecausetherearenogapsbetweencells.Justcount
53bytesaheadtofind
thenextcell.
OtherPhysicalTechnologiesATMdoesnotlimitthephysicallayertoSONET.
Othertechnologies,evenwireless,maybeused.However,theproblem
ofcellbound­
ariesmustbesolved.Onesolutionisforthereceivertoguesstheend
ofthecelland
applytheCRCtothe5-byteheader.
Ifthereisnoerror,theendofthecell1sfound,witha
highprobability,correctly.Count52bytesbacktofindthebeginning
ofthecell.
ATMLayer
TheATM layerprovidesrouting,trafficmanagement,switching,andmultiplexing
services.
Itprocessesoutgoingtrafficbyaccepting48-bytesegmentsfromtheAAL
sublayersandtransformingtheminto53-bytecellsbytheaddition
ofa5-byteheader
(seeFigure18.18).

SECTION18.2ATM 531
Figure18.18 ATMlayer
FromAAL
A
T
M
HeaderFormatATMusestwofonnatsforthisheader,oneforuser-to-networkinter­
face(UNI)cellsandanotherfornetwork-to-networkinterface(NNI)cells.Figure18.19
showstheseheadersinthebyte-by-byteformatpreferredbytheITU-T(eachrowrepre­
sentsabyte).
Figure18.19 ATMheaders
GFC:Genericflowcontrol
VPl:Virtualpathidentifier
VCl:Virtualcircuitidentifier
PT:Payloadtype
CLP:Celllosspriority
HEC:Headererrorcontrol
GFC
VPI
VCI
VPI
VCI
VCI
·Pltyloail
datlL
UNIcell
CLP
,Pay;lofuI:
data
NNIcell
CLP
oGenericflowcontrol(GFC). The4-bitGFCfieldprovidesflowcontrolatthe
UNIlevel.TheITU-Thasdeterminedthatthislevel
offlowcontrolisnotneces­
saryattheNNIlevel.IntheNNIheader,therefore,thesebitsareaddedtotheVPI.
ThelongerVPIallowsmorevirtualpathstobedefinedatthe
NNIlevel.The
formatforthisadditionalVPIhasnotyetbeendetermined.
oVirtualpathidentifier(VPI). TheVPIisan8-bitfieldinaUNIcellanda12-bit
fieldinanNNIcell(seeabove).
oVirtualcircuitidentifier(VCI). TheVCIisa16-bitfieldinbothframes.
oPayloadtype(PT). Inthe3-bitPTfield,thefirstbitdefinesthepayloadasuser
dataormanagerialinformation.Theinterpretation
ofthelast2bitsdepends onthe
firstbit.

532 CHAPTER 18VIRTUAL-CIRCUITNETWORKS:FRAME RELAYANDATM
oCelllosspriority(CLP).TheI-bitCLP fieldisprovidedforcongestioncontrol.A
cellwith
itsCLPbitset toImustberetained aslongastherearecellswithaCLP ofO.
Wediscusscongestioncontrolandquality ofservicein anATMnetworkinChapter24.
oHeadererrorcorrection(HEC).TheHECisacodecomputedforthefirst
4bytes
oftheheader.ItisaCRCwiththedivisor x
8
+x
2
+x+1thatisusedto
correctsingle-biterrorsandalargeclass
ofmultiple-biterrors.
ApplicationAdaptationLayer
Theapplicationadaptationlayer(AAL)wasdesignedtoenabletwo ATMconcepts.
First,
ATMmustacceptanytype ofpayload,bothdataframesandstreams ofbits.A
dataframecancomefromanupper-layerprotocolthatcreatesaclearlydefinedframe
tobesenttoacarriernetworksuch
asATM.Agoodexampre istheInternet.ATMmust
alsocarrymultimediapayload.Itcanacceptcontinuousbitstreamsandbreakthem
intochunkstobeencapsulatedintoacellatthe
ATMlayer.AALusestwosublayers to
accomplishthesetasks.
Whetherthedataareadataframeorastream
ofbits,thepayloadmustbeseg­
mentedinto48-bytesegments
tobecarriedbyacell.Atthedestination,thesesegments
needtobereassembledtorecreatetheoriginalpayload.TheAALdefinesasublayer,
calledasegmentation
andreassembly(SAR)sublayer,to doso.Segmentationisat
thesource;reassembly,atthedestination.
BeforedataaresegmentedbySAR,theymustbepreparedtoguaranteetheintegrity
ofthedata.Thisisdonebyasublayercalledtheconvergencesublayer(CS).
ATMdefinesfourversions oftheAAL: AALl,AAL2,AAL3/4,andAAL5.
Althoughwediscussalltheseversions,weneedtoinformthereaderthatthecommon
versionstodayareAALIandAAL5.Thefirst
isusedinstreamingaudioandvideo
communication;thesecond,indatacommunications.
AALIAALIsupportsapplicationsthattransferinformationatconstantbitrates,
such
asvideoandvoice.Itallows ATMtoconnectexistingdigitaltelephonenetworks
such
asvoicechannelsandTlines.Figure18.20showshowabitstream ofdatais
choppedinto47-bytechunksandencapsulatedincells.
The
CSsublayerdividesthebitstreaminto47-bytesegmentsandpassesthem to
theSARsublayerbelow.NotethattheCSsublayerdoesnotaddaheader.
TheSARsublayeradds1byte
ofheaderandpassesthe48-bytesegmenttothe
ATMlayer.Theheaderhastwofields:
oSequencenumber(SN).This4-bitfielddefinesasequencenumbertoorderthe
bits.Thefirstbitissometimesusedfortiming,whichleaves3bitsforsequencing
(modulo8).
oSequencenumberprotection(SNP).Thesecond4-bitfieldprotectsthefirst
field.Thefirst3bitsautomaticallycorrecttheSNfield.Thelastbitisaparitybit
thatdetectserroroverall8bits.
AAL2OriginallyAAL2wasintendedtosupportavariable-data-ratebitstream,butit
hasbeenredesigned.
Itisnowusedforlow-bit-ratetrafficandshort-frametrafficsuch
asaudio(compressedoruncompressed),video,orfax.Agoodexample ofAAL2useis
inmobiletelephony.AAL2allowsthemultiplexing
ofshortframesintoonecell.

SECTION18.2ATM 533
Figure18.20 AALl
Constant-bit-ratedatafromupperlayer
......................1110010010001111 111110101010101
..
A
I I
CS I
I I II
A
47bytes 47 bytes: 47bytes:
I I
L
tEl 00 I tillI
SAR
1 I147bytes I147bytes I II47bytes I
I I I I I
A~OO 100
I
00
I
T
I I
M 5 48bytes
I
5 48bytes
1
5 48bytes
I
SARheaderISN
4bits
SNP
4bits
SN:Sequencenumber
SNP:Sequencenumberprotection
UUI:User-to-userindication
HEC:Headererrorcontrol
SF:Startfield
Figure18.21showstheprocess ofencapsulatingashortframefromthesamesource
(thesameuser
ofamobilephone)orfromseveralsources(severalusers ofmobiletele­
phones)intoonecell.
Figure18.21 AAL2
Shortpackets
II
fromupperlayer~
A ffitj
3~t"~24 ~24
1
CS
A
1324
1
" "
I
"
~
L
[illrSAR
2 I147bytes 1 1 147bytes I
I 1 1 I
A
~OO I ~od I
T
M
5 48bytes 5 48bytes
CSheader
I
__C_IDI__LI_---.J~ HECI
8bits 6 2 3 5
SARheader
I
SFICID:Channelidentifier
'----:-8-c
bi
-ts
---
LI:Lengthindicator
PPT:Packetpayloadtype
TheCSlayeroverheadconsists offivefields:
oChannelidentifier(CID). The8-bitCIDfielddefinesthechannel(user) ofthe
shortpacket.
oLengthindicator(LI).The6-bitLIfieldindicateshowmuch ofthefinalpacket
isdata.
oPacketpayloadtype(PPT). ThePPTfielddefinesthetype ofpacket.

534 CHAPTER 18VIRTUAL-CIRCUITNETWORKS:FRAME RELAYANDATM
oUser-to-userindicator(UUI).TheUUIfieldcanbeusedbyend-to-endusers.
oHeadererrorcontrol(HEC).Thelast5bits isusedtocorrecterrors intheheader.
TheonlyoverheadattheSARlayeristhestartfield(SF)thatdefinestheoffsetfrom
thebeginning
ofthepacket.
AAL3/4Initially,AAL3wasintended
tosupportconnection-orienteddataservicesand
AAL4tosupportconnectionlessservices.
Astheyevolved,however, itbecameevident
thatthefundamentalissues
ofthetwoprotocolswerethesame.Theyhavethereforebeen
combinedintoasingleformatcalledAAL3/4.Figure18.22showstheAAL3/4sublayer.
Figure18.22
AAL3/4
Datapacketupto65,535bytes
I
A
I 1
cs [ill
Data
~I'
...
I
A I
, ,
1I
, ,
I... ,
L
~I ~
, ,
~ ~
SAR @ )~
o0 0
3/4
1
2
44 2
1 1
2 44 2 1 1
2 44 2
1
:
I
:
I I 1
A I I 1 1
T
-+-[[1 I[[] I..olliJ I
M 5 48bytes 5 48bytes 5 48bytes
CSheader
I
CPII~
8bits 8
CStrailer
I
AL~
8bits 8
BAsize
16
L
16
CPI:Commonpartidentifier
Btag:Beginningtag
BAsize:Bufferallocationsize
AL:Alignment
Etag:Endingtag
L:Length
SARheader
~I MID
2 4 10
SARtrailer~I CRC
6 10
ST:Segmenttype
SN:Sequencenumber
MID:Multiplexingidentifier
LI:Lengthidentifier
CRC:Errordetector
TheCSlayerheaderandtrailerconsist ofsixfields:
oCommonpartidentifier(CPI).TheCPIdefineshowthesubsequentfieldsareto
beinterpreted.Thevalueatpresentis
O.
oBegintag(Btag).Thevalueofthisfieldisrepeatedineach ceUtoidentifyallthe
cellsbelonging
tothesamepacket.Thevalue isthesameastheEtag(seebelow).
oBufferallocationsize(BAsize).The2-byteBAfieldtellsthereceiverwhatsize
buffer
isneededforthecomingdata.
oAlignment(AL).TheI-byteALfieldisincludedtomaketherestofthetrailer
4byteslong.
oEndingtag(Etag).TheI-byteETfieldserves asanendingflag.Itsvalueisthe
sameasthatofthebeginningtag.
oLength(L).The2-byteLfieldindicatesthelength ofthedataunit.

SECTION18.2ATM 535
TheSARheaderandtrailerconsistoffivefields:
oSegmenttype(ST).The2-bitSTidentifierspecifiesthepositionofthesegment
inthemessage:beginning(00),middle(01),orend(10).Asingle-segmentmessage
has
anSTof11.
oSequencenumber(SN).Thisfieldisthesameasdefinedpreviously.
oMultiplexingidentifier(MID).The10-bitMIDfieldidentifiescellscomingfrom
differentdataflowsandmultiplexedonthesamevirtualconnection.
oLengthindicator(LI).Thisfielddefineshowmuchofthepacket isdata,not
padding.
oCRC.Thelast 10bitsofthetrailerisaCRCfortheentiredataunit.
AALSAAL3/4providescomprehensivesequencinganderrorcontrolmechanisms
thatarenotnecessaryforeveryapplication.Fortheseapplications,thedesigners
of
ATMhaveprovidedafifthAALsublayer,calledthesimple andefficientadaptation
layer(SEAL).AALSassumesthatallcellsbelongingtoasinglemessagetravel
sequentiallyandthatcontrolfunctionsareincludedintheupperlayers
ofthesending
application.Figure18.23showstheAAL5sublayer.
Figure
18.23AAL5
Datapacketup
tof55,535bytes
I I
A
I I
CS
I
Data
~K ,
i
I} I
I , "-
I I
I
, ,
I
L
II
, ,
I I
SAR 11...,I
5 I48bytes I :48bytes I I48bytes I
II,'
I I I I I I
A
...-[[jI[RJ I[[II
T •••
M 548bytes 548bytes 548bytes
CStrailer~_L_...J.-. __C_RC_--,
8 8 16 32
UU:Channelidentifier
CPI:Commonpartidentifier
L:Length
CRC:Errordetector
ThefourtrailerfieldsintheCSlayerare
oUser-to-user(UU).Thisfieldisusedbyendusers,asdescribedpreviously.
oCommonpartidentifier(CPI).Thisfieldisthesame asdefinedpreviously.
oLength(L).The2-byteLfieldindicatesthelength oftheoriginaldata.
oCRC.Thelast4bytesisforerrorcontrolontheentiredataunit.
CongestionControl andQualityofService
ATMhasaverydevelopedcongestioncontrolandquality ofservicethatwediscussin
Chapter24.

536 CHAPTER 18VIRTUAL-CIRCUITNETWORKS:FRAME RELAYANDATM
18.3ATMLANs
ATMismainlyawide-areanetwork(WANATM);however,thetechnologycanbe
adaptedtolocal-areanetworks(ATMLANs).Thehighdatarate
ofthetechnology(155
and622Mbps)hasattractedtheattention
ofdesignerswhoarelookingforgreaterand
greaterspeedsinLAN
s.Inaddition,ATMtechnologyhasseveraladvantagesthatmake
itanidealLAN:
oATMtechnologysupportsdifferenttypes ofconnectionsbetweentwoendusers.It
supportspermanentandtemporaryconnections.
oATMtechnologysupportsmultimediacommunicationwithavariety ofbandwidths
fordifferentapplications.Itcanguaranteeabandwidth
ofseveralmegabitspersecond
forreal-timevideo.Itcanalsoprovidesupportfortext
transfer.duringoff-peakhours.
oAnATMLANcanbeeasilyadaptedforexpansioninanorganization.
ATMLANArchitecture
Today,wehavetwowaystoincorporateATMtechnologyinaLANarchitecture:creating
a
pureATMLANormakingalegacy ATMLAN.Figure18.24showsthetaxonomy.
Figure18.24ATMLANs
_______ Mixed
architecture
PureATMArchitecture
InapureATMLAN,an ATMswitchisusedtoconnectthestations inaLAN,in
exactlythesamewaystationsareconnectedtoanEthernetswitch.Figure18.25shows
thesituation.
Inthisway,stationscanexchangedataatone
oftwostandardrates ofATMtech­
nology(155and652Mbps).However,thestationusesavirtualpathidentifier(VPI)
andavirtualcircuitidentifier
(Vel),insteadofasourceanddestinationaddress.
Thisapproachhasamajordrawback.Thesystemneedstobebuiltfromtheground
up;existingLANscannotbeupgradedintopureATMLANs.
LegacyLANArchitecture
AsecondapproachistouseATMtechnologyasabackbonetoconnecttraditional
LANs.Figure18.26showsthisarchitecture,alegacy
ATMLAN.

SECTION18.3ATMLANs 537
Figure18.25PureATMLAN
ATMswitch
~
Station
Station
Station
Station
Figure18.26LegacyATMLAN
Station
Station
Converter
ATMswitch
Ethernet
StationStation
Station
Station
Inthisway,stationsonthesameLANcanexchangedataattherateandformat of
traditionalLANs(Ethernet,TokenRing,etc.).Butwhentwostationsontwodifferent
LANsneedtoexchangedata,theycangothroughaconvertingdevicethatchangesthe
frameformat.TheadvantagehereisthatoutputfromseveralLANscanbemultiplexed
togethertocreateahigh-data-rateinputtotheATMswitch.Thereareseveralissues
thatmustberesolvedfirst.
MixedArchitecture
Probablythebestsolutionistomixthetwopreviousarchitectures.Thismeanskeeping
theexistingLANsand,atthesametime,allowingnewstationstobedirectlyconnected
toan
ATMswitch.Themixed architectureLANallowsthegradualmigration oflegacy
LANsonto
ATMLANsbyaddingmoreandmoredirectlyconnectedstationstothe
switch.Figure18.27showsthisarchitecture.
Again,thestationsinonespecificLANcanexchangedatausingtheformatand
datarate
ofthatparticularLAN.ThestationsdirectlyconnectedtotheATMswitchcan
usean
ATMframetoexchangedata.However,theproblemis,Howcanastationina

538 CHAPTER 18VIRTUAL-CIRCUITNETWORKS:FRAME RELAYANDATM
Figure18.27 Mixedarchitecture ATMIAN
--~
ATMstation
ATMstation
ATMswitch
StationStation Station
Station
Station
traditionalLANcommunicatewithastationdirectlyconnectedtothe ATMswitchor
viceversa?
Weseehowtheproblemisresolved now.
LANEmulation(LANE)
Atthesurfacelevel,theuseof ATMtechnologyinLANsseemslikeagoodidea.However,
manyissuesneedtoberesolved,
assummarizedbelow:
oConnectionlessversusconnection-oriented.TraditionalLANs,such asEthernet,
are
connectionlessprotocols. Astationsendsdatapacketstoanotherstationwhen­
everthepacketsareready.Thereisno
connectionestablishment orconnection
termination
phase.Ontheotherhand, ATMisaconnection-orientedprotocol; a
stationthatwishestosendcellstoanotherstationmustfirstestablishaconnection
and,afterallthecellsaresent,terminatetheconnection.
oPhysicaladdressesversusvirtual-circuitidentifiers.Closelyrelatedtothefirst
issueisthedifferenceinaddressing.Aconnectionlessprotocol,such
asEthernet,
definestheroute
ofapacketthrough sourceanddestinationaddresses. However,a
connection-orientedprotocol,suchasATM,definestheroute
ofacellthrough
virtualconnectionidentifiers(VPIsandVCIs).
oMulticastingandbroadcastingdelivery.TraditionalLANs,such asEthernet,
canboth
multicastandbroadcastpackets;astationcansendpacketstoagroup
ofstationsortoallstations.Thereisnoeasywaytomulticastorbroadcastonan
ATMnetworkalthoughpoint-to-multipointconnectionsareavailable.
oInteroperability.Inamixedarchitecture,astationconnectedtoalegacyLAN
mustbeabletocommunicatewithastationdirectlyconnectedtoan
ATMswitch.
Anapproachcalledlocal-areanetworkemulation(LANE)solvestheabove-mentioned
problemsandallowsstationsinamixedarchitecturetocommunicatewithoneanother.
Theapproachusesemulation.Stationscanuseaconnectionlessservicethatemulatesa
connection-orientedservice.Stationsusethesourceanddestinationaddressesforinitial

SECTION18.3ATMLANs 539
connectionandthenuseVPIandVCIaddressing.Theapproachallowsstationstouse
unicast,multicast,andbroadcastaddresses.Finally,theapproachconvertsframesusinga
legacyformat
toATMcellsbeforetheyaresentthroughtheswitch.
Client/ServerModel
LANEisdesignedasa client/servermodeltohandlethe fourpreviouslydiscussed
problems.Theprotocoluses onetype
ofclientandthreetypes ofservers,asshownin
Figure18.28.
Figure18.28Clientandserversina LANE
LEes
LES
BUS
LANEmulationClient
AllATMstationshaveLANemulationclient(LEC)softwareinstalledontop ofthe
threeATMprotocols.Theupper-layerprotocolsareunaware
oftheexistenceofthe
ATMtechnology.TheseprotocolssendtheirrequeststoLECforaLANservicesuchas
connectionlessdeliveryusingMACunicast,multicast,orbroadcastaddresses.TheLEC,
however,justinterpretstherequestandpassestheresultontotheservers.
LANEmulationConfigurationServer
TheLAN emulationconfigurationserver(LECS)isusedfortheinitialconnection
betweentheclientandLANE.Thisserverisalwayswaiting
toreceivetheinitialcontact.
It
hasawell-knownATMaddressthatisknowntoeveryclientinthesystem.
LANEmulationServer
LANemulationserver(LES)softwareisinstalledontheLES.Whenastation
receivesaframetobesenttoanotherstationusingaphysicaladdress,LECsendsa
specialframetotheLES.Theservercreatesavirtualcircuitbetweenthesourceandthe
destinationstation.Thesourcestationcannowusethisvirtualcircuit(andthecorre­
spondingidentifier)
tosendtheframeorframes tothedestination.
Broadcast/UnknownServer
Multicastingandbroadcastingrequiretheuse ofanotherservercalledthe broadcast!
unknownserver(BUS).Ifastationneedstosendaframetoagroup ofstationsorto
everystation,theframefirstgoes
totheBUS;thisserverhaspermanentvirtualconnec­
tionstoeverystation.Theservercreatescopiesofthereceivedframeandsendsacopy
toagroup
ofstationsortoallstations,simulatingamulticastingorbroadcastingprocess.

540 CHAPTER 18ViRTUAL-CIRCUITNETWORKS:FRAME REIAYANDATM
Theservercanalsodeliveraunicastframe bysendingtheframetoeverystation.Inthis
casethedestinationaddressisunknown.Thisissometimesmoreefficientthangetting
theconnectionidentifierfromtheLES.
MixedArchitecturewithClient/Server
Figure18.29showsclientsandserversinamixedarchitectureATMLAN.Inthefigure,
threetypes
ofserversareconnectedtotheATMswitch(theycanactuallybepart ofthe
switch).Alsoweshowtwotypes
ofclients.StationsAandB,designedtosendandreceive
LANEcommunication,aredirectlyconnected
totheATMswitch.StationsC,D,E, F,G,
andHintraditionallegacyLANsareconnectedtotheswitchviaaconverter.Thesecon­
vertersactasLECclientsandcommunicate
onbehalfoftheirconnectedstations.
Figure18.29 Amixedarchitecture ATMIANusingIANE
Upper
layers
ATM
LEC
AAL
ATM
AAL
BUS
Upper
layers
Upper
layers
Physical
Physical
ATMswitch
ATM
LES
AAL
Physical
LECS
ATM
AAL
Upper
layers
LEC
AAL
Upper
layers
Physical
f---:::-:=-..;A:.:;,;TM=--1JLEC
Physical
(client)
Converter
software
Converter
software
LEC
MAC AAL
ATM
PhysicalPhysical
LEC
AAL MAC
ATM
PhysicalPhysical
LEC
(client)
Station Station
18.4RECOMMENDED READING
Formoredetailsaboutsubjectsdiscussedinthischapter,werecommendthefollowing
books.Theitemsinbrackets[
...]refertothereferencelistattheend ofthetext.

SECTION18.6SUMMARY 541
Books
FrameRelayandATMarediscussedinChapter3 of[Sta98].ATMLANisdiscussed
inChapter14
of[For03].Chapter7 of[Kei02]alsohasagooddiscussion ofATM
LANs.
18.5KEYTERMS
AALI
AAL2
AAL3/4
AAL5
applicationadaptationlayer(AAL)
AsynchronousTransferMode
(ATM)
ATMlayer
ATMswitch
backwardexplicitcongestionnotification
(BECN)
bandwidthondemand
broadcast/unknownserver(BUS)
burstydata
cell
cellnetwork
cellrelay
client/servermodel
congestioncontrol
conyergencesublayer(CS)
data
linkconnectionidentifier
(DLCI)
discardeligibility(DE)
forwardexplicitcongestionnotification
(FECN)
FrameRelay
FrameRelayassembler/disassembler
(FRAD)
LANemulationclient(LEC)
LANemulationconfigurationserver
(LECS)
LANemulationserver(LES)
legacy
ATMLAN
local-areanetworkemulation(LANE)
LocalManagementInformation(LMI)
mixedarchitectureLAN
network-to-networkinterface(NNI)
permanentvirtualcircuit(PVC)
pureATMLAN
qualityofservice(QoS)
segmentationandreassembly(SAR)
simpleandefficientadaptationlayer
(SEAL)
switchedvirtualcircuit(SVC)
transmissionpath(TP)
user-to-networkinterface(UNI)
virtualcircuit(VC)
virtual-circuitidentifier(VCl)
virtualpath(VP)
virtualpathidentifier(VPI)
VoiceOverFrameRelay(VOFR)
X.25
18.6SUMMARY
oVirtual-circuitswitchingisadatalinklayertechnologyinwhichlinksareshared.
oAvirtual-circuitidentifier(VCI)identifiesaframebetweentwoswitches.
oFrameRelayisarelativelyhigh-speed,cost-effectivetechnologythatcanhandle
burstydata.

542 CHAPTER 18VIRTUAL-CIRCUITNETWORKS:FRAME RELAYANDATM
DBothPVCandSVCconnectionsareusedinFrameRelay.
DThedatalinkconnectionidentifier(DLCI)identifiesavirtualcircuitinFrameRelay.
oAsynchronousTransferMode(ATM)isacellrelayprotocolthat,incombination
withSONET,allowshigh-speedconnections.
oAcellisasmall,fixed-sizeblock ofinformation.
DTheATMdatapacketisacellcomposed of53bytes(5bytesofheaderand48bytes
ofpayload).
DATMeliminatesthevaryingdelaytimesassociatedwithdifferent-sizepackets.
DATMcanhandlereal-timetransmission.
oAuser-to-networkinterface(UNI) istheinterfacebetweenauserandanATMswitch.
oAnetwork-to-networkinterface(NNI)istheinterfacebetweentwoATMswitches.
DInATM,connectionbetweentwoendpointsis
accomplisheClthroughtransmission
paths(TPs),virtualpaths(VPs),andvirtualcircuits(VCs).
DInATM,acombination ofavirtualpathidentifier(VPI)andavirtual-circuit
identifieridentifiesavirtualconnection.
oTheATMstandarddefinesthreelayers:
a.Applicationadaptationlayer(AAL)acceptstransmissionsfromupper-layer
servicesandmapsthemintoATMcells.
b.ATMlayerprovidesrouting,trafficmanagement,switching,andmultiplexing
serVIces.
c.Physical layerdefinesthetransmissionmedium,bittransmission,encoding,and
electrical-to-opticaltransformation.
DTheAALisdividedintotwosublayers:convergencesublayer(CS)andsegmentation
andreassembly(SAR).
oTherearefourdifferentAALs,eachforaspecificdatatype:
a.AALIforconstant-bit-ratestream.
b.AAL2forshortpackets.
c.AAL3/4forconventionalpacketswitching(virtual-circuitapproachordatagram
approach).
d.AAL5forpacketsrequiringnosequencingandnoerrorcontrolmechanism.
DATMtechnologycanbeadoptedforuseinaLAN(ATMLAN).
DInapureATMLAN,anATMswitchconnectsstations.
DInalegacyATMLAN,thebackbonethatconnectstraditionalLANsusesATM
technology.
oAmixedarchitectureATMLANcombinesfeatures ofapureATMLANanda
legacyATMLAN.
DLocal-areanetworkemulation(LANE)isaclient/servermodelthatallowstheuse
ofATMtechnologyinLAN s.
DLANEsoftwareincludesLANemulationclient(LECS),LANemulationconfigu­
rationserver(LECS),LANemulationserver(LES),andbroadcast/unknownserver
(BUS)modules.

SECTION18.7PRACTICESET 543
18.7PRACTICESET
ReviewQuestions
1.TherearenosequencenumbersinFrameRelay.Why?
2.CantwodevicesconnectedtothesameFrameRelaynetworkusethesame
DLCIs?
3.WhyisFrameRelayabettersolutionforconnectingLANsthan T-llines?
4.CompareanSVCwitha PVc.
5.DiscusstheFrameRelayphysicallayer.
6.Whyismultiplexingmoreefficient ifallthedataunitsarethesamesize?
7.HowdoesanNNIdifferfromaUNI?
8.WhatistherelationshipbetweenTPs,VPs,andVCs?
9.Howisan ATMvirtualconnectionidentified?
10.Namethe ATMlayersandtheirfunctions.
11.HowmanyvirtualconnectionscanbedefinedinaUNI?Howmanyvirtualconnec­
tionscanbedefinedinanNNI?
12.Brieflydescribetheissuesinvolvedinusing ATMtechnologyinLANs.
Exercises
13.Theaddressfield ofaFrameRelayframeis1011000000010111.What istheDLCI
(indecimal)?
14.Theaddressfield ofaFrameRelayframeis101100000101001.Isthisvalid?
15.FindtheDLCIvalueifthefirst3bytesreceivedis7C74 Elinhexadecimal.
16.Findthevalue ofthe2-byteaddressfieldinhexadecimal iftheDLCIis178.
Assumenocongestion.
17."InFigure18.30avirtualconnectionisestablishedbetweenAandB.Showthe
DLCIforeachlink.
Figure18.30 Exercise17

544 CHAPTER18VIRTUAL-CIRCUITNETWORKS:FRAME RELAYANDATM
18.InFigure18.31avirtualconnectionisestablishedbetweenAandB.Showthe
correspondingentriesinthetables
ofeachswitch.
Figure18.31Exercise18
DLCI=233 DLCI= 111DLCI= 99
19.AnAALllayerreceivesdataat2Mbps.Howmanycellsarecreatedpersecondby
the
ATMlayer?
20.Whatisthetotalefficiency ofATMusingAAL1(theratio ofreceivedbitstosent
bits)?
21.
IfanapplicationusesAAL3/4andthereare47,787bytes ofdatacomingintothe
CS,howmanypaddingbytesarenecessary?Howmanydataunitsgetpassedfrom
theSARtotheATMlayer?Howmanycellsareproduced?
22.Assumingnopadding,doestheefficiency
ofATMusingAAL3/4dependonthesize
ofthepacket?Explainyouranswer.
23.Whatistheminimumnumber
ofcellsresultingfromaninputpacketintheAAL3/4
layer?What
isthemaximumnumber ofcellsresultingfromaninputpacket?
24.Whatistheminimumnumber
ofcellsresultingfromaninputpacketintheAAL5
layer?What
isthemaximumnumber ofcells resultingfromaninputpacket?
25.ExplainwhypaddingisunnecessaryinAAL1,butnecessaryinotherAALs.
26.UsingAAL3/4,showthesituationwhereweneed
ofpadding.
a.0bytes (nopadding)
b.40bytes
c.43bytes
27.UsingAAL5,showthesituationwhereweneed
ofpadding.
a.0bytes(nopadding)
b.40bytes
c.47bytes
28.Ina53-bytecell,howmanybytesbelongtotheuserinthefollowing(assumeno
padding)?
a.AALI
b.AAL2
c.AAL3/4(notthefirstorlastcell)
d.AAL5(notthefirstorlastcell)

SECTION18.7PRACTICE SET 545
ResearchActivities
29.Findoutabout1.150protocolthatprovidesgenericflowcontrolforUNIinterface.
30.
ATMusesthe8-bit HEe(headererrorcontrol)fieldtocontrolerrorsinthefirstfour
bytes(32bits)
oftheheader.Thegeneratingpolynomialis x
8
+x
2
+X+1.Findout
howthisisdone.
31.Findtheformat oftheLANEframesandcompareitwiththeformat oftheEthernet
frame.
32.Findoutaboutdifferentstepsinvolvedintheoperation
ofaLANE.

NetworkLayer
Objectives
Thenetworklayerisresponsibleforthesource-to-destinationdelivery ofapacket,possi­
blyacrossmultiplenetworks(links).Whereasthedatalinklayeroverseesthedelivery
of
thepacketbetweentwosystemsonthesamenetwork(links),thenetworklayerensures
thateachpacketgetsfromitspoint
oforigintoitsfinaldestination.
Thenetworklayerisresponsibleforthedelivery ofindividual
packets
fromthesourcetothedestinationhost.
Thenetworklayeraddsaheaderthatincludesthelogicaladdresses ofthesender
andreceivertothepacketcorningfromtheupperlayer.
Ifapackettravelsthroughthe
Internet,weneedthisaddressingsystemtohelpdistinguishthesourceanddestination.
Whenindependentnetworksorlinksareconnectedtogethertocreateaninternet­
work,routersorswitchesroutepackets
totheirfinaldestination.One ofthefunctions
ofthenetworklayeristoprovidearoutingmechanism.
InPart4
ofthebook,wefirstdiscusslogicaladdressing (referredto asIPaddressing
intheInternet).
Wethendiscussthemainaswellassomeauxiliaryprotocolsthatare
responsibleforcontrollingthedelivery ofapacketfromitssourcetoitsdestination.
Part4ofthebookisdevoted tothenetworklayerand
theservicesprovided bythislayer.
Chapters
Thispartconsists offourchapters:Chapters 19to22.
Chapter19
Chapter19discusseslogicalorIPaddressing. Wefirstdiscussthehistoricalclassful
addressing.
Wethendescribethenewclasslessaddressingdesignedtoalleviatesome
problemsinherentinclassfuladdressing.Thecompletelynewaddressingsystem,IPv6,
whichmaybecomeprevalentinthenearfuture,isalsodiscussed.

Chapter20
Chapter20isdevoted tothemainprotocolatthenetworklayerthatsupervisesandcon­
trolsthedelivery
ofpacketsfromthesource todestination.Thisprotocol iscalledthe
InternetProtocolor
IP.
Chapter21
Chapter21isdevotedtosomeauxiliaryprotocolsdefinedatthenetworklayer,that
helptheIPprotocoldoitsjob.Theseprotocolsperformaddressmapping(logical
to
physicalorviceversa),errorreporting,andfacilitatemulticastdelivery.
Chapter22
Deliveryandrouting ofpacketsintheInternet isavery
delicat~andimportantissue.
WedevoteChapter22 tothismatter.Wefirstdiscussthemechanism ofdeliveryand
routing.
Wethenbrieflydiscusssomeunicastandmulticastroutingprotocolsused in
theInternettoday.

CHAPTER19
NetworkLayer:
LogicalAddressing
AswediscussedinChapter2,communicationatthenetworklayeris
host-to-host
(computer-to-computer);acomputersomewhereintheworldneedstocommunicate
withanothercomputersomewhereelseintheworld.Usually,computerscommunicate
throughtheInternet.Thepackettransmittedbythesendingcomputermaypassthrough
severalLANsorWANsbeforereachingthedestinationcomputer.
Forthislevel
ofcommunication,weneedaglobaladdressingscheme;wecalled
thislogicaladdressinginChapter
2.Today,weusetheterm IPaddresstomeanalogical
addressinthenetworklayer
oftheTCP/IPprotocolsuite.
TheInternetaddressesare32bitsinlength;thisgivesusamaximum of2
32
addresses.TheseaddressesarereferredtoasIPv4(IPversion4)addressesorsimplyIP
addresses
ifthereisnoconfusion.
Theneedformoreaddresses,inaddition
tootherconcernsabouttheIPlayer,
moti­
vatedanewdesign oftheIPlayercalledthenewgeneration ofIPorIPv6(lPversion6).
Inthisversion,theInternetuses 128-bitaddressesthatgivemuch greaterflexibilityin
addressallocation.Theseaddressesarereferred
toasIPv6(IPversion6)addresses.
Inthischapter,wefirstdiscussIPv4addresses,whicharecurrentlybeingusedinthe
Internet.
WethendiscusstheIPv6addresses,whichmaybecomedominantinthefuture.
19.1IPv4ADDRESSES
AnIPv4addressisa32-bitaddressthat uniquelyanduniversallydefinestheconnection
ofadevice(forexample,acomputerorarouter)totheInternet.
AnIPv4addressis32bitslong.
IPv4addressesareunique.Theyareuniqueinthesensethateachaddressdefines
one,andonlyone,connectiontotheInternet.TwodevicesontheInternetcannever
havethesameaddressatthesametime.
Wewillseelaterthat,byusingsomestrategies,
anaddressmaybeassignedtoadeviceforatimeperiodandthentakenawayand
assignedtoanotherdevice.
549

550 CHAPTER 19NETWORKIAYER:LOGICALADDRESSING
Ontheotherhand, ifadeviceoperatingatthenetworklayerhas mconnectionsto
theInternet,
itneedstohave maddresses.Wewillseelaterthatarouterissucha
device.
TheIPv4addressesareuniversalinthesensethattheaddressingsystemmustbe
acceptedbyanyhostthatwantstobeconnectedtotheInternet.
TheIPv4addressesareunique anduniversal.
AddressSpace
Aprotocolsuch asIPv4thatdefinesaddresseshasan addressspace.Anaddressspace
isthetotalnumber
ofaddressesusedbytheprotocol. Ifaprotocoluses Nbitstodefine
anaddress,theaddressspace
is2
N
becauseeachbitcanhavetwodifferentvalues(0or 1)
andNbitscanhave 2
N
values.
IPv4uses32-bitaddresses,whichmeansthattheaddressspaceis2
32
or
4,294,967,296(morethan4billion).Thismeansthat,theoretically,
iftherewereno
restrictions,morethan4billiondevicescouldbeconnectedtotheInternet.
Wewillsee
shortlythattheactualnumberismuchlessbecause
oftherestrictionsimposedonthe
addresses.
Theaddressspace ofIPv4is2
32
or4,294,967,296.
Notations
TherearetwoprevalentnotationstoshowanIPv4address: binarynotationanddotted­
decimalnotation.
BinaryNotation
Inbinarynotation,theIPv4addressisdisplayed
as32bits.Eachoctetisoftenreferred
to
asabyte.SoitiscommontohearanIPv4addressreferredto asa32-bitaddressora
4-byteaddress.Thefollowingis
anexampleofanIPv4addressinbinarynotation:
01110101100101010001110100000010
Dotted-DecimalNotation
TomaketheIPv4addressmorecompactandeasiertoread,Internetaddressesareusu­
allywrittenindecimalformwithadecimalpoint(dot)separatingthebytes.Thefol­
lowingisthe
dotted~decimal notationoftheaboveaddress:
117.149.29.2
Figure19.1showsanIPv4addressinbothbinaryanddotted-decimalnotation.
Notethatbecauseeachbyte(octet)is8bits,eachnumberindotted-decimalnotationis
avaluerangingfrom0to255.

SECTION19.1IPv4ADDRESSES 551
Figure19.1Dotted-decimalnotationandbinarynotationforanIPv4address
10000000 0000 10II 00000011 00011111
-----~/-----­
128.11.3.31
NumberingsystemsarereviewedinAppendixB.
Example19.1
ChangethefollowingIPv4addressesfrombinarynotation todotted-decimalnotation.
a.10000001000010110000101111101111
b.11000001100000110001101111111111
Solution
Wereplaceeachgroup of8bitswithitsequivalentdecimalnumber(seeAppendixB)andadd
dotsforseparation.
a.129.11.11.239
b.193.131.27.255
Example19.2
ChangethefollowingIPv4addressesfromdotted-decimalnotationtobinarynotation.
a.111.56.45.78
b.221.34.7.82
Solution
Wereplaceeachdecimalnumberwithitsbinaryequivalent(seeAppendixB).
a
.•01101111001110000010110101001110
b.11011101001000100000011101010010
Example19.3
Findtheerror, ifany,inthefollowingIPv4addresses.
a.111.56.045.78
b.221.34.7.8.20
c.75.45.301.14
d.11100010.23.14.67
Solution
a.Theremustbenoleadingzero(045).
b.TherecanbenomorethanfournumbersinanIPv4address.
c.Eachnumberneedstobelessthanorequalto255(301isoutsidethisrange).
d.Amixtureofbinarynotationanddotted-decimalnotationisnotallowed.

552 CHAPTER 19NETWORKLAYER:LOGICALADDRESSING
ClassfulAddressing
IPv4addressing,atitsinception,usedtheconcept ofclasses.Thisarchitectureiscalled
classfuladdressing.Althoughthisschemeisbecomingobsolete,webrieflydiscussit
here
toshowtherationalebehindclasslessaddressing.
Inclassfuladdressing,theaddressspaceisdividedintofiveclasses:
A,B,C,D,
andE.Eachclassoccupiessomepart oftheaddressspace.
Inclassfuladdressing, theaddressspaceisdividedintofiveclasses:
A,B,C,D,
andE.
Wecanfindtheclass ofanaddresswhengiventheaddressinbinarynotation
ordotted-decimalnotation. Iftheaddressisgiveninbinarynotation,thefirstfew
bitscanimmediatelytellustheclass
oftheaddress.Iftheaddressisgivenin
decimal-dottednotation,thefirstbytedefinestheclass.Bothmethodsareshownin
Figure19.2.
Figure
19.2Finding theclasses inbinaryanddotted-decimalnotation
FirstSecondThirdFourth FirstSecondThirdFourth
byte byte byte byte byte byte byte byte
ClassA
0 II II
II
ClassAI0-127II II II
ClassB 10 II IIII
ClassB 1128-19111II II
ClassC 110II IIII
ClassC 1192-22311II II
ClassD 1110II IIII
ClassD 1224--23911II II
ClassE 1111II II II
ClassE 1240-25511II II
a.Binarynotation b.Dotted-decimalnotation
Example19.4
Findtheclass ofeachaddress.
a.00000001 000010110000101111101111
b.11000001100000110001101111111111
c.14.23.120.8
d.252.5.15.111
Solution
a.Thefirstbitis O.ThisisaclassAaddress.
b.Thefirst2bitsare 1;thethirdbitis O.ThisisaclassCaddress.
c.Thefirstbyteis 14(between0and127);theclassis A.
d.Thefirstbyteis252(between240and255);theclassisE.

SECTION19.1IPv4ADDRESSES 553
ClassesandBlocks
Oneproblemwithclassfuladdressingisthateachclassisdividedintoafixednumber
ofblockswitheachblockhavingafixedsize asshowninTable19.1.
Table19.1
NumberofblocksandblocksizeinclassfulIPv4addressing
Class Number
ofBlocks BlockSize Application
A 128 16,777,216 Unicast
B 16,384 65,536 Unicast
C 2,097,152 256 Unicast
D 1 268,435,456 Multicast
E 1
268,435.456 Reserved
Letusexaminethetable.Previously,whenanorganizationrequestedablock of
addresses,itwasgrantedoneinclass A,B,orC.ClassAaddressesweredesignedfor
largeorganizationswithalargenumber
ofattachedhostsorrouters.ClassBaddresses
weredesignedformidsizeorganizationswithtens
ofthousandsofattachedhostsor
routers.ClassCaddressesweredesignedforsmallorganizationswithasmallnumberof
attachedhostsorrouters.
Wecanseetheflawinthisdesign.AblockinclassAaddressistoolargefor
almostanyorganization.Thismeansmost
oftheaddressesinclassAwerewastedand
werenotused.AblockinclassBisalsoverylarge,probablytoolargeformany
ofthe
organizationsthatreceivedaclassBblock.AblockinclassCisprobablytoosmallfor
manyorganizations.ClassDaddressesweredesignedformulticasting
aswewillseein
alaterchapter.Eachaddressinthisclassisusedtodefineonegroup
ofhostsonthe
Internet.TheInternetauthoritieswronglypredictedaneedfor268,435,456groups.
Thisneverhappenedandmanyaddresseswerewastedheretoo.Andlastly,theclassE
addresseswerereservedforfutureuse;onlyafewwereused,resultinginanotherwaste
ofaddresses.
«
Inc1assfnladdressing,alargepartoftheavailableaddresseswerewasted.
NetidandHostid
Inclassfuladdressing, anIPaddressinclassA,B,orCisdividedintonetidandhostid.
Thesepartsare
ofvaryinglengths,dependingontheclass oftheaddress.Figure19.2
showssomenetidandhostidbytes.Thenetidisincolor,thehostidisinwhite.Notethat
theconceptdoesnotapplytoclassesDandE.
Inclass
A,onebytedefinesthenetidandthreebytesdefinethehostid.InclassB,
twobytesdefinethenetidandtwobytesdefinethehostid.InclassC,threebytesdefine
thenetidandonebytedefinesthehostid.
Mask
Althoughthelengthofthenetidandhostid(inbits) ispredeterminedinclassfuladdress­
ing,wecanalsousea
mask(alsocalledthedefaultmask),a32-bitnumbermade of

554 CHAPTER 19NETWORKlAYER:LOG1CALADDRESSING
contiguousIsfollowedbycontiguousas.ThemasksforclassesA,B,andCareshown
inTable19.2.TheconceptdoesnotapplytoclassesD and
E.
Table19.2 Defaultmasks forclassfuladdressing
Class Binary Dotted-Decimal CIDR
A 111111110000000000000000 00000000 255.0.0.0 18
B 11111111 1111111100000000 00000000 255.255.0.0 116
C 1111111111111111 1111111100000000 255.255.255.0 124
Themaskcanhelpustofindthenetidandthehostid.Forexample,themaskfora
classAaddresshaseight1s,whichmeansthefirst8bits
ofanyaddressinclassA
definethe
netid;thenext24bitsdefinethehostid.
Thelast column
ofTable19.2showsthemaskintheform Inwherencanbe 8,16,
or24inclassfuladdressing.Thisnotationisalsocalledslashnotation orClassless
InterdomainRouting(CIDR) notation.Thenotationisusedinclasslessaddressing,
whichwewilldiscusslater.
Weintroduceitherebecauseitcanalsobeappliedtoclass­
fuladdressing.Wewillshowlaterthatclassfuladdressingisaspecialcase
ofclassless
addressing.
Subnetting
Duringtheera ofclassfuladdressing, subnettingwasintroduced.Ifanorganizationwas
grantedalargeblockinclassAorB,itcoulddividetheaddressesintoseveralcontiguous
groupsandassigneachgrouptosmallernetworks(called
subnets)or,inrarecases,
sharepart
oftheaddresseswithneighbors.Subnettingincreasesthenumber ofIsinthe
mask,aswewillseelaterwhenwediscussclasslessaddressing.
Supernetting
Thetimecamewhenmost oftheclassA andclassBaddressesweredepleted;however,
therewasstillahugedemandformidsizeblocks.Thesize
ofaclassCblockwitha
maximumnumber
of256addressesdidnotsatisfytheneeds ofmostorganizations.
Evenamidsizeorganizationneededmoreaddresses.Onesolutionwas
supernetting.
Insupernetting,anorganizationcancombineseveralclassCblockstocreatealarger
range
ofaddresses.Inotherwords,severalnetworksarecombinedtocreateasuper­
networkora
supemet.Anorganizationcanapplyforaset ofclassCblocksinstead of
justone.Forexample,anorganizationthatneeds1000addressescanbegrantedfour
contiguousclassCblocks.Theorganizationcanthenusetheseaddressestocreateone
supernetwork.Supernettingdecreasesthenumber
ofIsinthemask.Forexample, ifan
organizationisgivenfourclassCaddresses,themaskchangesfrom/24to/22.
Wewill
seethatclasslessaddressingeliminatedtheneedforsupernetting.
AddressDepletion
Theflawsinclassfuladdressingschemecombinedwiththefastgrowth oftheInternetled
totheneardepletion
oftheavailableaddresses.Yetthenumber ofdevicesontheInternet
ismuchlessthanthe2
32
addressspace. Wehaverunout ofclassA and Baddresses,and

SECTION19.1IPv4ADDRESSES 555
aclassC blockistoosmallfor mostmidsizeorganizations.Onesolutionthathas
alleviatedtheproblemistheidea
ofclasslessaddressing.
Classfuladdressing,whichisalmostobsolete,isreplacedwithclasslessaddressing.
ClasslessAddressing
Toovercomeaddressdepletionandgive moreorganizationsaccesstotheInternet,
classlessaddressingwasdesignedandimplemented.Inthisscheme,there areno
classes,buttheaddressesarestillgrantedinblocks.
AddressBlocks
Inclasslessaddressing,whenanentity,small orlarge,needsto beconnectedtothe
Internet,
itisgrantedablock(range) ofaddresses.Thesize oftheblock(thenumber of
addresses)variesbasedonthenatureandsize oftheentity.Forexample,ahousehold
maybegivenonlytwoaddresses;alargeorganization maybegiventhousands of
addresses.AnISP,astheInternetserviceprovider,maybegiventhousandsorhundreds
ofthousandsbasedonthenumber ofcustomersitmayserve.
RestrictionTosimplifythehandling ofaddresses,theInternetauthorities impose
threerestrictionsonclasslessaddressblocks:
1.Theaddressesinablockmustbecontiguous,oneafteranother.
2.Thenumberofaddressesinablockmust beapowerof2(I,2,4,8,...).
3.Thefirstaddressmust beevenlydivisible bythenumber ofaddresses.
Example19.5
Figure19.3showsablock ofaddresses,inbothbinaryanddotted-decimalnotation,granted toa
smallbusinessthatneeds
16addresses.
Figure19.3Ablockof16addressesgrantedtoasmallorganization
Block Block
-
First 205.16.37.32 11001101000100000010010100100000
'"<J.l
'"205.16.37.33 110011010001000000100101 00100001 '"!:l
"0
"0
-<
Last 205.16.37.47 11001101000100000010010100101111
;::;
1-
a.Decimal b.Binary
Wecanseethattherestrictionsareappliedtothisblock.Theaddressesarecontiguous.
Thenumber
ofaddressesisapower of2(16=2
4
),andthefirstaddressisdivisibleby16.The
firstaddress,whenconvertedtoadecimalnumber,is3,440,387,360,whichwhendividedby
16resultsin215,024,210.InAppendixB,weshowhowtofindthedecimalvalue ofan
IPaddress.

556 CHAPTER 19NETWORKLAYER:LOGICALADDRESSING
Mask
Abetterwaytodefineablock ofaddressesistoselectanyaddressintheblockandthe
mask.Aswediscussedbefore,amask
isa32-bitnumberinwhichthe nleftmostbits
areIsandthe32-
nrightmostbitsare Os.However,inclasslessaddressingthemask
forablockcantakeanyvaluefrom0to32.Itisveryconvenienttogivejustthevalue
ofnprecededbyaslash(CIDRnotation).
In1Pv4addressing,ablock ofaddressescanbedefinedas
x.y.z.tln
inwhichx.y.z.tdefinesone oftheaddressesandtheIndefinesthemask.
Theaddressandthe Innotationcompletelydefinethewholeblock(thefirst
address,thelastaddress,andthenumber
ofaddresses).
FirstAddressThefirstaddressintheblockcanbefoundbysettingthe32-nright­
mostbitsinthebinarynotation
oftheaddressto Os.
Thefirstaddressintheblockcanbefoundbysettingtherightmost32- nbitstoOs.
Example19.6
Ablockofaddressesisgrantedtoasmallorganization. Weknowthatone oftheaddressesis
205.16.37.39/28.Whatisthefirstaddressintheblock?
Solution
Thebinaryrepresentation ofthegivenaddressis 11001101000100000010010100100I 11.Ifwe
set
32-28 rightmostbitsto 0,weget110011010001000001001010010000 or205.16.37.32.
ThisisactuallytheblockshowninFigure 19.3.
LastAddressThelastaddressintheblockcanbefoundbysettingthe32-nright­
mostbitsinthebinarynotation
oftheaddresstoIs.
Thelastaddressintheblockcanbefoundbysettingtherightmost32-nbitstoIs.
Example19.7
FindthelastaddressfortheblockinExample 19.6.
Solution
Thebinaryrepresentation ofthegivenaddressis 11001101000100000010010100100111. Ifwe
set32-28 rightmostbitsto 1,weget1100110100010000001001010010 1111or205.16.37.47.
ThisisactuallytheblockshowninFigure 19.3.
NumberofAddressesThenumber ofaddressesintheblockisthedifferencebetween
thelastandfirstaddress.
Itcaneasilybefoundusingtheformula 2
32
-
n
.
Thenumberofaddressesintheblockcanbefoundbyusingthe formula2
32
-n

SECTION19.1IPv4ADDRESSES 557
Example19.8
Findthenumber ofaddressesinExample19.6.
Solution
Thevalueofnis28,whichmeansthatnumber ofaddressesis2
32
-
28
or16.
Example19.9
Anotherwaytofindthefirstaddress,thelastaddress,andthenumber ofaddressesistorepresent
themaskasa32-bitbinary(or8-digithexadecimal)number.This
isparticularlyusefulwhenwe
arewritingaprogramtofindthesepieces
ofinformation.InExample19.5the/28canberepre­
sented
as1111111111111111 1111111111110000(twenty-eightIsandfour Os).Find
a.Thefirstaddress
h.Thelastaddress
c.Thenumber ofaddresses
Solution
a.ThefirstaddresscanbefoundbyANDingthegivenaddresseswiththemask.ANDinghere is
donebitbybit.Theresult ofANDing2bitsis1 ifbothbitsareIs;theresultis0otherwise.
Address:
Mask:
Firstaddress:
11001101000100000010010100100111
11111111111111111111111111110000
11001101000100000010010100100000
b.ThelastaddresscanbefoundbyORingthegivenaddresseswiththecomplement ofthe
mask.ORinghereisdonebitbybit.TheresultofORing2bitsis0
ifbothbitsare Os;the
resultis1otherwise.Thecomplement
ofanumberisfound bychangingeach1to0and
each0to
1.
Address:
Maskcomplement:
Lastaddress:
11001101000100000010010100100111
0000000000000000 00000000 00001111
1100110100010000 00100101 00101111
c.Thenumber ofaddressescanbefoundbycomplementingthemask,interpreting itasa
decimalnumber,andadding1toit.
Maskcomplement:
Number
ofaddresses:
00000000000000000 00000000 00001111
15+1=16
NetworkAddresses
AveryimportantconceptinIPaddressingisthe networkaddress. Whenanorganiza­
tionisgivenablock
ofaddresses,theorganizationisfreetoallocatetheaddressesto
thedevicesthatneedtobeconnectedtotheInternet.Thefirstaddressintheclass,how­
ever,
isnormally(notalways)treatedasaspecialaddress.Thefirstaddressiscalledthe
networkaddressanddefinestheorganizationnetwork.Itdefinestheorganizationitself
totherest
oftheworld.Inalaterchapterwewillseethatthefirstaddressistheonethat
isusedbyrouterstodirectthemessagesenttotheorganizationfromtheoutside.

558 CHAPTER 19NETWORKLAYER:LOGICALADDRESSING
Figure19.4showsanorganizationthatisgranteda16-addressblock.
Figure19.4
Anetworkconfiguration fortheblock205.16.37.32/28
Restof
theInternet
Allmessageswithreceiveraddresses
205.16.37.32to205.16.37.47
arerouted
tox.y.z.t/n
-----------------------------1
1
1
I
1
1
1
1
205.16.37.46/28205.16.37.47/28
1
~ ~:
1 1
1
1
1
1
:o~i~~~~~--------------------------
:network
I
I
I
I
1205.16.37.33/28205.16.37.34/28 205.16.37.39/28
:
~. ~
I I
I
I
:Networkaddress: 205.16.37.32/28
L
~ ~ ~
TheorganizationnetworkisconnectedtotheInternetviaarouter.Therouterhas
twoaddresses.Onebelongstothegrantedblock;theotherbelongstothenetworkthat
isattheothersideoftherouter.
Wecallthesecondaddress x.y.z.t/nbecausewedonot
knowanythingaboutthenetworkitisconnectedtoattheotherside.Allmessagesdes­
tinedforaddressesintheorganizationblock(205.16.37.32to205.16.37.47)aresent,
directlyorindirectly,to
x.y.z.t/n.Wesaydirectlyorindirectlybecausewedonotknow
thestructure
ofthenetworktowhichtheothersideoftherouterisconnected.
Thefirstaddress inablockisnormallynotassignedtoanydevice; itisusedasthe
networkaddress
thatrepresentstheorganization totherestof theworld.
Hierarchy
IPaddresses,likeotheraddressesoridentifiersweencounterthesedays,havelevels of
hierarchy.Forexample,atelephonenetworkinNorthAmericahasthreelevels ofhier­
archy.Theleftmostthreedigitsdefinetheareacode,thenextthreedigitsdefinethe
exchange,thelastfourdigitsdefinetheconnection
ofthelocallooptothecentral
office.Figure19.5showsthestructureofahierarchicaltelephonenumber.
Figure19.5
HierarchyinatelephonenetworkinNorthAmerica
(I
408I)I8641-18902
1 I
:Areacode:
I
I
Exchangeoffice
It
)'1
I
I
Subscriber
It

SECTION19.1IPv4ADDRESSES 559
Two-LevelHierarchy:NoSubnetting
AnIPaddresscandefineonlytwolevels ofhierarchywhennotsubnetted.The nleft­
mostbits
oftheaddressx.y.z.tJndefinethenetwork(organizationnetwork);the 32-n
rightmostbitsdefinetheparticularhost(computer
orrouter)tothenetwork.Thetwo
commontermsareprefixandsuffix.
Thepartoftheaddressthatdefinesthenetworkis
calledthe
prefix;thepartthatdefinesthehostiscalledthesuffix.Figure19.6shows
thehierarchicalstructure
ofanIPv4address.
Figure19.6TwolevelsofhierarchyinanIPv4address
28bits 4bits
I I I
I
Networkprefix I I
Il )II I
I I
I Hostaddress I
, )1
Theprefixiscommontoalladdressesinthenetwork;thesuffixchangesfromone
devicetoanother.
Eachaddressintheblockcanbeconsideredasatwo-levelhierarchicalstructure:
theleftmost
nbits(prefix)define thenetwork;
therightmost32- nbitsdefinethehost.
Three-LevelsofHierarchy:Subnetting
Anorganizationthatisgrantedalargeblock ofaddressesmaywanttocreateclusters of
networks(calledsubnets)anddividetheaddressesbetweenthedifferentsubnets. The
restoftheworldstillseestheorganizationasoneentity;however,internallythereare
severalsubnets.Allmessagesaresenttotherouteraddressthatconnectstheorganization
totherest
oftheInternet;therouterroutesthemessagetotheappropriatesubnets.The
organization,however,needstocreatesmallsubblocks
ofaddresses,eachassignedto
specificsubnets.Theorganizationhasitsownmask;eachsubnetmustalsohaveitsown.
Asanexample,supposeanorganizationisgiventheblock17.12.40.0/26,which
contains64addresses.Theorganizationhasthreeofficesandneedstodividethe
addressesintothreesubblocks
of32,16,and16addresses.Wecanfindthenewmasks
byusingthefollowingarguments:
1.Supposethemaskforthefirstsubnetisn1,then2
32
-n1
mustbe32,whichmeans
that
n1=27.
2.Supposethemaskforthesecondsubnetisn2,then2
32
-
n2
mustbe16,which
meansthatn2
=28.
3.Supposethemaskforthethirdsubnetisn3,then2
32
-n3
mustbe16,whichmeans
thatn3
=28.
Thismeansthat
wehavethemasks27,28,28withtheorganization maskbeing26.
Figure19.7shows
oneconfigurationfortheabovescenario.

560 CHAPTER 19NETWORKLAYER:LOGICALADDRESSING
Figure19.7Configurationandaddressesinasubnettednetwork
,------------------------------------------------------------1
Subnet1 Subnet3 :
_'..,17.12.14.63/28:
I
1
1
1
_..,17.12.14.62/281
I
~
....
17.12.14.50/28
~..,17.12.14.49/28
Subnet2
00
<'1
N
~
-i
r-i
....
~
-
17.12.14.34/28 _~17.12.14.3312817.12.14.2127
r--
~
:!
E::::J:--11<'i
-
~
....
··

Network:17.12.14.11/26
x.y.z.tln
Totherestof
theInternet
Letuschecktosee ifwecanfindthesubnetaddressesfromone oftheaddressesin
thesubnet.
a.Insubnet1,theaddress17.12.14.29/27cangiveusthesubnetaddress ifweusethe
mask/27because
Host:
Mask:
Subnet:
00010001000011000000111000011101
/27
0001000100001100 0000111000000000
....(17.12.14.0)
b.Insubnet2,theaddress17.12.14.45/28cangiveusthesubnetaddress ifweusethe
mask/28because
Host:00010001000011000000111000101101
Mask:/28
Subnet:000100010000110000001110 00100000
....(17.12.14.32)
c.Insubnet3,theaddress17.12.14.50/28cangiveusthesubnetaddress ifweusethe
mask/28because
Host:00010001000011000000111000110010
Mask:/28
Subnet:00010001000011000000111000110000
....(17.12.14.48)

SECTION19.1IPv4ADDRESSES 561
Notethatapplyingthemask ofthenetwork,126,toanyoftheaddressesgivesusthe
networkaddress17.12.14.0/26.Weleavethisprooftothereader.
Wecansaythatthroughsubnetting,wehavethreelevels
ofhierarchy.Notethatin
ourexample,thesubnetprefixlengthcandifferforthesubnetsasshowninFigure19.8.
Figure19.8 Three-levelhierarchyinanIPv4address
II
Hostaddress
Subnets
2and3
26
bits
CD4bitsI
--------------J
1
I I
Networkprefix I I I
r-------"---------+l'1I I
I I
Subnetprefix I I
t+----------'----------+111I
I
I
Subnet1
26bits0
5bits
I I I I
I
Networkprefix
II I101 -II r·
I I I
I
Subnetprefix I II'
"Jrl t~
I I
I
Hostaddress II' I
MoreLevels ofHierarchy
Thestructureofclasslessaddressingdoesnotrestrictthenumber ofhierarchicallevels.
Anorganizationcandividethegrantedblock
ofaddressesintosubblocks.Eachsub­
blockcaninturn
bedividedintosmallersubblocks.Andsoon.Oneexample ofthisis
seenintheISPs.Anational
ISPcandivideagrantedlargeblockintosmallerblocks
andassigneach
ofthemtoaregionalISP.AregionalISPcandividetheblockreceived
fromthenationalISPintosmallerblocksandassigneach
onetoalocalISP.AlocalISP
candividetheblockreceivedfromtheregionalISPintosmallerblocksandassigneach
onetoadifferentorganization.Finally,anorganizationcandividethereceivedblock
andmakeseveralsubnetsout
ofit.
AddressAllocation
Thenextissueinclasslessaddressingisaddressallocation.Howaretheblocksallocated?
Theultimateresponsibility
ofaddressallocationisgiventoaglobalauthoritycalledthe
InternetCorporationforAssignedNamesandAddresses (ICANN).However,ICANN
doesnotnormallyallocateaddressestoindividual organizations.Itassignsalargeblock
ofaddressestoan ISP.EachISP,inturn,dividesitsassignedblockintosmallersubblocks
andgrantsthesubblockstoitscustomers.
Inotherwords,anISPreceivesonelargeblock
tobedistributedtoitsInternetusers.Thisiscalled
addressaggregation:manyblocks of
addressesareaggregatedinoneblockandgrantedtoone ISP.
Example19.10
AnISPisgrantedablock ofaddressesstartingwith190.100.0.0/16(65,536addresses).TheISP
needstodistributetheseaddressestothreegroups
ofcustomersasfollows:
a.Thefirstgrouphas64customers;eachneeds256addresses.
b.Thesecondgrouphas128customers;eachneeds128addresses.
c.Thethirdgrouphas128customers;eachneeds64addresses.
Designthesubblocksandfindouthowmanyaddressesarestillavailableaftertheseallocations.

562 CHAPTER19NETWORKLAYER:LOGICALADDRESS1NG
Solution
Figure19.9showsthesituation.
Figure19.9 Anexampleofaddressallocationanddistributionbyan IS?
ISP
Group1: Customer00 1;190.100.0.0/24
r-19_0_.1_00_.0_.0_t_o_19_0_.l_0_0._63_.2_5_5--r_Customer064:190.100.63.0/24
Toandfrom
the Internet
Group2:
190.100.64.0to190.100.127.255
Group
3:
190.100.128.0to190.100.159.255
Available
190.100.160.0to190.100.255.255
Customer00
1:190.100.64.0/25
Customer128:190.100.127.128/25
Customer001:190.100.128.0/26
Customer128:190.100.159.192/26
1.Group1
Forthisgroup,eachcustomerneeds256addresses.Thismeansthat8(log2256)bitsare
neededtodefineeachhost.Theprefixlengthisthen32- 8
=24.Theaddressesare
1stCustomer:
2ndCustomer:
190.100.0.0/24
190.100.1.0/24
190.100.0.255/24
190.100.1.255/24
64thCustomer:190.100.63.0/24190.100.63.255/24
Total
=64X256
=16,384
2.Group2
Forthisgroup,eachcustomerneeds128addresses.Thismeansthat7 (10g2128)bitsare
neededtodefineeachhost.Theprefixlengthisthen32-7=25.Theaddressesare
1stCustomer:190.100.64.0/25
2ndCustomer:190.100.64.128/25
190.100.64.127/25
190.100.64.255/25
128thCustomer:190.100.127.128/25190.100.127.255/25
Total
=128X128
=16,384
3.Group3
Forthisgroup,eachcustomerneeds64addresses.Thismeansthat6(logz64)bitsareneeded
toeachhost.Theprefixlengthisthen32- 6
=26.Theaddressesare

SECTION19.1IPv4ADDRESSES 563
1stCustomer:
2ndCustomer:
190.100.128.0/26
190.100.128.64/26
190.100.128.63/26
190.100.128.127/26
128thCustomer:190.100.159.192/26190.100.159.255/26
Total
=128X64=8192
Number
ofgrantedaddressestotheISP:65,536
Number
ofallocatedaddresses bytheISP:40,960
Number
ofavailableaddresses:24,576
NetworkAddressTranslation(NAT)
Thenumber ofhomeusersandsmallbusinessesthatwanttousetheInternetisever
increasing.Inthebeginning,auserwasconnectedtotheInternetwithadial-upline,
whichmeansthatshewasconnectedforaspecificperiod
oftime.AnISPwithablock of
addressescoulddynamicallyassignanaddresstothisuser.Anaddresswasgiventoa
userwhenitwasneeded.Butthesituationisdifferenttoday.Homeusersandsmallbusi­
nessescan
beconnectedbyanADSLlineorcablemodem.Inaddition,manyarenot
happywithoneaddress;manyhavecreatedsmallnetworkswithseveralhostsandneed
anIPaddressforeachhost.Withtheshortage
ofaddresses,thisisaseriousproblem.
Aquicksolutiontothisproblemiscalled
networkaddresstranslation(NAT).
NATenablesausertohavealargeset ofaddressesinternallyandoneaddress,orasmall
set
ofaddresses,externally.Thetrafficinsidecanusethelargeset;thetrafficoutside,the
smallset.
Toseparatetheaddressesusedinsidethehomeorbusinessandtheonesusedfor
theInternet,theInternetauthoritieshavereservedthreesets
ofaddressesasprivate
addresses,showninTable19.3.
Table19.3 Addressesforprivatenetworks
Range Total
10.0.0.0 to10.255.255.255 2
24
172.16.0.0to172.31.255.255 2
20
192.168.0.0to192.168.255.255 2
16
Anyorganizationcanuseanaddressout ofthissetwithoutpermissionfromthe
Internetauthorities.Everyoneknowsthatthesereservedaddressesareforprivatenet­
works.Theyareuniqueinsidetheorganization,buttheyarenotuniqueglobally.No
routerwillforwardapacketthathasoneoftheseaddressesasthedestinationaddress.
ThesitemusthaveonlyonesingleconnectiontotheglobalInternetthrougharouter
thatrunsthe
NATsoftware.Figure19.10showsasimpleimplementationof NAT.
AsFigure19.10shows,theprivatenetworkusesprivateaddresses.Therouterthat
connectsthenetworktotheglobaladdressusesoneprivateaddressandoneglobal
address.
Theprivatenetworkistransparenttotherest oftheInternet;therest ofthe
InternetseesonlytheNATrouterwiththeaddress200.24.5.8.

564 CHAPTER 19NETWORKLAYER:LOGICALADDRESSING
Figure19.10ANATimplementation
172.18.3.20
...
172.18.3.1172.18.3.2
Siteusingprivateaddresses
-----------------------------------,
I
I
I
I
I
I
I
I
NATrouter
172.18.3.30 200.24.5.8
Internet
I,
___________________________________ J
AddressTranslation
Alltheoutgoingpacketsgothroughthe NATrouter,whichreplacesthe sourceaddress
inthepacketwiththeglobal NATaddress.Allincomingpacketsalsopassthroughthe
NATrouter,whichreplacesthe destinationaddress inthepacket(the NATrouterglobal
address)withtheappropriateprivateaddress.Figure19.11showsanexample
ofaddress
translation.
Figure19.11AddressesinaNAT
Internet
Source:200.24.5.8
"-----------'-b.
Destination:200.24.5.8
Source:172.18.3.1
..---------r---b.
Destination:172.18.3.1
172.18.3.1
~--------------------------1
I
I
I
I
I
I
I
TranslationTable
Thereadermayhavenoticedthattranslatingthesourceaddressesforoutgoingpackets
isstraightforward.Buthowdoesthe
NATrouterknowthedestinationaddress fora
packetcomingfromtheInternet?Theremaybetensorhundreds
ofprivateIPaddresses,
eachbelongingtoonespecifichost.Theproblemissolved
iftheNATrouterhasatrans­
lationtable.
Using
OneIPAddressInitssimplestfonn,atranslationtablehasonlytwocolumns:
theprivate'addressandtheexternaladdress(destinationaddress
ofthepacket).When
theroutertranslatesthesourceaddress
oftheoutgoingpacket,italsomakesnote ofthe
destination
address-wherethepacketisgoing.Whentheresponsecomesbackfrom
thedestination,therouterusesthesourceaddress
ofthepacket(astheexternaladdress)
tofindtheprivateaddress
ofthepacket.Figure19.12showstheidea.Notethatthe
addressesthatarechanged(translated)areshownincolor.

SECTION19.1IPv4ADDRESSES 565
Figure19.12NATaddresstranslation
--------------------------~
Destination:25.8.2.10 I
I
Source:172.HU.I I
I
I
I
I
I
I
Destination:25.8.2.10
Source:200.24.5.g
Translationtable
Private External
172.18.3.1...
25.8.2.10..oEt----'
•.
I
: Destination:200.24.5.1l
ISource:25.8.2.10
I
I
I
I
I
I
------=:~=::::::::::::::=====----~.~r___---.:::.---=========-
Destination:171.18.3.1
Source:25.8.2.10
Inthisstrategy,communicationmustalways beinitiatedbytheprivatenetwork.
TheNATmechanismdescribedrequiresthattheprivatenetworkstartthecommunica­
tion.Aswewillsee,NATisusedmostlybyISPswhichassignonesingleaddresstoa
customer.Thecustomer,however,may
beamemberofaprivatenetworkthathasmany
privateaddresses.Inthiscase,communicationwiththeInternetisalwaysinitiatedfrom
thecustomersite,usingaclientprogramsuchasHTTP,TELNET,orFTPtoaccessthe
correspondingserverprogram.Forexample,whene-mailthatoriginatesfromanon­
customersiteisreceived
bytheISPe-mailserver,thee-mailisstoredinthemailbox of
the.customeruntilretrieved.Aprivatenetworkcannotrunaserverprogramforclients
outside
ofitsnetworkifitisusingNATtechnology.
UsingaPool
ofIPAddressesSincetheNATrouterhasonlyoneglobaladdress,only
oneprivatenetworkhostcanaccessthesameexternalhost.
Toremovethisrestriction,the
NATrouterusesapool
ofglobaladdresses.Forexample,instead ofusingonlyoneglobal
address(200.24.5.8),theNATrouter
canusefouraddresses(200.24.5.8,200.24.5.9,
200.24.5.10,and200.24.5.11).Inthiscase,fourprivatenetworkhostscancommunicate
withthesameexternalhostatthesametimebecauseeachpair
ofaddressesdefinesa
connection.However,therearestillsomedrawbacks.Inthisexample,nomorethanfour
connections
canbemadetothesamedestination.Also,noprivate-networkhost can
accesstwoexternalserverprograms(e.g.,HTTPand FfP)atthesametime.
Using
BothIPAddressesandPortNumbersToallowamany-to-manyrelationship
betweenprivate-networkhostsandexternalserverprograms,weneedmoreinformation
inthetranslationtable.Forexample,supposetwohostswithaddresses172.18.3.1and
172.18.3.2insideaprivatenetworkneedtoaccesstheHTTPserveronexternalhost

566 CHAPTER 19NETWORKLAYER:LOGICALADDRESSING
25.8.3.2.Ifthetranslationtablehasfivecolumns,instead oftwo,thatincludethesource
anddestinationportnumbers
ofthetransportlayerprotocol,theambiguityiseliminated.
WediscussportnumbersinChapter23.Table19.4showsanexample ofsuchatable.
Table19.4
Five-columntranslationtable
PrivatePrivateExternalExternalTransport
Address Port Address Port Protocol
172.18.3.11400 25.8.3.2 80 TCP
172.18.3.21401 25.8.3.2 80 TCP
... ... . .. ... ...
NotethatwhentheresponsefromHTTPcomesback,thecombination ofsource
address(25.8.3.2)anddestinationportnumber(1400)definesthe-privatenetworkhost
towhichtheresponseshouldbedirected.Notealsothatforthistranslationtowork,the
temporaryportnumbers(1400and1401)mustbeunique.
NATandISP
AnISPthatservesdial-upcustomerscanuse NATtechnologytoconserveaddresses.
Forexample,supposeanISP
isgranted1000addresses,buthas100,000customers.
Each
ofthecustomersisassignedaprivatenetworkaddress.TheISPtranslateseach of
the100,000sourceaddressesinoutgoingpacketstoone ofthe1000globaladdresses;
ittranslatestheglobaldestinationaddressinincomingpacketstothecorresponding
privateaddress.Figure19.13showsthisconcept.
Figure19.13AnISPandNAT
172.18.3.1
···
172.24.1.1
ISP
site
·•

172.30,100
19.2IPv6ADDRESSES
1000
addresses
Despiteallshort-termsolutions,suchasclasslessaddressing,DynamicHostConfigu­
rationProtocol(DHCP),discussedinChapter21,and
NAT,addressdepletionisstilla
long-termproblemfortheInternet.ThisandotherproblemsintheIPprotocolitself,

SECTION19.2IPv6ADDRESSES 567
suchaslack ofaccommodationforreal-timeaudioandvideotransmission,andencryp­
tionandauthentication
ofdataforsomeapplications,havebeenthemotivationforIPv6.
Inthissection,
wecomparetheaddressstructure ofIPv6toIPv4.InChapter20,we
discussbothprotocols.
Structure
AnIPv6addressconsistsof16bytes(octets); itis128bitslong.
An
IPv6addressis 128bitslong.
HexadecimalColonNotation
Tomakeaddressesmorereadable,IPv6specifies hexadecimalcolonnotation.Inthisnota­
tion,128bitsisdividedintoeightsections,each2bytesinlength.Twobytesinhexadecimal
notationrequiresfourhexadecimaldigits.Therefore,theaddressconsists
of32hexadecimal
digits,witheveryfourdigitsseparatedbyacolon,asshowninFigure19.14.
Figure19.14 IPv6addressinbinaryandhexadecimalcolonnotation

1111110111101100
128bits=16bytes=32hexdigits
1111111111111111
IFDECI:I0074I:I0000I:t0000I:I0000I:IBOFFI:I0000I:IFFFFI
Abbreviation
AlthoughtheIPaddress,eveninhexadecimalformat,isverylong,many ofthedigitsare
zer9s.Inthiscase,we
canabbreviatetheaddress.Theleadingzeros ofasection(four
digitsbetweentwocolons)canbeomitted.Onlytheleadingzeroscanbedropped,not
thetrailingzeros(seeFigure19.15).
Figure19.15 AbbreviatedIPv6addresses
Original
FDEC:0074:0000:0000:0000:BOFF:0000:FFFO
AbbreviatedFDEC:
74:0:0:0:BOFF:0:FFFO

568 CHAPTER 19NETWORKLAYER:LOGICALADDRESSING
Usingthisformofabbreviation,0074canbewritten as74,OOOFasF,and0000as O.
Notethat3210cannotbeabbreviated.Furtherabbreviationsarepossible ifthereare
consecutivesectionsconsistingofzerosonly.
Wecanremovethezerosaltogetherand
replacethemwithadoublesemicolon.Notethatthistype
ofabbreviationisallowed
onlyonceperaddress.
Iftherearetworuns ofzerosections,onlyone ofthemcanbe
abbreviated.Reexpansionoftheabbreviatedaddressisverysimple:Aligntheunabbre­
viatedportionsandinsertzerostogettheoriginalexpandedaddress.
Example19.11
Expandtheaddress0:15::1:12:1213toitsoriginal.
Solution
Wefirstneedtoaligntheleftside ofthedoublecolontotheleftoftheoriginalpatternandthe
rightside
ofthedoublecolontotheright oftheoriginalpatterntofindnowmany Osweneedto
replacethedoublecolon.
xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx
0:15:
l:12:1213
Thismeansthattheoriginaladdressis
0000:0015:0000:0000:0000:0001:0012:1213
AddressSpace
IPv6hasamuchlargeraddressspace;2
128
addressesareavailable.Thedesigners of
IPv6dividedtheaddressintoseveralcategories.Afewleftmostbits,calledthe type
prefix,
ineachaddressdefineitscategory.Thetypeprefixisvariableinlength,butitis
designedsuchthatnocodeisidentical
tothefirstpart ofanyothercode.Inthisway,
thereisnoambiguity;whenanaddressisgiven,thetypeprefixcaneasilybedeter­
mined.Table19.5showstheprefixforeachtype
ofaddress.Thethirdcolumnshows
thefraction
ofeachtype ofaddressrelativetothewholeaddressspace.
Table19.5
Typeprefixesfor1Pv6addresses
TypePrefix Type Fraction
00000000 Reserved 1/256
00000001 Unassigned 1/256
0000001 ISOnetworkaddresses 1/128
0000010 IPX(Novell)networkaddresses 1/128
0000011 Unassigned 1/128
00001 Unassigned 1/32
0001 Reserved
1/16
001 Reserved 1/8
010 Provider-basedunicastaddresses 1/8

SECTION19.2IPv6ADDRESSES 569
Table19.5 TypeprefixesforIPv6addresses(continued)
TypePrefix Type Fraction
011 Unassigned 1/8
100
Geographic-basedunicastaddresses 1/8
101 Unassigned 1/8
110
Unassigned 1/8
1110
Unassigned 1116
11110 Unassigned 1132
111110 Unassigned 1/64
1111110
Unassigned 1/128
11111110
aUnassigned 1/512
1111111010Linklocaladdresses 111024
11111110
11Sitelocaladdresses 1/1024
11111111
Multicastaddresses 1/256
UnicastAddresses
Aunicastaddress definesasinglecomputer.Thepacketsenttoaunicastaddressmust
bedelivered
tothatspecificcomputer.IPv6definestwotypes ofunicastaddresses:geo­
graphicallybasedandprovider-based.
Wediscussthesecondtypehere;thefirsttypeis
leftforfuturedefinition.Theprovider-basedaddressisgenerallyusedbyanormalhost
asaunicastaddress.TheaddressformatisshowninFigure19.16.
Figure19.16 Prefixesforprovider-basedunicastaddress
Subnetprefix
Subscriberprefix
-
Providerprefix
151
ProviderSubscribeI: Snbnet Node
Iidentifier idenfifiiii: identifier identifier
~
INTERNIC 11000
RIPNIC 01000
APNIC 10100
Registry
Fieldsfortheprovider-basedaddressare asfollows:
oTypeidentifier.This3-bitfielddefinestheaddressasaprovider-base.daddress.
oRegistryidentifier. This5-bitfieldindicatestheagencythathasregisteredthe
address.Currentlythreeregistrycentershavebeendefined.INTERNIC(code
11000)isthecenterforNorthAmerica;RIPNIC(code01000)isthecenterfor
Europeanregistration;andAPNIC(code10100)isforAsianandPacificcountries.

570 CHAPTER 19NETWORKLAYER:LOGICALADDRESSING
oProvideridentifier. Thisvariable-lengthfieldidentifiestheproviderforInternet
access(such
asanISP).A16-bitlengthisrecommendedforthisfield.
oSubscriberidentifier. WhenanorganizationsubscribestotheInternetthrougha
provider,itisassignedasubscriberidentification.A24-bitlengthisrecommended
forthisfield.
oSubnetidentifier. Eachsubscribercanhavemanydifferentsubnetworks,andeach
subnetworkcanhave
anidentifier.Thesubnetidentifierdefinesaspecificsubnetwork
undertheterritory
ofthesubscriber.A32-bitlengthisrecommendedforthisfield.
oNodeidentifier.Thelastfielddefinestheidentity ofthenodeconnectedtoasubnet.
Alength
of48bitsisrecommendedforthisfieldtomakeitcompatiblewiththe
48-bitlink(physical)addressusedbyEthernet.Inthefuture,thislinkaddresswill
probablybethesame
asthenodephysicaladdress.
MulticastAddresses
Multicastaddressesareusedtodefineagroup ofhostsinsteadofjustone.Apacketsent
toa
multicastaddress mustbedeliveredtoeachmember ofthegroup.Figure19.17
showstheformat
ofamulticastaddress.
Figure19.17 MulticastaddressinIPv6
8bits
0000
0001 4 4
Reserved
Nodelocal
Linklocal
Sitelocal
Organizational
Global
Reserved
112bits
GroupID
Thesecondfieldisaflagthatdefinesthegroupaddressaseitherpermanentor
transient.ApermanentgroupaddressisdefinedbytheInternetauthoritiesandcanbe
accessedatalltimes.Atransient groupaddress,ontheotherhand,isusedonlytempo­
rarily.Systemsengagedinateleconference,forexample,canuseatransientgroup
address.Thethirdfielddefinesthescope
ofthegroupaddress.Manydifferentscopes
havebeendefined,
asshowninFigure19.17.
AllycastAddresses
IPv6alsodefinesanycastaddresses.An anycastaddress, likeamulticastaddress,also
definesagroup
ofnodes.However,apacketdestinedforananycastaddressisdelivered
toonlyone
ofthemembersoftheanycastgroup,thenearestone(theonewiththeshortest
route).Althoughthedefinition
ofananycastaddressisstilldebatable,onepossibleuse
istoassignananycastaddresstoallrouters
ofanISPthatcoversalargelogicalareain
theInternet.TheroutersoutsidetheISPdeliverapacketdestinedfortheISPtothe
nearestISProuter.Noblockisassignedforanycastaddresses.

SECTION19.2IPv6ADDRESSES 571
ReservedAddresses
Anothercategoryintheaddressspaceisthe reservedaddress. Theseaddressesstart
witheight
Os(typeprefixis00000000).Afewsubcategoriesaredefinedinthiscategory,
asshowninFigure19.18.
Figure19.18 ReservedaddressesinIPv6
8bits 120bits
l_oooooooo_IIooo A_ll_os ......1a.Unspecified
8bits 120bits
l_oo_oo_DOO_0
oioC
11.- °_0_00_0_00_0_00_0_00_0_00_0_",_",_"'_",_,,,_,°_00_0_00_0_00_0_1 1b.Loopback
8bits 88bits 32bits
32bits16bits72bits
l_o_oDOO_DOO_II.- A_I_1o_s ...I.....I_'Pv_4_'<t_ddr_,_es_s,......1c.Compatible
8bits
l_o_oooooo__o...II.-
A
_ll
_
O
_S
""'-_Al_Il_S__I...,...IPV'_4...<t_ddre_s_s_Id.Mapped
Anunspecifiedaddress isusedwhenahostdoesnotknowitsownaddressand
sendsaninquirytofinditsaddress.A
loopbackaddress isusedbyahosttotestitself
withoutgoingintothenetwork.A
compatibleaddressisusedduringthetransition
fromIPv4toIPv6(seeChapter20).
ItisusedwhenacomputerusingIPv6wantsto
sendamessagetoanothercomputerusingIPv6,butthemessageneedstopassthrough
apart
ofthenetworkthatstilloperatesinIPv4.A mappedaddressisalsousedduring
transition.However,itisusedwhenacomputerthathasmigratedtoIPv6wantstosend
apackettoacomputerstillusingIPv4.
LocalAddresses.
TheseaddressesareusedwhenanorganizationwantstouseIPv6protocolwithoutbeing
connectedtotheglobalInternet.Inotherwords,theyprovideaddressingforprivatenet­
works.Nobodyoutsidetheorganizationcansendamessagetothenodesusingthese
addresses.Twotypes
ofaddressesaredefinedforthispurpose, asshowninFigure19.19.
Figure19.19 LocaladdressesinIPv6
10bits 70bits
AllOs
48bits
Node
addressIa.Linklocal
38bits
AllOs b.Sitelocal

572 CHAPTER 19NETWORKLAYER:LOGICALADDRESSING
Alinklocaladdressisusedinanisolatedsubnet;asitelocal addressisusedin
anisolatedsitewithseveralsubnets.
19.3RECOMMENDED READING
Formoredetailsaboutsubjectsdiscussedinthischapter,werecommendthefollowing
booksandsites.Theitemsinbrackets[
...]refertothereferencelistattheend of
thetext.
Books
IPv4addressesarediscussedinChapters4and5 of[For06],Chapter3 of[Ste94],Sec­
tion
4.1of[PD03],Chapter 18of[Sta04],andSection5.6 of
[TlUl03].IPv6addresses
arediscussedinSection27.1
of[For06]andChapter8 of[Los04].Agooddiscussion of
NATcanbefoundin[DutOl].
Sites
owww.ietf.org/rfc.htmlInformationaboutRFCs
RFCs
AdiscussionofIPv4addressescanbefoundinmost oftheRFCsrelatedtotheIPv4
protocol:
760,781,791,815,1025,1063,1071,1141,1190,1191,1624,2113
Adiscussionof1Pv6addressescanbefoundinmost oftheRFCsrelatedtoIPv6protocol:
1365,1550,1678,1680,1682,1683,1686,1688,1726,1752,1826,1883,1884,1886,1887,
1955,2080,2373,2452,2463,2465,2466,2472,2492,2545,2590
AdiscussionofNATcanbefoundin
1361,2663,2694
19.4KEY TERMS
addressaggregation
addressspace
anycastaddress
binarynotation
classAaddress
classBaddress
classCaddress
classDaddress
classEaddress
classfuladdressing
classlessaddressing
classlessinterdomainrouting(CIDR)

compatibleaddress
dotted-decimalnotation
defaultmask
hexadecimalcolonnotation
hostid
IPaddress
IPv4address
IPv6address
linklocaladdress
mappedaddress
mask
multicastaddress
netid
networkaddress
SECTION19.5SUMMARY 573
networkaddresstranslation
(NAT)
prefix
reservedaddress
sitelocaladdress
subnet
subnetmask
subnetting
suffix
supernet
supernetmask
supernetting
unicastaddress
unspecifiedaddress
19.5SUMMARY
oAtthenetworklayer,aglobalidentificationsystemthatuniquelyidentifiesevery
hostandrouter
isnecessaryfordelivery ofapacketfromhosttohost.
oAnIPv4addressis32bitslonganduniquelyanduniversallydefinesahostor
routerontheInternet.
oInclassfuladdressing,theportion oftheIPaddressthatidentifiesthenetworkis
calledthenetid.
oInclassfuladdressing,theportion oftheIPaddressthatidentifiesthehost orrouter
onthenetwork
iscalledthehostid.
oAnIPaddressdefinesadevice'sconnectiontoanetwork.
o
~TherearefiveclassesinIPv4addresses.Classes A,B,and Cdifferinthenumber
ofhostsallowedpernetwork.ClassDisformulticastingandClassEisreserved.
oTheclassofanaddressiseasilydeterminedbyexamination ofthefirstbyte.
oAddressesinclassesA,B, orCaremostlyusedforunicastcommunication.
oAddressesinclassDareusedformulticastcommunication.
oSubnettingdividesonelargenetworkintoseveralsmallerones,addinganinterme-
diatelevel
ofhierarchyinIPaddressing.
oSupernettingcombinesseveralnetworksintoonelargeone.
oInclasslessaddressing,wecandividetheaddressspaceintovariable-lengthblocks.
oTherearethreerestrictionsinclasslessaddressing:
a.Thenumber ofaddressesneedstobeapower of2.
b.Themaskneedstobeincludedintheaddresstodefinetheblock.
c.Thestartingaddressmustbedivisiblebythenumber ofaddressesintheblock.
oThemaskinclasslessaddressingisexpressed astheprefixlength (In)inCIDRnotation.

574 CHAPTER 19NETWORKLAYER:LOGICALADDRESSING
oTofindthefirstaddressinablock,wesettherightmost32- nbitsto O.
oTofindthenumber ofaddressesintheblock,wecalculate 2
32
-n
,
wherenisthe
prefixlength.
oTofindthelastaddress intheblock,wesettherightmost32-nbitsto O.
oSubnettingincreasesthevalue ofn.
oTheglobalauthorityfor addressallocation isICANN.ICANNnormallygrants
largeblocks
ofaddressestoISPs,whichintumgrantsmallsubblockstoindividual
customers.
oIPv6addressesusehexadecimalcolonnotationwithabbreviationmethodsavailable.
oTherearethreetypes ofaddressesinIPv6:unicast,anycast,andmulticast.
oInanIPv6address,thevariabletypeprefixfielddefinestheaddresstypeorpurpose.
19.6PRACTICESET
ReviewQuestions
1.Whatisthenumber ofbitsinanIPv4address?Whatisthenumber ofbitsinan
IPv6address?
2.WhatisdotteddecimalnotationinIPv4addressing?Whatisthenumber ofbytes
inanIPv4addressrepresentedindotteddecimalnotation?Whatishexadecimal
notationinIPv6addressing?Whatisthenumber
ofdigitsinanIPv6addressrepre­
sentedinhexadecimalnotation?
3.WhatarethedifferencesbetweenclassfuladdressingandclasslessaddressinginIPv4?
4.Listtheclassesinclassfuladdressinganddefinetheapplication
ofeachclass(unicast,
multicast,broadcast,orreserve).
5.Explainwhymost oftheaddressesinclassAarewasted.Explainwhyamedium-size
orlarge-sizecorporationdoesnotwantablock
ofclassCaddresses.
6.WhatisamaskinIPv4addressing?WhatisadefaultmaskinIPv4addressing?
7.Whatisthenetworkaddressinablock
ofaddresses?Howcanwefindthenetwork
address
ifoneoftheaddressesinablock isgiven?
8.Brieflydefinesubnettingandsupemetting.Howdothesubnetmaskandsupemet
maskdifferfromadefaultmask
inclassfuladdressing?
9.HowcanwedistinguishamulticastaddressinIPv4addressing?Howcanwedoso
inIPv6addressing?
10.WhatisNAT?Howcan NAThelpinaddressdepletion?
Exercises
II.Whatistheaddressspaceineach ofthefollowingsystems?
a.Asystemwith8-bitaddresses
b.Asystemwith16-bitaddresses
c.Asystemwith64-bitaddresses

SECTION19.6PRACTICESET 575
12.Anaddressspacehasatotal of1024addresses.Howmanybitsareneededtorep­
resentanaddress?
13.Anaddressspaceusesthethreesymbols0, 1,and2torepresentaddresses.
Ifeachaddressismade of10symbols,howmanyaddressesareavailableinthis
system?
14.ChangethefollowingIPaddressesfromdotted-decimalnotationtobinarynotation.
a.114.34.2.8
b.129.14.6.8
c.208.34.54.12
d.238.34.2.1
15.ChangethefollowingIPaddressesfrombinarynotationtodotted-decimalnotation.
a.01111111111100000110011101111101
b.10101111110000001111100000011101
c.11011111101100000001111101011101
d.11101111111101111100011100011101
16.Findtheclass ofthefollowingIPaddresses.
a.208.34.54.12
b.238.34.2.1
c.114.34.2.8
d.129.14.6.8
17.Findtheclass ofthefollowingIPaddresses.
a.111101111111001110000111 11011101
b.10101111110000001111000000011101
c.11011111101100000001111101011101
d.1110111111110111 1100011100011101
18.Findthenetidandthehostid ofthefollowingIPaddresses.

a.114.34.2.8
b.132.56.8.6
c.208.34.54.12
19.Inablock ofaddresses,weknowtheIPaddress ofonehostis25.34.12.56/16.
Whatarethefirstaddress(networkaddress)andthelastaddress(limitedbroadcast
address)inthisblock?
20.Inablock
ofaddresses,weknowtheIPaddress ofonehostis182.44.82.16/26.
Whatarethefirstaddress(networkaddress)andthelastaddressinthisblock?
21.
Anorganizationisgrantedtheblock16.0.0.0/8.Theadministratorwantstocreate
500fixed-lengthsubnets.
a.Findthesubnetmask.
b.Findthenumber ofaddressesineachsubnet.
c.Findthefirstandlastaddressesinsubnet 1.
d.Findthefirstandlastaddressesinsubnet500.

576 CHAPTER 19NETWORKLAYER:LOGICALADDRESSING
22.Anorganizationisgrantedtheblock130.56.0.0/16.Theadministratorwantsto
create1024subnets.
a.Findthesubnetmask.
b.Findthenumberofaddressesineachsubnet.
c.Findthefirstandlastaddressesinsubnet 1.
d.Findthefirstandlastaddressesinsubnet1024.
23.Anorganizationisgrantedtheblock211.17.180.0/24.Theadministratorwantsto
create32subnets.
a.Findthesubnetmask.
b.Findthenumberofaddressesineachsubnet.
c.Findthefirstandlastaddressesinsubnet 1.
d.Findthefirstandlastaddressesinsubnet32.
24.Writethefollowingmasksinslashnotation
(In).
a.255.255.255.0
b.255.0.0.0
c.255.255.224.0
d.255.255.240.0
25.Findtherange ofaddressesinthefollowingblocks.
a.123.56.77.32/29
b.200.17.21.128/27
c.17.34.16.0/23
d.180.34.64.64/30
26.AnISPisgrantedablockofaddressesstartingwith150.80.0.0/16.TheISPwants
todistributetheseblocksto2600customersasfollows.
a.Thefirstgrouphas200medium-sizebusinesses;eachneeds128addresses.
b.Thesecondgrouphas400smallbusinesses;eachneeds16addresses.
c.Thethirdgrouphas2000households;eachneeds4addresses.
Designthesubblocksandgivetheslashnotationforeachsubblock.Findouthow
manyaddressesarestillavailableaftertheseallocations.
27.AnISPisgrantedablock
ofaddressesstartingwith120.60.4.0/22.TheISP
wantstodistributetheseblocksto100organizationswith
eachorganization
receivingjusteightaddresses.Designthesubblocksandgivetheslashnotation
foreachsubblock.Findouthowmanyaddressesarestillavailableafterthese
allocations.
28.AnISPhasablockof1024addresses.
Itneedstodividetheaddressesamong
1024customers.Doesitneedsubnetting?Explainyouranswer.
29.Showtheshortestform
ofthefollowingaddresses.
a.2340:lABC:119A:AOOO:0000:0000:0000:0000
b.OOOO:OOAA:OOOO:OOOO:OOOO:OOOO: 119A:A231
c.2340:0000:0000:0000:0000:119 A:AOO1:0000
d.0000:0000:0000:2340:0000:0000:0000:0000

SECTION19.6PRACTICESET 577
30.Showtheoriginal(unabbreviated)form ofthefollowingaddresses.
a.0::0
b.O:AA::O
c.0:1234::3
d.123::1:231.Whatisthetype ofeachofthefollowingaddresses?
a.FE80::12
b.FECO::24A2
c.FF02::0
d.0::01
32.What
isthetypeofeachofthefollowingaddresses?
a.0::0
b.0::FFFF:O:O
c.582F:1234::2222
d.4821::14:22
e.54EF::A234:2
33.Showtheproviderprefix(inhexadecimalcolonnotation)
ofanaddressassigned
toasubscriber
ifitisregisteredintheUnitedStateswithABC1astheprovider
identification.
34.Showinhexadecimalcolon notationtheIPv6address
a.CompatibletotheIPv4address129.6.12.34
b.MappedtotheIPv4address129.6.12.34
35.Showinhexadecimalcolonnotation
a.Thelinklocaladdressinwhichthenodeidentifieris0::123/48
b.Thesitelocaladdressinwhichthenodeidentifier is0::123/48
36.Showinhexadecimalcolonnotationthepermanentmulticastaddressusedinalink
localscope.
37.•Ahosthastheaddress581E:1456:2314:ABCD::1211. Ifthenodeidentificationis
48bits,findtheaddress
ofthesubnettowhichthehostisattached.
38.Asitewith200subnetshastheclassBaddress
of132.45.0.0.Thesiterecently
migratedtoIPv6withthesubscriberprefix581E:1456:2314::ABCD/80.Design
thesubnetsanddefinethesubnetaddresses,usingasubnetidentifier
of32bits.
ResearchActivities
39.Findtheblock ofaddressesassignedtoyourorganizationorinstitution.
40.
IfyouareusinganISPtoconnectfromyourhometotheInternet,findthename of
theISPandtheblock ofaddressesassignedtoit.
41.Somepeoplearguethatwecanconsiderthewholeaddressspace
asonesingle
blockinwhicheachrange
ofaddressesisasubblocktothissingleblock.Elaborate
onthisidea.Whathappens
tosubnettingifweacceptthisconcept?
42.Isyourschoolororganizationusingaclassfuladdress?
Ifso,findouttheclass of
theaddress.

CHAPTER20
NetworkLayer:
InternetProtocol
IntheInternetmodel,themainnetworkprotocolistheInternetProtocol(IP).Inthis
chapter,wefirstdiscussinternetworkingandissuesrelatedtothenetworklayerprotocol
ingeneral.
Wethendiscussthecurrentversion oftheInternetProtocol,version4,orIPv4.
Thisleadsustothenextgeneration
ofthisprotocol,orIPv6,whichmaybecomethe
dominantprotocolinthenearfuture.
Finally,wediscussthetransitionstrategiesfromIPv4toIPv6.Somereadersmay
notetheabsence
ofIPv5.IPv5isanexperimentalprotocol,basedmostlyontheOSI
modelthatnevermaterialized.
20.1INTERNETWORKING
Thephysicalanddatalinklayers ofanetworkoperatelocally.Thesetwolayersare
jointlyresponsiblefordatadeliveryonthenetworkfromonenodetothenext,
asshown
inFigure20.1.
Thisinternetworkismade
offivenetworks:fourLANsandoneWAN. IfhostA
needstosendadatapackettohostD,thepacketneedstogofirstfromAto
Rl(aswitch
orrouter),thenfrom
RltoR3,andfinallyfrom R3tohostD. Wesaythatthedatapacket
passesthroughthreelinks.Ineachlink,twophysicalandtwodatalinklayersareinvolved.
However,thereisabigproblemhere.Whendataarriveatinterface
flofRl,how
does
RIknowthatinterface f3istheoutgoinginterface?Thereisnoprovisioninthe
datalink(orphysical)layertohelp
Rlmaketherightdecision.Theframedoesnot
carryanyroutinginformationeither.TheframecontainstheMACaddress
ofAasthe
sourceandtheMACaddress
ofRlasthedestination.ForaLAN oraWAN,delivery
meanscarryingtheframethroughonelink,andnotbeyond.
NeedforNetworkLayer
Tosolvetheproblem ofdeliverythroughseverallinks,thenetworklayer(ortheinter­
networklayer,
asitissometimescalled)wasdesigned.Thenetworklayerisresponsible
forhost-to-hostdeliveryandforroutingthepacketsthroughtheroutersorswitches.
Figure20.2showsthesameinternetworkwithanetworklayeradded.
579

580 CHAPTER 20NETWORKLAYER:INTERNETPROTOCOL
Figure20.1Linksbetweentwohosts
A 51 53 0
Datalink~ffi ~~ ~Datalink
Physical Physical
------------
Hop-to-hop Hop-to-hop Hop-to-hop
delivery delivery delivery
LAN
LAN
Link3 0
.-------
..~...,
53
52
f2
fl--.lliii...-----<.,
----
WAN
f3
f2
, fl-'~~~
I --....,.....
I
I
I
Link2
L •
Figure20.2Networklayerinaninternetwork
A
N',,"",k~
D,",""k
Physical
51 53 D
~ ~ ~
Network
Datalink
_______ Physical
-----------------------------.
Host-to-hostpath
LAN
f2
f2
52
fl
WAN
Figure20.3showsthegeneralidea ofthefunctionalityofthenetworklayerata
source,atarouter,andatthedestination.Thenetworklayeratthesourceisresponsible
forcreatingapacketfromthedatacomingfromanotherprotocol(suchasatransport
layerprotocoloraroutingprotocol).Theheader
ofthepacketcontains,amongother
information,thelogicaladdresses
ofthesourceanddestination.Thenetworklayeris
responsibleforcheckingitsroutingtabletofindtheroutinginformation(such
asthe
outgoinginterface
ofthepacketorthephysicaladdress ofthenextnode). Ifthepacket
istoolarge,thepacketisfragmented(fragmentationisdiscussedlaterinthischapter).

SECTION20.11NTERNETWORKING S8t
Figure20.3Networklayer atthesource,router,anddestination
____________ ...1
Networklayer
Datato
anotherprotocol
Destination
~----------- -----
Networklayer
Datafrom
anotherprotocol
Todata
linklayer
Fromdata
linklayer
a.Network layeratsource b.Networklayer atdestination
Router
-----------~----------
Routing
table
lP
packet
Networklayer
Fromdata
Todata .
linklayerlinklayer
c.Networklayeratarouter
Thenetworklayerattheswitchorrouterisresponsibleforroutingthepacket.
Whenapacketarrives,therouterorswitchconsultsitsroutingtableandfindstheinter­
facefromwhichthepacketmustbesent.Thepacket,aftersomechangesintheheader,
withtheroutinginfonnationispassedtothedatalinklayeragain.
•Thenetworklayeratthedestination isresponsibleforaddressverification;itmakes
surethatthedestinationaddressonthepacketisthesameastheaddress
ofthehost.If
thepacketisafragment,thenetworklayerwaitsuntilallfragmentshavearrived,and
thenreassemblesthemanddeliversthereassembledpacket
tothetransportlayer.
InternetasaDatagramNetwork
TheInternet,atthenetworklayer,isapacket-switchednetwork. Wediscussedswitching
inChapter
8.Wesaidthat,ingeneral,switchingcanbedividedintothreebroadcatego­
ries:circuitswitching,packetswitching,andmessageswitching.Packet switchinguses
eitherthevirtualcircuitapproachorthedatagramapproach.
TheInternethaschosenthedatagramapproachtoswitchinginthenetworklayer.
Itusestheuniversaladdressesdefinedinthenetworklayertoroutepacketsfromthe
sourcetothedestination.
Switchingatthenetworklayer intheInternetusesthe datagramapproachtopacketswitching.

582 CHAPTER 20NETWORKLAYER:INTERNETPROTOCOL
InternetasaConnectionlessNetwork
Deliveryofapacketcanbeaccomplishedbyusingeitheraconnection-orientedora
connectionlessnetworkservice.Ina
connection-orientedservice, thesourcefirst
makesaconnectionwiththedestinationbeforesendingapacket.Whentheconnection
isestablished,asequence
ofpacketsfromthesamesource tothesamedestinationcan
besentoneafteranother.
Inthiscase,thereisarelationshipbetweenpackets.Theyare
sentonthesamepathinsequentialorder.Apacketislogicallyconnectedtothepacket
travelingbeforeitandtothepackettravelingafterit.Whenallpackets
ofamessage
havebeendelivered,theconnection
isterminated.
Inaconnection-orientedprotocol,thedecisionabouttheroute
ofasequenceof
packetswiththesamesourceanddestinationaddressescanbemadeonlyonce,when
theconnectionisestablished.Switchesdonotrecalculatetherouteforeachindividual
packet.Thistype
ofserviceisusedinavirtual-circuit
approacH.topacketswitching
such
asinFrameRelayand ATM.
Inconneetionlessservice, thenetworklayerprotocoltreatseachpacketindepen­
dently,witheachpackethavingnorelationship
toanyotherpacket.Thepacketsina
message
mayormaynottravelthesamepathtotheirdestination.Thistype ofservice
isusedinthedatagramapproach
topacketswitching.TheInternethaschosenthistype
ofserviceatthenetworklayer.
ThereasonforthisdecisionisthattheInternetismade
ofsomanyheterogeneous
networksthatitisalmostimpossibletocreateaconnectionfromthesourcetothe
destinationwithoutknowingthenature
ofthenetworksinadvance.
CommunicationatthenetworklayerintheInternetisconnectionless.
20.2IPv4
TheInternetProtocolversion 4(IPv4)isthedeliverymechanismusedbytheTCP/IP
protocols.Figure20.4showstheposition
ofIPv4inthesuite.
Figure20.4 PositionofIPv4inTCPIIPprotocolsuite
APPliC~~~~~I~~ITFTPI~ISNMPI••• IBOOTPII
Tran~;;= 11 SCTPII TCPkI UDPII
I
~IIGMP~ilICMP~II~IPv~4 ~I~I~I
N"~:~ . .'--. ----'IARPII~J
DatalinkI I
layer~~~ UnderlyingLAN orWAN
Physical
I technology I
layer
1-_-:..'::================:-_.....1

SECTION20.2IPv4 583
IPv4isanunreliableandconnectionlessdatagram protocol-abest-effortdelivery
service.Theterm
best-effortmeansthatIPv4providesnoerrorcontrolor flowcontrol
(exceptforerrordetectionontheheader).IPv4assumestheunreliability
oftheunder­
lyinglayers anddoesitsbesttogetatransmissionthroughtoitsdestination,butwith
noguarantees.
Ifreliabilityisimportant,IPv4mustbepairedwithareliableprotocolsuch asTCP.
Anexampleofamorecommonlyunderstoodbest-effortdeliveryserviceisthepost
office.Thepostofficedoesitsbesttodeliverthemailbutdoesnotalwayssucceed.
If
anunregisteredletterislost,itisuptothesenderorwould-berecipienttodiscoverthe
lossandrectifytheproblem.Thepostofficeitselfdoesnotkeeptrack
ofeveryletter
andcannotnotifyasenderoflossordamage.
IPv4isalsoaconnectionlessprotocolforapacket-switchingnetworkthatusesthe
datagramapproach(seeChapter
8).Thismeansthateachdatagramishandledindepen­
dently,andeachdatagramcanfollowadifferentroutetothedestination.Thisimplies
thatdatagramssentbythesamesourcetothesamedestinationcouldarriveout
of
order.Also,somecouldbelostorcorruptedduringtransmission.Again,IPv4relieson
ahigher-levelprotocoltotakecare
ofalltheseproblems.
Datagram
PacketsintheIPv4layerarecalled datagrams.Figure20.5showstheIPv4datagram
format.
Figure20.5
IPv4datagramfannat
:
20-60bytes
"I
HeMer
I
Data
I
---
--
VER
I
HLENI
Service Totallength
4bits 4bits 8bits
16bits
Identification Flags
I
Fragmentationoffset
16bits 3bits 13bits
Timetolive
I
Protocol Headerchecksum
8bits 8bits
16bits
SourceIPaddress
DestinationIPaddress
Option

32bits -I
Adatagramisavariable-lengthpacketconsisting oftwoparts:headeranddata.
Theheaderis20to60bytesinlengthandcontainsinformationessentialtoroutingand

584 CHAPTER 20NETWORKLAYER:INTERNETPROTOCOL
delivery.Itiscustomaryin TCP/IPtoshowtheheaderin4-bytesections.A brief
descriptionofeachfieldisinorder.
oVersion(VER). This4-bitfielddefinestheversion oftheIPv4protocol.Currently
theversion
is4.However,version6(orIPng)maytotallyreplaceversion4inthe
future.ThisfieldtellstheIPv4softwarerunningintheprocessingmachinethatthe
datagramhastheformat
ofversion4.Allfieldsmustbeinterpreted asspecified
inthefourthversion
oftheprotocol.Ifthemachineisusingsomeotherversion of
IPv4,thedatagram isdiscardedratherthaninterpretedincorrectly.
oHeaderlength(HLEN). This4-bitfielddefinesthetotallength ofthedatagram
headerin4-bytewords.Thisfieldisneededbecausethelength
oftheheader
isvariable(between20and60bytes).Whentherearenooptions,theheaderlength
is20bytes,andthevalue
ofthisfieldis5(5x 4=20).Whentheoptionfieldis
atitsmaximumsize,thevalue
ofthisfieldis 15(15x 4=60).
oServices.IETFhaschangedtheinterpretationandname ofthis8-bitfield.This
field,previouslycalled
servicetype, isnowcalled differentiatedservices. Weshow
bothinterpretationsinFigure20.6.
Figure20.6 Servicetype ordifferentiatedservices
D:Minimizedelay R:Maximizereliability
T:
MaximizethroughputC:Minimizecost
Precedence TOSbits
Servicetype
Codepoint
Differentiatedservices
1.ServiceType
Inthisinterpretation,thefirst3bitsarecalledprecedencebits.Thenext4bitsare
called
typeofservice(TOS) bits,andthelastbitisnotused.
a.Precedenceisa3-bitsubfieldrangingfrom0(000inbinary)to7(111inbinary).
Theprecedencedefinesthepriorityofthedatagraminissuessuch
ascongestion.
Ifarouteriscongestedandneedstodiscardsomedatagrams,thosedatagrams
withlowestprecedencearediscardedfirst.SomedatagramsintheInternetare
moreimportantthanothers.Forexample,adatagramusedfornetworkmanage­
mentismuchmoreurgentand importantthanadatagramcontainingoptional
informationforagroup.
Theprecedencesubfieldwas partofversion
4,butneverused.
b.TOSbitsisa4-bitsubfieldwitheachbithavingaspecialmeaning.Althougha
bitcanbeeither0or
1,oneandonlyone ofthebitscanhavethevalue of1in
eachdatagram.ThebitpatternsandtheirinterpretationsaregiveninTable20.1.
Withonly1bitsetatatime,wecanhave
fivedifferenttypes ofservices.

SECTION20.2IPv4 585
Table20.1 Typesofservice
TOSBits Description
0000 Normal(default)
0001 Minimizecost
0010 Maximizereliability
0100 Maximizethroughput
1000 Minimizedelay
Applicationprogramscanrequestaspecifictype ofservice.Thedefaultsforsome
applicationsareshowninTable20.2.
Table20.2
Defaulttypes ofservice
Protocol TOSBits Description
ICMP
0000 Normal
BOOTP
0000 Normal
NNTP
0001 Minimizecost
IGP
0010 Maximizereliability
SNMP
0010 Maximizereliability
TELNET
1000 Minimizedelay
FTP(data)
0100 Maximizethroughput
FTP(control)
1000 Minimizedelay
TFTP
1000 Minimizedelay
SMTP(command)
1000 Minimizedelay
SMTP(data)
0100 Maximizethroughput
DNS(UDPquery)
1000 Minimizedelay
DNS(TCPquery)
0000 Normal
DNS(zone)
0100 Maximizethroughput
ItisclearfromTable20.2thatinteractiveactivities,activitiesrequiringimmediate
attention,andactivitiesrequiringimmediateresponseneedminimumdelay.Those
activitiesthatsendbulkdatarequiremaximumthroughput.Managementactivities
needmaximumreliability.Backgroundactivitiesneedminimumcost.
2.DifferentiatedServices
Inthisinterpretation,thefirst6bitsmakeupthecodepointsubfield,andthelast2bits
arenotused.Thecodepointsubfieldcanbeusedintwodifferentways.
a.Whenthe3rightmostbitsare Os,the3leftmostbitsareinterpretedthesame asthe
precedencebitsintheservicetypeinterpretation.Inotherwords,
itiscompatible
withtheoldinterpretation.

586 CHAPTER 20NE1WORKLAYER:INTERNETPROTOCOL
b.Whenthe3rightmostbitsarenotall Os,the6bitsdefine64servicesbasedonthe
priorityassignmentbytheInternetorlocalauthoritiesaccordingtoTable20.3.The
firstcategorycontains32servicetypes;thesecondandthethirdeachcontain
16.
Thefirstcategory(numbers 0,2,4,...,62)isassignedbytheInternetauthorities
(IETF).Thesecondcategory(3,7,
11, 15,,63)canbeusedbylocalauthorities
(organizations).Thethirdcategory(1,
5,9,,61)istemporaryandcanbeused
forexperimentalpurposes.Notethatthenumbersarenotcontiguous.
Iftheywere,
thefirstcategorywouldrangefrom0
to31,thesecondfrom32to47,andthethird
from48to63.ThiswouldbeincompatiblewiththeTOSinterpretationbecause
XXXOOO(whichincludes0, 8,16,24,32,40, 48,and56)wouldfallintoall
threecategories.Instead,inthisassignmentmethodalltheseservicesbelongto
category
1.Notethattheseassignmentshavenotyetbeenfinalized.
Table20.3
Valuesforcodepoints
Category Codepoint AssigningAuthority
1 XXXXXO Internet
2 XXXXll Local
3 XXXXOI Temporaryorexperimental
oTotallength.This
isaIn-bitfieldthatdefinesthetotallength(headerplusdata)
oftheIPv4datagraminbytes. Tofindthelength ofthedatacomingfromtheupper
layer,subtracttheheaderlengthfromthetotallength.Theheaderlengthcanbe
foundbymultiplyingthevalueintheHLENfieldby4.
Lengthofdata=totallength-headerlength
Sincethefieldlength is16bits,thetotallength oftheIPv4datagram islimitedto
65,535(2
16
-1)bytes,ofwhich20to60bytesaretheheaderandtherestisdata
fromtheupperlayer.
Thetotallengthfielddefinesthetotallength ofthedatagramincludingtheheader.
Thoughasizeof65,535bytesmightseemlarge,thesizeoftheIPv4datagram
mayincreaseinthenearfutureastheunderlyingtechnologiesallowevenmore
throughput(greaterbandwidth).
Whenwediscussfragmentationinthenextsection,wewillseethatsomephys­
icalnetworksarenotable
toencapsulateadatagram of65,535bytesintheirframes.
Thedatagrammustbefragmentedtobeabletopassthroughthosenetworks.
Onemayaskwhyweneedthisfieldanyway.Whenamachine(routerorhost)
receivesaframe,itdropstheheaderandthetrailer,leavingthedatagram.Why
includeanextrafieldthat
isnotneeded?Theanswer isthatinmanycaseswe
reallydonotneedthevalueinthisfield.However,thereareoccasionsinwhichthe

SECTION20.2IPv4 587
datagramisnottheonlythingencapsulatedinaframe; itmaybethatpaddinghas
beenadded.Forexample,theEthernetprotocolhasaminimumandmaximum
restrictiononthesize
ofdatathatcanbeencapsulatedinaframe(46to1500bytes).
IfthesizeofanIPv4datagramislessthan46bytes,somepaddingwillbeaddedto
meetthisrequirement.Inthiscase,whenamachinedecapsulatesthedatagram,it
needstocheckthetotallengthfieldtodeterminehowmuchisreallydataandhow
muchispadding(seeFigure20.7).
Figure20.7 Encapsulationofasmalldatagram inanEthernetframe
L2
Header
Length:Minimum46bytes
Data
<46bytes II
Padding
,I
II
L2
Trailer
oIdentification.Thisfieldisusedinfragmentation(discussedinthenextsection).
oFlags.Thisfieldisusedinfragmentation(discussedinthenextsection).
oFragmentationoffset. Thisfieldisused infragmentation(discussedinthenext
section).
oTimetolive.Adatagramhasalimitedlifetimeinitstravelthrough aninternet.
Thisfieldwasoriginallydesigned
toholdatimestamp,whichwasdecrementedby
eachvisitedrouter.Thedatagramwasdiscardedwhenthevaluebecamezero.How­
ever,forthisscheme,allthemachinesmusthavesynchronizedclocksandmust
knowhowlongittakesforadatagramtogofromonemachinetoanother.Today,
thisfieldisusedmostlytocontrolthemaximumnumber
ofhops(routers)visitedby
thedatagram.Whenasourcehostsendsthedatagram,itstoresanumberinthis
field.Thisvalueisapproximately2timesthemaximumnumber
ofroutesbetween
anytwohosts.Eachrouterthatprocessesthedatagramdecrementsthisnumberby
1.
Ifthisvalue,afterbeingdecremented,iszero,therouterdiscardsthedatagram.
Thisfield
isneededbecause routingtablesintheInternetcanbecomecorrupted.
Adatagrammaytravelbetweentwoormoreroutersforalongtimewithouteverget­
tingdeliveredtothedestinationhost.Thisfieldlimitsthelifetime
ofadatagram.
Anotheruse
ofthisfieldistointentionallylimitthejourney ofthepacket.For
example,
ifthesourcewantstoconfinethepackettothelocalnetwork,itcanstore
1inthisfield.Whenthepacketarrivesatthefirstrouter,thisvalueisdecremented
to
0,andthedatagramisdiscarded.
oProtocol.This8-bitfielddefinesthehigher-levelprotocolthatusestheservices of
theIPv4layer.AnIPv4datagramcanencapsulatedatafromseveralhigher-level
protocolssuch
asTCP,UDP,ICMP,andIGMP.Thisfieldspecifiesthefinaldesti­
nationprotocoltowhichtheIPv4datagram
isdelivered.Inotherwords,sincethe
IPv4protocolcarriesdatafromdifferentotherprotocols,thevalue
ofthisfield
helpsthereceivingnetworklayerknow
towhichprotocolthedatabelong(see
Figure20.8).

588 CHAPTER 20NETWORKlAYER:INTERNETPROTOCOL
Figure20.8 Protocolfield andencapsulateddata
Transportlayer
Networklayer
The
"aloeoftheprotomlfielddefines
towhichprotocolthe databelong.
Thevalueofthisfieldforeachhigher-levelprotocol isshowninTable10.4.
Table20.4 Protocolvalues
Value Protocol
1 ICMP
2 IGMP
6 TCP
17 UDP
89 OSPF
oChecksum.Thechecksumconceptanditscalculationarediscussedlaterinthis
chapter.
oSourceaddress. This32-bitfielddefinestheIPv4address ofthesource.Thisfield
mustremainunchangedduringthetimetheIPv4datagramtravelsfromthesource
hosttothedestinationhost.
oDestinationaddress. This32-bitfielddefinestheIPv4address ofthedestination.
ThisfieldmustremainunchangedduringthetimetheIPv4datagramtravelsfrom
thesourcehosttothedestinationhost.
Example20.1
AnIPv4packethasarrivedwiththefirst8bitsasshown:
01000010
Thereceiverdiscardsthepacket. Why?
Solution
Thereisan elTOrinthispacket. The4leftmostbits(0100)showtheversion,whichiscorrect.The
next4bits(0010)show
aninvalidheaderlength(2 x4=8).Theminimumnumberofbytesinthe
header
mustbe20.Thepackethas beencorruptedintransmission.

SECTION20.2IPv4 589
Example20.2
InanIPv4packet,thevalue ofHLENis1000inbinary.Howmanybytes ofoptionsarebeing
carriedbythispacket?
Solution
TheHLENvalueis 8,whichmeansthetotalnumber ofbytesintheheaderis8 x4, or32bytes.
Thefirst20bytesarethebaseheader,thenext12bytesaretheoptions.
Example20.3
InanIPv4packet,thevalue ofHLENis5,andthevalue ofthetotallengthfieldisOx0028.How
manybytes
ofdataarebeingcarriedbythispacket?
Solution
TheHLENvalue is5,whichmeansthetotalnumber ofbytesintheheader is5 x4,or20bytes(no
options).Thetotallength
is40bytes,whichmeansthepacket iscarrying20bytes ofdata(40-20).
Example20.4
AnIPv4packethasarrivedwiththefirstfewhexadecimaldigitsasshown.
Ox45000028000100000102
...
Howmanyhopscanthispackettravelbeforebeingdropped?Thedatabelongtowhatupper-layer
protocol?
Solution
Tofindthetime-to-livefield,weskip8bytes(16hexadecimaldigits).Thetime-to-livefieldisthe
ninthbyte,whichis01.Thismeansthepacketcantravelonlyonehop.Theprotocolfieldisthe
nextbyte(02),whichmeansthattheupper-layerprotocolisIGMP(seeTable20.4).
Fragmentation
Adatagramcantravelthroughdifferentnetworks.EachrouterdecapsulatestheIPv4
datagramfromtheframeitreceives,processesit,andthenencapsulatesitinanother
frame.Theformatandsize
ofthereceivedframedependontheprotocolusedbythe
physicalnetworkthroughwhichtheframehasjusttraveled.Theformatandsize
of
thesentframedependontheprotocolusedbythephysicalnetworkthroughwhichthe
frameisgoingtotravel.Forexample,
ifarouterconnectsaLANtoa WAN,itreceives
aframeintheLANformatandsendsaframeinthe
WANformat.
MaximumTransferUnit(MTU)
Eachdatalinklayerprotocolhasitsownframeformatinmostprotocols.Oneofthe
fieldsdefinedintheformatisthemaximumsizeofthedatafield.Inotherwords,when
adatagramisencapsulatedinaframe, thetotalsize
ofthedatagrammustbelessthan
thismaximumsize,whichisdefinedbytherestrictionsimposedbythehardwareand
softwareusedinthenetwork(seeFigure20.9).
Thevalue
oftheMTUdependsonthephysicalnetworkprotocol.Table20.5shows
thevaluesforsomeprotocols.

590 CHAPTER 20NETWORKLAYER:INTERNETPROTOCOL
Figure20.9Maximumtransferunit(MTU)
IPdatagtam
.".M1lh ...
":Maximumli~gthofdatatomiencapsulated~a' frame
Frame
Table20.5 MTUsforsomenetworks
Protocol
MTU
Hyperchannel 65,535
TokenRing(16Mbps) 17,914
TokenRing(4Mbps) 4,464
FDDI 4,352
Ethernet 1,500
X.25 576
PPP 296
TomaketheIPv4protocolindependent ofthephysicalnetwork,thedesigners
decidedtomakethemaximumlength
oftheIPv4datagramequalto65,535bytes.This
makestransmissionmoreefficient
ifweuseaprotocolwithanMTU ofthissize.How­
ever,forotherphysicalnetworks,wemustdividethedatagramtomakeitpossibleto
passthroughthesenetworks.Thisiscalled
fragmentation.
ThesourceusuallydoesnotfragmenttheIPv4packet.Thetransportlayerwill
insteadsegmentthedataintoasizethatcanbeaccommodatedbyIPv4andthedata
linklayerinuse.
Whenadatagramisfragmented,eachfragmenthasitsownheaderwithmost
of
thefieldsrepeated,butwithsomechanged.Afragmenteddatagrammayitselfbefrag­
mented
ifitencountersanetworkwithanevensmallerMTU.Inotherwords,adata­
gramcanbefragmentedseveraltimesbeforeitreachesthefinaldestination.
InIPv4,adatagramcanbefragmentedbythesourcehostoranyrouterinthepath
althoughthereisatendencytolimitfragmentationonlyatthesource.Thereassembly
of
thedatagram,however,isdoneonlybythedestinationhostbecauseeachfragment
becomesanindependentdatagram.Whereasthefragmenteddatagramcantravelthrough
differentroutes,andwecannevercontrolorguaranteewhichrouteafragmenteddata­
grammaytake,allthefragmentsbelongingtothesamedatagramshouldfinallyarriveat
thedestinationhost.Soitislogicaltodothereassemblyatthefinaldestination.Aneven
strongerobjectiontoreassemblingpacketsduringthetransmissionistheloss
ofeffi­
ciencyitincurs.
Whenadatagramisfragmented,requiredparts
oftheheadermustbecopiedbyall
fragments.Theoptionfield
mayormaynotbecopied, aswewillseeinthenextsection.
Thehost
orrouterthatfragmentsadatagrammustchangethevalues ofthreefields:

SECTION20.2IPv4 591
flags,fragmentationoffset,andtotallength.Therestofthefieldsmustbecopied.Of
course,thevalueofthechecksummustberecalculatedregardlessoffragmentation.
FieldsRelatedtoFragmentation
Thefieldsthatarerelated tofragmentationandreassemblyofanIPv4datagramarethe
identification,flags,andfragmentationoffsetfields.
oIdentification.This16-bitfieldidentifiesadatagramoriginatingfromthesource
host.ThecombinationoftheidentificationandsourceIPv4addressmustuniquely
defineadatagramasitleavesthesourcehost.
Toguaranteeuniqueness,theIPv4
protocolusesacountertolabelthedatagrams.Thecounterisinitializedtoaposi­
tivenumber.WhentheIPv4protocolsendsadatagram,itcopiesthecurrentvalue
ofthecountertotheidentificationfieldandincrementsthecounter
by'~1.Aslongas
thecounteriskeptinthemainmemory,uniquenessisguaranteed.Whenadata­
gramisfragmented,thevalueintheidentificationfieldiscopiedtoallfragments.
Inotherwords,allfragmentshavethesameidentificationnumber,thesame
asthe
originaldatagram.Theidentificationnumberhelpsthedestinationinreassembling
thedatagram.
Itknowsthatallfragmentshavingthesameidentificationvaluemust
beassembledintoonedatagram.
oFlags.Thisisa3-bitfield.Thefirstbitisreserved.Thesecondbitiscalledthe do
notfragmentbit.Ifitsvalueis 1,themachinemustnotfragmentthedatagram.Ifit
cannotpassthedatagramthroughanyavailablephysicalnetwork,itdiscardsthe
datagramandsendsanICMPerrormessagetothesourcehost(seeChapter21).
If
itsvalueis 0,thedatagramcanbefragmented ifnecessary.Thethirdbitiscalled
the
morefragment bit.Ifitsvalueis 1,itmeansthedatagramisnotthelastfrag­
ment;therearemorefragmentsafterthisone.
Ifitsvalueis0,itmeansthisisthe
lastoronlyfragment(seeFigure20.10).
Figure20.10
Flagsusedinfragmentation
~ D:Donatfragment
~ M:Morefragments
oFragmentationoffset.This13-bitfieldshowstherelativeposition ofthisfrag­
mentwithrespecttothewholedatagram.
Itistheoffsetofthedataintheoriginal
datagrammeasuredinunits
of8bytes.Figure20.11showsadatagramwithadata
sizeof4000bytesfragmentedintothreefragments.
Thebytesintheoriginaldatagramarenumbered0
to3999.Thefirstfragment
carriesbytes0to1399.Theoffsetforthisdatagramis0/8
=O.Thesecondfrag­
mentcarriesbytes1400to2799;theoffsetvalueforthisfragmentis1400/8
=175.
Finally,thethirdfragmentcarriesbytes2800to3999.Theoffsetvalueforthis
fragment
is2800/8=350.
Rememberthatthevalueoftheoffset
ismeasuredinunits of8bytes.Thisis
donebecausethelength
oftheoffsetfieldisonly 13bitsandcannotrepresenta

592 CHAPTER 20NETWORKLAYER:INTERNETPROTOCOL
Figure20.11 Fragmentationexample
Byte0000
Offset
=0000/8=0
•••
Offset=0000/8=0
Offset
=1400/8=175
Offset=2800/8=350
2800 3999
sequenceofbytesgreaterthan8191.Thisforceshostsorroutersthatfragmentdata­
gramstochooseafragmentsizesothatthefirstbytenumber
isdivisibleby 8.
Figure20.12showsanexpandedview ofthefragmentsinFigure20.11.
Noticethevalue
oftheidentificationfield isthesameinallfragments.Noticethe
value
oftheflagsfieldwiththe morebitsetforallfragmentsexceptthelast.Also,
thevalue
oftheoffsetfieldforeachfragmentisshown.
Figure20.12
Detailedfragmentationexample
I I 1420
14,567
I111000
I
Bytes0000-1399
I I 820
14,567
I111175
Fragment1
I
II 4020
1/
14,567 I101000 I I 1420
Bytes1400-2199
I 14,567 I I
II175
I Fragment2.1
~
I I 620
Bytes0000-3999 Bytes1400-2799
14,567 IIII275
I
Fragment2
Originaldatagram
II 1220
Bytes
2200-2799
14,567 I101'350 Fragment2.2
I
Bytes2800-3999
Fragment3

SECTION20.2IPv4 593
Thefigurealsoshowswhathappens ifafragmentitselfisfragmented.Inthis
casethevalue
oftheoffsetfieldisalwaysrelativetotheoriginaldatagram.For
example,inthefigure,thesecondfragmentisitselffragmentedlatertotwofrag­
ments
of800bytesand600bytes,buttheoffsetshowstherelativeposition ofthe
fragmentstotheoriginaldata.
Itisobviousthateven ifeachfragmentfollowsadifferentpathandarrivesout
oforder,thefinaldestinationhostcanreassembletheoriginaldatagramfromthe
fragmentsreceived(ifnoneofthem
islost)byusingthefollowingstrategy:
1.Thefirstfragmenthasanoffsetfieldvalueofzero.
2.Dividethelength ofthefirstfragmentby 8.Thesecondfragmenthasanoffset
valueequaltothatresult.
3.Dividethetotallength ofthefirstandsecondfragmentsby 8.Thethirdfragment
has
anoffsetvalueequal tothatresult.
4.Continuetheprocess.Thelastfragmenthasa
morebitvalueof O.
Example20.5
Apackethasarrivedwithan MbitvalueofO.Isthisthefirstfragment,thelastfragment,ora
middle fragment?Do weknowifthepacketwasfragmented?
Solution
IftheMbitis0,itmeansthattherearenomorefragments;thefragmentisthelastone.However,
wecannotsay
iftheoriginalpacketwasfragmentedornot.Anonfragmentedpacketisconsid­
eredthelastfragment.
Example20.6
Apackethas arrivedwith anMbitvalueof1.Isthisthefirstfragment,thelastfragment, ora
middle fragment?Do weknow
ifthepacketwasfragmented?
Solution
IftheMbitis1,itmeansthatthereisatleastonemorefragment.Thisfragmentcanbethefirst
oneoramiddleone,butnotthelastone.
Wedon'tknowifitisthefirstoneoramiddleone;we
needmoreinformation(thevalue
ofthefragmentationoffset).SeeExample20.7.
Example20.7
Apackethasarrivedwithan Mbitvalueof1andafragmentationoffsetvalue ofO.Isthisthefirst
fragment,thelastfragment,
Oramiddlefragment?
Solution
Becausethe Mbitisl,itiseitherthefirstfragmentoramiddleone.Becausetheoffsetvalueis0,
itisthefirstfragment.
Example20.8
Apackethasarrivedinwhichtheoffsetvalueis100.Whatisthenumber ofthefirstbyte?Dowe
knowthenumber
ofthelastbyte?

594 CHAPTER 20NETWORKLAYER:INTERNETPROTOCOL
Solution
Tofindthenumber ofthefirstbyte,wemultiplytheoffsetvalueby 8.Thismeansthatthefirst
bytenumberis800.
Wecannotdeterminethenumber ofthelastbyteunlessweknowthelength
ofthedata.
Example20.9
Apackethasarrivedinwhichtheoffsetvalueis100,thevalue ofHLENis5,andthevalue ofthe
tota1lengthfield
is100.Whatarethenumbers ofthefirstbyteandthelastbyte?
Solution
Thefirstbytenumberis100x 8 =800.Thetotallengthis100bytes,andtheheaderlength is
20bytes(5x4),whichmeansthatthereare80bytesinthisdatagram. Ifthefirstbytenumber
is800,thelastbytenumbermustbe879.
Checksum
Wediscussedthegeneralideabehindthechecksumandhowit iscalculatedinChapter 10.
TheimplementationofthechecksumintheIPv4packetfollowsthesameprinciples.First,
thevalue
ofthechecksumfieldissetto O.Thentheentireheaderisdividedinto16-bit
sectionsandaddedtogether.Theresult(sum)iscomplementedandinsertedintothe
checksumfield.
ThechecksumintheIPv4packetcoversonlytheheader,notthedata.Therearetwo
goodreasonsforthis.First,allhigher-levelprotocolsthatencapsulatedataintheIPv4
datagramhaveachecksumfieldthatcoversthewholepacket.Therefore,thechecksum
fortheIPv4datagramdoesnothave
tochecktheencapsulateddata.Second,theheader
oftheIPv4packetchangeswitheachvisitedrouter,butthedatadonot.Sothechecksum
includesonlythepartthathaschanged.
Ifthedatawereincluded,eachroutermustrecal­
culatethechecksumforthewholepacket,whichmeansanincreaseinprocessingtime.
Example20.10
Figure20.13showsanexample ofachecksumcalculationforanIPv4headerwithoutoptions.
Theheaderisdividedinto16-bitsections.Allthesectionsareaddedandthesumiscomple­
mented.Theresult
isinsertedinthechecksumfield.
Options
TheheaderoftheIPv4datagram ismadeoftwoparts:afixedpaltandavariablepart.
Thefixedpart
is20byteslongandwasdiscussedintheprevioussection.Thevariable
partcomprisestheoptionsthatcanbeamaximum
of40bytes.
Options,asthenameimplies,arenotrequiredforadatagram.Theycanbeusedfor
networktestinganddebugging.Althoughoptionsarenotarequiredpart
oftheIPv4
header,optionprocessingisrequired
oftheIPv4software.Thismeansthatallimple­
mentationsmustbeable
tohandleoptions iftheyarepresentintheheader.
Thedetaileddiscussion
ofeachoptionisbeyondthescope ofthisbook.Wegive
thetaxonomy
ofoptionsinFigure20.14andbrieflyexplainthepurpose ofeach.
NoOperation
Ano-operationoption isaI-byteoptionused asafillerbetweenoptions.

SECTION20.2IPv4 595
Figure20.13 ExampleofchecksumcalculationinIPv4
4I5I0 28
1 oI 0
4I
17{}
10.12.14.5
12.6.7.9
4,5,and0
------+4 5 00
28------+00 1 C
1------+0 0 0 1
oand0------+0 0 00
4and17------+0411
0------+0 0 00
10.12------+0A0C
14.5------+0E05
12.6------+0C06
7.9------+0709
Sum------+744E
Checksum------+8B B 1
Figure20.14 TaxonomyofoptionsinIPv4
Single-byte
Nooperation
Endofoption
.Options
Multiple-byte
Recordroute
Strictsourceroute
Loosesourceroute
Timestamp
EndofOption
Anend-of-optionoption isaI-byteoptionusedforpaddingattheend oftheoption
field.
It,however,canonlybeused asthelastoption.
RecordRoute
Arecordrouteoption isusedtorecordtheInternetroutersthathandlethedatagram.
Itcanlistuptoninerouteraddresses. Itcanbeusedfordebuggingandmanagement
purposes.
StrictSourceRoute
Astrictsourcerouteoption isusedbythesourcetopredeterminearouteforthedata­
gram
asittravelsthroughtheInternet.Dictation ofaroutebythesourcecanbeuseful

596 CHAPTER20NETWORKLAYER:INTERNETPROTOCOL
forseveralpurposes.Thesendercanchoosearoutewithaspecifictype ofservice,such
asminimumdelayormaximumthroughput.Alternatively,itmaychoosearoutethatis
saferormorereliableforthesender'spurpose.Forexample,asendercanchoosearoute
sothatitsdatagramdoesnottravelthroughacompetitor'snetwork.
Ifadatagramspecifiesastrictsourceroute,alltheroutersdefinedintheoption
mustbevisitedbythedatagram.Aroutermustnotbevisited
ifitsIPv4address isnot
listedinthedatagram.
Ifthedatagramvisitsarouterthatisnotonthelist,thedatagram
isdiscardedandanerrormessageisissued. Ifthedatagramarrivesatthedestination
andsome
oftheentrieswerenotvisited, itwillalsobediscardedandanerrormessage
issued.
LooseSourceRoute
Aloosesourcerouteoptionissimilar
tothestrictsourceroute,butitislessrigid.Each
routerinthelistmustbevisited,butthedatagramcanvisitotherrouters
aswell.
Timestamp
A
timestampoptionisusedtorecordthetime ofdatagramprocessingbyarouter.The
timeisexpressed
inmillisecondsfrommidnight,Universaltime orGreenwichmean
time.Knowingthetimeadatagramisprocessedcanhelpusersandmanagerstrackthe
behavior
oftheroutersintheInternet.Wecanestimatethetimeittakesforadatagram
togofromone
~outertoanother.Wesayestimatebecause,althoughallroutersmayuse
Universaltime,theirlocalclocksmaynotbesynchronized.
20.3IPv6
ThenetworklayerprotocolintheTCPIIPprotocolsuiteiscurrentlyIPv4(Internet­
workingProtocol,version4).IPv4providesthehost-to-hostcommunicationbetween
systemsintheInternet.AlthoughIPv4iswelldesigned,datacommunicationhas
evolvedsincetheinception
ofIPv4inthe1970s.IPv4hassomedeficiencies(listed
below)thatmakeitunsuitableforthefast-growingInternet.
oDespiteallshort-termsolutions,such assubnetting,classlessaddressing,and NAT,
addressdepletion isstillalong-termproblemintheInternet.
oTheInternetmustaccommodatereal-timeaudioandvideotransmission.Thistype
oftransmissionrequiresminimumdelaystrategiesandreservation ofresourcesnot
providedintheIPv4design.
oTheInternetmustaccommodateencryptionandauthentication ofdataforsome
applications.NoencryptionorauthenticationisprovidedbyIPv4.
Toovercomethesedeficiencies,
IPv6(InternetworkingProtocol,version6),also
known
asIPng(InternetworkingProtocol,nextgeneration),wasproposedandis
nowastandard.
InIPv6,theInternetprotocolwasextensivelymodified toaccommo­
datetheunforeseengrowth
oftheInternet.Theformatandthelength oftheIPaddress
werechangedalong withthepacketformat.Relatedprotocols,suchasICMP,werealso
modified.Otherprotocolsinthenetworklayer,such
asARP,RARP,andIGMP,were

SECTION20.3IPv6 597
eitherdeletedorincludedintheICMPv6protocol(seeChapter21).Routingprotocols,
suchasRIPandOSPF(seeChapter22),werealsoslightlymodifiedtoaccommodate
thesechanges.CommunicationsexpertspredictthatIPv6anditsrelatedprotocolswill
soonreplacethecurrentIPversion.InthissectionfirstwediscussIPv6.Thenweexplore
thestrategiesusedforthetransitionfromversion4toversion6.
Theadoption
ofIPv6hasbeenslow.Thereasonisthattheoriginalmotivationfor
itsdevelopment,depletion
ofIPv4addresses,
hasbeenremediedbyshort-termstrategies
such
asclasslessaddressingand NAT.However,thefast-spreadinguse oftheInternet,
andnewservicessuch
asmobileIP,IPtelephony,andIP-capablemobiletelephony,may
eventuallyrequirethetotalreplacement
ofIPv4withIPv6.
Advantages
Thenext-generationIP,orIPv6,hassomeadvantagesoverIPv4thatcanbesummarized
asfollows:
oLargeraddressspace. AnIPv6addressis128bitslong,aswediscussed inChap­
ter19.Comparedwiththe32-bitaddress
ofIPv4,thisisahuge(2
96
)
increasein
theaddressspace.
oBetterheaderformat. IPv6usesanewheaderformatinwhichoptionsaresepa­
ratedfromthebaseheaderandinserted,whenneeded,betweenthebaseheader
andtheupper-layerdata.Thissimplifiesandspeedsuptheroutingprocessbecause
most
oftheoptionsdonotneedtobecheckedbyrouters.
oNewoptions.IPv6hasnewoptions toallowforadditionalfunctionalities.
oAllowanceforextension. IPv6isdesignedtoallowtheextension oftheprotocolif
requiredbynewtechnologies orapplications.
oSupportforresourceallocation. InIPv6,thetype-of-servicefieldhasbeen
removed,butamechanism(calledjlow
label)hasbeenaddedtoenablethesource
torequestspecialhandling ofthepacket.Thismechanismcanbeusedtosupport
trafficsuch
asreal-timeaudioandvideo.
oSupportformoresecurity. TheencryptionandauthenticationoptionsinIPv6
provideconfidentialityandintegrity
ofthepacket.
PacketFormat
TheIPv6packet isshowninFigure20.15.Eachpacket iscomposedofamandatorybase
headerfollowedbythepayload.Thepayloadconsists
oftwoparts:optionalextension
headersanddatafromanupperlayer.Thebaseheaderoccupies40bytes,whereasthe
extensionheadersanddatafromtheupperlayercontainup
to65,535bytes ofinformation.
BaseHeader
Figure20.16showsthe baseheader withitseightfields.
Thesefieldsare
asfollows:
oVersion.This4-bitfielddefinestheversionnumber oftheIP.ForIPv6,thevalue is6.
oPriority.The4-bitpriorityfielddefinesthepriority ofthepacketwithrespect to
trafficcongestion. Wewilldiscussthisfieldlater.

598 CHAPTER 20NETWORKLAYER:INTERNETPROTOCOL
Figure20.15IPv6datagramheaderandpayload
1__'_4_0_b-,---Yt_es_--"I__' u-'---P_to_65_,5_3_5_bY_te_s -----+.1
Extensionheaders
(optional)
Figure20.16FormatofanIPv6datagram
Datapacketfromupperlayer
I'4bitsII_4bits'1-
8bits 8bits 8bits
..VER
I
PRl
I
Flowlabel
Payloadlength --kN~t head;;
I
Hoplimit
::
_______________Sourceaddress
c:
~ Destinationaddress
-
, '"
I I
.Nextheader Headerlength
,--'
c:
----
Nextheader
I
Headerlength
I.- .'
I
----


···•
L
,
I I
Nextheader' Headerlength
oFlowlabel.Theflowlabelisa3-byte(24-bit)fieldthatisdesignedtoprovide
specialhandlingforaparticularflow
ofdata.Wewilldiscussthisfieldlater.
oPayloadlength.The2-bytepayloadlengthfielddefinesthelength oftheIPdata­
gramexcludingthebaseheader.
oNextheader.The nextheaderisan8-bitfielddefiningtheheaderthatfollowsthe
baseheaderinthedatagram.Thenextheaderiseitherone
oftheoptionalexten­
sionheadersusedbyIPortheheader
ofanencapsulatedpacketsuch asUDPor
TCP.Eachextensionheaderalsocontainsthisfield.Table20.6showsthevalues
of
nextheaders.Notethatthisfieldinversion4iscalledtheprotocol.
oHoplimit.This8-bithoplimitfieldservesthesamepurpose astheTILfieldinIPv4.
oSourceaddress.Thesourceaddressfieldisa16-byte(128-bit)Internetaddress
thatidentifies theoriginalsource
ofthedatagram.

SECTION20.3IPv6 599
Table20.6 Nextheadercodes forIPv6
Code NextHeader
0 Hop-by-hopoption
2 ICMP
6 TCP
17
UDP
43 Sourcerouting
44 Fragmentation
50 Encryptedsecuritypayload
51 Authentication
59 Null(nonextheader)
60 Destinationoption
oDestinationaddress. Thedestinationaddressfieldisa16-byte(128-bit)Internet
addressthatusuallyidentifiesthefinaldestination
ofthedatagram.However, if
sourceroutingisused,thisfieldcontainstheaddress ofthenextrouter.
Priority
Thepriorityfield oftheIPv6packetdefinesthepriority ofeachpacketwithrespectto
otherpacketsfromthesamesource.Forexample,
ifoneoftwoconsecutivedatagrams
mustbediscardedduetocongestion,thedatagramwiththelower
packetpriority will
bediscarded.IPv6dividestrafficintotwobroadcategories:congestion-controlledand
noncongestion-controlled.
Congestion-ControlledTraffic Ifasourceadaptsitselftotrafficslowdownwhen
thereiscongestion,thetrafficisreferredtoas
congestion-controlledtraffic. For
example,TCP,whichusestheslidingwindowprotocol,caneasilyrespondtotraffic. In
congestion-controlledtraffic, itisunderstoodthatpacketsmayarrivedelayed,lost,or
out
oforder.Congestion-controlleddataareassignedprioritiesfrom0to7,aslistedin
Table20.7.Apriority
of0isthelowest;apriority of7isthehighest.
Table20.7 Prioritiesforcongestion-controlledtraffic
Priority Meaning
0 Nospecifictraffic
1 Backgrounddata
2 Unattendeddatatraffic
3 Reserved
4 Attendedbulkdatatraffic
5 Reserved
6 Interactivetraffic
7 Controltraffic

600 CHAPTER 20NETWORKLAYER:INTERNETPROTOCOL
Theprioritydescriptionsare asfollows:
oNospecifictraffic.Apriority of0isassignedtoapacketwhentheprocessdoes
notdefineapriority.
oBackgrounddata.Thisgroup(priority 1)definesdatathatareusuallydelivered
inthebackground.Delivery
ofthenewsisagoodexample.
oUnattendeddatatraffic.Iftheuserisnotwaiting(attending)forthedatatobe
received,thepacketwillbegivenapriority
of2.E-mailbelongstothisgroup.The
recipient
ofane-maildoesnotknowwhenamessagehasarrived.Inaddition,an
e-mailisusuallystoredbeforeitisforwarded.Alittlebit
ofdelayis oflittle
consequence.
oAttendedbulkdatatraffic.Aprotocolthattransfersdatawhiletheuseriswaiting
(attending)toreceivethedata(possiblywithdelay)isgivenapriority
of4.FTP
andHTTPbelongtothisgroup.
oInteractivetraffic.Protocolssuch asTELNETthatneeduserinteractionare
assignedthesecond-highestpriority(6)inthisgroup.
oControltraffic.Controltrafficisgiventhehighestpriority(7).Routingprotocols
such
asOSPFandRIPandmanagementprotocolssuch asSNMPhavethispriority.
Noncongestion-ControlledTrafficThisreferstoatype
oftrafficthatexpectsmini­
mumdelay.Discarding
ofpacketsisnotdesirable.Retransmissioninmostcasesis
impossible.Inotherwords,thesourcedoesnotadaptitselftocongestion.Real-time
audioandvideoareexamples
ofthistypeoftraffic.
Prioritynumbersfrom8to
15areassignedtononcongestion-controlledtraffic.
Althoughtherearenotyetanyparticularstandardassignmentsforthistype
ofdata,the
prioritiesareusuallybasedonhowmuchthequalityofreceiveddataisaffectedbythe
discarding
ofpackets.Datacontaininglessredundancy(such aslow-fidelityaudioor
video)canbegivenahigherpriority(15).Datacontainingmoreredundancy(such
as
high-fidelityaudioorvideo)aregivenalowerpriority(8).SeeTable20.8.
Table20.8
Prioritiesfornoncongestion-controlledtraffic
Priority Meaning
8
Datawithgreatestredundancy
... .,.
15 Datawithleastredundancy
FlowLabel
Asequenceofpackets,sentfromaparticularsourcetoaparticulardestination,thatneeds
specialhandlingbyroutersiscalleda
flowofpackets.Thecombinationofthesource
addressandthevalue
oftheflowlabeluniquelydefinesa flowofpackets.
Toarouter,aflowisasequence ofpacketsthatsharethesamecharacteristics,such
astravelingthesamepath,usingthesameresources,havingthesamekindofsecurity,
and
soon.Arouterthatsupportsthehandling offlowlabelshasa flowlabeltable.The
tablehasanentryforeachactive
flowlabel; eachentrydefinestheservicesrequiredby

SECTION20.3IPv6 601
thecorrespondingflowlabel.Whentherouterreceivesapacket, itconsultsitsflow
labeltabletofindthecorrespondingentryfortheflowlabelvaluedefinedinthepacket.
Itthenprovidesthepacketwiththeservicesmentioned intheentry.However,notethat
theflowlabelitselfdoesnotprovidetheinformationfortheentries
oftheflowlabel
table;theinformationisprovidedbyothermeanssuchasthehop-by-hopoptionsor
otherprotocols.
Initssimplestform,aflowlabelcanbeusedtospeeduptheprocessing
ofapacket
byarouter.Whenarouterreceivesapacket,instead
ofconsultingtheroutingtableand
goingthrougharoutingalgorithmtodefinetheaddress
ofthenexthop,itcaneasily
lookinaflowlabeltableforthenexthop.
Initsmoresophisticatedform,a
flowlabelcanbeusedtosupportthetransmissionof
real-timeaudioandvideo.Real-timeaudioorvideo,particularlyindigitalform,requires
resourcessuchashighbandwidth,largebuffers,longprocessingtime,andsoon.A
processcanmakeareservationfortheseresourcesbeforehand
toguaranteethatreal-time
datawillnotbedelayedduetoalack
ofresources.Theuse ofreal-timedataandthe
reservation
oftheseresourcesrequireotherprotocolssuch asReal-TimeProtocol(RTP)
andResourceReservationProtocol(RSVP)inadditiontoIPv6.
Toallowtheeffectiveuse offlowlabels,threeruleshavebeendefined:
1.Theflowlabelisassignedtoapacketbythesourcehost.Thelabelisarandom
numberbetween1and2
24
-
1.Asourcemustnotreuseaflowlabelforanewflow
whiletheexistingflowisstillactive.
2.Ifahostdoesnotsupporttheflowlabel, itsetsthisfieldtozero. Ifarouterdoesnot
supporttheflowlabel,
itsimplyignoresit.
3.Allpacketsbelongingtothesameflowhavethesamesource,samedestination,
samepriority,andsameoptions.
ComparisonBetweenIPv4 andIPv6Headers
Table20.9comparesIPv4andIPv6headers.
Table20.9
ComparisonbetweenIPv4andIPv6packetheaders
Comparison
1.TheheaderlengthfieldiseliminatedinIPv6becausethelength oftheheaderisfixedin
thisversion.
2.Theservicetypefield iseliminatedinIPv6.Thepriorityandflowlabelfieldstogethertake
overthefunction
oftheservicetypefield.
3.ThetotallengthfieldiseliminatedinIPv6andreplacedbythepayloadlengthfield.
4.Theidentification,flag,andoffsetfieldsareeliminatedfromthebaseheaderinIPv6.They
areincludedinthefragmentationextensionheader.
5.TheTTLfieldiscalledhoplimitinIPv6.
6.Theprotocolfieldisreplacedbythenextheaderfield.
7.Theheaderchecksumiseliminatedbecausethechecksum isprovidedbyupper-layer
protocols;
itisthereforenotneededatthislevel.
8.TheoptionfieldsinIPv4areimplementedasextensionheadersinIPv6.

602 CHAPTER 20NETWORKLAYER:INTERNETPROTOCOL
ExtensionHeaders
Thelengthofthebaseheader isfixedat40bytes.However,togivegreaterfunctionality
totheIPdatagram,thebaseheadercanbefollowedbyuptosix
extensionheaders.
ManyoftheseheadersareoptionsinIPv4.Sixtypes ofextensionheadershavebeen
defined,asshowninFigure20.17.
Figure20.17 Extensionheadertypes
PadI
Extension
headers
Hop-by-hopoption
Sourcerouting
Fragmentation
Authentication
Encryptedsecuritypayload
Destinationoption
PadN
Jumbopayload
Hop-by-HopOption
Thehop-by-hopoption isusedwhenthesourceneedstopassinformationtoallrouters
visitedbythedatagram.Sofar,onlythreeoptionshavebeendefined:
Padl,PadN,and
jumbopayload.ThePadloptionis1bytelongandisdesignedforalignmentpur­
poses.PadNissimilarinconceptto
Padi.ThedifferenceisthatPadNisusedwhen2or
morebytesisneededforalignment.Thejumbopayloadoptionisusedtodefineapay­
loadlongerthan65,535bytes.
Source RoutingThesourceroutingextensionheadercombinestheconceptsofthe
strictsourcerouteandtheloosesourcerouteoptions
ofIPv4.
Fragmentation
Theconcept offragmentationisthesame asthatinIPv4.However,theplacewhere
fragmentationoccursdiffers.InIPv4,thesourceorarouterisrequiredtofragment
if
thesizeofthedatagram islargerthantheMTU ofthenetworkoverwhichthedatagram
travels.InIPv6,onlytheoriginalsourcecanfragment.Asourcemustusea
pathMTU
discoverytechnique tofindthesmallestMTUsupportedbyanynetworkonthepath.
Thesourcethenfragmentsusingthisknowledge.
Authentication
Theauthenticationextensionheaderhasadualpurpose:itvalidatesthemessagesender
andensurestheintegrityofdata.
Wediscussthisextensionheaderwhenwediscussnet­
worksecurityinChapter31.

SECTION20.4TRANSITIONFROMIPv4TOIPv6 603
EncryptedSecurityPayload
Theencryptedsecuritypayload(ESP)isanextensionthatprovidesconfidentiality
andguardsagainsteavesdropping.
WediscussthisextensionheaderinChapter31.
Destination
OptionThedestinationoptionisusedwhenthesourceneedstopass
informationtothedestinationonly.Intermediateroutersarenotpermittedaccesstothis
information.
ComparisonBetweenIPv4Options andIPv6ExtensionHeaders
Table20.10comparestheoptionsinIPv4withtheextensionheadersinIPv6.
Table20.10
ComparisonbetweenIPv4optionsandIPv6extensionheaders
Comparison
1.Theno-operationandend-of-optionoptionsinIPv4arereplacedby PadlandPadN
optionsinIPv6.
2.TherecordrouteoptionisnotimplementedinIPv6because itwasnotused.
3.Thetimestampoptionisnotimplementedbecauseitwasnotused.
4.ThesourcerouteoptioniscalledthesourcerouteextensionheaderinIPv6.
5.Thefragmentationfieldsinthebaseheadersection ofIPv4havemovedtothefragmentation
extensionheaderinIPv6.
6.TheauthenticationextensionheaderisnewinIPv6.
7.TheencryptedsecuritypayloadextensionheaderisnewinIPv6.
20.4TRANSITIONFROMIPv4 TOIPv6
Becauseofthehugenumber ofsystemsontheInternet,thetransitionfromIPv4
toIPv6cannothappensuddenly.Ittakesaconsiderableamount
oftimebeforeevery
systemintheInternetcanmovefromIPv4toIPv6.Thetransitionmustbesmoothto
preventanyproblems
betweenIPv4andIPv6systems.Threestrategieshavebeen
devisedbythe
!ElFtohelpthetransition(seeFigure20.18).
Figure20.18Threetransitionstrategies

604 CHAPTER 20NETWORKLAYER:INTERNETPROTOCOL
DualStack
Itisrecommendedthatall hosts,beforemigratingcompletelytoversion6,havea dual
stackofprotocols.Inotherwords,astationmustrunIPv4andIPv6simultaneouslyuntil
alltheInternetusesIPv6.SeeFigure20.19forthelayoutofadual-stackconfiguration.
Figure20.19Dualstack
oIPv6system
Transportand
applicationlayers
IPv4 IPv6
r ~
Underlying
LANor
WAN
technology
m
TToIPv4syste
Todeterminewhichversiontousewhensendingapackettoadestination,thesource
hostqueriestheDNS.IftheDNSreturnsanIPv4address,thesourcehostsendsanIPv4
packet.
IftheDNSreturnsanIPv6address,thesourcehostsendsanIPv6packet.
Tunneling
ThnnelingisastrategyusedwhentwocomputersusingIPv6wanttocommunicate
witheachotherandthepacketmustpassthrougharegionthatusesIPv4.
Topass
throughthisregion,thepacketmusthaveanIPv4address.SotheIPv6packetisencap­
sulatedinanIPv4packetwhenitenterstheregion,anditleavesitscapsulewhenit
exitstheregion.Itseemsas
iftheIPv6packetgoesthroughatunnelatoneendand
emergesattheotherend.
TomakeitclearthattheIPv4packetiscarryinganIPv6
packet
asdata,theprotocolvalueissetto41.TunnelingisshowninFigure20.20.
Figure20.20Tunnelingstrategy
IPv6 IPv6
host host
&-------ieDlIS:~....._----llii~~------t..1It:i;;:tt-------&
IPv4region

IPv6regioll
SECTION20.5RECOMMENDED READING 605
HeaderTranslation
Headertranslationisnecessarywhenthemajority oftheInternethasmovedtoIPv6
butsomesystemsstilluseIPv4.ThesenderwantstouseIPv6,butthereceiverdoesnot
understandIPv6.Tunnelingdoesnotworkinthissituationbecausethepacketmustbe
intheIPv4formattobeunderstoodbythereceiver.Inthiscase,theheaderformatmust
betotallychanged throughheadertranslation.Theheader
oftheIPv6packetiscon­
vertedtoanIPv4header(seeFigure20.21).
Figure20.21Headertranslationstrategy
iii
IPv6 • I IPv4
host host
&-----;'l..~~I-----_cO~---...,..1I:ii:!II,t------&
Header
translation
donehere
HeadertranslationusesthemappedaddresstotranslateanIPv6addresstoanIPv4
address.Table20.11listssomerulesusedintransforminganIPv6packetheadertoan
IPv4packetheader.
Table20.11
Headertranslation
HeaderTranslationProcedure
1.TheIPv6mappedaddressischangedtoanIPv4addressbyextractingtherightmost32bits.
2.Thevalue
oftheIPv6priorityfieldisdiscarded.
3.Thetype
ofservicefield inIPv4issettozero.
4.ThechecksumforIPv4iscalculatedandinsertedinthecorrespondingfield.
5.TheIPv6 flowlabelisignored.
6.CompatibleextensionheadersareconvertedtooptionsandinsertedintheIPv4header.
Somemayhavetobedropped.
7.Thelength
ofIPv4headeriscalculatedandinsertedintothecorrespondingfield.
8.Thetotallength oftheIPv4packet iscalculatedandinsertedinthecorrespondingfield.
20.5RECOMMENDED READING
Formoredetailsaboutsubjectsdiscussedinthischapter,werecommendthefollowing
booksandsites.Theitemsinbrackets[
...]refertothereferencelistattheend of
thetext.

606 CHAPTER20NETWORKLAYER:INTERNETPROTOCOL
Books
IPv4isdiscussedinChapter8 of[For06],Chapter3 of[Ste94J,Section4.1 of[PD03],
Chapter
18of[Sta04],andSection5.6 of[Tan03].IPv6isdiscussedinChapter27 of
[For06]and[Los04].
Sites
owww.ietforg/rfc.htmlInformationaboutRFCs
RFCs
AdiscussionofIPv4canbefoundinfollowingRFCs:
760,781,791,815,1025,1063,1071,1141,1190,1191,1624,2113
AdiscussionofIPv6canbefoundinthefollowingRFCs:
1365,1550,1678,1680,1682,1683,1686,1688,1726,1752,1826,1883,1884,1886,1887,
1955,2080,2373,2452,2463,2465,2466,2472,2492,2545,2590
20.6KEYTERMS
authentication
baseheader
best-effortdelivery
codepoint
connectionlessservice
connection-orientedservice
datagram
destinationaddress
destinationoption
differentiatedservices
dualstack
encryptedsecuritypayload(ESP)
end-of-optionoption
extensionheader
flowlabel
fragmentation
fragmentationoffset
headerlength
headertranslation
hoplimit
hop-by-hopoption
InternetProtocol(IP)
InternetProtocol,nextgeneration(IPng)
InternetProtocolversion4(IPv4)
InternetProtocolversion6(IPv6)
jumbopayload
loosesourcerouteoption
maximumtransferunit(MTU)
nextheader
noncongestion-controlledtraffic
no-operationoption
packetpriority
Padl
PadN
pathMTUdiscoverytechnique
precedence

recordrouteoption
servicetype
sourceaddress
strictsourcerouteoption
SECTION20.8PRACTICE SET 607
timetolive
timestampoption
tunneling
type
ofservice(TOS)
20.7SUMMARY
oIPv4isanunreliableconnectionlessprotocolresponsibleforsource-to-destination
delivery.
oPacketsintheIPv4layerarecalleddatagrams.Adatagramconsists ofaheader
(20to60bytes)anddata.Themaximumlength
ofadatagramis65,535bytes.
oTheMTUisthemaximumnumber ofbytesthatadatalinkprotocolcanencapsulate.
MTUsvaryfromprotocoltoprotocol.
oFragmentationisthedivisionofadatagramintosmallerunitstoaccommodatethe
MTU
ofadatalinkprotocol.
oTheIPv4datagramheaderconsists ofafixed,20-bytesectionandavariableoptions
sectionwithamaximum
of40bytes.
oTheoptionssection oftheIPv4headerisusedfornetworktestinganddebugging.
oThesixIPv4optionseachhaveaspecificfunction.Theyareasfollows:filler
betweenoptionsforalignmentpurposes,padding,recordingtheroutethedatagram
takes,selection
ofamandatoryroutebythesender,selection ofcertainroutersthat
mustbevisited,andrecording
ofprocessingtimesatrouters.
oIPv6,thelatestversion oftheInternetProtocol,hasa128-bitaddressspace,arevised
headerformat,newoptions,anallowanceforextension,supportforresource
allocation,andincreasedsecuritymeasures.
oAnIPv6datagramiscomposed ofabaseheaderandapayload.
oExtensionheadersaddfunctionalitytotheIPv6datagram.
oThreestrategiesusedtohandlethetransitionfromversion4toversion6aredual
stack,tunneling,andheadertranslation.
20.8PRACTICESET
ReviewQuestions
1.Whatisthedifferencebetweenthedelivery ofaframeinthedatalinklayerandthe
delivery
ofapacketinthenetworklayer?
2.Whatisthedifferencebetweenconnectionlessandconnection-orientedservices?
Whichtype
ofserviceisprovidedbyIPv4?Whichtype ofserviceisprovidedbyIPv6?
3.DefinefragmentationandexplainwhytheIPv4andIPv6protocolsneedtofragment
somepackets.
Isthereanydifferencebetweenthetwoprotocolsinthismatter?

608 CHAPTER20NETWORKLAYER:INTERNETPROTOCOL
4.ExplaintheprocedureforchecksumcalculationandverificationintheIPv4protocol.
Whatpart
ofanIPv4packetiscoveredinthechecksumcalculation?Why?Are
options,
ifpresent,includedinthecalculation?
5.ExplaintheneedforoptionsinIPv4andlisttheoptionsmentionedinthischapter
withabriefdescription
ofeach.
6.Compareandcontrastthefieldsinthemainheaders ofIPv4andIPv6.Makeatable
thatshowsthepresence
orabsenceofeachfield.
7.BothIPv4andIPv6assumethatpacketsmayhavedifferentprioritiesorprecedences.
Explainhoweachprotocolhandlesthisissue.
8.CompareandcontrasttheoptionsinIPv4andtheextensionheadersinIPv6.Make
atablethatshowsthepresenceorabsence
ofeach.
9.Explainthereasonfortheelimination
ofthechecksumintheIPv6header.
10.ListthreetransitionstrategiestomovefromIPv4toIPv6.Explainthedifference
betweentunnelinganddualstackstrategiesduringthetransitionperiod.Whenis
eachstrategyused?
Exercises
11.Whichfields oftheIPv4headerchangefromroutertorouter?
12.CalculatetheHLEN(inIPv4)value ifthetotallengthis1200bytes,1176 ofwhich
isdatafromtheupperlayer.
13.Table20.5liststheMTUsformanydifferentprotocols.TheMTUsrangefrom296
to65,535.Whatwouldbetheadvantages
ofhavingalargeMTU?Whatwouldbe
theadvantages
ofhavingasmallMTU?
14.Givenafragmenteddatagram(inIPv4)withanoffset of120,howcanyoudetermine
thefirstandlastbytenumbers?
15.Canthevalue oftheheaderlengthinanIPv4packetbelessthan5?Whenisit
exactly5?
16.ThevalueofHLENinanIPv4datagramis 7.Howmanyoptionbytesarepresent?
17.Thesizeoftheoptionfield ofanIPv4datagramis20bytes.Whatisthevalue of
HLEN?Whatisthevalueinbinary?
18.ThevalueofthetotallengthfieldinanIPv4datagramis36,andthevalue ofthe
headerlengthfieldis
5.Howmanybytes ofdataisthepacketcarrying?
19.AnIPv4datagram iscarrying1024bytes ofdata.Ifthereisnooptioninformation,
whatisthevalue
oftheheaderlengthfield?Whatisthevalue ofthetotallength
field?
20.Ahost
issending100datagramstoanotherhost. Iftheidentificationnumber ofthe
firstdatagram
is1024,whatistheidentificationnumber ofthelast(inIPv4)?
21.
AnIPv4datagramarriveswithfragmentationoffset of0 andan Mbit(morefragment
bit)
ofO.Isthisafirstfragment,middlefragment,orlastfragment?
22.AnIPv4fragmenthasarrivedwithanoffsetvalue
of100.Howmanybytes ofdata
wereoriginallysentbythesourcebeforethedatainthisfragment?

SECTION20.8PRACTICE SET 609
23.AnIPv4datagramhasarrivedwiththefollowinginformation intheheader(in
hexadecimal):
Ox4500005400035850 200600007C4E03 02B4OEOF02
a.Isthepacketcorrupted?
b.Arethereanyoptions?
c.Isthepacketfragmented?
d.Whatisthesizeofthedata?
e.Howmanymorerouterscanthepackettravelto?
f.Whatistheidentificationnumber ofthepacket?
g.Whatisthetype ofservice?
24.InanIPv4datagram,the
Mbitis0,thevalue ofHLENis5,thevalue oftotal
lengthis200,andtheoffsetvalueis200.Whatisthenumber
ofthefirstbyteand
number
ofthelastbyte inthisdatagram?Isthisthelastfragment,thefirstfragment,
oramiddlefragment?
ResearchActivities
25.Findoutwhytherearetwosecurityprotocols(AHandESP) inIPv6.

CHAPTER21
NetworkLayer:AddressMapping,
ErrorReporting,andMulticasting
InChapter20wediscussedtheInternetProtocol(IP)asthemainprotocolatthenetwork
layer.
IPwasdesignedasabest-effortdeliveryprotocol,butitlackssomefeaturessuch
asflowcontrolanderrorcontrol.
Itisahost-to-hostprotocolusinglogicaladdressing.
TomakeIPmoreresponsivetosomerequirementsintoday'sintemetworking,weneed
thehelp
ofotherprotocols.
Weneedprotocolstocreateamappingbetweenphysicalandlogicaladdresses.
IPpacketsuselogical(host-to-host)addresses.Thesepackets,however,need
tobeencap­
sulatedinaframe,whichneedsphysicaladdresses(node-to-node).Wewillseethata
protocolcalledARP,theAddressResolutionProtocol,isdesignedforthispurpose.We
sometimesneedreverse
mapping-mappingaphysicaladdress toalogicaladdress.For
example,whenbootingadisklessnetworkorleasinganIPaddresstoahost.Threepro­
tocolsaredesignedforthispurpose:RARP,BOOTp,andDHCP.
Lack
offlowanderrorcontrolintheInternetProtocolhasresultedinanotherpro­
tocol,ICMP,thatprovidesalerts.
Itreportscongestionandsometypes oferrorsinthe
networkordestinationhost.
IPwasoriginallydesignedforunicastdelivery,onesource
toonedestination.Asthe
Internethasevolved,theneedformulticastdelivery,onesource
tomanydestinations,has
increasedtremendously.IGMPgivesIPamulticastcapability.
Inthischapter,wediscusstheprotocolsARP,
RARP,BOOTP,DHCP,andIGMP
insomedetail.WealsodiscussICMPv6,whichwillbeoperationalwhenIPv6isoper­
ational.ICMPv6combinesARP,ICMP,andIGMPinoneprotocol.
21.1ADDRESS MAPPING
Aninternetismade ofacombinationofphysicalnetworksconnectedbyinternetworking
devicessuchasrouters.Apacketstartingfromasourcehostmaypassthroughseveral
differentphysicalnetworksbeforefinallyreachingthedestinationhost.Thehostsand
routersarerecognizedatthenetworklevelbytheirlogical(IP)addresses.
However,packetspassthroughphysicalnetworkstoreachthesehostsandrouters.
Atthephysicallevel,thehostsandroutersarerecognizedbytheirphysicaladdresses.
611

612 CHAPTER 21NETWORKLAYER:ADDRESSMAPPING,ERRORREPORTING, ANDMULTICASTING
Aphysicaladdress isalocaladdress.Itsjurisdictionisalocalnetwork.Itmustbe
uniquelocally,but
isnotnecessarilyuniqueuniversally.Itiscalleda physicaladdress
becauseit
isusually(butnotalways)implementedinhardware.Anexample ofaphysical
addressisthe48-bitMACaddressintheEthernetprotocol,whichisimprintedonthe
NICinstalledinthehostorrouter.
Thephysicaladdressandthelogicaladdressaretwodifferentidentifiers.Weneed
bothbecauseaphysicalnetworksuchasEthernetcanhavetwodifferentprotocolsat
thenetworklayersuch
asIPandIPX(Novell)atthesametime.Likewise,apacketata
networklayersuch
asIPmaypassthroughdifferentphysicalnetworkssuch asEthernet
andLocalTalk(Apple).
Thismeansthatdelivery
ofapackettoahostorarouterrequirestwolevels of
addressing:logicalandphysical. Weneedtobeable tomapalogicaladdresstoitscor­
respondingphysicaladdressandviceversa.Thesecanbedonebyusingeitherstaticor
dynamicmapping.
Staticmapping involvesinthecreation ofatablethatassociatesalogicaladdress
withaphysicaladdress.Thistableisstoredineachmachineonthenetwork.Eachmachine
thatknows,forexample,theIPaddress
ofanothermachinebutnotitsphysicaladdress
canlookitupinthetable.Thishassomelimitationsbecausephysicaladdressesmay
changeinthefollowingways:
1.AmachinecouldchangeitsNIC,resultinginanewphysicaladdress.
2.InsomeLANs,such asLocalTalk,thephysicaladdresschangeseverytimethe
computer
isturnedon.
3.Amobilecomputercanmovefromonephysicalnetworktoanother,resultingina
changeinitsphysicaladdress.
Toimplementthesechanges,astaticmappingtablemustbeupdatedperiodically.This
overheadcouldaffectnetworkperformance.
In
dynamicmapping eachtimeamachineknowsone ofthetwoaddresses(logical
orphysical),itcanuseaprotocol
tofindtheotherone.
MappingLogicaltoPhysical Address:ARP
AnytimeahostorarouterhasanIPdatagramtosendtoanotherhostorrouter,ithasthe
logical(IP)address
ofthereceiver.Thelogical(IP)addressisobtainedfromtheDNS
(seeChapter25)
ifthesenderisthehostorit isfoundinaroutingtable(seeChapter22)
ifthesenderisarouter.ButtheIPdatagrammustbeencapsulatedinaframetobeableto
passthroughthephysicalnetwork.Thismeansthatthesenderneedsthephysicaladdress
ofthereceiver.ThehostortheroutersendsanARPquerypacket.Thepacketincludes
thephysicaland
IPaddressesofthesenderandtheIPaddress ofthereceiver.Because
thesenderdoesnotknowthephysicaladdress
ofthereceiver,thequeryisbroadcast
overthenetwork(seeFigure21.1).
EveryhostorrouteronthenetworkreceivesandprocessestheARPquerypacket,
butonlytheintendedrecipientrecognizesitsIPaddressandsendsbackanARPresponse
packet.Theresponsepacketcontainstherecipient'sIPandphysicaladdresses.Thepacket
isunicastdirectlytotheinquirerbyusingthephysicaladdressreceivedinthequery
packet.

SECTION21.1ADDRESSMAPPING 613
Figure21.1 ARPoperation
Lookingforphysicaladdress ofa
nodewith
IPaddress141.23.56.23
Request
SystemA
a.ARPrequest isbroadcast
SystemA
b.ARPreply isunicast
Thenodephysicaladdress
isA4:6E:F4:59:83:AB
Reply
System
B
SystemB
InFigure21.1a,thesystemontheleft(A)hasapacketthatneedstobedeliveredto
anothersystem(B)withIPaddress141.23.56.23.SystemAneedstopassthepacketto
itsdatalinklayerfortheactualdelivery,butitdoesnotknowthephysicaladdress
of
therecipient.Itusestheservices ofARPbyaskingtheARPprotocoltosendabroad­
castARPrequestpackettoaskforthephysicaladdress
ofasystemwithanIF address
of141.23.56.23.
Thispacketisreceivedbyeverysystemonthephysicalnetwork,butonlysystemB
willanswerit,
asshowninFigure21.1 b.SystemBsendsanARPreplypacketthat
includesitsphysicaladdress.NowsystemAcansendallthepacketsithasforthisdes­
tinationbyusingthephysicaladdressitreceived.
CacheMemory
UsingARPisinefficient ifsystemAneedstobroadcastanARPrequestforeachIP
packetitneedstosendtosystemB.
ItcouldhavebroadcasttheIPpacketitself.ARP
canbeuseful
iftheARPreplyiscached(keptincachememoryforawhile)becausea
systemnormallysendsseveralpacketstothesamedestination.Asystemthatreceives
anARPreplystoresthemappinginthecachememoryandkeepsitfor20to30minutes
unlessthespaceinthecacheisexhausted.BeforesendinganARPrequest,thesystem
firstchecksitscachetosee
ifitcanfindthemapping.
PacketFormat
Figure21.2 showstheformat ofanARPpacket.

614 CHAPTER 21NETWORKLAYER:ADDRESSMAPPING,ERRORREPORTING, ANDMULTICASTING
Figure21.2 ARPpacket
32bits
8bits
l
I~
8bits 16bits
I
I
I
I
_I
HardwareType ProtocolType
Hardware Protocol Operation
length length RequestI,Reply2
Senderhardwareaddress
(Forexample,6bytesforEthernet)
Senderprotocoladdress
(Forexample,4bytesforIP)
Targethardwareaddress
(Forexample,6bytesforEthernet)
(Itisnotfilledinarequest)
Targetprotocoladdress
(Forexample,4bytesforIP)
Thcfieldsarc asfollows:
oHardwaretype.Thisisa16-bitfielddefiningthetype ofthenetworkonwhich
ARPisrunning.EachLANhasbeenassignedanintegerbasedonitstype.For
example,Ethernetisgiventype
1.ARPcanbeusedonanyphysicalnetwork.
oProtocoltype.Thisisa16-bitfielddefiningtheprotocol.Forexample,thevalue
ofthisfieldfortheIPv4protocolis0800
16
,ARPcanbeused withanyhigher-level
protocol.
oHardwarelength.Thisisan8-bitfielddefiningthelength ofthephysicaladdress
inbytes.Forexample,forEthernetthevalueis
6.
oProtocollength.Thisisan8-bitfielddefiningthelength ofthelogicaladdressin
bytes.Forexample,fortheIPv4protocolthevalueis4.
oOperation.Thisisa16-bitfielddefiningthetype ofpacket.Twopackettypesare
defined:ARPrequest(1)andARPreply(2).
oSenderhardwareaddress.Thisisavariable-lengthfielddefiningthephysical
address
ofthesender.Forexample,forEthernetthisfieldis6byteslong.
oSenderprotocoladdress.Thisisavariable-lengthfielddefiningthelogical(for
example,IP)address
ofthe sender.FortheIPprotocol,thisfieldis4byteslong.
oTargethardwareaddress.Thisisavariable-lengthfielddefiningthephysical
address
ofthetarget.Forexample,forEthernetthisfieldis6byteslong.ForanARP
requestmessage,thisfieldisalIOsbecausethesenderdoesnotknowthephysical
address
ofthetarget.
oTargetprotocoladdress.Thisisavariable-lengthfielddefiningthelogical(for
example,IP)address
ofthetarget.FortheIPv4protocol,thisfield is4byteslong.

SECTION21.1ADDRESSMAPPING 615
Encapsulation
AnARPpacketisencapsulateddirectlyintoadatalinkframe.Forexample,inFigure21.3
anARPpacketisencapsulatedinanEthernetframe.Notethatthetypefieldindicatesthat
thedatacarriedbytheframeareanARPpacket.
Figure21.3 EncapsulationofARPpacket
ARPrequestorreplypacket
Preamble
andSPD
8bytes 6bytes 6bytes2bytes
Data
4bytes
Operation
Let
usseehowARPfunctionsonatypicalinternet.Firstwedescribethestepsinvolved.
Thenwediscussthefourcasesinwhichahostorrouterneedstouse
ARP.Thesearethe
stepsinvolvedin
anARPprocess:
1.ThesenderknowstheIPaddressofthetarget. Wewillseehowthesenderobtains
thisshortly.
2.IPasksARPtocreateanARPrequestmessage,fillinginthesenderphysicaladdress,
thesenderIPaddress,andthetargetIPaddress.Thetargetphysicaladdressfieldis
filledwith
Os.
3.Themessage ispassedtothedatalinklayerwhereit isencapsulatedinaframeby
usingthephysicaladdress
ofthesenderasthesourceaddressandthephysical
broadcastaddress
asthedestinationaddress.
4.Everyhostorrouterreceivestheframe.Becausetheframecontainsabroadcast
destinationaddress,allstationsremovethemessageandpassittoARP.All
machinesexcepttheonetargeteddropthepacket.Thetargetmachinerecognizes
itsIPaddress.
5.ThetargetmachinereplieswithanARPreplymessagethatcontainsitsphysical
address.Themessageisunicast.
6.Thesenderreceivesthereplymessage. Itnowknowsthephysicaladdressofthe
targetmachine.
7.TheIPdatagram,whichcarriesdataforthetargetmachine,isnowencapsulatedin
aframeandisunicasttothedestination.
FourDifferentCases
Thefollowingarefourdifferentcasesinwhichtheservices
ofARPcanbeused(see
Figure21.4).
1.Thesenderisahostandwantstosendapackettoanotherhostonthesamenet­
work.Inthiscase,thelogicaladdressthatmustbemappedtoaphysicaladdressis
thedestinationIP addressinthedatagramheader.

616 CHAPTER 21NETWORKLAYER:ADDRESSMAPPING,ERRORREPORTING, ANDMULTICASTING
Figure21.4 Fourcasesusing ARP
TargetIPaddress:
DestinationaddressintheIPdatagram
Sender
LAN
Receiver
Case
1.Ahosthasapackettosendto
anotherhostonthesamenetwork.
Target
IFaddress:
IFaddress
oftheappropriaterouter
found
intheroutingtable
Sender
~ ...)a~
LAN::;;.
Receiver
Case3.A
routerreceivesapacketto besent
toahoston
anothernetwork.Itmustfirst
bedeliveredtothe
appropriaterouter.
Target
IPaddress:
IPaddress
ofarouter
Sender
LAN
Case2.Ahostwantstosendapacketto
anotherhostonanothernetwork.
Itmustfirstbedeliveredtoarouter.
Target
IPaddress:
Destinationaddress
intheIPdatagram
Sender
~ ..~
LAN ="'"'-
Receiver
Case4.A
routerreceivesapackettobesent
toahost
onthesamenetwork.
2.Thesenderisahostandwantstosendapackettoanotherhostonanothernetwork.
Inthiscase,thehostlooksatitsroutingtableandfindstheIPaddress
ofthenext
hop(router)forthisdestination.
Ifitdoesnothavearoutingtable, itlooksforthe
IPaddress
ofthedefaultrouter.TheIPaddress oftherouterbecomesthelogical
addressthatmustbemappedtoaphysicaladdress.
3.Thesenderisarouterthathasreceivedadatagramdestinedforahostonanother
network.
Itchecksitsrouting tableandfindstheIPaddress ofthenextrouter.The
IPaddress
ofthenextrouterbecomesthelogicaladdressthatmustbemappedtoa
physicaladdress.
4.Thesenderisarouterthathasreceivedadatagramdestinedforahostonthesame
network.ThedestinationIPaddressofthedatagrambecomesthelogicaladdress
thatmustbemappedtoaphysicaladdress.
AnARPrequestisbroadcast;anARPreplyisunicast.
Example21.1
AhostwithIPaddress130.23.43.20andphysicaladdressB2:34:55:10:22: 10hasapacketto
sendtoanotherhostwithIPaddress130.23.43.25andphysicaladdressA4:6E:F4:59:83:AB
(whichisunknowntothefirsthost).ThetwohostsareonthesameEthernetnetwork.Showthe
ARPrequestandreplypacketsencapsulatedinEthernetframes.

SECTION21.1ADDRESSMAPPlNG 617
Solution
Figure21.5showstheARPrequestandreplypackets.NotethattheARPdatafieldinthiscaseis
28bytes,andthattheindividualaddressesdonot fitinthe4-byteboundary.Thatiswhywedo
notshowtheregular4-byteboundariesfortheseaddresses.
Figure21.5Example21.1,anARPrequestandreply
130.23.43.20
ARPRequest
OxOOOI Ox0800
Ox06
Ox04 OxOOOl
OxB23455102210
130.23.43.20
OxOOOOOOOOOOOO
130.23.43.25 ARPReply
r
Time
OxOOOl IOx0800
Ox06IOx04IOxOO02
I ......-
OxA.t6EF45983AB H
I
130.23.43.25
I
I I
I
OxB2345510221O I
I
130.23.43.20 I
I I
y
Time
ProxyARP
Atechniquecalled proxyARPisusedtocreateasubnettingeffect.A proxyARPisan
ARPthatacts
onbehalfofasetofhosts.WheneverarouterrunningaproxyARP
receivesanARPrequestlookingfortheIPaddress
ofoneofthesehosts,therouter
sendsanARPreplyannouncingitsownhardware(physical)address.Aftertherouter
receivestheactualIPpacket,itsendsthepackettotheappropriatehostorrouter.
Letusgive
anexample.InFigure21.6theARPinstalledontheright-handhost
willansweronlyto
anARPrequestwithatargetIPaddress of141.23.56.23.
Figure21.6ProxyARP
141.23.56.21141.23.56.22141.23.56.23
r r r
Addedsubnetwork
Theproxy
ARProuterreplies
toany
ARPrequestreceived
fordestinations141.23.56.21,
141.23.56.22,and141.23.56.23.
Proxy
ARP
router
Request
Routerorhost

618 CHAPTER 21NETWORKLAYER:ADDRESSMAPPING,ERRORREPORTING, ANDMULTICASTING
However,theadministratormay needtocreatea subnetwithoutchangingthe
wholesystemtorecognizesubnettedaddresses.Onesolutionistoaddarouterrunning
aproxyARP.Inthiscase,therouteractsonbehalf
ofallthehostsinstalledonthesubnet.
Whenitreceivesan ARPrequestwithatarget IPaddressthatmatchestheaddress
ofoneofits
proteges(141.23.56.21,141.23.56.22, or141.23.56.23),itsendsan ARP
replyandannouncesitshardwareaddressasthetarget hardwareaddress. Whenthe
routerreceivestheIPpacket,itsendsthepackettotheappropriatehost.
MappingPhysicaltoLogicalAddress:RARP,BOOTP, andDHCP
Thereareoccasionsinwhichahostknowsitsphysicaladdress,butneedstoknowits
logicaladdress.Thismayhappenintwocases:
1.Adisklessstationisjustbooted.Thestationcanfinditsphysicaladdressbychecking
itsinterface,butitdoesnotknowitsIPaddress.
2.Anorganizationdoesnothaveenough IPaddressestoassigntoeachstation;itneeds
toassign
IPaddressesondemand.Thestation cansenditsphysicaladdressand
askforashorttimelease.
RARP
ReverseAddressResolutionProtocol (RARP)findsthelogicaladdressforamachine
thatknowsonlyitsphysicaladdress.Eachhost
orrouterisassignedone ormorelogical
(IP)addresses,whichareuniqueandindependent
ofthephysical(hardware)address of
themachine.Tocreatean IPdatagram,ahost orarouterneedstoknowitsownIP
address
oraddresses.TheIPaddress ofamachineisusuallyreadfromitsconfiguration
filestoredonadiskfile.
However,adisklessmachineisusuallybootedfromROM,whichhasminimum
bootinginformation.
TheROMisinstalledbythemanufacturer. Itcannotinclude
the
IPaddressbecausetheIPaddresses onanetworkareassignedbythe network
administrator.
Themachinecangetitsphysicaladdress(byreadingitsNIC,forexample),which
isuniquelocally.Itcanthenusethephysicaladdresstogetthelogicaladdressbyusing
the
RARPprotocol.ARARPrequestiscreatedandbroadcast onthelocalnetwork.
AnothermachineonthelocalnetworkthatknowsalltheIPaddresseswillrespondwith
a
RARPreply.TherequestingmachinemustberunningaRARPclientprogram;the
respondingmachinemustberunningaRARPserverprogram.
ThereisaseriousproblemwithRARP:Broadcastingisdoneatthedata
linklayer.The
physicalbroadcastaddress,
allisinthecase ofEthernet,doesnotpasstheboundaries of
anetwork.Thismeansthat ifanadministratorhasseveralnetworks orseveralsubnets,it
needstoassignaRARPserverforeachnetwork
orsubnet.ThisisthereasonthatRARP
isalmostobsolete.
1\voprotocols,BOOTPandDHCp,arereplacingRARP.
BOOTP
TheBootstrapProtocol(BOOTP) isaclient/serverprotocoldesignedtoprovide
physicaladdresstologicaladdressmapping.BOOTPisanapplicationlayerprotocol.
Theadministratormayputtheclientandtheserveronthesamenetwork
orondifferent

SECTION21.1ADDRESSMAPPING 619
networks,asshowninFigure21.7.BOOTPmessagesareencapsulatedinaUDPpacket,
andtheUDPpacketitself
isencapsulatedinanIPpacket.
Figure21.7BOOTPclientandserveronthesameanddifferentnetwork
D
BOOTP
Client
BOOTPD
Server
IRequest~
~ Reply
a.Clientandserveronthesamenetwork
c::=Jo+
Broadcast
request
server
D
BOOTP
c:::=::Jo+
Unicast
request
Internet
Relayagent
--~
'" ......
I "-
I \
, \
\ I
\ I
" i'...... /
~ .--
D
BOOTP
Client
b.Clientandserverondifferentnetworks
ThereadermayaskhowaclientcansendanIPdatagramwhenitknowsneither
itsownIPaddress(thesourceaddress)northeserver'sIPaddress(thedestination
address).Theclientsimplyusesallas
asthesourceaddressand allIsasthedestination
address.
One
oftheadvantagesofBOOTPoverRARPisthattheclientandserverare
application-layerprocesses.Asinotherapplication-layerprocesses,aclientcanbein
onenetworkandtheserverinanother,separatedbyseveralothernetworks.However,
thereisoneproblemthatmustbesolved.TheBOOTPrequestisbroadcastbecausethe
clientdoesnotknowtheIPaddressoftheserver.AbroadcastIPdatagramcannotpass
throughanyrouter.
Tosolvetheproblem,thereisaneedforanintermediary.One ofthe
hosts(orarouterthatcanbeconfiguredtooperateattheapplicationlayer)canbeused
asarelay.Thehostinthiscaseiscalledarelayagent.Therelayagentknowstheunicast
address
ofaBOOTPserver.Whenitreceivesthistype ofpacket,itencapsulatesthe
message
inaunicastdatagramandsendstherequesttotheBOOTPserver.Thepacket,

620 CHAPTER 21NETWORKLAYER:ADDRESSMAPPING,ERRORREPORTING, ANDMULTICASTING
carryingaunicastdestinationaddress,isroutedbyanyrouterandreachestheBOOTP
server.TheBOOTPserverknowsthemessagecomesfromarelayagentbecauseone
of
thefieldsintherequestmessagedefinestheIPaddress oftherelayagent.Therelay
agent,afterreceivingthereply,sendsittotheBOOTPclient.
DHCP
BOOTPisnota dynamicconfigurationprotocol.WhenaclientrequestsitsIP
address,theBOOTPserverconsultsatablethatmatchesthephysicaladdressoftheclient
withitsIPaddress.Thisimpliesthatthebindingbetweenthephysicaladdressandthe
IPaddress
oftheclientalreadyexists.Thebindingispredetermined.
However,whatifahostmovesfromonephysicalnetworktoanother?What
ifa
hostwantsatemporaryIPaddress?BOOTPcannothandlethesesituationsbecausethe
bindingbetweenthephysicalandIPaddressesisstaticandfixedinatableuntilchanged
bytheadministrator.BOOTPisastaticconfigurationprotocol.
TheDynamicHostConfigurationProtocol(DHCP)hasbeendevised
toprovide
staticanddynamicaddressallocationthatcanbemanualorautomatic.
DHCPprovidesstatic anddynamicaddressallocation thatcanbemanualorautomatic.
StaticAddressAllocationInthiscapacityDHCPacts asBOOTPdoes.Itisbackward­
compatiblewithBOOTP,whichmeansahostrunningtheBOOTPclientcanrequesta
staticaddressfromaDHCPserver.ADHCPserverhasadatabasethatstaticallybinds
physicaladdressestoIPaddresses.
DynamicAddressAllocationDHCPhasaseconddatabasewithapool
ofavailable
IPaddresses.ThisseconddatabasemakesDHCPdynamic.WhenaDHCPclientrequests
atemporaryIPaddress,theDHCPservergoestothepool
ofavailable(unused)IP
addressesandassignsanIPaddressforanegotiableperiod
oftime.
WhenaDHCPclientsendsarequesttoaDHCPserver,theserverfirstchecksits
staticdatabase.
Ifanentrywiththerequestedphysicaladdressexistsinthestaticdata­
base,thepermanentIPaddress
oftheclientisreturned.Ontheotherhand,iftheentry
doesnotexistinthestaticdatabase,theserverselectsanIPaddressfromtheavailable
pool,assignstheaddresstotheclient,andaddstheentrytothedynamicdatabase.
Thedynamicaspect
ofDHCPisneededwhenahostmovesfromnetworktonet­
workorisconnectedanddisconnectedfromanetwork(asisasubscriber
toaservice
provider).DHCPprovidestemporaryIPaddressesforalimitedtime.
Theaddressesassignedfromthepoolaretemporaryaddresses.TheDHCPserver
issuesaleaseforaspecifictime.Whentheleaseexpires,theclientmusteitherstop
usingtheIPaddressorrenewthelease.Theserverhastheoptiontoagreeordisagree
withtherenewal.
Iftheserverdisagrees,theclientstopsusingtheaddress.
ManualandAutomaticConfigurationOnemajorproblemwiththeBOOTPprotocol
isthatthetablemappingtheIPaddressestophysicaladdressesneedstobemanually
configured.ThismeansthateverytimethereisachangeinaphysicalorIPaddress,the
administratorneedstomanuallyenterthechanges.DHCP,ontheotherhand,allows
bothmanualandautomaticconfigurations.Staticaddressesarecreated
manually~ dynamic
addressesarecreatedautomatically.

SECTION21.2ICMP 621
21.2ICMP
AsdiscussedinChapter20,theIPprovidesunreliableandconnectionlessdatagram
delivery.
Itwasdesignedthiswaytomakeefficientuse ofnetworkresources.TheIP
protocolisabest-effortdeliveryservicethatdeliversadatagramfromitsoriginal
sourcetoitsfinaldestination.However,ithastwodeficiencies:lack
oferrorcontroland
lack
ofassistancemechanisms.
TheIPprotocolhasnoerror-reportingorerror-correctingmechanism.Whathappens
ifsomethinggoeswrong?Whathappens ifaroutermustdiscardadatagrambecauseit
cannotfindaroutertothefinaldestination,orbecausethetime-to-livefieldhasazero
value?Whathappens
ifthefinaldestinationhostmustdiscardallfragmentsofadatagram
becauseithasnotreceivedallfragmentswithinapredeterminedtimelimit?Theseare
examples
ofsituationswhereanerrorhasoccurredandtheIPprotocolhasnobuilt-in
mechanismtonotifytheoriginalhost.
TheIPprotocolalsolacksamechanismforhostandmanagementqueries.Ahost
sometimesneedstodetermine
ifarouteroranotherhostisalive.Andsometimesanet­
workadministratorneedsinformationfromanotherhostorrouter.
The
InternetControlMessageProtocol(ICMP) hasbeendesignedtocompensate
fortheabovetwodeficiencies.
Itisacompaniontothe IPprotoco1.
TypesofMessages
ICMPmessagesaredividedintotwobroadcategories: error-reportingmessages and
querymessages.
Theerror-reportingmessagesreportproblemsthatarouterorahost(destination)
mayencounter when
itprocessesanIPpacket.
Thequerymessages,whichoccurinpairs,helpahostoranetworkmanagerget
specificinformationfromarouteroranotherhost.
Forexample,nodescandiscover
theirneighbors.Also,hostscandiscoverandlearnaboutroutersontheirnetwork,and
routerscanhelpanoderedirectitsmessages.
MessageFormat
AnICMPmessagehasan8-byteheaderandavariable-sizedatasection.Althoughthe
generalformat
oftheheaderisdifferentforeachmessagetype,thefirst4bytesarecom­
montoall.AsFigure21.8shows,thefirstfield,ICMPtype,definesthetype
ofthe
Figure21.8 Generalformatof[CM?messages
8bits 8bits 8bits 8bits
Type
I
Code
I
Checksum
Rest
oftheheader
Datasection

622 CHAPTER 21NETWORKLAYER:ADDRESSMAPPING,ERRORREPORTING, ANDMULTICASTING
message.Thecodefieldspecifiesthereasonfortheparticularmessagetype.Thelast
commonfieldisthechecksumfield(tobediscussedlaterinthechapter).Therest
ofthe
headerisspecificforeachmessagetype.
The datasection
inerrormessagescarriesinformationforfindingtheoriginal
packetthathadtheerror.
Inquerymessages,thedatasectioncarriesextrainformation
basedonthetype
ofthequery.
ErrorReporting
Oneofthemainresponsibilities ofICMPis toreporterrors.Althoughtechnologyhas
producedincreasinglyreliabletransmissionmedia,errorsstillexistandmustbehandled.
IP,asdiscussedinChapter20, isanunreliableprotocol.Thismeansthaterrorchecking
anderrorcontrolarenotaconcern
ofIP.ICMPwasdesigned,inpart,tocompensatefor
thisshortcoming.However,ICMPdoesnotcorrect
errors-itsimplyreportsthem.Error
correction
islefttothehigher-levelprotocols.Errormessagesarealwayssent totheorig­
inalsourcebecausetheonlyinformationavailableinthedatagramabouttherouteisthe
sourceanddestinationIPaddresses.ICMPusesthesourceIPaddress
tosendtheerror
messagetothesource(originator)
ofthedatagram.
ICMPalwaysreports errormessagestotheoriginalsource.
Fivetypes oferrorsarehandled:destinationunreachable,sourcequench,time
exceeded,parameterproblems,andredirection(seeFigure21.9).
Figure21.9Error-reportingmessages
Error
reporting
Time
exceeded
Type:11 Type:5
ThefollowingareimportantpointsaboutICMPerrormessages:
oNoICMPerrormessagewillbegeneratedinresponsetoa datagramcarryingan
ICMPerrormessage.
DNoICMPerrormessagewillbegeneratedforafragmented datagramthatisnot
thefirstfragment.
DNoIeMPerrormessagewill begeneratedfora datagramhavingamulticast
address.
DNoICMPerrormessagewillbegeneratedfora datagramhavingaspecialaddress
suchas
127.0.0.0or0.0.0.0.

SECTION21.2ICMP 623
NotethatallerrormessagescontainadatasectionthatincludestheIPheader ofthe
originaldatagramplusthefirst8bytes
ofdatainthatdatagram.Theoriginaldatagram
headerisaddedtogivetheoriginalsource,whichreceivestheerrormessage,informa­
tionaboutthedatagramitself.The8bytes
ofdataareincludedbecause, aswewillsee
inChapter23onUDPandTCPprotocols,thefirst8bytesprovideinformationabout
theportnumbers(UDPandTCP)andsequencenumber(TCP).Thisinformationis
neededsothesourcecaninformtheprotocols(TCPorUDP)abouttheerror.ICMP
forms
anerrorpacket,whichisthenencapsulatedin anIPdatagram(seeFigure21.10).
Figure21.10Contentsofdatafieldfortheerrormessages
8 : Rest of
bytesIIPdata
Receiveddatagram
ICMP
header
.-- ~~---~_-_----J
8 I
bytes:ICMPpacket
~_-~~~~j
....---------;-"c-+----"""""'~"""""_m 8 I
bytes:SentIPdatagram
___-'===~ J
DestinationUnreachable
Whenaroutercannotrouteadatagramorahostcannotdeliveradatagram,thedatagram
isdiscardedandtherouterorthehostsendsadestination-unreachablemessagebackto
thesourcehostthatinitiatedthedatagram.Notethatdestination-unreachablemessages
canbecreatedbyeitherarouterorthedestinationhost.
SourceQuench
TheIPprotocolisaconnectionlessprotocol.Thereisnocommunicationbetweenthe
sourcehost,whichproducesthedatagram,therouters,whichforwardit,andthedestina­
tionhost,whichprocessesit.One
oftheramificationsofthisabsenceofcommunication
isthelack
offlowcontrol.IPdoesnothaveaflowcontrolmechanismembeddedinthe
protocol.Thelack
offlowcontrolcancreateamajorproblem intheoperationofIP:
congestion.Thesourcehostneverknows
iftheroutersorthedestinationhosthasbeen
overwhelmedwithdatagrams.Thesourcehostneverknows
ifitisproducingdatagrams
fasterthancanbeforwardedbyroutersorprocessedbythedestinationhost.
Thelack
offlowcontrolcancreatecongestioninroutersorthedestinationhost.
Arouterorahosthasalimited-sizequeue(buffer)forincomingdatagramswaitingto
beforwarded(inthecase
ofarouter)ortobeprocessed(inthecase ofahost).Ifthe
datagramsarereceivedmuchfasterthantheycanbeforwardedorprocessed,the
queuemayoverflow.
Inthiscase,therouterorthehosthasnochoicebuttodiscard
some
ofthedatagrams.The source-quenchmessageinICMPwasdesignedtoadda
kind
offlowcontroltothe IP.Whenarouterorhostdiscardsadatagramduetocon­
gestion,itsendsasource-quenchmessagetothesender
ofthedatagram.Thismessage
hastwopurposes.First,itinformsthesourcethatthedatagramhasbeendiscarded.
Second,itwarnsthesourcethatthereiscongestionsomewhereinthepathandthatthe
sourceshouldslowdown(quench)thesendingprocess.

624 CHAPTER 21NETWORKLAYER:ADDRESSMAPPING,ERRORREPORTING, ANDMULTICASTING
TimeExceeded
Thetime-exceeded messageisgeneratedintwocases:AsweseeinChapter22,routers
useroutingtablestofindthenexthop(nextrouter)thatmustreceivethepacket.
Ifthere
areerrors
inoneormoreroutingtables,apacketcantravel inalooporacycle,going
fromoneroutertothenext
orvisitingaseries ofroutersendlessly.AswesawinChap­
ter20,
eachdatagramcontainsafieldcalled timetolive thatcontrolsthissituation.
Whenadatagramvisitsarouter,thevalue
ofthisfieldisdecremented by1.Whenthe
time-to-livevaluereaches0,afterdecrementing,therouterdiscardsthedatagram.How­
ever,whenthedatagramisdiscarded,atime-exceededmessagemust
besentbythe
routertotheoriginalsource.Second,atime-exceededmessageisalsogeneratedwhen
notallfragmentsthatmakeupamessagearriveatthedestinationhostwithinacertain
timelimit.
ParameterProblem
Anyambiguity intheheaderpart ofadatagramcanCreateseriousproblemsasthedata­
gramtravelsthroughtheInternet. Ifarouterorthedestinationhostdiscoversanambig­
uousormissingvalue
inanyfieldofthedatagram,itdiscardsthedatagramandsendsa
parameter-problemmessagebacktothesource.
Redirection
Whenarouterneedstosendapacketdestinedforanothernetwork,itmustknowtheIP
address
ofthenextappropriaterouter.Thesameistrue ifthesenderisahost.Bothrouters
andhosts,then,musthavearoutingtabletofindtheaddress
oftherouterorthenext
router.Routerstakepart
intheroutingupdateprocess,aswewillseeinChapter22,and
aresupposedtobeupdatedconstantly.Routingisdynamic.
However,forefficiency,hostsdonottakepartintheroutingupdateprocessbecause
therearemanymorehosts
inaninternetthanrouterS.Updatingtheroutingtables ofhosts
dynamicallyproducesunacceptabletraffic.
Thehostsusuallyusestaticrouting.Whena
hostcomesup,itsroutingtablehasalimitednumber
ofentries.ItusuallyknowstheIP
address
ofonlyonerouter,thedefaultrouter.Forthisreason,thehostmaysendadata­
gram,whichisdestinedforanothernetwork,tothewrongrouter.
Inthiscase,therouter
thatreceivesthedatagramwillforwardthedatagramtothecorrectrouter.However,to
updatetheroutingtable
ofthehost,itsendsaredirectionmessagetothehost.Thiscon­
cept
ofredirectionisshowninFigure21.11.HostAwantstosendadatagramtohost B.
Figure21.11Redirectionconcept
Redirection A
LAN
~:::lP:::p::ac::ke::t::::
R2
LAN
lPpacket
B

SECTION21.2ICMP 625
RouterR2isobviouslythemostefficientroutingchoice,buthostAdidnotchoose
routerR2.Thedatagramgoesto
R1instead.RouterR1,afterconsultingitstable,finds
thatthepacketshouldhavegonetoR2.ItsendsthepackettoR2and,atthesametime,
sendsaredirectionmessagetohost
A.HostA'sroutingtablecannowbeupdated.
Query
Inadditiontoerrorreporting, ICMPcandiagnosesomenetworkproblems.Thisis
accomplishedthroughthequerymessages,agroup
offourdifferentpairsofmessages,
asshowninFigure21.12.Inthistype
ofICMPmessage,anodesendsamessagethat
isansweredinaspecificformatbythedestinationnode.Aquerymessageisencapsu­
latedinanIPpacket,whichintum
isencapsulatedinadatalinklayerframe.However,in
thiscase,nobytesoftheoriginalIPareincludedinthemessage,
asshowninFigure21.13.
Figure21.12Querymessages
Types:8 and0 Types:13 and14
Types:17and18 Types:10 and9
Figure21.13EncapsulationofICMPquerymessages
IeMP
Packet
IP IP
header Data
EchoRequestandReply
Theecho-requestandecho-replymessagesaredesignedfordiagnosticpurposes.Net­
workmanagersandusersutilizethispair
ofmessagestoidentifynetworkproblems.The
combination
ofecho-requestandecho-replymessagesdetennineswhethertwosystems
(hostsorrouters)cancommunicatewitheachother.Theecho-requestandecho-reply
messagescanbeusedtodetermine
ifthereiscommunicationattheIPlevel.Because
ICMPmessagesareencapsulatedinIPdatagrams,thereceipt
ofanecho-replymessage
bythemachinethatsenttheechorequestisproofthattheIPprotocolsinthesenderand
receiverarecommunicatingwitheachotherusingtheIPdatagram. Also,itisproofthat
theintermediateroutersarereceiving,processing,andforwardingIPdatagrams.Today,
mostsystemsprovideaversion
ofthepingcommandthatcancreateaseries(instead of
justone)ofecho-requestandecho-replymessages,providingstatisticalinformation.We
willseetheuse
ofthisprogramattheend ofthechapter.

626 CHAPTER 21NETWORKlAYER:ADDRESSMAPPING,ERRORREPORTING, ANDMULTICASTING
TimestampRequest andReply
Twomachines(hostsorrouters)canusethe timestamprequest andtimestampreply
messages
todeterminetheround-triptimeneededforanIPdatagram totravelbetween
them.
Itcanalsobeusedtosynchronizetheclocksintwomachines.
Address-MaskRequestandReply
AhostmayknowitsIPaddress,butitmaynotknowthecorrespondingmask.For
example,ahostmayknowitsIPaddressas159.31.17.24,butitmaynotknowthatthe
correspondingmaskis/24.
Toobtainitsmask,ahostsends anaddress-mask-request
message
toarouterontheLAN. Ifthehostknowstheaddress oftherouter,itsendsthe
requestdirectlytotherouter.
Ifitdoesnotknow, itbroadcaststhemessage.Therouter
receivingtheaddress-mask-requestmessagerespondswithan
address-mask-reply
message,
providingthenecessarymaskforthehost.Thiscanbeapplied toitsfullIP
addresstogetitssubnetaddress.
RouterSolicitationandAdvertisement
Aswediscussedintheredirectionmessagesection,ahostthatwantstosenddata toahost
onanothernetworkneeds
toknowtheaddress ofroutersconnected toitsownnetwork.
Also,thehostmustknow
iftheroutersarealiveandfunctioning.The router-solicitation
androuter-advertisementmessages
canhelpinthissituation.Ahostcanbroadcast(or
multicast)arouter-solicitationmessage.Therouterorroutersthatreceivethesolicitation
messagebroadcasttheirroutinginformationusingtherouter-advertisementmessage.A
routercanalsoperiodicallysendrouter-advertisementmessageseven
ifnohosthassolic­
ited.Notethatwhenaroutersendsoutanadvertisement,itannouncesnotonlyitsown
presencebutalsothepresence
ofallroutersonthenetwork ofwhichit isaware.
Checksum
InChapter10,welearnedtheconceptandidea ofthechecksum.InICMPthechecksum
iscalculatedovertheentiremessage(headeranddata).
Example21.2
Figure21.14showsanexample ofchecksumcalculationforasimpleecho-requestmessage. We
randomlychosetheidentifiertobe1andthesequencenumbertobe 9.Themessage isdivided
Figure21.14 Exampleofchecksumcalculation
Checksum
~ 1110100000 0100
8I
0
\
0k-
I I 9
TEST
8 & 0~ 0000100000000000
o~ 0000000000000000
1~ 0000000000000001
9~ 0000000000001001
T&E~ 0101010001000101
S & T~ 0101001101010100
Sum~ 1010111110100011
111

SECTION21.2ICMP 627
into16-bit(2-byte)words.Thewordsareaddedandthesumiscomplemented.Nowthesender
canputthisvalueinthechecksumfield.
DebuggingTools
ThereareseveraltoolsthatcanbeusedintheInternetfordebugging.Wecandetermine
theviability
ofahostorrouter.Wecantracetheroute ofapacket.Weintroducetwo
toolsthatuseICMPfordebugging:
pingandtraceroute.Wewillintroducemoretools
infuturechaptersafterwehavediscussedthecorrespondingprotocols.
Ping
Wecanusethe pingprogramtofind ifahostisaliveandresponding. Weusepinghere
toseehowitusesICMPpackets.
ThesourcehostsendsICMPecho-requestmessages(type:
8,code:0);thedestina­
tion,
ifalive,respondswithICMPecho-replymessages.The pingprogramsetstheidenti­
fierfieldintheecho-requestandecho-replymessageandstansthesequencenumber
from
0;thisnumberisincrementedby1eachtimeanewmessageissent.Notethat ping
cancalculatetheround-triptime. Itinsertsthesendingtimeinthedatasection ofthe
message.Whenthepacketarrives,itsubtractsthearrivaltimefromthedeparturetimeto
gettheround-triptime(RTT).
Example21.3
Weusethepingprogramtotesttheserverfhda.edu.Theresultisshownbelow:
$pingthda.edu
PINGthda.edu(153.18.8.1)56(84)bytes
ofdata.
64bytesfromtiptoe.fhda.edu(153.18.8.1):icmp_seq=O
64bytesfromtiptoe.fhda.edu(153.18.8.1):icmp_seq=l
64bytesfromtiptoe.fhda.edu(153.18.8.1):icmp_seq=2
64bytesfromtiptoe.fhda.edu(153.18.8.1):icmp_seq=3
64bytesfromtiptoe.fhda.edu(153.18.8.1):icmp_seq=4
64bytesfromtiptoe.fhda.edu(153.18.8.1):icmp_seq=5
64bytesfromtiptoe.fhda.edu(153.18.8.1):icmp_seq=6
64bytesfromtiptoe.:fhda.edu(153.18.8.1):icmp_seq=7
64bytesfromtiptoe.:fhda.edu(153.18.8.1):icmp_seq=8
64bytesfromtiptoe.fhda.edu(153.18.8.1):icmp_seq=9
64bytesfromtiptoe.:fhda.edu(153.18.8.1):icmp_seq=lO
ttl=62
ttl=62
ttl=62
ttl=62
ttl=62
ttl=62
tt1=62
ttl=62
ttl=62
ttl=62 ttl==62
time=1.91ms
time:=2.04ms
time=1.90ms
time=1.97ms
time=1.93 ms time=2.00ms
time=1.94ms
time=1.94ms
time=1.97ms
time=1.89ms
time=1.98ms
---thda.edupingstatistics---
11packetstransmitted, 11received,0%packetloss,time10103ms
rttminJavg/max=1.899/1.955/2.041ms
The
pingprogramsendsmessageswithsequencenumbersstartingfrom O.Foreachprobeit
givesustheRTTtime.TheTTL(timetolive)fieldintheIPdatagramthatencapsulatesanICMP
messagehasbeensetto62,whichmeansthepacketcannottravelmarethan62hops.Atthebegin­
ning,
pingdefinesthenumber ofdatabytesas56andthetotalnumberofbytesas84.Itisobvious
that
ifweadd8bytes ofICMPheaderand20bytes ofIPheaderto56,theresultis84.However,

628 CHAPTER 21NETWORKIAYER:ADDRESSMAPPING,ERRORREPORTiNG,ANDMULTiCASTING
notethatineachprobe pingdefinesthenumber ofbytesas64.Thisisthetotalnumber ofbytesin
theICMPpacket(56
+8).Thepingprogramcontinuestosendmessages, ifwedonotstopitby
usingtheinterruptkey(ctrl
+c,forexample).Afteritisinterrupted,itprintsthestatistics ofthe
probes.
Ittellsusthenumberofpacketssent,thenumber ofpacketsreceived,thetotaltime,and
theRTTminimum,maximum,andaverage.Somesystemsmayprintmoreinfonnation.
Tracerollte
ThetracerouteprograminUNIXor tracertinWindowscanbeusedtotracetheroute
ofapacketfromthesourcetothedestination.Wehaveseenanapplication ofthe
traceroute programtosimulatetheloosesourcerouteandstrictsourcerouteoptions of
anIPdatagraminChapter20. WeusethisprograminconjunctionwithICMPpackets
inthischapter.TheprogramelegantlyusestwoICMPmessages,timeexceededand
destinationunreachable,tofindtheroute
ofapacket.Thisisaprogramattheapplica­
tionlevelthatusestheservices
ofUDP(seeChapter23).Letusshowtheidea ofthe
tracerouteprogrambyusingFigure21.15.
Figure21.15Thetracerouteprogramoperation
HostA
Network
Network
R3
Hoste
HostB
Network
Giventhetopology,weknowthatapacketfromhostAtohostBtravelsthrough
routers
RlandR2.However,most ofthetime,wearenotaware ofthistopology.There
couldbeseveralroutesfromAto
B.ThetracerouteprogramusestheICMPmessages
andtheTTL(timetolive)fieldintheIPpackettofindtheroute.
1.Thetracerouteprogramusesthefollowingstepstofindtheaddress oftherouterRl
andtheround-triptimebetweenhostA androuter Rl.
a.ThetracerouteapplicationathostAsendsapackettodestination BusingUDP;
themessageisencapsulatedinanIPpacketwithaTTLvalue
of1.Theprogram
notesthetimethepacketissent.
b.RouterRlreceivesthepacketanddecrementsthevalue ofTTLto O.Itthendis­
cardsthepacket(becauseTTLis0).Therouter,however,sendsatime-exceeded
ICMPmessage(type:11,code:0)toshowthattheTTLvalue
is0 andthepacket
wasdiscarded.
c.Thetraceroute programreceivestheICMPmessagesandusesthedestination
address
oftheIPpacketencapsulatingICMPtofindtheIPaddress ofrouterRl.
Theprogramalsomakesnote ofthetimethepackethasarrived.Thedifference
betweenthistimeandthetimeatstepa
istheround-triptime.

SECTION21.2ICMP 629
Thetracerouteprogramrepeatsstepsatocthreetimestogetabetteraverage
round-triptime.Thefirsttriptimemaybemuchlongerthanthesecond
orthird
becauseittakestimefortheARPprogramtofindthephysicaladdress
ofrouter
RI.Forthesecondandthirdtrips,ARPhastheaddressinitscache.
2.Thetracerouteprogramrepeatsthepreviousstepstofindtheaddress ofrouterR2
andtheround-triptimebetweenhostAandrouterR2.However,inthisstep,the
value
ofTTLissetto2.Sorouter RIforwardsthemessage,whilerouterR2dis­
cardsitandsendsatime-exceededICMPmessage.
3.Thetracerouteprogramrepeatsstep2tofindtheaddress ofhostBandtheround-trip
timebetweenhostAandhost
B.WhenhostBreceivesthepacket, itdecrementsthe
value
ofTIL,butitdoesnotdiscardthemessagesinceithasreacheditsfinaldesti­
nation.HowcananICMPmessagebesentbacktohostA?The
tracerouteprogram
usesadifferentstrategyhere.Thedestinationport
oftheUDPpacketissettoone
thatisnotsupportedbytheUDPprotocol.WhenhostBreceivesthepacket,itcannot
findanapplicationprogramtoacceptthedelivery.
Itdiscardsthepacketandsendsan
ICMPdestination-unreachablemessage(type:
3,code:3)tohost A.Notethatthis
situationdoesnothappenatrouter
RIorR2becausearouterdoesnotcheckthe
UDPheader.The
tracerouteprogramrecordsthedestinationaddress ofthearrived
IPdatagramandmakesnote oftheround-triptime.Receivingthedestination­
unreachablemessagewithacodevalue3isanindicationthatthewholeroutehas
beenfoundandthere
isnoneedtosendmorepackets.
Example21.4
Weusethe traceroute programtofindtheroutefromthecomputervoyager.deanza.edutothe
serverfhda.edu.Thefollowingshowstheresult:
$traceroutefbda.edu
traceroute
tofbda.edu
1Dcore.fhda.edu
2Dbackup.fhda.edu
3tiptoe.fhda.edu
(153.18.8.1),30
hopsmax,38bytepackets
(153.18.31.254)0.995ms 0.899ms
(153.18.251.4)1.039
fiS1.064fiS
(153.18.8.1) 1.797 illS1.642ms
0.878ms
1.083
fiS
1.757fiS
Theunnumberedlineafterthecommandshowsthatthedestinationis153.18.8.1.The TIL
valueis30hops.Thepacketcontains38bytes:20bytes ofIPheader,8bytes ofUDPheader,and
10bytes
ofapplicationdata. Theapplicationdataareusedby traceroutetokeeptrack ofthe
packets.
Thefirstlineshowsthefirstroutervisited.TherouterisnamedDcore.fhda.eduwithIP
address153.18.31.254.Thefirstround-triptimewas0.995ms,thesecondwas0.899ms,andthe
thirdwas0.878ms.
Thesecondlineshowsthesecondroutervisited.TherouterisnamedDbackup.fhda.edu
withIPaddress153.18.251.4.Thethreeround-triptimesarealsoshown.
Thethirdlineshowsthedestinationhost.Weknowthatthis
isthedestinationhostbecause
therearenomorelines.Thedestinationhost
istheserverthda.edu,butitisnamedtiptoe.fhda.edu
withtheIPaddress153.18.8.1.Thethreeround-triptimesarealsoshown.
Example21.5
Inthisexample,wetracealongerroute,theroutetoxerox.com.

630 CHAPTER 21NETWORKLAYER:ADDRESSMAPPING,ERRORREPORTING, ANDMULTICASTING
$traceroutexerox.com
traceroutetoxerox.com(13.1.64.93), 30hopsmax,38bytepackets
1Dcore.fbda.edu (153.18.31.254) 0.622ms 0.891ms
2Ddmz.fbda.edu (153.18.251.40) 2.132ms 2.266ms
3Cinic.fhda.edu (153.18.253.126) 2.110ms 2.145ms
4cenic.net (137.164.32.140) 3.069ms 2.875ms
5cenic.net (137.164.22.31) 4.205ms 4.870ms
0.875ms
2.094ms
1.763ms
2.930ms
4.197ms
14snfc21.pbi.net (151.164.191.49) 7.656ms 7.129ms 6.866ms
15sbcglobaLnet (151.164.243.58) 7.844ms 7.545ms 7.353ms
16pacbell.net (209.232.138.114)9.857ms 9.535ms 9.603ms
17209.233.48.223 (209.233.48.223)10.634ms10.771ms10.592ms
18alpha.Xerox.COM(13.1.64.93) 11.172ms11.048ms10.922ms
Herethereare
17hopsbetweensourceanddestination.Notethatsomeround-triptimeslook
unusual.Itcouldbethatarouterwastoobusytoprocessthepacketimmediately.
21.3IGMP
TheIPprotocolcanbeinvolvedintwotypes ofcommunication:unicastingandmulti­
casting.Unicastingisthecommunicationbetweenonesenderandonereceiver.
Itisa
one-to-onecommunication.However,someprocessessometimesneedtosendthesame
messagetoalargenumber
ofreceiverssimultaneously.Thisiscalled multicasting,
whichisaone-to-manycommunication.Multicastinghasmanyapplications.Forexam­
ple,multiplestockbrokerscansimultaneouslybeinformed
ofchangesinastockprice,
ortravelagentscanbeinformed
ofaplanecancellation.Someotherapplicationsinclude
distancelearningandvideo-on-demand.
The
InternetGroupManagementProtocol(IGMP) isoneofthenecessary,but
notsufficient(aswewillsee),protocolsthatisinvolvedinmulticasting.IGMPisa
companiontotheIPprotocol.
GroupManagement
FormulticastingintheInternetweneedroutersthatareable toroutemulticastpackets.
Theroutingtables
oftheseroutersmustbeupdatedbyusingone ofthemulticasting
routingprotocolsthatwediscussinChapter22.
IGMPisnotamulticastingroutingprotocol;itisaprotocolthatmanages
group
membership.
Inanynetwork,thereareone ormoremulticastroutersthatdistribute
multicastpackets
tohostsorotherrouters.TheIGMPprotocolgivesthe multicastrouters
informationaboutthemembershipstatus ofhosts(routers)connected tothenetwork.
Amulticastroutermayreceivethousands
ofmulticastpacketseverydayfordifferent
groups.
Ifarouterhasnoknowledgeaboutthemembershipstatus ofthehosts,itmust
broadcastallthesepackets.Thiscreatesalot
oftrafficandconsumesbandwidth.Abetter
solutionistokeepalist
ofgroupsinthenetworkforwhichthereisatleastoneloyal
member.IGMPhelpsthemulticastroutercreateandupdatethislist.

SECTION21.3IGMP 631
IGMPisagroupmanagementprotocol. Ithelpsamulticastroutercreate
andupdatealist ofloyalmembersrelatedtoeach routerinterface.
IGMPMessages
IOMPhasgonethroughtwoversions.WediscussIOMPv2,thecurrentversion.IOMPv2
hasthreetypes
ofmessages:thequery,themembershipreport, andtheleavereport.
Therearetwotypes ofquerymessages:general andspecial(seeFigure21.16).
Figure21.16 IGMPmessagetypes
MessageFormat
Figure21.17showstheformat ofanIOMP(version2)message.
Figure21.17 IGMPmessage fonnat

8bits
Type
8bits
l
~axim~ responset
Ie time
8bits 8bits
Groupaddressinmembershipandleavereportsandspecialquery;alIOsingeneralquery
oType.This8-bitfielddefinesthetype ofmessage,asshowninTable21.1.Thevalue
ofthetypeisshowninbothhexadecimalandbinarynotation.
Table21.1 IGMPtypefield
Type Value
Generalorspecialquery Ox11or00010001
Membershipreport
Ox16or00010110
Leavereport
Ox17or00010111
oMaximumResponseTime. This8-bitfielddefinestheamount oftimeinwhicha
querymust
beanswered.Thevalueisintenths ofasecond;forexample, ifthe

632 CHAPTER 21NETWORKLAYER:ADDRESSMAPPING,ERRORREPORTING, ANDMULTICASTING
valueis100,itmeans10 s.Thevalueisnonzero inthequerymessage;itissetto
zerointheothertwomessagetypes.Wewillseeitsuseshortly.
DChecksum.Thisisa16-bitfieldcarryingthechecksum.Thechecksum iscalculated
overthe8-bytemessage.
DGroupaddress.Thevalueofthisfieldis0forageneralquerymessage.Thevalue
definesthegroupid(multicastaddress
ofthegroup)inthespecialquery,themem­
bershipreport,andtheleavereportmessages.
IGMPOperation
IGMPoperateslocally. Amulticastrouterconnectedtoanetworkhasalist ofmulticast
addresses
ofthegroupswithatleastoneloyalmemberinthatnetwork(seeFigure21.18).
Figure21.18IGMPoperation
Toanothernetwork
229.60.12.8
...
Network
List
ofgroups
having
loyalmembers
225.70.8.20
231.24.60.9
Toothernetworks
Toanothernetwork
Foreachgroup,thereisonerouterthathastheduty ofdistributingthemulticast
packetsdestinedforthatgroup.Thismeansthat
iftherearethreemulticastrouters
connectedtoanetwork,theirlists
ofgroupidsaremutuallyexclusive.Forexample,in
Figure21.18onlyrouterRdistributespacketswiththemulticastaddressof225.70.8.20.
Ahostormulticastroutercanhavemembership
inagroup.Whenahosthasmember­
ship,itmeansthatone
ofitsprocesses(anapplicationprogram)receivesmulticastpackets
fromsomegroup.Whenarouterhasmembership,itmeansthatanetworkconnectedto
one
ofitsotherinterfacesreceivesthesemulticastpackets. Wesaythatthehostorthe
routerhasan
interestinthegroup.Inbothcases,thehostandtherouterkeepalist of
groupidsandrelaytheirinteresttothedistributingrouter.
Forexample,inFigure21.18,routerRisthedistributingrouter.Therearetwo
othermulticastrouters(R1andR2)that,depending
onthegrouplistmaintainedby
router
R,couldbetherecipients ofrouterR inthisnetwork.RoutersR IandR2maybe
distributorsforsome
ofthesegroupsinothernetworks,butnot onthisnetwork.
JoiningaGroup
Ahostoraroutercanjoinagroup.Ahostmaintainsalist ofprocessesthathavemember­
shipinagroup.Whenaprocesswantstojoinanewgroup,itsendsitsrequesttothehost.

SECTION21.3IGMP 633
Thehostaddsthename oftheprocessandthename oftherequestedgroup toitslist.If
thisisthefirstentryforthisparticulargroup,thehostsendsamembershipreportmes­
sage.
Ifthisisnotthefirstentry,thereisnoneedtosendthemembershipreportsincethe
hostisalreadyamember
ofthegroup;italreadyreceivesmulticastpacketsforthisgroup.
Theprotocolrequiresthatthemembershipreportbesenttwice,oneaftertheother
withinafewmoments.Inthisway,
ifthefirstoneislost ordamaged,thesecondone
replacesit.
InIGMP,amembershipreport issenttwice,oneaftertheother.
LeavingaGroup
Whenahostseesthatnoprocessisinterestedinaspecificgroup, itsendsaleavereport.
Similarly,whenarouterseesthat
noneofthenetworksconnectedtoitsinterfacesis
interestedinaspecificgroup,itsendsaleavereportaboutthatgroup.
However,
whenamulticastrouterreceivesaleavereport, itcannotimmediately
purgethatgroupfromitslistbecausethereportcomesfrom
justonehostorrouter;
theremaybeotherhosts
orroutersthatarestillinterestedinthatgroup.Tomakesure,
theroutersendsaspecialquerymessageandinsertsthegroupid,
ormulticastaddress,
relatedtothegroup. Therouterallowsaspecifiedtimeforanyhost orroutertorespond.
If,duringthistime,nointerest(membershipreport)isreceived,therouterassumesthat
therearenoloyalmembersinthenetworkandpurgesthegroupfromitslist.
MonitoringMembership
Ahostorroutercan joinagroupbysendingamembershipreportmessage.Itcanleave
agroup
bysendingaleavereportmessage.However,sendingthesetwotypes ofreports
is
notenough.Considerthesituationin whichthereisonly onehostinterestedina
group,butthehostisshutdown
orremovedfromthesystem. Themulticastrouterwill
neverreceivealeavereport.Howisthishandled?
Themulticastrouterisresponsible
formonitoringallthehosts
orroutersina LANtoseeiftheywanttocontinue their
membershipinagroup.
Therouterperiodically(bydefault,every125s)sendsageneralquerymessage.In
thismessage,thegroupaddressfieldissetto0.0.0.0.Thismeansthequeryformember­
shipcontinuationisforallgroupsinwhichahostisinvolved,not
justone.
Thegeneralquerymessagedoesnotdefineaparticulargroup.
Therouterexpectsananswerforeachgroup initsgrouplist;evennewgroupsmay
respond.
Thequerymessagehasa maximumresponsetimeof10s(the valueofthe
fieldisactually100,butthis
isintenthsofasecond).Whenahostorrouterreceivesthe
generalquerymessage,
itrespondswitha membershipreportifitisinterestedina
group.However,
ifthereisa commoninterest(twohosts,forexample,areinterestedin
thesamegroup),onlyoneresponseissentforthatgrouptopreventunnecessarytraffic.
Thisiscalledadelayedresponse.Notethatthequerymessagemust
besentbyonlyone

634 CHAPTER21 NETWORKLAYER:ADDRESSMAPPING,ERRORREPORTING, ANDMULTICASTING
router(normallycalledthequeryrouter),alsotopreventunnecessarytraffic.Wediscuss
thisissueshortly.
DelayedResponse
Topreventunnecessarytraffic,IGMPusesadelayedresponsestrategy.Whenahostor
routerreceivesaquerymessage,itdoesnotrespondimmediately;itdelaystheresponse.
Eachhost
orrouterusesarandomnumbertocreateatimer,whichexpiresbetween Iand
lOs.Theexpirationtimecanbeinsteps
ofIsorless.Atimerissetforeachgroupinthe
list.Forexample,thetimerforthefirstgroupmayexpirein
2s,butthetimerforthethird
groupmayexpirein
5s.Eachhostorrouterwaitsuntilitstimerhasexpiredbeforesend­
ingamembershipreportmessage.Duringthiswaitingtime,
ifthetimerofanotherhostor
router,forthesamegroup,expiresearlier,thathost
orroutersendsamembershipreport.
Because,aswewillseeshortly,thereportisbroadcast,thewaitinghostorrouterreceives
thereportandknowsthatthereisnoneedtosendaduplicatereportforthisgroup;thus,
thewaitingstationcancelsitscorrespondingtimer.
Example21.6
Imaginetherearethreehostsinanetwork,asshowninFigure21.19.
Figure21.19Example21.6
GroupTimerGroupTimerGroupTimer
225.14.0.0
30228.42.0.048225.14.0.062
228.42.0.012238.71.0.0
50230.43.0.070
230.43.0.0
80
Toothernetworks
A B C
~R~~¥-
Aquerymessagewasreceivedattime 0;therandomdelaytime(intenths ofseconds)for
eachgroupisshownnext
tothegroupaddress.Showthesequence ofreportmessages.
Solution
Theeventsoccurinthissequence:
a.Time12:Thetimerfor228.42.0.0inhostAexpires,andamembershipreportissent,
whichisreceivedbytherouterandeveryhostincludinghost
Bwhichcancelsitstimer
for228.42.0.0.
b.Time30:Thetimerfor225.14.0.0inhostAexpires,andamembershipreportissent,
whichisreceived
bytherouterandeveryhostincludinghostCwhichcancelsitstimer
for225.14.0.0.
c.Time50:Thetimerfor238.71.0.0inhostBexpires,andamembershipreportissent,
whichisreceivedbytherouterandeveryhost.
d.Time70:Thetimerfor230.43.0.0inhostCexpires,andamembershipreportissent,
whichisreceived
bytherouterandeveryhostincludinghostAwhichcancelsitstimer
for230.43.0.0.

SECTION21.3IGMP 635
Notethat ifeachhosthadsentareportforeverygroupinitslist,therewouldhavebeenseven
reports;withthisstrategyonlyfourreportsaresent.
QueryRouter
Querymessages maycreatealot ofresponses.Topreventunnecessarytraffic,IGMP
designatesonerouterasthe
queryrouterforeachnetwork.Onlythisdesignatedrouter
sendsthequerymessage,andtheotherroutersarepassive(theyreceiveresponsesand
updatetheirlists).
Encapsulation
TheIGMPmessageisencapsulatedinanIPdatagram,whichisitselfencapsulatedina
frame.SeeFigure21.20.
Figure21.20EncapsulationofIGMPpacket
8bytes
IGMP
message
W IP
header data
Frame Frame Trailer
Iheader data (ifany)
EncapsulationatNetworkLayer
Thevalueoftheprotocolfieldis2fortheIGMPprotocol.EveryIPpacketcarryingthis
valueinitsprotocolfieldhasdatadeliveredtotheIGMPprotocol.Whenthemessageis
encapsulatedintheIPdatagram,thevalue
ofTTLmust be1.Thisisrequiredbecause
thedomain
ofIGMPistheLAN.NoIGMPmessagemusttravelbeyondtheLAN.A
TTLvalue
of1guaranteesthatthemessagedoesnotleavetheLANsincethisvalueis
decrementedto0bythenextrouterand,consequently,thepacketisdiscarded.Table21.2
showsthedestination
IPaddressforeachtype ofmessage.
TheIPpacketthatcarriesanIGMPpackethasavalueof1initsTTLfield.
Table21.2 DestinationIPaddresses
Type
IPDestinationAddress
Query 224.0.0.1Allsystemsonthissubnet
MembershipreportThemulticastaddress
ofthegroup
Leavereport 224.0.0.2Allroutersonthissubnet
Aquerymessageismulticastbyusingthemulticastaddress224.0.0.1Allhosts
andallrouterswillreceivethemessage.Amembershipreportismulticastusinga

636 CHAPTER21NETWORKLAYER:ADDRESSMAPPING,ERRORREPORTING,ANDMULTICASTING
destinationaddressequaltothemulticastaddressbeingreported(groupid).Everysta­
tion(hostorrouter)thatreceivesthe
packetcanimmediatelydetermine(fromthe
header)thegroupforwhichareporthasbeensent.Asdiscussedpreviously,thetimers
forthecorrespondingunsentreportscanthenbecanceled.Stationsdonotneedtoopen
thepackettofindthegroupid.Thisaddressisduplicatedinapacket;it'spart
ofthe
messageitselfandalsoafieldintheIPheader.Theduplicationpreventserrors.Aleave
reportmessageismulticastusingthemulticastaddress
224.0.0.2(allroutersonthis
subnet)sothatroutersreceivethistype
ofmessage.Hostsreceivethismessagetoo,but
disregardit.
EncapsulationatDataLinkLayer
Atthenetworklayer,the IGMPmessageisencapsulatedinan IPpacketandistreated
asanIPpacket.However,becausethe
IPpackethasamulticastIPaddress,the ARP
protocolcannotfindthecorrespondingMAC(physical)addresstoforwardthepacket
atthedatalinklayer.Whathappensnextdependsonwhethertheunderlyingdatalink
layersupportsphysicalmulticastaddresses.
Physical
MulticastSupportMostLANssupportphysicalmulticastaddressing.Ether­
netisone
ofthem.AnEthernetphysicaladdress(MACaddress)issixoctets(48bits)
long.
Ifthefirst25bitsinanEthernetaddressare 0000000100000000010111100,this
identifiesaphysicalmulticastaddressfortheTCP/IPprotocol.Theremaining
23bitscan
beusedtodefineagroup.ToconvertanIPmulticastaddressintoanEthernetaddress,the
multicastrouterextractstheleastsignificant
23bitsofaclassDIPaddressandinserts
themintoamulticastEthernetphysicaladdress(seeFigure
21.21).
Figure21.21Mappingclass DtoEthernetphysicaladdress
-[
23bitsofmulticastaddress
32-bitclassDaddress
I
I
I
I
I
I
I
--------------------,
10000000100000000010111100 2__3__b__its__o__f__ph__y__sic__a__la__dd__re__s__s_I
,- 48-bitEthernetaddress -I
However,thegroupidentifier ofaclassDIPaddressis28bitslong,whichimplies
that5bitsisnotused.Thismeansthat
32(25)multicastaddressesatthe IPlevelare
mappedtoasinglemulticastaddress. Inotherwords,the mappingismany-to-one
instead
ofone-to-one.Ifthe5leftmostbits ofthegroupidentifier ofaclassDaddress
arenotallzeros,ahostmayreceivepacketsthat
donotreallybelongtothegroup in
whichitisinvolved.Forthisreason,thehostmustchecktheIPaddressanddiscardany
packetsthatdonotbelongtoit.
OtherLANssupportthesameconceptbuthavedifferentmethods
ofmapping.

SECTION21.3IGMP 637
AnEthernetmulticastphysicaladdressisintherange
01:00:5E:00:OO:OOto01:00:5E:7F:FF:FF.
Example21.7
ChangethemulticastIPaddress230.43.14.7 toanEthernetmulticastphysicaladdress.
Solution
Wecandothisintwosteps:
a.Wewritetherightmost 23bitsoftheIPaddressinhexadecimal.Thiscanbedonebychanging
therightmost3bytes
tohexadecimalandthensubtracting8fromtheleftmostdigit ifitis
greaterthanorequal
to8.Inourexample,theresultis2B:OE:07.
b.Weaddtheresult
ofparta tothestartingEthernetmulticastaddress,which is
01:00:5E:00:00:00.Theresultis
01:00:5E:2B:OE:07
Example21.8
ChangethemulticastIPaddress238.212.24.9toanEthernetmulticastaddress.
Solution
a.Therightmost3bytesinhexadecimalisD4:18:09. Weneedtosubtract8fromtheleftmost
digit,resultingin54:18:09.
b.Weaddtheresult ofparta totheEthernetmulticaststartingaddress.Theresult is
01:00:5E:54:18:09
NoPhysicalMulticast SupportMostWANsdonotsupportphysicalmulticastaddress­
ing.Tosendamulticastpacketthroughthesenetworks,aprocesscalled
tunnelingisused.
In
tunneling,themulticastpacketisencapsulatedinaunicastpacketandsentthroughthe
network,whereitemergesfromtheothersideasamulticastpacket(seeFigure21.22).
Figure21.22Tunneling
MulticastIPdatagram
Header
I
Data
Header Data
UnicastIPdatagram
NetstatUtility
Thenetstatutilitycan beusedtofindthemulticastaddressessupported byaninterface.

638 CHAPTER 21NETWORKLAYER:ADDRESSMAPPING,ERRORREPORTING, ANDMULTICASTING
Example21.9
Weusenetstatwiththreeoptions:-n,-r,and-a.The-noptiongivesthenumericversions ofIP
addresses,the-roptiongivestheroutingtable,andthe-aoptiongives
alladdresses(unicastand
multicast).Notethatweshowonlythefieldsrelativetoourdiscussion."Gateway"definesthe
router,"Iface"definestheinterface.
$netstat-nra
KernelIProutingtable
Destination Gateway
153.18.16.0 0.0.0.0
169.254.0.0 0.0.0.0
127.0.0.0 0.0.0.0
224.0.0.0 0.0.0.0
0.0.0.0 153.18.31.254
Mask
255.255.240.0
255.255.0.0
255.0.0.0
224.0.0.0
0.0.0.0
Flags
U
U
U
u
va
Iface
ethO
ethO
10
ethO
ethO
Natethatthemulticastaddressisshownincolor.Anypacketwithamulticastaddressfrom
224.0.0.0to239.255.255.255ismaskedanddeliveredtotheEthernetinterface.
21.4ICMPv6
Wediscussed1Pv6inChapter20.Anotherprotocolthathasbeenmodifiedinversion6of
theTCPIIPprotocolsuiteisICMP(ICMPv6).Thisnewversionfollowsthesamestrategy
andpurposesofversion4.ICMPv4hasbeenmodifiedtomakeitmoresuitableforIPv6.
Inaddition,someprotocolsthatwereindependentinversion4arenowpart
ofInternet­
working
ControlMessageProtocol(ICMPv6). Figure21.23comparesthenetwork
layerofversion4toversion
6.
Figure21.23 Comparisonofnetworklayersinversion 4andversion6
Networklayerinversion4 Networklayerinversion6
TheARPandIGMPprotocolsinversion4arecombinedinICMPv6.TheRARP
protocol
isdroppedfromthesuitebecauseitwasrarelyusedandBOOTPhasthesame
functionality.
JustasinICMPv4,wedividetheICMPmessagesintotwocategories.However,
eachcategoryhasmoretypes
ofmessagesthanbefore.
ErrorReporting
Aswesawinourdiscussionofversion4,one ofthemainresponsibilitiesofICMPisto
reporterrors.Fivetypes
oferrorsarehandled:destinationunreachable,packettoobig,
timeexceeded,parameterproblems,andredirection.ICMPv6formsanerrorpacket,

SECTION21.4ICMPv6 639
whichisthenencapsulatedinanIPdatagram.Thisisdeliveredtotheoriginalsource of
thefaileddatagram.Table21.3comparesthe error-reportingmessagesofICMPv4
withICMPv6.Thesource-quenchmessageiseliminatedinversion6becausethepriority
andtheflowlabelfieldsallowtheroutertocontrolcongestionanddiscardtheleast
importantmessages.Inthisversion,thereisnoneedtoinformthesendertoslowdown.
Thepacket-too-bigmessageisaddedbecausefragmentationistheresponsibility
ofthe
senderinIPv6.
Ifthesenderdoesnotmaketherightpacketsizedecision,therouterhas
nochoicebuttodropthepacketandsend
anerrormessagetothesender.
Table21.3
Comparisonoferror-reportingmessages inICMPv4andICMPv6
Type
ofMessage Version4 Version6
Destinationunreachable Yes Yes
Sourcequench Yes No
Packettoobig
No Yes
Timeexceeded Yes Yes
Parameterproblem Yes Yes
Redirection Yes Yes
DestinationUnreachable
Theconceptofthedestination-unreachablemessageisexactlythesameasdescribed
forICMPversion
4.
PacketTooBig
Thisisanewtype ofmessageaddedtoversion 6.Ifarouterreceivesadatagramthatis
largerthanthemaximumtransmissionunit(MTU)size
ofthenetworkthroughwhich
thedatagramshouldpass,twothingshappen.First,therouterdiscardsthedatagram
andthenanICMPerror
packet-apacket-too-bigmessage-issenttothesource.
TimeExceeded
Thismessageissimilartotheoneinversion4.
ParameterProblem
Thismessageissimilartoitsversion4counterpart.
Redirection
Thepurposeoftheredirectionmessage isthesameasdescribedforversion 4.
Query
Inadditiontoerrorreporting,ICMPcandiagnosesomenetworkproblems.Thisis
accomplishedthroughthe
querymessages.Fourdifferentgroups ofmessageshavebeen
defined:echorequestandreply,routersolicitationandadvertisement,neighborsolicita­
tionandadvertisement,andgroupmembership.Table21.4showsacomparisonbetween

640 CHAPTER 21NETWORKLAYER:ADDRESSMAPPING,ERRORREPORTING, ANDMULTICASTING
thequerymessagesinversions4and 6.Twosetsofquerymessagesareeliminatedfrom
ICMPv6:time-stamprequestandreply-andaddress-maskrequestandreply.Thetime­
stamprequestandreplymessagesareeliminatedbecausetheyareimplementedinother
protocolssuch
asTCPandbecausetheywererarelyusedinthepast.Theaddress-mask
requestandreplymessagesareeliminatedinIPv6becausethesubnetsection
ofan
addressallowsthesubscribertouseupto2
32
-
1subnets.Therefore,subnetmasking, as
definedinIPv4,isnotneededhere.
Table21.4
ComparisonofquerymessagesinICMPv4andICMPv6
Type
ofMessage Version4Version6
Echorequestandreply Yes Yes
Timestamprequestandreply Yes
No
Address-maskrequestandreply Yes No
Routersolicitationandadvertisement Yes Yes
Neighborsolicitationandadvertisement ARP Yes
Groupmembership IGMP Yes
EchoRequest andReply
Theideaandformat oftheechorequestandreplymessagesarethesame asthosein
version4.
RouterSolicitation andAdvertisement
Theideabehindtherouter-solicitationand-advertisementmessagesisthesame asin
version4.
NeighborSolicitation andAdvertisement
Aspreviouslymentioned,thenetworklayerinversion4containsanindependentprotocol
calledAddressResolutionProtocol(ARP).Inversion
6,thisprotocoliseliminated,and
its dutiesareincludedinICMPv6.Theideaisexactlythesame,buttheformat
ofthe
messagehaschanged.
GroupMembership
Aspreviouslymentioned,thenetworklayerinversion4containsanindependentprotocol
calledIGMP.Inversion
6,thisprotocoliseliminated,anditsdutiesareincludedin
ICMPv6.Thepurposeisexactlythesame.
21.5RECOMMENDED READING
Formoredetailsaboutsubjectsdiscussedinthischapter, werecommendthefollow­
ingbooksandsite.Theitemsinbrackets[
...Jrefertothereferencelistattheend of
thetext.

SECTION21.6KEYTERMS 641
Books
ARPand RARParediscussedinChapter7 of[For06]andChapters4and5 of[Ste94].
ICMPisdiscussedinChapter9
of[For06]andChapter6 of[Ste94].IGMPisdiscussed
inChapter
10of[For06]andChapter 13of[Ste94].BOOTPandDHCParediscussedin
Chapter16
of[For06]andChapter 16of[Ste94].ICMPv6isdiscussedinChapter27 of
[For06].
Site
owww.ietf.org/rfc.htmlInformationaboutRFCs
RFCs
AdiscussionofARPandRARPcan befoundinfollowingRFCs:
826,903,925,1027,1293,1329,1433,1868,1931,2390
AdiscussionofICMPcanbefoundinthefollowingRFCs:
777,792,1016,1018,1256,1788,2521
AdiscussionofIGMPcan befoundinthefollowingRFCs:
966,988,1054,1112,1301,1458,1469,1768,2236,2357,2365,2502,2588
AdiscussionofBOOTPandDHCPcanbefoundinthefollowingRFCs:
951,1048,1084,1395,1497,1531,1532,1533,1534,1541,1542,2131,2132
21.6KEYTERMS
address-mask-replymessage
address-mask-requestmessage
addressresolutionprotocol
(ARP)
BootstrapProtocol(BOOTP)
delayedresponsestrategy
destination-unreachablemessage
dynamicconfigurationprotocol
DynamicHostConfigurationProtocol
(DHCP)
dynamicmapping
echo-requestandecho-replymessages
error-reportingmessage
generalquerymessage
groupid
groupmembership
InternetControlMessageProtocol
(ICMP)
InternetGroupManagementProtocol
(IGMP)
InternetworkingControlMessage
Protocol,version6(ICMPv6)
lease
leavereport
membershipreport

642 CHAPTER21NETWORKLAYER:ADDRESSMAPPING,ERRORREPORTING, ANDMULTICASTING
multicastaddress
multicastrouter
multicasting
neighbor-solicitationandadvertisement
message
packet-too-bigmessage
parameter-problemmessage
physicaladdress
proxyARP
querymessage
queryrouter
redirectionmessage
relayagent
reverseaddressresolutionprotocol
(RARP)
router-solicitationandrouter-
advertisementmessages
source-quenchmessage
specialquerymessage
staticmapping
time-exceededmessage
timestamprequestandtimestamp
replymessages
traceroute
tunneling
21.7SUMMARY
oDeliveryofapackettoahostorrouterrequirestwolevels ofaddresses:logicaland
physical.Aphysicaladdressidentifiesahostorrouteratthephysicallevel.
oMappingofalogicaladdresstoaphysicaladdresscanbestaticordynamic.
oStaticmappinginvolvesalist oflogicalandphysicaladdresscorrespondences;
maintenance
ofthelistrequireshighoverhead.
oTheaddressresolutionprotocol(ARP)isadynamicmappingmethodthatfindsa
physicaladdress,givenalogicaladdress.
oInproxyARP,arouterrepresentsaset ofhosts.WhenanARPrequestseeksthe
physicaladdress
ofanyhostinthisset,theroutersendsitsownphysicaladdress.
Thiscreatesasubnettingeffect.
oReverseAddressResolutionProtocol(RARP)isaform ofdynamicmappingin
whichagivenphysicaladdressisassociatedwithalogicaladdress.
oICMPsendsfourpairsofquerymessages:echo-requestandecho-reply,time-stamp
requestandreply,address-mask-requestand-reply,androutersolicitationand
advertisement.
DThechecksumforICMPiscalculatedbyusingboththeheaderandthedatafields
oftheICMPmessage.
DPacketInterNetGroper (ping)isanapplicationprogramthatusestheservices of
ICMPtotestthereachabilityofahost.
oMulticastingisthesending ofthesamemessagetomorethanonereceiver
simultaneously.
oTheInternetGroupManagementProtocol(IGMP)helpsmulticastrouterscreateand
updatealistofloyalmembersrelatedtoarouterinterface.
oThethree IGMPmessagetypesarethequerymessage,themembershipreport,and
theleavereport.

SECTION21.8PRACTICESET 643
DAdelayedresponsestrategypreventsunnecessarytrafficonaLAN.
DTheIGMPmessageisencapsulatedinanIPdatagram.
DMostLANs,includingEthernet,supportphysicalmulticastaddressing.
DWANsthatdonotsupportphysicalmulticastaddressingcanuseaprocesscalled
tunnelingtosendmulticastpackets.
DBOOTPandDynamicHostConfigurationProtocol(DHCP)areclient/serverapplica­
tionsthatdelivervitalnetworkinformationtoeitherdisklesscomputersorcomputers
atfirstboot.
DABOOTP requestisencapsulatedinaUDPuserdatagram.
DBOOTP,astaticconfigurationprotocol,usesatablethatmapsIPaddressesto
physicaladdresses.
DArelayagentisarouterthathelpssendlocalBOOTPrequests toremoteservers.
DDHCPisadynamicconfigurationprotocolwithtwodatabases:Oneissimilarto
BOOTP,andtheother
isapoolofIPaddressesavailablefortemporaryassignment.
DTheDHCPserverissuesaleaseforanIPaddresstoaclientforaspecifictime.
DICMPv6,likeversion4,reportserrors,handlesgroupmemberships,updatesspecific
routerandhosttables,andcheckstheviability
ofahost.
21.8PRACTICESET
ReviewQuestions
1.Isthesize oftheARPpacketfixed?Explain.
2.Whatisthesize ofanARPpacketwhentheprotocolisIPv4andthehardwareis
Ethernet?
3.Whatisthesize ofanEthernetframecarryinganARPpacketinQuestion2?
4.WhatisthebroadcastaddressforEthernet?
5.Whyistherearestrictiononthegeneration
ofanICMPv4messageinresponseto
afailedICMPv4errormessage?
6.Whatisthepurpose ofincludingtheIPv4headerandthefirst8bytesofdatagram
dataintheerror-reportingICMPv4messages?
7.Giveanexample ofasituationinwhichahostwouldneverreceivearedirection
message.
8.Whatistheminimumsize ofanICMPv4packet?Whatisthemaximumsize ofan
ICMPv4packet?
9.Whatistheminimumsize ofanIPv4packetthatcarriesanICMPv4packet?What
isthemaximumsize?
10.Howcanwedetermine ifanIPv4packetiscarryinganICMPv4packet?
11.Whatistheminimumsize ofanEthernetframethatcarriesanIPv4packetwhich
inturncarriesanICMPv4packet?Whatisthemaximumsize?
12.WhyistherenoneedfortheICMPv4messagetotraveloutsideitsownnetwork?

644 CHAPTER 21NETWORKLAYER:ADDRESSMAPPING,ERRORREPORTING, ANDMULTICASTING
Exercises
13.ArouterwithIPv4address125.45.23.12andEthernetphysicaladdress
23:45:AB:4F:67:CDhasreceivedapacketforahostdestinationwith
IPaddress
125.11.78.10.Showtheentriesin
theARPrequestpacketsentbytherouter.Assume
nosubnetting.
14.Showtheentries intheARPpacketsentinresponsetoExercise13.
15.Encapsulatetheresult ofExercise13inadatalinkframe.Fillinallthefields.
16.Encapsulatetheresult ofExercise14inadatalinkframe.Fillinallthefields.
17.HostAsendsadatagramtohostB.HostBneverreceivesthedatagram,andhostA
neverreceivesnotification
offailure.Givetwodifferentexplanations ofwhatmight
havehappened.
18.CalculatethechecksumforthefollowingICMPpacket:
Type:EchoRequestIdentifier: 123Sequencenumber: 25 Message:Hello
19.ArouterreceivesanIPv4packetwithsource IPaddress130.45.3.3anddestination
IPaddress201.23.4.6.TheroutercannotfindthedestinationIPaddressinitsrouting
table.WhichICMPv4messageshouldbesent?
20.TCPreceivesasegmentwithdestinationportaddress234.TCPchecksandcannot
findanopenportforthisdestination.WhichICMPv4messageshouldbesent?
21.Amulticastaddressforagroupis231.24.60.9.Whatisits48-bitEthernetaddress
foraLANusingTCPIIP?
22.
Ifarouterhas20entriesinitsgrouptable,shoulditsend20differentqueriesperiod­
ically
orjustone?Explainyouranswer.
23.
Ifahostwantstocontinuemembershipinfivegroups,shoulditsendfivedifferent
membershipreportmessages
orjustone?
24.Arouter
onanEthernetnetworkhasreceivedamulticastIPpacketwithgroupid
226.17.18.4.
Whenthehostchecksitsmulticastgrouptable,itfindsthisaddress.
ShowhowtheroutersendsthispackettotherecipientsbyencapsulatingtheIP
packetinanEthernetframe.Showalltheentries
oftheEthernetframe.Theoutgoing
IPaddressoftherouteris185.23.5.6,anditsoutgoingphysicaladdressis
4A224512E1E2.Doestherouterneedtheservices
ofARP?
25.AhostwithIPv4address114.45.7.9receivesanIGMPquery.
Whenitchecksits
grouptable,itfindsnoentries.
Whatactionshouldthehosttake?Shoulditsend
anymessages?
26.AhostwithIPv4address222.5.7.19receivesan IGMPquery.Whenitchecksits
routingtable,itfindstwoentriesinitstable:227.4.3.7and229.45.6.23.
What
actionshouldthehosttake?Shoulditsendanymessages? Ifso,whattypeandhow
many?
27.Howmanymulticastaddressescan
besupportedfortheIPv4protocolinEthernet?
HowmanymulticastaddressescanbesupportedbytheIPv4protocol?
Whatisthe
size
ofaddressspacelostwhenwetransformamulticastIPv4addresstoanEthernet
multicastaddress?
28.ChangethefollowingIPv4multicastaddresses
toEthernetmulticastaddresses.
Howmany
ofthemspecifythesameEthernetaddress?

SECTION21.8PRACTICESET 645
a.224.18.72.8
b.235.18.72.8
c.237.18.6.88
d.224.88.12.8
ResearchActivities
29.Usethe pingprogramtotestyourowncomputer(loopback).
30.Usethe
pingprogramtotestahostinsidetheUnitedStates.
31.Usethe
pingprogramtotestahostoutsidetheUnitedStates.
32.Usetraceroute(ortracert)tofindtheroutefromyourcomputertoacomputerina
collegeoruniversity.
33.Usenetstattofindout
ifyourserversupportsmulticastaddressing.
34.DHCPusesseveralmessagessuchasDHCPREQUEST, DHCPDECLINE,
DHCPACK,
DHCPNACK, andDHCPRELEASE. Findthepurposeofthese
messages.

CHAPTER22
NetworkLayer:
Delivery,Forwarding,
andRouting
Thischapterdescribesthedelivery,forwarding,androuting ofIPpacketstotheirfinal
destinations.
Deliveryreferstothewayapacketishandledbytheunderlyingnetworks
underthecontrol
ofthenetworklayer. Forwardingreferstothewayapacket isdeliv­
eredtothenextstation.
Routingreferstothewayroutingtablesarecreatedtohelpin
forwarding.
Routingprotocols areusedtocontinuouslyupdatetheroutingtablesthatarecon­
sultedforforwardingandrouting.Inthischapter,wealsobrieflydiscusscommonuni­
castand
multicastrouting protocols.
22.1DELIVERY
Thenetworklayersupervisesthehandling ofthepacketsbytheunderlyingphysical
networks.Wedefinethishandling
asthedeliveryofapacket.
DirectVersusIndirectDelivery
Thedeliveryofapackettoitsfinaldestinationisaccomplishedbyusingtwodifferent
methods
ofdelivery,directandindirect, asshowninFigure22.1.
DirectDelivery
Inadirectdelivery, thefinaldestination ofthepacketisahostconnectedtothesame
physicalnetworkasthedeliverer.Directdeliveryoccurswhenthesourceanddestina­
tion
ofthepacketarelocatedonthesamephysicalnetworkorwhenthedeliveryis
betweenthelastrouterandthedestinationhost.
Thesendercaneasilydetermine
ifthedeliveryisdirect. Itcanextractthenetwork
address
ofthedestination(usingthemask)andcomparethisaddresswiththeaddresses
ofthenetworkstowhichitisconnected. Ifamatchisfound,thedeliveryisdirect.
IndirectDelivery
Ifthedestinationhostisnot onthesamenetworkasthedeliverer,thepacketisdeliv­
eredindirectly.Inan
indirectdelivery,thepacketgoesfromroutertorouteruntil it
reachestheoneconnectedtothesamephysicalnetworkasitsfinaldestination.Note
647

648 CHAPTER 22NETWORKLAYER:DELIVERY,FORWARDING, ANDROUTING
Figure22.1 Directandindirectdelivery
Host Host Host(source)
Totherest
oftheInternet
a.Directdelivery
Host(destination)
b.Indirectanddirectdelivery
thatadeliveryalwaysinvolvesonedirectdeliverybutzeroormoreindirectdeliveries.
Notealsothatthelastdeliveryisalwaysadirectdelivery.
22.2FORWARDING
Forwardingmeanstoplacethepacket initsroutetoitsdestination.Forwarding
requiresahostoraroutertohavearoutingtable.Whenahosthasapackettosendor
whenarouterhasreceivedapackettobeforwarded,itlooksatthistabletofindthe
routetothefinaldestination.However,thissimplesolutionisimpossibletodayin
an
internetworksuch astheInternetbecausethenumber ofentriesneededintherouting
tablewouldmaketablelookupsinefficient.
ForwardingTechniques
Severaltechniquescanmakethesize oftheroutingtablemanageableandalsohandle
issuessuchassecurity.
Webrieflydiscussthesemethodshere.
Next-HopMethodVersusRouteMethod
Onetechniquetoreducethecontentsofaroutingtableiscalledthenext-hopmethod.
Inthistechnique,therouting tableholdsonlytheaddress
ofthenexthopinstead
ofinformationaboutthecompleteroute(routemethod).Theentriesofaroutingtable
mustbeconsistentwithoneanother.Figure22.2showshowroutingtablescanbesim­
plifiedbyusingthistechnique.
Network-SpecificMethodVersusHost-SpecificMethod
Asecondtechniquetoreducetheroutingtableandsimplifythesearchingprocess
is
calledthenetwork-specificmethod.Here,insteadofhavinganentryforeverydesti­
nationhostconnectedtothesamephysical network(host-specificmethod),wehave

SECTION22.2FORWARDING 649
Figure22.2 Routemethodversusnext-hop method
a.Routingtablesbasedonroute
Destination Route
HostB RI,R2,hostB
Routingtable
forhost A
b.Routingtablesbasedonnexthop
DestinationNexthop
HostB
Rl
Destination
HostB
Destination
HostB
HostA
Route
R2,hostB
Route
HostB
Routingtable
for
Rl
Routingtable
forR2
Destination
HostB
Destination
HostB
Nexthop
R2
Nexthop
HostB
onlyoneentrythatdefinestheaddress ofthedestinationnetworkitself.Inotherwords,
wetreatallhostsconnectedtothesamenetworkasonesingleentity.Forexample,
if
1000hostsareattachedtothesamenetwork,onlyoneentryexistsintheroutingtable
instead
of1000.Figure22.3showstheconcept.
Figure22.3 Host-specificversusnetwork-specific method
RoutingtableforhostSbased
onhost-specificmethod
DestinationNexthop
A Rl
B Rl
C Rl
D Rl
RoutingtableforhostSbased
on
network-specificmethod
Host-specificroutingisusedforpurposessuchascheckingtheroute orproviding
securitymeasures.
DefaultMethod
Anothertechniquetosimplifyrouting
iscalledthe defaultmethod. InFigure22.4host
Aisconnectedtoanetworkwithtworouters.Router
Rlroutesthepacketstohosts
connectedtonetworkN2.However,fortherest
oftheInternet,routerR2 isused.So
instead
oflistingallnetworksintheentireInternet,hostAcan justhaveoneentry
calledthedefault(normallydefinedasnetworkaddress0.0.0.0).

650 CHAPTER 22NETWORKLAYER:DELIVERY,FORWARDING, ANDROUTING
Figure22.4 Defaultmethod
HostA
Destinat.iotlNexthop,
N2
Rl
Anyother R2
Routingtable
forhostA
N2
RestoftheInternet
ForwardingProcess
Letusdiscusstheforwardingprocess. Weassumethathostsandroutersuseclassless
addressingbecauseclassfuladdressingcanbetreatedasaspecialcase
ofclassless
addressing.
Inclasslessaddressing,theroutingtableneeds tohaveonerowofinforma­
tionforeachblockinvolved.Thetableneedstobesearchedbasedonthenetwork
address(firstaddressintheblock).Unfortunately,thedestinationaddressinthepacket
gives
noclueaboutthenetworkaddress. Tosolvetheproblem,weneedtoincludethe
mask
(In)inthetable;weneedtohaveanextracolumnthatincludesthemaskforthe
correspondingblock.Figure22.5showsasimpleforwardingmoduleforclassless
addressing.
Figure22.5 Simplifiedforwardingmoduleinclasslessaddress
Forwarding
module
E"tract
Packet-f-+destination~
address
Search
table
Mask
(In)
NetworkNext-hop
Interface
addressaddress
Next-hopaddress
and
interfacenumber
ToARP
Notethatweneedatleastfourcolumnsinour routingtable;usuallytherearemore.
Inclasslessaddressing,weneed atleastfourcolwnnsinaroutingtable.

SECTION22.2FORWARDING 651
Example22.1
Makearoutingtableforrouter Rl,usingtheconfigurationinFigure22.6.
Figure22.6 ConfigurationforExample22.1
180.70.65.135/25
ml
mO
201.4.16.2/22 201.4.22.3/24
m2Rl
180.70.65.194/26
180.70.65.200/26
RestoftheIntemet
Solution
Table22.1showsthecorrespondingtable.
Table22.1 Routingtable forrouterRIinFigure22.6
Mask NetworkAddress NextHop
lnteiface
/26 180.70.65.192 - m2
/25 180.70.65.128
- mO
/24 201.4.22.0 - m3
/22 201.4.16.0 .... ml
Any Any 180.70.65.200 m2
Example22.2
Showtheforwardingprocess ifapacketarrivesat RlinFigure22.6withthedestinationaddress
180.70.65.140.
Solution
Therouterperformsthefollowingsteps:
1.Thefirstmask(/26)isappliedtothedestinationaddress.Theresult is180.70.65.128,which
doesnotmatchthecorrespondingnetworkaddress.
2.Thesecondmask(/25) isappliedtothedestinationaddress.Theresultis180.70.65.128,
whichmatchesthecorrespondingnetworkaddress.Thenext-hop
address(thedestination
address
ofthepacketinthiscase)andtheinterfacenumber mOarepassedtoARPforfurther
processing.

652 CHAPTER22NETWORKLAYER:DELIVERY,FORWARDING, ANDROUTING
Example22.3
Showtheforwardingprocess ifapacketarrivesat R1inFigure22.6withthedestinationaddress
201.4.22.35.
Solution
Therouterperformsthefollowingsteps:
I.Thefirstmask(/26)isappliedtothedestinationaddress.Theresultis201.4.22.0,which
doesnotmatchthecorrespondingnetworkaddress(row
1).
2.Thesecondmask(/25)isappliedtothedestinationaddress.Theresultis201.4.22.0,which
doesnotmatchthecorrespondingnetworkaddress(row2).
3.Thethirdmask(/24) isappliedtothedestinationaddress.Theresultis201.4.22.0,which
matchesthecorrespondingnetworkaddress.Thedestinationaddress
ofthepacketandthe
interfacenumberm3arepassedto
ARP.
Example22.4
Showtheforwardingprocess ifapacketarrivesat R1inFigure22.6withthedestinationaddress
18.24.32.78.
Solution
Thistimeallmasksareapplied,onebyone,tothedestinationaddress,butnomatchingnetwork
addressisfound.When
itreachestheend ofthetable,themodulegivesthenext-hopaddress
180.70.65.200andinterfacenumberm2to
ARP.Thisisprobablyanoutgoingpackagethatneeds
tobesent,viathedefaultrouter,tosomeplaceelseintheInternet.
AddressAggregatioll
Whenweuseclasslessaddressing,itislikelythatthenumber ofroutingtableentries
willincrease.Thisissobecausetheintent
ofclasslessaddressingistodivideupthe
wholeaddressspaceintomanageableblocks.Theincreasedsize
ofthetableresultsin
anincreaseintheamount
oftimeneededtosearchthetable. Toalleviatetheproblem,
theidea
ofaddressaggregation wasdesigned.InFigure22.7wehavetworouters.
Router
Rlisconnectedtonetworksoffourorganizationsthateachuse64addresses.
RouterR2issomewherefarfrom
Rl.RouterRlhasalongerroutingtablebecauseeach
packetmustbecorrectlyrouted
totheappropriateorganization.RouterR2,ontheother
hand,canhaveaverysmallroutingtable.ForR2,anypacketwithdestination140.24.7.0
to140.24.7.255issentoutfrominterface mOregardlessoftheorganizationnumber.This
iscalledaddressaggregationbecausetheblocks
ofaddressesforfourorganizationsare
aggregatedintoonelargerblock.RouterR2wouldhavealongerroutingtable
ifeach
organizationhadaddressesthatcouldnotbeaggregatedintooneblock.
Notethatalthoughtheidea
ofaddressaggregationissimilartotheidea ofsubnet­
ting,wedonothaveacommonsitehere;thenetworkforeachorganizationisindepen­
dent.Inaddition,wecanhaveseverallevels
ofaggregation.
LongestMaskMatching
Whathappens ifoneoftheorganizationsinFigure22.7isnotgeographicallyclose to
theotherthree?Forexample, iforganization4cannotbeconnectedtorouter Rlfor
somereason,canwestillusetheidea
ofaddressaggregationandstillassignblock
140.24.7.192/26
toorganization4?

SECTION22.2FORWARDING 653
Figure22.7Addressaggregation
Organization1 140.24.7.0/26
:~ ~;~~m_l __
Somewhere
intheInternet
ml
Organization3140.24.7.128/26
~-~
Organization2140.24.7.64/26
Organization4140.24.7.192/26~------'
Mask
Network Next-hop
Interface
address address
/26140.24.7.0
---------- mO
/26140.24.7.64 ---------- ml
/26140.24.7.128 ---------- m2
/26140.24.7.192
---------- m3
/0 0.0.0.0 Default m4
Mask
Network Next-hop
Interface
address address
/24 140.24.7.0
-------~-- mO
/0 0.0.0.0 Default ml
RoutmgtableforR2
Routingtablefor
Rl
Theanswerisyesbecauserouting inclasslessaddressingusesanotherprinciple,
longestmaskmatching.Thisprinciplestatesthattheroutingtableissortedfromthe
longestmasktotheshortestmask.Inotherwords,
iftherearethreemasks 127,126,and
124,themask/27mustbethefirstentryand 124mustbelast.Letussee ifthisprinciple
solvesthesituationinwhichorganization4isseparatedfromtheotherthreeorganiza­
tions.Figure22.8showsthesituation.
Supposeapacketarrivesfororganization4withdestinationaddress140.24.7.200.
ThefirstmaskatrouterR2isapplied,whichgivesthenetworkaddress140.24.7.192.
Thepacketisroutedcorrectlyfrominterface
mlandreachesorganization4.If,how­
ever,theroutingtablewasnotstoredwiththelongestprefixfirst,applyingthe/24mask
wouldresultintheincorrectrouting
ofthepackettorouter Rl.
HierarchicalRouting
Tosolvetheproblemofgiganticroutingtables,wecancreateasense ofhierarchyin
theroutingtables.InChapter
1,wementionedthattheInternettodayhasasense of
hierarchy.WesaidthattheInternetisdividedintointernationalandnationalISPs.
NationalISPsaredividedintoregionalISPs,andregionalISPsaredividedintolocal
ISPs.
Iftheroutingtablehasasense ofhierarchy liketheInternetarchitecture,therout­
ingtablecandecrease
insize.
Letustakethecase
ofalocalISP.AlocalISPcanbeassignedasingle,butlarge
block
ofaddresseswithacertainprefixlength.ThelocalISPcandividethisblockinto
smallerblocks
ofdifferentsizesandcanassignthesetoindividualusersandorganiza­
tions,bothlargeandsmall.
IftheblockassignedtothelocalISPstartswitha.b.c.dln,
theISPcancreateblocksstartingwitheJ.g.h/m,where
mmayvaryforeachcustomer
andisgreaterthan
n.

654 CHAPTER22NETWORKLAYER:DELIVERY,FORWARDING, ANDROUTING
Figure22.8Longestmaskmatching
Routingtablefor R2
140.24.7.192/26
Organization4
R3
ml
Mask
Network
Next-hop
Interface
address address
/26 140.24.7.192
----------
ml
/24 140.24.7.0
----------mO
I?? ????????????????ml
/0 0.0.0.0 Default m2
Toothernetworks----I
Z;--------------~!2~
Iml
I
I
I
ml
l
Organization3140.24.7.128/26
Organization2140.24.7.64/26
Routmgtablefor RI
Mask
Network Next-hop
Interface
address address
/26 140.24.7.0---------- mO
/26 140.24.7.64 ----~---~- ml
/26 140.24.7.128 ---------- m2
/0 0.0.0.0 Default
m3
Organization1 140.24.7.0/26
Mask
Network Next-hop
Interface
address address
/26 140.24.7.192
----------
rnO
I?? ????????????????rnl
/0 0.0.0.0 Default
rn2
Routingtablefor R3
Howdoesthisreducethesize oftheroutingtable?TherestoftheInternetdoesnot
havetobeaware
ofthisdivision.Allcustomers ofthelocalISParedefinedasa.b.c.dlnto
therest
oftheInternet.Everypacketdestinedforone oftheaddressesinthislargeblock is
routedtothelocal ISP.Thereisonlyoneentryineveryrouter intheworldforallthesecus­
tomers.Theyallbelongtothesamegroup.
Ofcourse,insidethelocalISp,theroutermust
recognizethesubblocksandroutethepackettothedestinedcustomer.
Ifoneofthecus­
tomersisalargeorganization,italsocancreateanotherlevel
ofhierarchybysubnetting
anddividingitssubblockintosmallersubblocks(orsub-subblocks).Inclasslessrouting,
thelevels
ofhierarchyareunlimitedsolongaswefollowtherules ofclasslessaddressing.
Example22.5
Asanexampleofhierarchicalrouting,let usconsiderFigure22.9.AregionalISPisgranted
16,384addressesstartingfrom120.14.64.0.TheregionalISPhasdecidedtodividethisblock
intofoursubblocks,eachwith4096addresses.Three
ofthesesubblocksareassignedtothree
localISPs;thesecondsubblockisreservedforfutureuse.Notethatthemaskforeachblock
is120
becausetheoriginalblockwithmask/18isdividedinto4blocks.
ThefirstlocalISPhasdivideditsassignedsubblockinto8smallerblocksandassignedeach
toasmallISP.EachsmallISPprovidesservicesto128households (HOOItoHI28),eachusing
fouraddresses.NotethatthemaskforeachsmallISPisnow
123becausetheblockisfurther
dividedinto8blocks.Eachhouseholdhasamask
of130,becauseahouseholdhasonlyfour
addresses(2
32
-
30
is4).

SECTION22.2FORWARDING 655
Figure22.9 HierarchicalroutingwithISPs
120.14.64.0118
Total16384
120.14.80.0/20
Tota14096
120.14.64.0/20
Tota14096
120.14.64.0/23
Total512
LOrgOl
120.14.96.0/22
·
120.14.96.0/20
·
LOrg04·
Total4096
SOrg
01
120.14.112.0/24
• 120.14.112.0120
·
SOrg16

Total4096
H128
-------t__~120.14.78.0/23
H
001
120.14.78.0/30
Total512
H
001120.14.64.0/30
H128----L_.J
ThesecondlocalISPhasdivideditsblockinto4blocksandhasassignedtheaddressesto
fourlargeorganizations(LOrg01toLOrg04).Notethateachlargeorganizationhas1024addresses,
andthemaskis/22.
Thethirdlocal ISPhasdividedits blockinto16blocksand assignedeachblocktoa
smallorganization(SOrg01toSOrg16).Eachsmallorganizationhas256addresses,andthe
maskis/24.
Thereisasense
ofhierarchyinthisconfiguration.AllroutersintheInternetsendapacket
withdestinationaddress120.14.64.0to120.14.127.255totheregionalISP.
TheregionalISPsendseverypacketwithdestinationaddress120.14.64.0to120.14.79.255
tolocal
ISPl.LocalISP1sendseverypacketwithdestinationaddress120.14.64.0to120.14.64.3
toH001.
GeographicalRouting
Todecreasethesize oftheroutingtableevenfurther,weneedtoextendhierarchical
routingtoincludegeographicalrouting.
Wemustdividetheentireaddressspace intoa
fewlargeblocks.WeassignablocktoNorthAmerica,ablocktoEurope,ablockto
Asia,ablocktoAfrica,andsoon.Therouters
ofISPsoutsideEuropewillhaveonly
oneentryforpacketstoEuropeintheirroutingtables.Therouters
ofISPsoutside
NorthAmericawillhaveonlyoneentryforpacketstoNorthAmericaintheirrouting
tables.Andsoon.
RoutingTable
Letusnowdiscussroutingtables.Ahostorarouterhasaroutingtablewith anentry
foreachdestination,oracombination
ofdestinations,torouteIPpackets.Therouting
tablecanbeeitherstaticordynamic.
StaticRoutingTable
Astaticroutingtablecontainsinformationenteredmanually.Theadministratorenters
therouteforeachdestinationintothetable.Whenatableiscreated,itcannotupdate

656 CHAPTER 22NETWORKLAYER:DELIVERY,FORWARDING, ANDROUTING
automaticallywhenthereisachangeintheInternet.Thetablemustbemanuallyaltered
bytheadministrator.
Astaticroutingtablecanbeusedinasmallinternetthatdoesnotchangeveryoften,
orinanexperimentalinternetfortroubleshooting.Itispoorstrategytouseastaticrouting
tableinabiginternetsuchastheInternet.
DynamicRoutingTable
Adynamicroutingtable isupdatedperiodicallybyusingone ofthedynamicrouting
protocolssuchas
RIP,OSPF,orBGP.WheneverthereisachangeintheInternet,such
asashutdown
ofarouterorbreaking ofalink,thedynamicroutingprotocolsupdateall
thetablesintherouters(andeventuallyinthehost)automatically.
Theroutersinabiginternetsuch
astheInternetneedtobeupdateddynamically
forefficientdelivery
oftheIPpackets.Wediscussindetailthethreedynamicrouting
protocolslaterinthechapter.
Format
Asmentionedpreviously,aroutingtableforclasslessaddressinghasaminimum of
fourcolumns.However,some oftoday'sroutershaveevenmorecolumns. Weshould
beawarethatthenumber
ofcolumnsisvendor-dependent,andnotallcolumnscanbe
found inallrouters.Figure22.10showssomecommonfields intoday'srouters.
Figure22.10 Commonfieldsinaroutingtable
Mask
Network
address
Next-hop
address
Interlace
Reference
count.
Use
oMask.Thisfielddefinesthemaskappliedfortheentry.
oNetworkaddress. Thisfielddefinesthenetworkaddresstowhichthepacketis
finallydelivered.Inthecase
ofhost-specificrouting,thisfielddefinestheaddress
ofthedestinationhost.
oNext-hopaddress. Thisfielddefinestheaddress ofthenext-hoproutertowhich
thepacketisdelivered.
DInterface.Thisfieldshowsthename oftheinterface.
DFlags.Thisfielddefinesuptofiveflags.Flagsareon/offswitchesthatsignify
eitherpresenceorabsence.The
fiveflagsareU(up),G(gateway),H(host-specific),
D(addedbyredirection),andM(modifiedbyredirection).
a.U(up).TheUflagindicatestherouterisupandrunning. Ifthisflagisnotpresent,
itmeansthattherouterisdown.Thepacketcannotbeforwardedand
isdiscarded.
b.G(gateway).TheGflagmeansthatthedestination isinanothernetwork.The
packetisdeliveredtothenext-hoprouterfordelivery(indirectdelivery).When
thisflagismissing,itmeansthedestination
isinthisnetwork(directdelivery).

SECTION22.2FORWARDING 657
c.H(host-specific).TheHflagindicatesthattheentry inthenetworkaddress
fieldisahost-specificaddress.Whenit
ismissing,itmeansthattheaddressis
onlythenetworkaddress
ofthedestination.
d.D(addedbyredirection).TheDflagindicatesthatroutinginformationforthis
destinationhasbeenaddedtothehostroutingtable
byaredirectionmessage
fromICMP.WediscussedredirectionandtheICMPprotocol
inChapter21.
e.M(modifiedbyredirection).TheMflagindicatesthattheroutinginformation
forthisdestinationhasbeenmodifiedbyaredirectionmessagefromICMP.
We
discussedredirectionandtheICMPprotocolinChapter21.
oReferencecount. Thisfieldgivesthenumber ofusersofthisrouteatthemoment.
Forexample,
iffivepeopleatthesametimeareconnectingtothesamehostfrom
thisrouter,thevalue
ofthiscolumnis 5.
oUse.Thisfieldshowsthenumber ofpacketstransmittedthroughthisrouterforthe
correspondingdestination.
Utilities
Thereareseveralutilitiesthatcanbeusedtofindtheroutinginformationandthecon­
tents
ofaroutingtable.Wediscuss netstatandifconfig.
Example22.6
Oneutilitythatcanbeusedtofindthecontents ofaroutingtableforahostorrouteris netstatin
UNIXorLINUX.Thefollowingshowsthelist ofthecontentsofadefaultserver. Wehaveused
twooptions,rand
n.Theoptionrindicatesthatweareinterestedintheroutingtable,andthe
optionnindicatesthatwearelookingfornumericaddresses.Notethatthisisaroutingtablefora
host,notarouter.Althoughwediscussedtheroutingtableforarouterthroughoutthechapter,ahost
alsoneedsaroutingtable.
$netstat-rn
KernelIProutingtable
Destination Gateway
153.18.16.0 0.0.0.0
127.0.0.0 0.0.0.0
0.0.0.0 153.18.31.254
Mask
255.255.240.0
255.0.0.0
0.0.0.0
Flags
U
U
UO
Iface
ethO
10
ethO
Notealsothattheorder ofcolumnsisdifferentfromwhatweshowed.Thedestinationcolumn
heredefinesthenetworkaddress.Theterm
gatewayusedbyUNIX issynonymouswith router.This
columnacmallydefinestheaddress
ofthenexthop.Thevalue0.0.0.0showsthatthedeliveryis
direct.Thelastentryhasaflag
ofG,whichmeansthatthedestinationcanbereachedthrougha
router(defaultrouter).The
Ifacedefinestheinterface.Thehosthasonlyonerealinterface, ethO,
whichmeansinterface0connectedtoanEthernetnetwork.Thesecondinterface,la, isactuallya
virmalloopbackinterfaceindicatingthatthehostacceptspacketswithloopbackaddress127.0.0.0.
Moreinformationaboutthe
IPaddressandphysicaladdress oftheservercanbefoundby
usingthe
ifconfigcommandonthegiveninterface (ethO).
$ifconfigethO
ethOLinkencap:EthemetHWaddr00:BO:DO:DF:09:5D
inetaddr:153.18.17.11Bcast:153.18.31.255Mask:255.255.240.0

658 CHAPTER 22NETWORKIAYER:DELIVERY,FORWARDING, ANDROUTING
Fromtheaboveinformation, wecandeducetheconfiguration oftheserver,asshownin
Figure22.11.
Figure22.11ConfigurationoftheserverforExample22.6
==
c:;::;:::;:::u
E::::9
-ethO
00:BO:DO:DF:09:5D153.18.17.ll/20
153.18.31.254/20
RestoftheInternet
Notethatthe ifconfigcommandgivesustheIPaddressandthephysical(hardware)address
oftheinterface.
22.3UNICASTROUTINGPROTOCOLS
Aroutingtablecanbeeitherstaticordynamic.A statictable isonewithmanualentries.
A
dynamictable, ontheotherhand, isonethatisupdatedautomaticallywhenthereisa
changesomewhereintheinternet.Today,
aninternetneedsdynamic routingtables.The
tablesneedtobeupdatedassoon
asthereisachangeintheinternet.Forinstance,they
needtobeupdatedwhenarouterisdown,andtheyneedtobeupdatedwheneverabetter
routehasbeenfound.
Routingprotocolshavebeencreatedinresponsetothedemandfordynamicrouting
tables.Aroutingprotocolisacombination
ofrulesandproceduresthatletsroutersin
theinternetinformeachother
ofchanges.Itallowsrouterstosharewhatevertheyknow
abouttheinternetortheirneighborhood.Thesharing
ofinformationallowsarouterin
SanFranciscotoknowaboutthefailure
ofanetworkinTexas.Theroutingprotocols
alsoincludeproceduresforcombininginformationreceivedfromotherrouters.
Optimization
Arouterreceivesapacketfromanetworkandpassesittoanothernetwork.Arouteris
usuallyattachedtoseveralnetworks.When
itreceivesapacket,towhichnetwork
shoulditpassthepacket?Thedecisionisbasedonoptimization:Which
oftheavailable
pathwaysistheoptimumpathway?Whatisthedefinition
ofthetermoptimum?
Oneapproachistoassignacostforpassingthroughanetwork. Wecallthiscosta
metric.However,themetricassignedtoeachnetworkdependsonthetype ofproto­
col.Somesimpleprotocols,suchastheRoutingInformationProtocol(RIP),treatall
networksasequals.Thecost
ofpassingthroughanetworkisthesame; itisonehop
count.So
ifapacketpassesthrough10networkstoreachthedestination,thetotalcost
is10hopcounts.

SECTION22.3UNICASTROUTINGPROTOCOLS 659
Otherprotocols,such asOpenShortestPathFirst(OSPF),allowtheadministratorto
assignacostforpassingthroughanetworkbasedonthetype
ofservicerequired.Aroute
throughanetworkcanhavedifferentcosts(metrics).Forexample,
ifmaximum
through­
putisthedesiredtype ofservice,asatellitelinkhasalowermetricthanafiber-opticline.
Ontheotherhand,ifminimumdelay
isthedesiredtype ofservice,afiber-opticlinehas
alowermetricthanasatellitelink.Routersuseroutingtablestohelpdecidethebest
route.OSPFprotocolallowseachroutertohaveseveralroutingtablesbasedonthe
requiredtype
ofservice.
Otherprotocolsdefinethemetricinatotallydifferentway.IntheBorderGateway
Protocol(BGP),thecriterionisthepolicy,whichcanbesetbytheadministrator.The
policydefineswhatpathsshouldbechosen.
Intra-andInterdomainRouting
Today,aninternetcanbesolargethatoneroutingprotocolcannothandlethetask of
updatingtheroutingtables ofallrouters.Forthisreason,aninternetisdividedinto
autonomoussystems.An
autonomoussystem (AS)isagroup ofnetworksandrouters
undertheauthority
ofasingleadministration.Routinginsideanautonomoussystemis
referredtoas
intradomainrouting. Routingbetweenautonomoussystemsisreferred
toas
interdomainrouting. Eachautonomoussystemcanchooseoneormoreintrado­
mainroutingprotocolstohandleroutinginsidetheautonomoussystem.However,only
oneinterdomainroutingprotocolhandlesroutingbetweenautonomoussystems(see
Figure22.12).
Figure22.12 Autonomoussystems
Autonomoussystem Autonomoussystem
~A.
. .R4
Autonomoussystem
···
....
•_~D-""1IIIIIr'
Autonomoussystem
Severalintradomainandinterdomainroutingprotocolsareinuse.Inthissection,
wecoveronlythemostpopularones.
Wediscusstwointradomainroutingprotocols:
distancevectorandlinkstate.Wealsointroduceoneinterdomainroutingprotocol:path
vector(seeFigure22.13).
RoutingInformationProtocol(RIP) isanimplementation ofthedistance vector
protocol.
OpenShortestPathFirst(OSPF) isanimplementationofthelinkstateproto­
col.
BorderGatewayProtocol(BGP) isanimplementationofthepathvectorprotocol.

660 CHAPTER 22NETWORKLAYER:DELIVERY,FORWARDING, ANDROUTING
Figure22.13 Popularroutingprotocols
DistanceVectorRouting
Indistancevectorrouting, theleast-costroutebetweenanytwonodesistheroute
withminimumdistance.Inthisprotocol,asthenameimplies,eachnodemaintainsa
vector(table)
ofminimumdistancestoeverynode.Thetableateachnodealsoguides
thepacketstothedesirednodebyshowingthenextstopintheroute
(next-hoprouting).
Wecanthinkofnodesasthecitiesinanareaandthelinesastheroadsconnecting
them.Atablecanshowatouristtheminimumdistancebetweencities.
InFigure22.14,weshowasystem
offivenodeswiththeircorrespondingtables.
Figure22.14 Distancevectorroutingtables
D'stable E'stable
To
CostNext
A
B
C
D
E
To
CostNext
A 5¥!:
B()~W
~:~~i
E3~~.
B'stable
3
e'stable
A 2
B 4
C(}
D'5
E 4
3 <
8
5
o
9
3
A
B
C
D
E
A
B
C
D
E
To
CostNext
ToCostNext
ThetablefornodeAshowshowwecanreachanynodefromthisnode.Forexam­
ple,ourleastcosttoreachnodeEis6.TheroutepassesthroughC.
Initialization
ThetablesinFigure22.14arestable;eachnodeknowshowtoreachanyothernode
andthecost.Atthebeginning,however,this
isnotthecase.Eachnodecanknowonly

SECTION22.3UNICASTROUTINGPROTOCOLS 661
thedistancebetweenitselfandits immediateneighbors,thosedirectlyconnectedtoit.
Soforthemoment,weassumethateachnodecansendamessagetotheimmediate
neighborsandfindthedistancebetweenitselfandtheseneighbors.Figure22.15shows
theinitialtablesforeachnode.
Thedistanceforanyentrythatisnotaneighboris
markedasinfinite(unreachable).
Figure22.15Initializationoftablesindistancevectorrouting
3
To
CostNext
A -O,'~'i~·
~n~
E""f~~~,;:'
A'stable
ToCostNext
A3
~
B,'"'
,
C .>~,~
D
0["
E""k<7
D'stable
D
~5:J~
4(~i
C'stable
3
A
B
C
D
M
E3
ToCostNext
QQ ~;" ~~c,'.;
():jf,
E'stable
Sharing
Thewholeidea ofdistancevectorroutingisthesharing ofinformationbetweenneigh­
bors.AlthoughnodeAdoesnotknowaboutnodeE,nodeCdoes.So
ifnodeCshares
itsroutingtablewithA,nodeAcanalsoknowhowtoreachnodeE.Ontheotherhand,
nodeCdoesnotknowhowtoreachnodeD,butnodeAdoes.
IfnodeAsharesitsrout­
ingtablewithnodeC,nodeCalsoknowshowtoreachnodeD.Inotherwords,nodes
AandC,asimmediateneighbors,canimprovetheirroutingtables
iftheyhelpeach
other.
Thereisonlyoneproblem.Howmuch
ofthetablemustbesharedwitheach
neighbor?Anodeisnotaware
ofaneighbor'stable.Thebestsolutionforeachnode
istosenditsentiretabletotheneighborandlettheneighbordecidewhatpartto
useandwhatparttodiscard.However,thethirdcolumn
ofatable(nextstop)isnot
usefulfortheneighbor.
Whentheneighborreceivesatable,thiscolumnneedsto
bereplacedwiththesender'sname.
Ifanyoftherowscanbeused,thenextnodeis
thesender
ofthetable.Anodethereforecansendonlythefirsttwocolumns ofits
tabletoanyneighbor.In otherwords,sharingheremeanssharingonlythefirsttwo
columns.
Indistancevectorrouting,eachnodesharesitsroutingtablewithits
immediateneighborsperiodically
andwhenthereisachange.

662 CHAPTER 22NETWORKLAYER:DELIVERY,FORWARDING, ANDROUTING
Updating
Whenanodereceivesatwo-columntablefromaneighbor,itneedstoupdateitsrout­
ingtable.Updatingtakesthreesteps:
1.Thereceivingnodeneedstoaddthecostbetweenitselfandthesendingnode
toeachvalueinthesecondcolumn.Thelogicisclear.
IfnodeCclaimsthatits
distancetoadestinationis
xmi,andthedistancebetweenAandCis ymi,thenthe
distancebetweenAandthatdestination,viaC,is
x+ymi.
2.Thereceivingnodeneedstoaddthename ofthesendingnodetoeachrow asthe
thirdcolumn
ifthereceivingnodeusesinformationfromanyrow.Thesending
nodeisthenextnodeintheroute.
3.Thereceivingnodeneedstocompareeachrow ofitsoldtablewiththecorrespond­
ingrow
ofthemodifiedversion ofthereceivedtable.
a.Ifthenext-nodeentry isdifferent,thereceivingnodechoosestherowwiththe
smallercost.Ifthereisatie,theoldoneiskept.
b.Ifthenext-nodeentryisthesame,thereceivingnodechoosesthenew row.For
example,supposenodeChaspreviouslyadvertisedaroutetonodeXwithdis­
tance3.Supposethatnowthere
isnopathbetweenCandX;nodeCnowadver­
tisesthisroutewithadistance
ofinfinity.NodeAmustnotignorethisvalue
eventhoughitsold entry
issmaller.Theoldroutedoesnotexistanymore.The
newroutehasadistance
ofinfinity.
Figure22.16showshownodeAupdatesitsroutingtableafterreceivingthepartialtable
fromnode
C.
Figure22.16Updatingindistancevectorrouting
ToCost ToCostNext ToCostNext
A
~2 A4 A0
B4 B6 B .5
cif C2 C2
D ,1?0~_ D D '3
E4 E6 E qo
Received A'smodified A'soldtable
frome table
ToCostNext
A0
B5
C2
D3
E6
Thereareseveralpoints weneedtoemphasizehere.First, asweknowfrommath­
ematics,whenweaddanynumbertoinfinity,theresultisstillinfinity.Second,the
modifiedtableshowshowtoreachAfromAvia
C.IfAneedstoreachitselfviaC,it
needs
togotoCandcomeback,adistance of4.Third,theonlybenefitfromthisupdat­
ing
ofnodeAisthelastentry,howtoreachE.Previously,nodeAdidnotknowhowto
reachE(distance
ofinfinity);nowitknowsthatthecostis6via C.

SECTION22.3UNICASTROUTINGPROTOCOLS 663
Eachnodecanupdateitstable byusingthetablesreceivedfromothernodes. Ina
shorttime,
ifthereisnochangeinthenetworkitself,suchasafailureinalink,each
nodereachesastablecondition
inwhichthecontents ofitstableremainsthesame.
WhentoShare
Thequestionnowis,Whendoesanodesenditspartialroutingtable(onlytwocolumns)
toallitsimmediateneighbors?Thetableissentbothperiodicallyandwhenthereisa
changeinthetable.
PeriodicUpdateAnodesendsitsroutingtable,normallyevery 30s,inaperiodic
update.Theperioddepends
ontheprotocolthatisusingdistancevectorrouting.
TriggeredUpdateAnodesendsitstwo-columnroutingtabletoitsneighborsany­
timethereisachangeinitsroutingtable.Thisis calledatriggeredupdate.The
changecanresultfromthefollowing.
1.Anodereceivesatablefromaneighbor,resultinginchangesinitsowntableafter
updating.
2.Anodedetectssomefailureintheneighboringlinkswhichresults inadistance
changetoinfinity.
Two-NodeLoopInstability
Aproblemwithdistancevectorroutingisinstability,whichmeansthatanetworkusing
thisprotocolcanbecomeunstable.
Tounderstandtheproblem,letuslookatthescenario
depictedinFigure22.17.
Figure22.17Two-nodeinstability
Before
failure
After
failure
·•
·
I
Aft"Breceives
update
fromA
g€,I_o ~_-~_~_··__'__4__~_'~_'_"_: r-o----~-··~-~-:~-¥,t-: --4--~-X-:-;:-J-I) --,Finally
Figure22.17showsasystemwiththreenodes.Wehaveshownonlytheportions of
theroutingtableneededforourdiscussion. Atthebeginning,bothnodesAandBknow
howtoreachnode
X.Butsuddenly,thelinkbetweenAandXfails.NodeAchangesits
table.
IfAcansenditstabletoBimmediately,everythingisfine.However,thesystem
becomesunstable
ifBsendsitsroutingtabletoAbeforereceivingA'sroutingtable.
NodeAreceivestheupdateand,assumingthatBhasfoundawaytoreachX,immedi­
atelyupdatesitsroutingtable.Basedonthetriggeredupdatestrategy,Asendsitsnew

664 CHAPTER 22NETWORKLAYER:DELIVERY,FORWARDING, ANDROUTING
updatetoB.NowBthinksthatsomethinghasbeenchangedaroundAandupdatesits
routingtable.Thecost
ofreachingXincreasesgraduallyuntilitreachesinfinity.Atthis
moment,bothAandBknowthatXcannotbereached.However,duringthistimethe
systemisnotstable.NodeAthinksthattheroute toXisviaB;nodeBthinksthatthe
routetoXisviaA.
IfAreceivesapacketdestinedforX,itgoestoBandthencomes
backtoA.Similarly,
ifBreceivesapacketdestinedforX,itgoestoAandcomesback
to
B.PacketsbouncebetweenAandB,creatingatwo-nodeloopproblem.Afewsolu­
tionshavebeenproposedforinstability
ofthiskind.
Defining
InfinityThefirstobvioussolutionistoredefineinfinitytoasmallernum­
ber,suchas100.Forourpreviousscenario,thesystemwillbestableinlessthan20
updates.Asamatter
offact,mostimplementations ofthedistancevectorprotocol
definethedistancebetweeneachnodetobeIanddefine
16asinfinity.However,this
meansthatthedistancevectorroutingcannot
beusedinlargesystems.Thesizeofthe
network,ineachdirection,cannotexceed
15hops.
SplitHorizonAnothersolutioniscalled splithorizon.Inthisstrategy,instead of
floodingthetablethrougheachinterface,eachnodesendsonlypart ofitstablethrough
eachinterface.If,accordingtoitstable,nodeBthinksthattheoptimumroutetoreach
XisviaA,
itdoesnotneed toadvertisethispiece ofinformationtoA;theinformation
hascornefromA(Aalreadyknows).TakinginformationfromnodeA,modifyingit,
andsendingitbacktonodeAcreatestheconfusion.Inourscenario,nodeBeliminates
thelastlineofitsroutingtablebeforeitsendsittoA.Inthiscase,nodeAkeepsthe
valueofinfinityasthedistancetoX.LaterwhennodeAsendsitsroutingtabletoB,
nodeBalsocorrectsitsroutingtable.Thesystembecomesstableafterthefirstupdate:
bothnodeAandBknowthatXisnotreachable.
Split
HorizonandPoisonReverseUsingthesplithorizonstrategyhasonedraw­
back.Normally,thedistancevectorprotocolusesatimer,and
ifthereisnonewsabout
aroute,thenodedeletestheroutefromitstable.WhennodeBinthepreviousscenario
eliminatestheroutetoXfromitsadvertisementtoA,nodeAcannotguessthatthisis
duetothesplithorizonstrategy(thesourceofinformationwasA)orbecauseBhasnot
receivedanynewsaboutXrecently.Thesplithorizonstrategycanbecombinedwith
thepoisonreversestrategy.NodeBcanstilladvertisethevalueforX,but
ifthesource
ofinformationisA,itcanreplacethedistancewithinfinity asawarning:"Donotuse
thisvalue;whatIknowaboutthisroutecomesfrom
you."
Three-NodeInstability
Thetwo-nodeinstabilitycanbeavoided byusingthesplithorizonstrategycombined
withpoisonreverse.However,
iftheinstabilityisbetweenthreenodes,stabilitycannot
beguaranteed.Figure22.18showsthescenario.
Suppose,afterfindingthatXisnotreachable,nodeAsendsapacket
toBandCto
informthemofthesituation.NodeBimmediatelyupdatesitstable,butthepackettoC
islostinthenetworkandneverreaches
C.NodeCremains inthedarkandstillthinks
thatthereisaroutetoXviaAwithadistance
of5.Afterawhile,nodeCsendsto Bits
routingtable,whichincludestheroutetoX.NodeBistotallyfooledhere. Itreceives
information
ontheroutetoXfromC,andaccordingtothealgorithm, itupdatesits

SECTION22.3UNICASTROUTINGPROTOCOLS 665
Figure22.18Three-nodeinstability
Beforefailure
AfterAsends
therouteto
B0
andC,butthe
packettoC
islost
[ill8
2
AfterBsends
theroute
toA
After
Csends
theroutetoB
table,showingtheroutetoXviaCwithacost of8.ThisinformationhascomefromC,
notfromA,
soafterawhilenodeBmayadvertisethisroutetoA.NowAisfooledand
updatesitstabletoshowthatAcanreachXviaBwithacost
of12.Ofcourse,theloop
continues;nowAadvertisestheroutetoXtoC,withincreasedcost,butnottoB.Node
CthenadvertisestheroutetoBwithanincreasedcost.NodeBdoesthesameto
A.
Andsoon.Theloopstopswhenthecostineachnodereachesinfinity.
RIP
TheRoutingInformationProtocol(RIP)isanintradomainroutingprotocolused
insideanautonomoussystem.Itisaverysimpleprotocolbased
ondistancevector
routing.RIPimplementsdistancevectorroutingdirectlywithsomeconsiderations:
1.Inanautonomoussystem,wearedealingwithroutersandnetworks(links).The
routershaveroutingtables;networksdonot.
2.Thedestinationinaroutingtableisanetwork,whichmeansthefirstcolumn
definesanetworkaddress.
3.ThemetricusedbyRIPisverysimple;thedistanceisdefinedasthenumber of
links(networks)toreachthedestination.Forthisreason,themetricinRIPiscalled
a
hopcount.
4.Infinityisdefined as16,whichmeansthatanyrouteinanautonomoussystemusing
RIPcannothavemorethan
15hops.
5.Thenext-nodecolumndefinestheaddress oftheroutertowhichthepacketisto be
senttoreachitsdestination.
Figure22.19showsanautonomoussystemwithsevennetworksandfourrouters.The
table
ofeachrouterisalsoshown.Letuslookattheroutingtablefor Rl.Thetablehas
sevenentriestoshowhowtoreacheachnetworkintheautonomoussystem.Router
Rlis
directlyconnectedtonetworks130.10.0.0and130.11.0.0,whichmeansthatthereareno
next-hopentriesforthesetwonetworks.Tosendapackettoone
ofthethreenetworksat
thefarleft,router
RlneedstodeliverthepackettoR2.Thenext-nodeentryforthese
threenetworksistheinterface
ofrouterR2withIPaddress130.10.0.1.Tosendapacket
tothetwonetworksatthefarright,router
Rlneedstosendthepackettotheinterface of
routerR4withIPaddress130.11.0.1.Theothertablescanbeexplainedsimilarly.

666 CHAPTER 22NETWORKLAYER:DELIVERY,FORWARDING, ANDROUTING
Figure22.19Exampleofadomainusing RIP
195.2.4.0
130.10.0.0 130.11.0.0
205.5.5.0
Dest.HopNext
130.10.0.02130.11.0.2
130.11.0.01
195.2.4.03130.11.0.2
195.2.5.03130.11.0.2
195.2.6.04130.11.0.2
205.5.5.01
205.5.6.01
R4Table
205.5.6.0
205.5.5.1
R4
130.11.0.1
205.5.6.1
RITable
N
~
Q...
~R1
...
Des!HopNext
130.10.0.01--
130.11.0.01--
195.2.4.02130.10.0.1
195.2.5.02130.10.0.1
195.2.6.0
3130.10.0.1
205.5.5.02130.11.0.1
205.5.6.0
2130.11.0.1
130.10.0.1
195.2.5.1
195.2.5.0
195.2.5.2
195.2.4.1
R3
195.2.6.1
195.2.6.0
Dest.HopNext
R3Table
130.10.0.01
130.11.0.02130.10.0.2
195.2.4.01
195.2.5.01
195.2.6.02195.2.5.2
R2
205.5.5.03130.10.0.2
205.5.6.0
3130.10.0.2
R2Table
Dest.HopNext
130.10.0.02195.2.5.1
130.11.0.03195.2.5.1
195.2.4.02195.2.5.1
195.2.5.01
195.2.6.01
205.5.5.04195.2.5.1
205.5.6.04195.2.5.1
LinkStateRouting
Linkstateroutinghasadifferentphilosophyfromthat ofdistancevectorrouting.In
linkstaterouting,
ifeachnodeinthedomainhastheentiretopology ofthedomain­
thelistofnodesandlinks,howtheyareconnectedincludingthetype,cost(metric),and
condition
ofthelinks(upor down)-thenodecanuse Dijkstra'salgorithmtobuilda
routingtable.Figure22.20showstheconcept.
Figure22.20Conceptoflinkstaterouting
Thefigureshowsasimpledomainwithfivenodes.Eachnodeusesthesametopology
tocreatearoutingtable,buttheroutingtableforeachnodeisuniquebecausethecalcu­
lationsarebasedondifferentinterpretations
ofthetopology.Thisisanalogoustoacity
map.Whileeachpersonmayhavethesamemap,eachneedstotakeadifferentrouteto
reachherspecificdestination.

SECTION22.3UNICASTROUTINGPROTOCOLS 667
Thetopologymustbedynamic,representingthelateststate ofeachnodeandeach
link.
Iftherearechangesinanypointinthenetwork(alinkisdown,forexample),the
topologymustbeupdatedforeachnode.
Howcanacommontopologybedynamicandstoredineachnode?Nonodecan
knowthetopologyatthebeginningorafterachangesomewhereinthenetwork.Link
stateroutingisbasedontheassumptionthat,althoughtheglobalknowledgeaboutthe
topologyisnotclear,eachnodehaspartialknowledge:itknowsthestate(type,condi­
tion,andcost)
ofitslinks.Inotherwords,thewholetopologycanbecompiledfromthe
partialknowledgeofeachnode.Figure22.21showsthesamedomain
asinFigure22.20,
indicatingthepartoftheknowledgebelongingtoeachnode.
Figure22.21 Linkstateknowledge
"I
A'sstatesoflinks~
,:("'$
-~
.-...,
/'3''"
I ~
D'sstatesoflinks~., ;1
\ I
......' ~,-,,/
....::;'-,,-C~:,....
C'sstatesofIinks /'-~3""
I",,,
I. \
t4: IE'sstatesofIinks
, '.}
" "-_.-'
NodeAknowsthatitisconnectedtonodeBwithmetric 5,tonodeCwithmetric 2,
andtonodeDwithmetric 3.NodeCknowsthatitisconnectedtonodeAwithmetric2,
tonodeBwithmetric4,andtonodeEwithmetric4.NodeDknowsthatitiscon­
nectedonlytonodeAwithmetric3.Andsoon.Althoughthereisanoverlapinthe
knowledge,theoverlapguaranteesthecreation
ofacommontopology-apictureof
thewholedomainforeachnode.
BuildingRoutingTables
Inlinkstaterouting, foursetsofactionsarerequiredtoensurethateachnodehasthe
routing tableshowingtheleast-costnodetoeveryothernode.
].Creation
ofthestatesofthelinksbyeachnode,calledthelinkstatepacket(LSP).
2.DisseminationofLSPstoeveryotherrouter,called flooding,inanefficientand
reliable
way.
3.Formationofashortestpathtreeforeachnode.
4.Calculationofaroutingtablebasedontheshortestpathtree.
CreationofLinkStatePacket(LSP) Alinkstatepacketcancarryalargeamount
ofinformation.Forthemoment,however,weassumethatitcarriesaminimumamount

668 CHAPTER 22NETWORKLAYER:DELIVERY,FORWARDING, ANDROUTING
ofdata:thenodeidentity,thelist oflinks,asequencenumber,andage.Thefirsttwo,
nodeidentity andthelist
oflinks,areneededtomakethetopology.Thethird,sequence
number,facilitatesfloodinganddistinguishesnewLSPsfromoldones.Thefourth,age,
preventsoldLSPsfromremaininginthedomainforalongtime.LSPsaregenerated
on
twooccasions:
1.Whenthereisachange inthetopologyofthedomain.TriggeringofLSPdissemi­
nationisthemainwayofquicklyinforminganynode
inthedomaintoupdateits
topology.
2.Onaperiodicbasis. Theperiodinthiscaseismuchlongercomparedtodistance
vectorrouting.Asamatter
offact,thereisnoactualneedforthistype ofLSPdis­
semination.Itisdonetoensurethatoldinformationisremovedfromthedomain.
Thetimersetforperiodicdisseminationisnormallyintherange
of60minor2 h
basedontheimplementation.Alongerperiodensuresthatfloodingdoesnotcreate
toomuchtrafficonthenetwork.
FloodingofLSPsAfteranodehaspreparedanLSP,itmustbedisseminatedtoall
othernodes,notonlytoitsneighbors.Theprocessiscalledfloodingandbasedonthe
following:
1.Thecreatingnodesendsacopy oftheLSPout ofeachinterface.
2.AnodethatreceivesanLSPcomparesitwiththecopyitmayalreadyhave. Ifthe
newlyarrivedLSPisolderthantheoneithas(foundbycheckingthesequence
number),itdiscardsthe
LSP.Ifitisnewer,thenodedoesthefollowing:
a.ItdiscardstheoldLSPandkeepsthenewone.
b.Itsendsacopy ofitoutofeachinterfaceexcepttheonefromwhichthepacket
arrived.Thisguaranteesthatflooding stopssomewhereinthedomain(wherea
nodehasonlyoneinterface).
FormationofShortestPathTree:DijkstraAlgorithmAfterreceivingallLSPs,each
nodewillhaveacopy
ofthewholetopology.However,thetopology isnotsufficientto
findtheshortestpathtoeveryothernode;a
shortestpathtreeisneeded.
Atree
isagraphofnodesandlinks;onenodeiscalledtheroot.Allothernodes
canbereachedfromtherootthroughonlyonesingleroute.Ashortestpathtree
isatree
inwhichthepathbetweentherootandeveryothernodeistheshortest.Whatweneed
foreachnodeisashortestpathtreewiththatnode
astheroot.
The
Dijkstraalgorithmcreatesashortestpathtreefromagraph.Thealgorithm
dividesthenodesintotwosets:tentativeandpermanent.
Itfindstheneighbors ofa
currentnode,makesthemtentative,examinesthem,and
iftheypassthecriteria,
makesthempermanent.
Wecaninformallydefinethealgorithmbyusingtheflowchart
inFigure22.22.
Let
usapplythealgorithmtonodeA ofoursamplegraphinFigure22.23. Tofind
theshortestpathineachstep,weneedthecumulativecostfromtheroottoeachnode,
which
isshownnexttothenode.
Thefollowingshowsthesteps.
Attheendofeachstep,weshowthepermanent
(filledcircles)andthetentative(opencircles)nodesandlistswiththecumulative
costs.

SECT/ON22.3UN/CASTROUTINGPROTOCOLS 669
Figure22.22 Dijkstraalgorithm
Setroottolocalnodeand
moveittotentativelist.
Amongnodesintentativelist,movethe
onewiththeshortestpathtopermanentlist.
Addeachunprocessedneighbor
oflastmoved
nodetotentativelist
ifnotalreadythere.
Ifneighboris
inthetentativelistwithlarger
cumulativecost,replaceitwithnewone.
Figure22.23 Exampleofformationofshortestpathtree
Root
B 5 0
.·~.--------{B 5
Root
00
I.SetroottoAandmoveA to
tentativelist.
Root
o .
3
4.MoveDtopermanentlist.
Root
o .
2.MoveAtopermanentlistand add
B,C,andDtotentativelist.
5.MoveBtopermanentlist.
Topology
3.MoveCtopermanentandadd
Etotentativelist.
6
6.MoveE topermanentlist
(tentativelistisempty).

670 CHAPTER 22NETWORKLAYER:DELIVERY,FORWARDING, ANDROUTING
1.WemakenodeAtheroot ofthetreeandmoveittothetentativelist. Ourtwolistsare
Permanentlist:empty Tentativelist: A(O)
2.NodeAhastheshortestcumulativecostfromallnodesinthetentativelist.WemoveA
tothepennanentlistandadd
allneighborsofAtothetentativelist.Ournewlists are
Permanentlist:A(O) Tentativelist: B(5),
C(2),D(3)
3.NodeChastheshortestcumulativecostfromallnodes inthetentativelist.Wemove
Ctothepermanentlist.NodeChasthreeneighbors, butnodeAisalreadypro­
cessed,whichmakestheunprocessedneighbors
justBandE.However, Bisalready
inthetentative listwithacumulative costof5.NodeAcouldalsoreach nodeB
throughCwithacumulativecost of6.Since5islessthan6,wekeepnodeBwitha
cumulativecost
of5inthetentativelistanddonotreplaceit. Ournewlistsare
Permanentlist:A(O), e(2) Tentativelist:
B(5),0(3),E(6)
4.
NodeDhastheshortestcumulativecost ofallthenodes inthetentativelist.We
moveDtothe permanentlist.NodeDhasnounprocessedneighborto beaddedto
thetentativelist.
Ournewlistsare
Permanentlist:A(O), C(2),0(3)Tentativelist: B(5),E(6)
5.
NodeBhastheshortestcumulativecost ofallthenodes inthetentativelist.We
moveBtothe permanentlist.Weneedtoaddallunprocessedneighbors ofBtothe
tentativelist(thisis
justnodeE).However,E(6)isalready inthelistwithasmaller
cumulativecost.
ThecumulativecosttonodeE,astheneighbor ofB,is8.Wekeep
nodeE(6)inthetentativelist. Ournewlistsare
Permanentlist:A(O), B(5),C(2), 0(3)Tentativelist:E(6)
6.NodeEhastheshortestcumulative costfromallnodesinthetentativelist.We
moveEtothe permanentlist.NodeEhasnoneighbor.Nowthetentative listis
empty.Westop;
ourshortestpathtreeisready. Thefinallistsare
Permanentlist:
A(O),B(5), C(2),D(3),E(6) Tentativelist:empty
CalculationofRoutingTablefromShortestPathTreeEachnodeusestheshort­
estpathtreeprotocoltoconstructitsroutingtable. Theroutingtableshowsthecost of
reachingeachnodefromtheroot.Table22.2showstheroutingtablefornodeA.
Table22.2Routingtable fornodeA
Node Cost NextRouter
A
0 -
B 5 -
C 2 -
D 3
-
E 6 C

SECTION22.3UN/CASTROUTINGPROTOCOLS 671
CompareTable22.2withtheone inFigure22.14.Bothdistancevectorroutingand
linkstateroutingendupwiththesameroutingtablefornode A.
OSPF
TheOpenShortestPathFirstor OSPFprotocolisanintradomainroutingprotocol
basedonlinkstaterouting.Itsdomainisalso
anautonomoussystem.
AreasTohandleroutingefficientlyandinatimelymanner,OSPFdividesanauto­
nomoussystemintoareas.An
areaisacollectionofnetworks,hosts,androutersall
containedwithinanautonomoussystem.Anautonomoussystemcanbedividedinto
manydifferentareas.Allnetworksinsideanareamustbeconnected.
Routersinside
anareafloodtheareawithroutinginformation.Attheborder ofan
area,specialrouterscalled
areaborderrouterssummarizetheinformationaboutthe
areaandsendittootherareas.Amongtheareasinside
anautonomoussystemisaspe­
cialareacalledthe
backbone;alltheareasinside anautonomoussystemmustbecon­
nectedtothebackbone.Inotherwords,thebackboneserves
asaprimaryareaandthe
otherareas
assecondaryareas.Thisdoesnotmeanthattherouterswithinareascannot
beconnectedtoeachother,however.Theroutersinsidethebackbonearecalledthe
backbonerouters. Notethatabackboneroutercanalsobe anarea borderrouter.
If,becauseofsomeproblem,theconnectivity betweenabackboneand anareais
broken,a virtuallinkbetweenroutersmustbecreatedby anadministratortoallow
continuity
ofthefunctionsofthebackboneastheprimaryarea.
Eachareahas
anareaidentification.Theareaidentification ofthebackbone is
zero.Figure22.24shows anautonomoussystemanditsareas.
Figure22.24 Areasinanautonomoussystem
Area0
(backbone)
l-~. Toother
ASs
Autonomoussystem
MetricTheOSPFprotocolallowstheadministratortoassignacost,calledthe metric,
toeachroute.Themetriccanbebasedonatypeofservice(minimumdelay,maximum
throughput,andsoon).Asamatter
offact,aroutercanhavemultipleroutingtables,
eachbasedonadifferenttype
ofservice.
TypesofLinksInOSPFterminology,aconnectioniscalleda link.Fourtypes of
linkshavebeendefined:point-to-point,transient,stub,andvirtual(seeFigure22.25).

672 CHAPTER 22NETWORKLAYER:DELIVERY,FORWARDING, ANDROUTING
Figure22.25Typesoflinks
Apoint-to-pointlinkconnectstworouterswithoutanyotherhost orrouterin
between.Inotherwords,thepurpose
ofthelink(network) isjusttoconnectthetwo
routers.Anexample
ofthistypeoflinkistworoutersconnectedbyatelephonelineor
a Tline.Thereisnoneedtoassignanetworkaddresstothistype
oflink.Graphically,
theroutersarerepresentedbynodes,andthelinkisrepresentedbyabidirectionaledge
connectingthenodes.Themetrics,whichareusuallythesame,areshownatthetwo
ends,oneforeachdirection.Inotherwords,eachrouterhasonlyoneneighboratthe
otherside
ofthelink(seeFigure22.26).
Figure22.26Point-to-pointlink
~C"'Il~f-- ~.4~
~ Point-to-pointnetwork~
Router Router
Atransientlinkisanetworkwithseveralroutersattached toit.Thedatacanenter
throughany
oftheroutersandleavethroughanyrouter.AllLANsandsomeWANswith
twoormoreroutersare
ofthistype.Inthiscase,eachrouterhasmanyneighbors.For
example,considertheEthernetinFigure22.27a.RouterAhasroutersB, C,D,andE
as
neighbors.RouterBhasroutersA,C, D,andEasneighbors. Ifwewanttoshowthe
neighborhoodrelationshipinthissituation,wehavethegraphshowninFigure22.27b.
Figure22.27Transientlink
A
EDc
A
b.Unrealisticrepresentationc.Realisticrepresentation
E
B
Dc
Ethernet
a.Transientnetwork
Thisisneitherefficientnorrealistic. Itisnotefficientbecauseeachrouterneeds to
advertisetheneighborhoodtofourotherrouters,foratotal of20advertisements.Itis

SECTION22.3UNICASTROUTINGPROTOCOLS 673
notrealisticbecausethereisnosinglenetwork(link)betweeneachpair ofrouters;
there
isonlyonenetworkthatserves asacrossroadbetweenallfiverouters.
Toshowthateachrouterisconnectedtoeveryotherrouterthroughonesinglenet­
work,thenetworkitselfisrepresentedbyanode.However,becauseanetworkisnota
machine,itcannotfunctionasarouter.One
oftheroutersinthenetworktakesthis
responsibility.
Itisassignedadualpurpose;itisatruerouterandadesignatedrouter.
WecanusethetopologyshowninFigure22.27ctoshowtheconnections ofatransient
network.
Noweachrouterhasonlyoneneighbor,thedesignatedrouter(network).Onthe
otherhand,thedesignatedrouter(thenetwork)hasfiveneighbors.
Weseethatthc
number
ofneighborannouncementsisreducedfrom20to10.Still,thelinkisrepre­
sented
asabidirectionaledgebetweenthenodes.However,whilethereisametricfrom
eachnodetothedesignatedrouter,thereisnometricfromthedesignatedroutertoany
othernode.Thereasonisthatthedesignatedrouterrepresentsthenetwork.
Wecan
onlyassignacosttoapacketthatispassingthroughthenetwork.
Wecannotchargefor
thistwice.Whenapacketentersanetwork,weassignacost;whenapacketleavesthe
networktogototherouter,thereisnocharge.
Astublinkisanetworkthatisconnectedtoonlyonerouter.Thedatapackets
enterthenetworkthroughthissinglerouterandleavethenetworkthroughthissame
router.Thisisaspecialcase
ofthetransientnetwork. Wecanshowthissituationusing
therouter
asanodeandusingthedesignatedrouterforthenetwork.However,thelink
isonlyone-directional,fromtheroutertothenetwork(seeFigure22.28).
Figure22.28
Stublink
A
,.
Ethernet
a.Stubnetwork
A
• ""-,,...k'ro_
b.Representation
Whenthelinkbetweentworoutersisbroken,theadministrationmaycreatea
virtuallinkbetweenthem,usingalongerpaththatprobablygoesthroughseveral
routers.
GraphicalRepresentation
LetusnowexaminehowanAScanberepresented
graphically.Figure22.29showsasmallASwithsevennetworksandsixrouters.Two
ofthenetworksarepoint-to-pointnetworks. Weusesymbolssuchas NlandN2
fortransientandstubnetworks.Thereisnoneedtoassignanidentitytoapoint-to­
pointnetwork.Thefigurealsoshowsthegraphicalrepresentation
oftheAS asseen
byOSPF.
Wehaveusedsquarenodesfortheroutersandovalsforthenetworks(represented
bydesignatedrouters).However,OSPFseesboth
asnodes.Notethatwehavethree
stubnetworks.

674 CHAPTER 22NETWORKLAYER:DELIVERY,FORWARDING, ANDROUTING
Figure22.29 ExampleofanASanditsgraphicalrepresentation inOSPF
1---lII~l----I-1~" - - - - - - - - - - - - - -
N2
c
Nl
a.Autonomoussystem
B
T-31ine
N3--+O--...,£:i"---I
N5
b.Graphicalrepresentation
8
4
PathVectorRouting
Distancevectorandlinkstateroutingarebothintradomainroutingprotocols.Theycan
beusedinside
anautonomoussystem,butnotbetweenautonomoussystems.Thesetwo
protocolsarenotsuitableforinterdomainroutingmostlybecause
ofscalability.Both of
theseroutingprotocolsbecomeintractablewhenthedomain ofoperationbecomes
large.Distancevectorroutingissubjecttoinstability
iftherearemorethanafewhops
inthedomain
ofoperation.Linkstateroutingneedsahugeamount ofresourcestocal­
culateroutingtables.
Italsocreatesheavytrafficbecause offlooding.Thereisaneed
forathirdroutingprotocolwhichwecall
pathvectorrouting.
Pathvectorroutingprovedtobeusefulforinterdomainrouting.Theprinciple of
pathvectorroutingissimilartothat ofdistancevectorrouting.Inpathvectorrouting,
weassumethatthereisonenode(therecanbemore,butoneisenoughforourconcep­
tualdiscussion)ineachautonomoussystemthatactsonbehalf
oftheentireautono­
moussystem.Letuscallitthe
speakernode.ThespeakernodeinanAScreatesa
routingtableandadvertisesittospeakernodesintheneighboringASs.Theideaisthe
same
asfordistancevectorroutingexceptthatonlyspeakernodesineachAScancom­
municatewitheachother.However,whatisadvertisedisdifferent.Aspeakernode
advertisesthepath,notthemetric
ofthenodes,initsautonomoussystem orother
autonomoussystems.
Initialization
Atthebeginning,eachspeakernodecanknowonlythereachability ofnodesinsideits
autonomoussystem.Figure22.30showstheinitialtablesforeachspeakernodeina
systemmadeoffourASs.

SECTION22.3UNICASTROUTINGPROTOCOLS 675
Figure22.30 Initialroutingtablesin pathvectorrouting
Dest.Path
.A$L2
AS:L.
AlTable
AS1
Des!.Path
BlAS2\
B2As1
B3"~~'.
B4-~
BITable
AS
2
Dest.
Path
CI:~3
C2;'ASa
C3'A~~
ClTable
AS3
Des!'Path
Dl·~
D2·A£4'~
D3·-.:
D4:~;r'
AS4
NodeAlisthespeakernodefor ASl,BlforAS2,ClforAS3,and DlforAS4.
Node
Alcreatesaninitialtablethatshows AltoA5arelocatedin ASIandcanbe
reachedthroughit.Node
Bladvertisesthat BltoB4arelocatedinAS2andcanbe
reachedthrough
Bl.Andsoon.
SharingJustasindistancevectorrouting, inpathvectorrouting,aspeakerin an
autonomoussystemsharesitstablewithimmediateneighbors.InFigure22.30,node
Alsharesitstablewithnodes BlandCl.NodeClsharesitstablewithnodes Dl,Bl,
andAl.NodeBlsharesitstablewith ClandAl.NodeDlsharesitstablewith Cl.
UpdatingWhenaspeakernodereceivesatwo-columntablefromaneighbor,it
updatesitsowntablebyaddingthenodesthatarenotinitsroutingtableandaddingits
ownautonomoussystemandtheautonomoussystemthatsentthetable.Afterawhile
eachspeakerhasatableandknowshowtoreacheachnodeinotherASs.Figure22.31
showsthetablesforeachspeakernodeafterthesystemisstabilized.
Accordingtothefigure,
ifrouterAlreceivesapacketfornodesA3,itknowsthat
thepathisinASI(thepacketisathome);butif
itreceivesapacketfor Dl,itknowsthat
thepacketshouldgofrom
ASl,toAS2,andthentoAS3.Theroutingtableshowsthe
pathcompletely.Ontheotherhand,
ifnodeDlinAS4receivesapacketfornodeA2,it
knows
itshouldgothroughAS4,AS3,and AS1.
oLoop prevention.Theinstabilityofdistancevectorroutingandthecreationof
loopscanbeavoidedinpathvectorrouting.Whenarouterreceivesa message,it
checkstosee
ifitsautonomoussystemisinthepathlist tothedestination.Ifitis,
looping
isinvolvedandthemessageisignored.

676 CHAPTER 22NETWORKLAYER:DELIVERY,FORWARDING, ANDROUTING
Figure22.31 Stabilizedtables forthreeautonomoussystems
AlAS~·~·ASj
A5 AS4-~:t:ASi
~~~~~4~~3;,AS2
Dest. PathPath
ClTable
Oest.PathBlTable
Oest.Oest. Path
Al
A:IDi
ASASl
Bl
B4
Cl
...
C3
01
D4
AlTable
oPolicyrouting. Policyroutingcanbeeasilyimplementedthroughpathvector
routing.Whenarouterreceivesamessage,it
cancheckthepath. Ifoneofthe
autonomoussystemslistedinthepathisagainstitspolicy,itcanignorethatpath
andthatdestination.Itdoesnotupdateitsroutingtablewiththispath,anditdoes
notsendthismessagetoitsneighbors.
oOptimumpath. Whatistheoptimumpathinpathvectorrouting? Wearelooking
forapathtoadestinationthatisthebestfortheorganizationthatrunstheautono­
moussystem.Wedefinitelycannotincludemetricsinthisroutebecauseeach
autonomoussystemthatisincludedinthepathmayuseadifferentcriterionforthe
metric.Onesystemmayuse,internally,
RIP,whichdefineshopcount asthemetric;
anothermayuseOSPFwithminimumdelaydefinedasthemetric.Theoptimum
pathisthepaththatfitstheorganization.Inourpreviousfigure,eachautonomous
systemmayhavemorethanonepathtoadestination.Forexample,apathfrom
AS4to
ASIcanbeAS4-AS3-AS2-AS1, oritcanbeAS4-AS3-ASI.Forthetables,
wechosetheonethathadthesmallernumber
ofautonomoussystems,butthisis
notalwaysthecase.Othercriteria,suchassecurity,safety,andreliability,canalso
beapplied.
BGP
BorderGatewayProtocol(BGP)isaninterdomainroutingprotocolusingpathvector
routing.Itfirstappearedin1989andhasgonethroughfourversions.
Types
ofAutonomousSystemsAswesaidbefore,theInternetisdividedintohier­
archicaldomainscalledautonomoussystems.Forexample,alargecorporationthat
managesitsownnetworkandhasfullcontroloveritisanautonomoussystem.Alocal
ISPthatprovidesservicestolocalcustomersisanautonomoussystem.
Wecandivide
autonomoussystemsintothreecategories:stub,multihomed,andtransit.
oStubAS.Astub AShasonlyoneconnectiontoanotherAS.Theinterdomaindata
trafficinastub
AScanbeeithercreatedorterminatedintheAS.Thehostsinthe AS
cansenddatatraffictootherASs.ThehostsintheAScanreceivedatacomingfrom
hostsinotherASs.Datatraffic,however,cannotpassthroughastubAS.Astub
AS

SECTION22.3UNICASTROUTINGPROTOCOLS 677
iseitherasourceorasink.Agoodexample ofastubASisasmallcorporationora
smalllocal
ISP.
oMultihomedAS. AmultihomedAShasmorethanoneconnection tootherASs,
butitisstillonlyasourceorsinkfordatatraffic.Itcanreceivedatatrafficfrom
morethan oneAS.
Itcansenddatatraffic tomorethanoneAS,butthereisnotran­
sienttraffic.Itdoesnotallowdatacomingfromone
ASandgoingtoanotherASto
passthrough.Agoodexample ofamultihomedASisalargecorporationthatiscon­
nected
tomorethanoneregionalornational ASthatdoesnotallowtransienttraffic.
oTransitAS. AtransitASisamultihomedASthatalsoallowstransienttraffic.Good
examplesoftransitASsarenationalandinternationalISPs(Internetbackbones).
PathAttributesInourpreviousexample,wediscussedapathforadestinationnet­
work.Thepathwaspresented
asalistofautonomoussystems,butis,infact,alist of
attributes.Eachattributegivessomeinformationaboutthepath.Thelist ofattributes
helpsthereceivingroutermakeamore-informeddecisionwhenapplyingitspolicy.
Attributesaredividedintotwobroadcategories:wellknownandoptional.A
well­
known
attributeisonethateveryBGProutermustrecognize. Anoptionalattribute
isonethatneedsnotberecognizedbyeveryrouter.
Well-knownattributesarethemselvesdividedintotwocategories:mandatoryand
discretionary.A
well-knownmandatoryattribute isonethatmustappearinthedescrip­
tionofaroute.A
well-knowndiscretionaryattribute isonethatmustberecognizedby
eachrouter,butisnotrequiredtobeincludedineveryupdatemessage.One
well­
knownmandatoryattributeisORIGIN.Thisdefinesthesourceoftheroutinginforma­
tion(RIP,OSPF,andsoon).Anotherwell-known mandatoryattributeisAS_PATH.
Thisdefinesthelist
ofautonomoussystemsthroughwhichthedestinationcanbe
reached.Stillanotherwell-knownmandatoryattributeisNEXT-HOP,whichdefines
thenextrouter
towhichthedatapacketshouldbesent.
Theoptionalattributescanalsobesubdividedintotwocategories:transitiveand
nontransitive.An
optionaltransitiveattribute isonethatmustbepassed tothenext
routerbytherouterthathasnot implementedthisattribute.An
optionalnontransitive
attribute
isonethatmustbediscarded ifthereceivingrouterhasnotimplementedit.
BGPSessionsTheexchangeofroutinginformationbetweentworoutersusingBGP
takesplaceinasession.AsessionisaconnectionthatisestablishedbetweentwoBGP
routersonlyforthesake
ofexchangingroutinginformation. Tocreateareliableenvi­
ronment,BGPusestheservices
ofTCP.Inotherwords,asessionattheBGPlevel,as
anapplicationprogram,isaconnectionattheTCPlevel.However,thereisasubtledif­
ferencebetweenaconnection
inTCPmadeforBGPandotherapplicationprograms.
WhenaTCPconnectioniscreatedforBGP,itcanlastforalongtime,untilsomething
unusualhappens.Forthisreason,BGPsessionsaresometimesreferred
toassemi­
pennanentconnections.
ExternalandInternalBGPIfwewanttobeprecise,BGPcanhavetwotypes of
sessions:externalBGP(E-BGP)andinternalBGP(I-BGP)sessions.TheE-BGPses­
sionisused
toexchangeinformationbetweentwospeakernodesbelongingtotwodif­
ferentautonomoussystems.TheI-BGPsession,ontheotherhand,isused
toexchange
routinginformationbetweentworoutersinsideanautonomoussystem.Figure22.32
showstheidea.

678 CHAPTER 22NETWORKLAYER:DELIVERY,FORWARDING, ANDROUTING
Figure22.32InternalandexternalBGPsessions
AS1 AS2
1--E-BGPsession---I-BGPsessionsI
ThesessionestablishedbetweenAS1andAS2isanE-BOPsession.Thetwospeaker
routersexchangeinformationtheyknowaboutnetworksintheInternet.However,these
tworoutersneedtocollectinformationfromotherroutersintheautonomoussystems.
ThisisdoneusingI-BOPsessions.
22.4MULTICAST ROUTINGPROTOCOLS
Inthissection,wediscussmulticastingandmulticastroutingprotocols. Wefirstdefine
thetermmulticastingandcompareittounicastingandbroadcasting.Wealsobriefly
discusstheapplications
ofmulticasting.Finally,wemoveontomulticastroutingand
thegeneralideasandgoalsrelatedtoit.
Wealsodiscusssomecommonmulticastrouting
protocolsusedintheInternettoday.
Unicast,Multicast, andBroadcast
Amessagecanbeunicast,multicast,orbroadcast.Letusclarifythesetermsasthey
relatetotheInternet.
Unicasting
Inunicastcommunication,thereisonesourceandonedestination.Therelationship
betweenthesourceandthedestinationisone-to-one.Inthistype
ofcommunication,
boththesourceanddestinationaddresses,intheIPdatagram,aretheunicastaddresses
assignedtothehosts(orhostinterfaces,tobemoreexact).InFigure22.33,aunicast
Figure22.33Unicasting

SECTION22.4MULTICASTROUTINGPROTOCOLS 679
packetstaI1sfromthesource S1andpassesthroughrouterstoreachthedestination D1.
Wehaveshownthenetworksasalinkbetweentherouterstosimplifythefigure.
Notethatinunicasting,whenarouterreceivesapacket,
itforwardsthepacket
throughonlyone
ofitsinterfaces(theonebelongingtotheoptimumpath)asdefinedin
theroutingtable.Theroutermaydiscardthepacket
ifitcannotfindthedestination
addressinitsroutingtable.
Inunicasting,the routerforwardsthereceivedpacketthrough
onlyoneofitsinterfaces.
Multicasting
Inmulticastcommunication,thereisonesourceandagroup ofdestinations.Therela­
tionshipisone-to-many.Inthistype
ofcommunication,thesourceaddressisaunicast
address,butthedestinationaddressisagroupaddress,whichdefinesoneormoredesti­
nations.Thegroupaddressidentifiesthemembers
ofthegroup.Figure 22.34showsthe
ideabehindmulticasting.
Figure22.34
Multicasting
G1 G1 G1
~t ~t ~t
Sl
GI
AmulticastpacketstartsfromthesourceS 1andgoestoalldestinationsthat
belongtogroupG
1.Inmulticasting,whenarouterreceivesapacket,itmayforwardit
throughseveral
ofitsinterfaces.
Inmulticasting,theroutermayforwardthereceivedpacket
throughseveralofitsinterfaces.

680 CHAPTER22NETWORKLAYER:DELIVERY,FORWARDING, ANDROUTING
Broadcasting
Inbroadcastcommunication,therelationshipbetweenthesourceandthedestinationis
one-to-all.Thereisonlyonesource,butalltheotherhostsarethedestinations.The
Internetdoesnotexplicitlysupport
broadcastingbecauseofthehugeamount oftraffic
itwouldcreateandbecause
ofthebandwidthitwouldneed.Imaginethetrafficgener­
atedintheInternet
ifonepersonwantedtosendamessagetoeveryoneelseconnected
totheInternet.
MulticastingVersusMultipleUnicasting
Beforewefinishthissection,weneedtodistinguishbetweenmulticastingandmultiple
unicasting.Figure22.35illustratesbothconcepts.
Figure22.35 Multicastingversusmultipleunicasting
Gl Gl Gl
Gl
a.Multicasting
Dl D2 D3
D5
b.Multiplennicasting
Multicastingstartswithonesinglepacketfromthesourcethatisduplicatedbythe
routers.Thedestinationaddressineachpacketisthesameforallduplicates.Notethat
onlyonesinglecopy
ofthepackettravelsbetweenanytworouters.

SECTION22.4MULTICASTROUTINGPROTOCOLS 681
Inmultipleunicasting,severalpacketsstartfromthesource. Iftherearefive
destinations,forexample,thesourcesends
fivepackets,eachwithadifferentunicast
destinationaddress.Notethattheremaybemultiplecopiestravelingbetweentworouters.
Forexample,whenapersonsendsane-mailmessagetoagroup
ofpeople,thisis
multipleunicasting.Thee-mailsoftwarecreatesreplicas
ofthemessage,eachwitha
differentdestinationaddressandsendsthemonebyone.Thisisnotmulticasting;it
is
multipleunicasting.
EmulationofMulticastingwithUnicasting
Youmightwonderwhywehaveaseparatemechanismformulticasting,whenitcanbe
emulatedwithunicasting.Therearetwoobviousreasonsforthis.
1.Multicastingismoreefficientthanmultipleunicasting.InFigure22.35,wecansee
howmulticastingrequireslessbandwidththandoesmultipleunicasting.Inmulti­
pleunicasting,some
ofthelinksmusthandleseveralcopies.
2.Inmultipleunicasting,thepacketsarecreatedbythesourcewitharelativedelay
betweenpackets.
Ifthereare1000destinations,thedelaybetweenthefirstandthe
lastpacketmaybeunacceptable.
Inmulticasting,thereisnodelaybecauseonly
onepacketiscreatedbythe source.
Emulationofmulticastingthroughmultipleunicastingisnotefficient
andmaycreatelongdelays,particularlywithalargegroup.
Applications
Multicastinghasmanyapplicationstodaysuchasaccessto distributeddatabases,
informationdissemination,teleconferencing,anddistancelearning.
AccesstoDistributedDatabases
Mostofthelargedatabasestodayaredistributed.Thatis,theinformationisstoredin
morethanonelocation,usuallyatthetime
ofproduction.Theuserwhoneedstoaccess
thedatabasedoesnotknowthelocation
oftheinformation.Auser'srequestismulti­
casttoallthedatabaselocations,andthelocationthathastheinformationresponds.
InformationDissemination
Businessesoftenneedtosendinformationtotheircustomers. Ifthenatureoftheinfor­
mationisthesameforeachcustomer,itcanbemulticast.
Inthiswayabusinesscan
sendonemessagethatcanreachmanycustomers.Forexample,asoftwareupdatecan
besenttoallpurchasers
ofaparticularsoftwarepackage.
DisseminationofNews
Inasimilarmannernewscanbeeasilydisseminatedthroughmulticasting.Onesingle
messagecanbesenttothoseinterestedinaparticulartopic.Forexample,thestatistics
ofthechampionshiphighschoolbasketballtournamentcanbesenttothesportseditors
ofmanynewspapers.

682 CHAPTER22NETWORKLAYER:DELNERY,FORWARDING, ANDROUTING
Teleconferencing
Teleconferencinginvolvesmulticasting.Theindividualsattendingateleconferenceall
needtoreceivethesameinformationatthesametime.Temporaryorpermanentgroups
canbeformedforthispurpose.Forexample,anengineeringgroupthatholdsmeetings
everyMondaymorningcouldhaveapermanentgroupwhilethegroupthatplansthe
holidaypartycouldformatemporarygroup.
DistanceLearning
Onegrowingareaintheuse ofmulticastingisdistancelearning.Lessonstaughtby
onesingleprofessorcanbereceivedbyaspecificgroup
ofstudents.This isespecially
convenientforthosestudentswhofinditdifficulttoattendclassesoncampus.
MulticastRouting
Inthissection,wefirstdiscusstheidea ofoptimalrouting,commoninallmulticast
protocols.
Wethengiveanoverview ofmulticastroutingprotocols.
OptimalRouting:ShortestPathTrees
Theprocessofoptimalinterdomainroutingeventuallyresultsinthefinding ofthe
shortestpathtree. Therootofthetreeisthesource,andtheleavesarethepotentialdes­
tinations.Thepathfromtheroottoeachdestinationistheshortestpath.However,the
number
oftreesandtheformation ofthetreesinunicastandmulticastroutingaredif­
ferent.Letusdiscusseachseparately.
Unicast
RoutingInunicastrouting,whenarouterreceivesapackettoforward,it
needstofindtheshortestpathtothedestination
ofthepacket.Therouterconsultsits
routingtableforthatparticulardestination.Thenext-hopentrycorrespondingtothe
destinationisthestart
oftheshortestpath.Therouterknowstheshortestpathfor
eachdestination,whichmeansthattherouterhasashortestpathtreetooptimally
reachalldestinations.Inotherwords,eachline
oftheroutingtableisashortestpath;
thewholeroutingtableisashortestpathtree.Inunicastrouting,eachrouterneeds
onlyoneshortestpathtreetoforwardapacket;however,eachrouterhasitsown
shortestpathtree.Figure22.36showsthesituation.
Thefigureshowsthedetails
oftheroutingtableandtheshortestpathtreefor
router
Rl.Eachlineintheroutingtablecorrespondstoonepathfromtheroottothe
correspondingnetwork.Thewholetablerepresentstheshortestpathtree.
Inunicastrouting,each routerinthedomainhasatable thatdefines
ashortest
pathtreetopossibledestinations.
MulticastRoutingWhenarouterreceivesamulticastpacket,thesituationisdifferent
fromwhenitreceivesaunicastpacket.Amulticastpacketmayhavedestinationsinmore
thanonenetwork.Forwarding
ofasinglepackettomembers ofagrouprequiresa
shortestpathtree.
Ifwehavengroups,wemayneed nshortestpathtrees. Wecanimagine
thecomplexity
ofmulticastrouting.Twoapproacheshavebeenusedtosolvetheproblem:
source-basedtreesandgroup-sharedtrees.

SECTION22.4MULTICASTROUTINGPROTOCOLS 683
Figure22.36 Shortestpathtreeinunicastrouting
N2
OJR2
R2Table
I
I
,.-----------
NI
Root
---e----
RI
N5~
u....:J
R4Table
R4
N6
R2
R2
RZ
R4
Destination
Next-hop
NI
N2
N3
N4
N5
N6
Shortestpath
---+-
---_II..Shortestpath---+-
N4 L-__----L ---I
N3
OJR3
R3Table
RlTable
Inmulticastrouting,eachinvolvedrouterneedstoconstruct
ashortestpathtreeforeachgroup.
oSource-BasedTree.Inthesource-basedtreeapproach,eachrouterneedstohave
oneshortestpathtreeforeachgroup.Theshortestpathtreeforagroupdefinesthe
nexthopforeachnetworkthathasloyalmember(s)forthatgroup.InFigure22.37,
weassumethatwehaveonlyfivegroupsinthedomain:
GI,G2, G3, G4,andG5.
AtthemomentGIhasloyalmembersinfournetworks,G2inthree,
G3intwo,G4
intwo,and
G5intwo.Wehaveshownthenamesofthegroupswithloyalmem­
bers
oneachnetwork.Figure22.37alsoshowsthemulticastroutingtablefor
router
RI.Thereisoneshortestpathtreeforeachgroup;thereforetherearefive
shortestpathtreesforfivegroups.
IfrouterRlreceivesapacketwithdestination
Figure22.37Source-basedtreeapproach
GI,G2
RZ
I:"Tl
u....:J
R2Table
GI,G2 G3 Gl,G4,G5
~
u....:J
R4Table
R4
____.S.hortestpathtree
RlTable
~ Gl -,RZ,R4
G2 -,RZ
G3 -,RZ
G4 RZ,R4
~ G5 RZ,R4
NexthopDestination
··
·
Shortestpathtree
Gl,G2,G4
G3,G5
~R3
u....:J
R3Table

684 CHAPTER 22NETWORKIAYER:DELIVERY,FORWARDING, ANDROUTING
addressG 1,itneedstosendacopy ofthepackettotheattachednetwork,acopyto
routerR2,andacopytorouterR4sothatallmembers
ofG1canreceiveacopy.In
thisapproach,
ifthenumberofgroupsis m,eachrouterneedstohave mshortest
pathtrees,oneforeachgroup.Wecanimaginethecomplexity
oftheroutingtable
ifwehavehundreds orthousandsofgroups.However,wewillshowhowdifferent
protocolsmanagetoalleviatethesituation.
Inthesource-basedtreeapproach,eachrouterneeds
tohaveoneshortest
pathtreeforeachgroup.
oGroup-SharedTree. Inthegroup-sharedtree approach,instead ofeachrouter
having
mshortestpathtrees,onlyonedesignatedrouter,calledthecentercore,or
rendezvousrouter, takestheresponsibility ofdistributingmulticasttraffic.Thecore
has
mshortestpathtreesin itsroutingtable.Therest oftheroutersinthedomainhave
none.
Ifarouterreceivesamulticastpacket,itencapsulatesthepacketinaunicast
packetandsendsittothecorerouter.Thecorerouterremovesthemulticastpacket
fromitscapsule,andconsultsitsroutingtabletoroutethepacket.Figure22.38shows
theidea.
Figure22.38 Group-sharedtreeapproach
Gl,G2 G3 Gl,G4,GS
R2
e;oioSl---------_-__:IiiI:II------i_-_~ __-____
G3,GS
R3
Rl R4
Gl,G2,G4
Shortestpathtree
Shortestpathtree
DestinationNexthop Gl-,R2,R3,R4
G2 -,R2,R3
G3
G4 R3,R4
G5 -,R4
Coreroutertable
Inthegroup-sharedtreeapproach,onlythecorerouter,
which
hasashortestpathtreeforeachgroup,isinvolvedinmulticasting.
RoutingProtocols
Duringthelastfewdecades,severalmulticastroutingprotocolshaveemerged.Some of
theseprotocolsareextensions ofunicastroutingprotocols;othersaretotallynew.

SECTION22.4MULTICASTROUTINGPROTOCOLS 685
Wediscusstheseprotocolsintheremainder ofthischapter.Figure22.39showsthe
taxonomy
oftheseprotocols.
Figure22.39
Taxonomyofcommonmulticastprotocols
----~---------- ----,,
:_~I~!~~~ ~~~-~~j
MOSPF DVMRP
PIM
CRT
MulticastLinkStateRouting:MOSPF
Inthissection,webrieflydiscussmulticastlinkstateroutinganditsimplementationin
theInternet,MOSPF.
MulticastLinkStateRouting
WediscussedunicastlinkstateroutinginSection22.3.
WesaidthateachroutercreatesashortestpathtreebyusingDijkstra'salgorithm.The
routingtableisatranslation
oftheshortestpathtree.Multicast linkstateroutingisa
directextension
ofunicastroutingandusesasource-basedtreeapproach.Although
unicastroutingisquiteinvolved,theextension
tomulticastroutingisverysimpleand
straightforward.
Multicastlinkstateroutingusesthesource-basedtreeapproach.
Recallthatinunicastrouting,eachnodeneedstoadvertisethestate ofitslinks.For
multicastrouting,anodeneedstorevisetheinterpretation
ofstate.Anodeadvertises
everygroupwhichhasanyloyalmemberonthelink.Herethemeaning
ofstateis
"whatgroupsareactiveonthislink."Theinformationaboutthegroupcomesfrom
IGMP(seeChapter21).EachrouterrunningIGMPsolicitsthehostsonthelinktofind
outthemembershipstatus.
WhenarouterreceivesalltheseLSPs,itcreates
n(nisthenumber ofgroups)
topologies,fromwhich
nshortestpathtreesaremadebyusingDijkstra'salgorithm.So
eachrouterhasaroutingtablethatrepresents
asmanyshortestpathtreesasthereare
groups.
Theonlyproblemwiththisprotocolisthetimeandspaceneededtocreateand
savethemanyshortestpathtrees.Thesolution
istocreatethetreesonlywhenneeded.
Whenarouterreceivesapacketwithamulticastdestinationaddress,itrunstheDijkstra
algorithmtocalculatetheshortestpathtreeforthatgroup.Theresultcanbecachedin
casethereareadditionalpacketsforthatdestination.
MOSPFMulticastOpenShortest PathFirst(MOSPF) protocolisanextension of
theOSPFprotocolthatusesmulticastlinkstateroutingtocreatesource-basedtrees.

686 CHAPTER 22NETWORKLAYER:DELIVERY,FORWARDING, ANDROUTING
Theprotocolrequiresanewlinkstateupdatepackettoassociatetheunicastaddress of
ahostwiththegroupaddressoraddressesthehost issponsoring.Thispacket iscalled
thegroup-membershipLSA.Inthisway,wecaninclude
inthetreeonlythehosts
(usingtheirunicastaddresses)thatbelongtoaparticulargroup.Inotherwords,we
makeatreethatcontainsallthehostsbelongingtoagroup,butweusetheunicast
address
ofthehostinthecalculation.Forefficiency,theroutercalculatestheshortest
pathtreesondemand(whenitreceivesthefirstmulticastpacket).Inaddition,thetree
canbesavedincachememoryforfutureusebythesamesource/grouppair.MOSPF
is
adata-drivenprotocol;thefirsttimeanMOSPFrouterseesadatagramwithagiven
sourceandgroupaddress,therouterconstructstheDijkstrashortestpathtree.
MulticastDistanceVector: DVMRP
Inthissection,webrieflydiscussmulticastdistancevectorroutinganditsimplementa­
tionintheInternet,DVMRP.
MulticastDistanceVectorRouting Unicastdistancevectorroutingisverysimple;
extendingittosupportmulticastroutingiscomplicated.Multicastroutingdoesnot
allowaroutertosenditsroutingtabletoitsneighbors.Theidea
istocreateatablefrom
scratchbyusingtheinformationfromtheunicastdistancevectortables.
Multicastdistancevectorroutingusessource-basedtrees,buttherouternever
actuallymakesaroutingtable.Whenarouterreceivesamulticastpacket,itforwards
thepacketasthoughitisconsultingaroutingtable.Wecansaythattheshortestpath
treeisevanescent.Afteritsuse(afterapacketisforwarded)thetableisdestroyed.
Toaccomplishthis,themulticastdistancevectoralgorithmusesaprocessbased
onfourdecision-makingstrategies.Eachstrategyis builtonitspredecessor.We
explainthemonebyoneandseehoweachstrategycanimprovetheshortcomings
of
thepreviousone.
DFlooding.Floodingisthefirststrategythatcomestomind.Arouterreceivesa
packetand,withoutevenlookingatthedestinationgroupaddress,sendsitout
fromeveryinterlaceexcepttheonefromwhich
itwasreceived.Floodingaccom­
plishesthefirstgoal
ofmulticasting:everynetworkwithactivemembersreceives
thepacket.However,sowillnetworkswithoutactivemembers.Thisisabroadcast,
notamulticast.Thereisanotherproblem:itcreatesloops.Apacketthathasleft
theroutermaycomebackagainfromanotherinterlaceorthesameinterlaceand
beforwardedagain.Somefloodingprotocolskeepacopy
ofthepacketforawhile
anddiscardanyduplicatestoavoidloops.Thenextstrategy,reversepathforward­
ing,correctsthisdefect.
Floodingbroadcastspackets,butcreatesloops inthesystems.
oReversePathForwarding(RPF). RPFisamodifiedfloodingstrategy. Toprevent
loops,onlyonecopy
isforwarded;theothercopiesaredropped.InRPF,arouterfor­
wardsonlythecopythathastraveledtheshortestpathfromthesourcetotherouter.
Tofindthiscopy,RPFusestheunicastroutingtable.Therouterreceivesapacketand
extractsthesourceaddress(aunicastaddress).
Itconsultsitsunicastroutingtable as
thoughitwantstosendapackettothesourceaddress.Theroutingtabletellsthe

SECTION22.4MULTICASTROUTINGPROTOCOLS 687
routerthenexthop. Ifthemulticastpackethasjustcomefromthehopdefinedinthe
table,thepackethastraveledtheshortestpathfromthesource
totherouterbecause
theshortestpathisreciprocalinunicastdistancevectorroutingprotocols.
Ifthepath
fromAtoBistheshortest,thenit
isalsotheshortestfromB toA.Therouterfor­
wardsthepacket
ifithastraveledfromtheshortestpath;itdiscardsitotherwise.
Thisstrategypreventsloopsbecausethereisalwaysoneshortestpathfromthe
sourcetotherouter.
Ifapacketleavestherouterandcomesbackagain,ithasnottrav­
eledtheshortestpath.
Tomakethepointclear,let uslookatFigure22.40.
Figure22.40showspart
ofadomainandasource.Theshortestpathtree ascalcu­
latedbyrouters
RI,R2,and R3isshownbyathickline.When RIreceivesapacket
fromthesourcethroughtheinterfacernl,itconsultsitsroutingtableandfindsthatthe
shortestpathfrom
RItothesourceisthroughinterface mI.Thepacketisforwarded.
However,
ifacopyofthepackethasarrivedthroughinterfacem2,itisdiscarded
becausem2doesnotdefinetheshortestpathfrom
RItothesource.Thestoryisthe
samewithR2andR3.
Youmaywonderwhathappens ifacopyofapacketthatarrives
atthe
mlinterfaceofR3,travelsthroughR6, R5,R2,andthenentersR3throughinter­
face
ml.ThisinterfaceisthecorrectinterfaceforR3.Isthecopy ofthepacketfor­
warded?Theansweristhatthisscenarioneverhappensbecausewhenthepacketgoes
fromR5toR2,itwillbediscardedbyR2andneverreachesR3.Theupstreamrouters
towardthesourcealwaysdiscardapacketthathasnotgonethroughtheshortestpath,
thuspreventingconfusionforthedownstreamrouters.
RPFeliminatestheloop inthefloodingprocess.
Figure22.40Reversepathforwarding(RPF)
Source
R2 R5
__--------------iIII~.R6
oReversePathBroadcasting(RPB).RPFguaranteesthateachnetworkreceivesa
copy
ofthemulticastpacketwithoutformationofloops.However,RPFdoesnot

688 CHAPTER 22NETWORKlAYER:DELWERY,FORWARDING, ANDROUTING
guaranteethateachnetworkreceivesonlyonecopy;anetworkmayreceivetwoor
morecopies.ThereasonisthatRPFisnotbasedonthedestinationaddress(agroup
address);forwardingisbasedonthesourceaddress.
Tovisualizetheproblem,let
uslookatFigure22.41.
Figure22.41Problemwith RPF
Net3receivestwo
copies
ofthepacket
b.RPB
RlistheparentofNetlandNet2.
R2istheparent
ofNet3
Net3inthisfigurereceivestwocopies ofthepacketeventhougheachrouter
justsendsoutonecopyfromeachinterface.Thereisduplicationbecauseatreehas
notbeenmade;instead
ofatreewehaveagraph.Net3hastwoparents:routers R2
andR4.
Toeliminateduplication,wemustdefineonlyoneparentrouterforeachnetwork.
Wemusthavethisrestriction:Anetworkcanreceiveamulticastpacketfromaparticular
sourceonlythroughadesignated
parentrouter.
Nowthepolicyisclear.Foreachsource,theroutersendsthepacketonlyout
ofthose
interfacesforwhichit
isthedesignatedparent.Thispolicyiscalledreversepathbroad­
casting(RPB).RPBguaranteesthatthepacketreacheseverynetworkandthateverynet­
workreceivesonlyonecopy.Figure22.42showsthedifferencebetweenRPFandRPB.
Figure22.42RPFVersusRPB
Thereadermayaskhowthedesignatedparentisdetermined.Thedesignatedparent
routercanbetherouterwiththeshortestpathtothesource.Becauseroutersperiodically

SECTION22.4MULTICASTROUTINGPROTOCOLS 689
sendupdatingpacketstoeachother(inRIP),theycaneasilydeterminewhichrouterin
theneighborhoodhastheshortestpathtothesource(wheninterpretingthesourceasthe
destination),
Ifmorethanonerouterqualifies,therouterwiththesmallestIPaddressis
selected.
RPBcreatesashortest pathbroadcasttreefromthesource toeach destination.
Itguaranteesthateachdestinationreceivesone andonlyonecopy ofthepacket.
oReversePathMulticasting(RPM). Asyoumayhavenoticed,RPBdoesnot
multicastthepacket,itbroadcastsit.Thisisnotefficient.
Toincreaseefficiency,
themulticastpacketmustreachonlythosenetworksthathaveactivemembersfor
thatparticulargroup.Thisiscalled
reversepathmulticasting(RPM).Toconvert
broadcastingtomulticasting,theprotocolusestwoprocedures,pruningandgraft­
ing.Figure22.43showstheidea
ofpruningandgrafting.
Figure22.43 RPF,RPB,
andRPM
a.RPF
I'
IPruned
Iroute,
~ CNet32)
c.RPM(afterpruning)
b.RPB
d.RPM(aftergrafting)
Thedesignatedparentrouter ofeachnetworkisresponsibleforholdingthemem­
bershipinformation.ThisisdonethroughtheIGMPprotocoldescribedinChapter21.
Theprocessstartswhenarouterconnectedtoanetworkfindsthatthereisnointerestin
amulticastpacket.Theroutersendsa
prunemessagetotheupstreamroutersothatit
canexcludethecorrespondinginterface.Thatis,theupstreamroutercanstopsending
multicastmessagesforthisgroupthroughthatinterface.Now
ifthisrouterreceives
prunemessagesfromalldownstreamrouters,it,inturn,sendsaprunemessagetoits
upstreamrouter.
What
ifaleafrouter(arouteratthebottom ofthetree)hassentaprunemessage
butsuddenlyrealizes,throughIGMP,thatone
ofitsnetworksisagaininterestedin
receivingthemulticastpacket?
Itcansenda graftmessage. Thegraftmessageforces
theupstreamroutertoresumesendingthemulticastmessages.

690 CHAPTER 22NETWORKLAYER:DELIVERY,FORWARDING, ANDROUTING
RPMaddspruningandgraftingtoRPBtocreateamulticastshortest
pathtreethatsupportsdynamicmembershipchanges.
DVMRP TheDistanceVectorMulticastRoutingProtocol(DVMRP)isanimple­
mentation
ofmulticastdistancevectorrouting. Itisasource-basedroutingprotocol,
basedonRIP.
CRT
TheCore-BasedTree(CBT)protocolisagroup-sharedprotocolthatusesacoreas
theroot
ofthetree.Theautonomoussystemisdividedintoregions,andacore(center
router
orrendezvousrouter)ischosenforeachregion.
FormationoftheTreeAftertherendezvouspointisselected,everyrouterisinfonned
oftheunicastaddress oftheselectedrouter.Eachrouterthensendsaunicastjoinmessage
(similartoagraftingmessage)toshowthatitwantstojointhegroup.Thismessagepasses
throughallroutersthatarelocatedbetweenthesenderandtherendezvousrouter.Each
intermediaterouterextractsthenecessary
infonnationfromthemessage,suchasthe
unicastaddress
ofthesenderandtheinterfacethroughwhichthepackethasarrived,and
forwardsthemessagetothenextrouter
inthepath.Whentherendezvousrouterhas
receivedall
joinmessagesfromevery memberofthegroup,thetreeisformed.Now
everyrouterknowsitsupstreamrouter(therouterthatleadstotheroot)andthedown­
streamrouter(therouterthatleadstotheleaf).
Ifarouterwants toleavethegroup,itsendsaleavemessagetoitsupstreamrouter.
Theupstreamrouterremovesthelinktothatrouterfromthetreeandforwardsthemes­
sagetoitsupstreamrouter,andsoon.Figure22.44showsagroup-sharedtreewithits
rendezvousrouter.
Figure22.44Group-sharedtreewithrendezvousrouter
Sharedtree
Member Member Member
ThereadermayhavenoticedtwodifferencesbetweenDVMRPandMOSPF,on
onehand,andCBT, ontheother.First,thetreeforthefirsttwoismadefromtheroot
up~thetreefor CBTisfonnedfromtheleavesdown.Second,inDVMRP,thetreeis

SECTION22.4MULTICASTROUTINGPROTOCOLS 691
firstmade(broadcasting)andthenpruned;in CBT,thereisnotreeatthebeginning;the
joining(grafting)graduallymakesthetree.
SendingMulticastPacketsAfterformation
ofthetree,anysource(belongingtothe
groupornot)cansendamulticastpackettoallmembers
ofthegroup.Itsimplysends
thepackettotherendezvousrouter,usingtheunicastaddress
oftherendezvousrouter;
therendezvousrouterdistributesthepacket
toallmembersofthegroup.Figure22.45
showshowahostcansendamulticastpackettoallmembers
ofthegroup.Notethatthe
sourcehostcanbeany
ofthehostsinsidethesharedtreeoranyhostoutsidetheshared
tree.
InFigure22.45weshowonelocatedoutsidethesharedtree.
Figure22.45
Sendingamulticastpackettotherendezvousrouter
Sharedtree
Member Member
Legend
Unicast
-=:J.
MulLicast_.
Member
SelectingtheRendezvousRouterThisapproachissimpleexceptforonepoint.
Howdoweselectarendezvousroutertooptimizetheprocessandmulticasting
aswell?
Severalmethodshavebeenimplemented.However,thistopicisbeyondthescope
of
thisbook,andweleaveittomoreadvancedbooks.
Insummary,theCore-BasedTree(CBT)isagroup-sharedtree,center-basedpro­
tocolusingonetreepergroup.One
oftheroutersinthetree iscalledthecore.Apacket
issentfromthesourcetomembers
ofthegroupfollowingthisprocedure:
1.Thesource,which mayormaynotbepart ofthetree,encapsulatesthemulticast
packetinsideaunicastpacketwiththeunicastdestinationaddress
ofthecoreand
sendsittothecore.Thispart
ofdeliveryisdoneusingaunicastaddress;theonly
recipientisthecorerouter.
2.Thecoredecapsulatestheunicastpacketandforwardsittoallinterestedintetfaces.
3.Eachrouterthatreceivesthemulticastpacket,intum,forwardsittoallinterested
interfaces.

692 CHAPTER22NETWORKLAYER:DELIVERY,FORWARDING, ANDROUTING
InCRT,thesourcesendsthemulticastpacket(encapsulatedinaunicastpacket)tothecore
router.Thecorerouterdecapsulatesthepacket
andforwardsittoallinterestedinterfaces.
PIM
ProtocolIndependentMulticast(PIM) isthenamegiventotwoindependentmulticast
routingprotocols:
ProtocolIndependentMulticast,Dense Mode(PIM-DM)and
ProtocolIndependentMulticast,SparseMode(PIM-SM). Bothprotocolsareunicast­
protocol-dependent,butthesimilarityendshere.
Wediscusseachseparately.
PIM-DM PIM-DMisusedwhenthereisapossibilitythateachrouterisinvolvedin
multicasting
(densemode). Inthisenvironment,theuse ofaprotocolthatbroadcasts
thepacketisjustifiedbecausealmostallroutersareinvolvedintheprocess.
PIM-DMisusedinadensemulticastenvironment,suchasaLAN.
PIM-DMisasource-basedtreeroutingprotocolthatusesRPFandpruningand
graftingstrategiesformulticasting.Itsoperationislikethat
ofDVMRP;however,
unlikeDVMRP,itdoesnotdependonaspecificunicastingprotocol.Itassumesthatthe
autonomoussystem
isusingaunicastprotocolandeachrouterhasatablethatcanfind
theoutgoinginterfacethathasanoptimalpathtoadestination.Thisunicastprotocol
canbeadistancevectorprotocol(RIP)orlinkstateprotocol(OSPF).
PIM-DMuses RPFandpruningandgraftingstrategiestohandlemulticasting.
However,
itisindependentoftheunderlyingunicastprotocol.
PIM-SMPIM-SMisusedwhenthereisaslightpossibilitythateachrouter isinvolved
inmulticasting(sparsemode).Inthisenvironment,theuse
ofaprotocolthatbroadcasts
thepacketisnotjustified;aprotocolsuchasCBTthatusesagroup-sharedtreeismore
appropriate.
PIM-SMisused inasparsemulticastenvironmentsuchasaWAN.
PIM-SMisagroup-sharedtreeroutingprotocolthathasarendezvouspoint(RP)
asthesource
ofthetree.ItsoperationislikeCB T;however,itissimplerbecause itdoes
notrequireacknowledgmentfrom
ajoinmessage.Inaddition,itcreatesabackupset of
RPsforeachregiontocover RPfailures.
One
ofthecharacteristicsofPIM-SMisthat itcanswitchfromagroup-sharedtree
strategytoasource-basedtreestrategywhennecessary.Thiscanhappen
ifthereisa
densearea
ofactivityfarfromthe RP.Thatareacanbemoreefficientlyhandledwitha
source-basedtreestrategyinstead
ofagroup-sharedtreestrategy.
PIM-SMissimilartoCRT butusesasimplerprocedure.
MBONE
Multimediaandreal-timecommunicationhaveincreasedtheneedformulticastingin
theInternet.However,onlyasmallfractionofInternetroutersaremulticastrouters.In

SECTION22.4MULTICASTROUTINGPROTOCOLS 693
otherwords,amulticast routermaynotfindanothermulticastrouterintheneighbor­
hoodtoforwardthemulticastpacket.Althoughthisproblemmaybesolvedinthenext
fewyearsbyaddingmoreandmoremulticastrouters,there isanothersolutiontothis
problem.Thesolutionistunneling.Themulticastroutersareseen
asagroupofrouters
ontopofunicastrouters.Themulticastroutersmaynotbeconnecteddirectly,butthey
areconnectedlogically.Figure22.46showstheidea.InFigure22.46,onlytherouters
enclosedintheshadedcirclesarecapable
ofmulticasting.Withouttunneling,theserouters
areisolatedislands.
Toenablemulticasting,wemakeamulticastbackbone(MBONE)
out
oftheseisolatedroutersbyusingtheconcept oftunneling.
Figure22.46
Logicaltunneling
Logicaltunnel
Rl
R3
Logicaltunnel
Alogicaltunnelisestablishedbyencapsulatingthemulticastpacketinsideauni­
castpacket.Themulticastpacketbecomesthepayload(data)
oftheunicastpacket.The
intermediate (nonmulticast)routersforwardthepacketasunicastroutersanddeliver
thepacketfromoneislandtoanother.It's
asiftheunicastroutersdonotexistandthe
twomulticastroutersareneighbors.Figure22.47showstheconcept.Sofartheonly
protocolthatsupportsMBONEandtunnelingisDVMRP.
Figure22.47
MBONE
,
'"
----- R2

\1<>'
Unicast
destination
address
r----(routerR2)
Unicastsource
address
(router
RI)
Multicast
group
address
Source
address------,
I
I
I
R3e-----------------------eR4

694 CHAPTER 22NETWORKLAYER:DELIVERY,FORWARDING, ANDROUTING
22.5RECOMMENDED READING
Formoredetailsaboutsubjectsdiscussedinthischapter,werecommendthefollowing
booksandsites.Theitemsinbrackets[
...Jrefertothereferencelistattheend ofthetext.
Books
DeliveryandforwardingarediscussedinChapter6 of[For06].Unicastroutingprotocols
arediscussedinChapter
14of[For06].Multicastingandmulticastroutingarediscussed
inChapter
15of[For06].Foracompletediscussion ofmulticastingsee[WZOl].For
routingprotocolssee
[HuiOO].OSPFisdiscussedin[Moy98].
Sites
owww.ietf.org/rfc.htmlInformationaboutRFCs
RFCs
AdiscussionofRIPcanbefoundinthefollowingRFCs:
1131,1245,1246,1247,1370,1583,1584,1585,1586,1587,1722,1723,2082,2453
AdiscussionofOSPFcanbefoundinthefollowingRFCs:
1131,1245,1246,1247,1370,1583,1584,1585,1586,1587,2178,2328,2329,2370
AdiscussionofBGPcanbefoundinthefollowingRFCs:
1092,1105,1163,1265,1266,1267,1364,1392,1403,1565,1654,1655,1665,1771,1772,
1745,1774,2283
22.6KEYTERMS
addressaggregation
area
areaborderrouters
areaidentification
autonomoussystem(AS)
backbonerouter
BorderGatewayProtocol(BGP)
broadcasting
Core-BasedTree(CBT)protocol
data-driven
defaultmethod
delivery
designatedparentrouter
Dijkstra'salgorithm
directdelivery
distancelearning
DistanceVectorMulticastRouting
Protocol(DVMRP)
distancevectorrouting
distributeddatabase
dynamicroutingmethod
dynamicroutingtable
flooding
forwarding
graftmessage
group-sharedtree

hierarchicalrouting
hopcount
host-specificmethod
ifconfig
immediateneighbors
indirectdelivery
interdomainrouting
intradomainrouting
least-costtree
linkstaterouting
logicaltunnel
longestmaskmatching
metric
multicastbackbone(MBONE)
MulticastOpenShortestPathFirst
(MOSPF)
multicastrouter
multicastrouting
multicasting
multipleunicasting
netstat
network-specificmethod
next-hopaddress
next-hopmethod
OpenShortestPathFirst(OSPF)
optionalattribute
OSPFprotocol
pathvectorrouting
point-to-pointlink
poisonreverse
policyrouting
SECTION22.7SUMMARY 695
ProtocolIndependentMulticast(PIM)
ProtocolIndependentMulticast,Dense
Mode(PIM-DM)
ProtocolIndependentMulticast,Sparse
Mode(PIM-SM)
prunemessage
rendezvousrouter
rendezvous-pointtree
reversepathbroadcasting(RPB)
reversepathforwarding(RPF)
reversepathmulticasting(RPM)
routemethod
routing
RoutingInformationProtocol(RIP)
routingprotocols
shortestpathtree
slowconvergence
source-basedtree
speakernode
splithorizon
staticroutingtable
stublink
switchingfabric
teleconferencing
transientlink
triggeredupdate
tunneling
unicasting
updatemessage
virtuallink
well-knownattribute
22.7SUMMARY
oThedeliveryofapacketiscalleddirect ifthedeliverer(hostorrouter)andthedes­
tinationareonthesamenetwork;thedelivery
ofapacketiscalledindirect ifthe
deliverer(host
orrouter)andthedestinationareondifferentnetworks.
oInthenext-hopmethod,instead ofacompletelist ofthestopsthepacketmust
make,onlytheaddress
ofthenexthopislisted intheroutingtable;inthenetwork­
specificmethod,allhostsonanetworkshareoneentryintheroutingtable.

696 CHAPTER 22NETWORKLAYER:DELIVERY,FORWARDING, ANDROUTING
DInthehost-specificmethod,thefullIPaddress ofahostisgivenintheroutingtable.
DInthedefaultmethod,arouterisassigned toreceiveallpacketswithnomatchin
theroutingtable.
DTheroutingtableforclasslessaddressingneedsatleastfourcolumns.
DAddressaggregationsimplifiestheforwardingprocessinclasslessaddressing.
oLongestmaskmatchingisrequiredinclasslessaddressing.
oClasslessaddressingrequireshierarchicalandgeographicalrouting toprevent
immenseroutingtables.
DAstaticroutingtable'sentriesareupdatedmanuallybyanadministrator;adynamic
routingtable'sentriesareupdatedautomaticallybyaroutingprotocol.
DAmetricisthecostassignedforpassage ofapacketthroughanetwork.
DAnautonomoussystem(AS)isagroup ofnetworksandroutersundertheauthority
ofasingleadministration.
DRIPisbasedondistancevectorrouting,inwhicheachroutershares,atregular
intervals,itsknowledgeabouttheentire
ASwithitsneighbors.
DTwoshortcomingsassociatedwiththeRIPprotocolareslowconvergenceand
instability.ProcedurestoremedyRIPinstabilityincludetriggeredupdate,split
horizons,andpoisonreverse.
DOSPFdivides anASintoareas,definedascollections ofnetworks,hosts,and
routers.
oOSPFisbasedonlinkstaterouting,inwhicheachroutersendsthestate ofits
neighborhood
toeveryotherrouterinthearea.Apacket issentonlyifthereisa
changeintheneighborhood.
DOSPFroutingtablesarecalculatedbyusingDijkstra'salgorithm.
DBGPis aninterautonomoussystemroutingprotocolusedtoupdateroutingtables.
DBGPisbasedonaroutingprotocolcalledpathvectorrouting.Inthisprotocol,the
ASsthroughwhichapacketmustpassareexplicitlylisted.
oInasource-basedtreeapproachtomulticastrouting,thesource/groupcombination
determinesthetree;inagroup-sharedtreeapproach
tomulticastrouting,the
group
determinesthetree.
DMOSPFisamulticastroutingprotocolthatusesmulticastlinkstaterouting to
createasource-basedleast-costtree.
DInreversepathforwarding(RPF),therouterforwardsonlythepacketsthathave
traveledtheshortestpathfromthesourcetotherouter.
DReversepathbroadcasting(RPB)createsashortestpathbroadcasttreefromthe
sourcetoeachdestination.
Itguaranteesthateachdestinationreceivesoneand
onlyonecopy
ofthepacket.
DReversepathmulticasting(RPM)addspruningandgraftingtoRPB tocreatea
multicastshortestpathtreethatsupportsdynamicmembershipchanges.
DDVMRPisamulticastroutingprotocolthatusesthedistanceroutingprotocol to
createasource-basedtree.
DTheCore-BasedTree(CBT)protocolisamulticastroutingprotocolthatusesa
routerastheroot
ofthetree.

SECTION22.8PRACTICESET 697
DPIM-DMisasource-basedtreeroutingprotocol thatusesRPFandpruningand
graftingstrategiestohandlemulticasting.
oPIM-SMisagroup-sharedtreeroutingprotocolthatissimilartoCBTandusesa
rendezvousrouter
asthesourceofthetree.
DFormulticastingbetweentwononcontiguousmulticastrouters,wemakeamulticast
backbone(MBONE)toenabletunneling.
22.8PRACTICESET
ReviewQuestions
1.Whatisthedifferencebetweenadirectandanindirectdelivery?
2.Listthreeforwardingtechniquesdiscussedinthischapterandgiveabriefdescription
ofeach.
3.Contrasttwodifferentroutingtablesdiscussedinthischapter.
4.Whatisthepurpose
ofRIP?
5.Whatarethefunctions ofaRIPmessage?
6.Whyistheexpirationtimervalue6timesthat oftheperiodictimervalue?
7.HowdoesthehopcountlimitalleviateRIP'sproblems?
8.ListRIPshortcomingsandtheircorrespondingfixes.
9.Whatisthebasis
ofclassificationforthefourtypes oflinksdefinedbyOSPF?
10.WhydoOSPFmessagespropagatefasterthanRIPmessages?
11.Whatisthepurpose ofBGP?
12.Giveabriefdescription oftwogroupsofmulticastroutingprotocolsdiscussedin
thischapter.
Exercises
13.Showaroutingtableforahostthatistotallyisolated.
14.ShowaroutingtableforahostthatisconnectedtoaLANwithoutbeingconnected
totheInternet.
15.Findthetopology ofthenetworkifTable22.3 istheroutingtableforrouterR 1.
Table22.3 Routingtable forExercise15
Network Next-Hop
Mask Address Address Interface
/27 202.14.17.224
- rn1
/18 145.23.192.0 - rnO
Default Default 130.56.12.4 m2
16.CanrouterR1inFigure22.8receiveapacketwithdestinationaddress140.24.7.194?
Explainyouranswer.

698 CHAPTER22NETWORKLAYER:DEUVERY,FORWARDING, ANDROUTING
17.Canrouter RlinFigure22.8receiveapacketwithdestinationaddressl40.24.7.42?
Explainyouranswer.
18.ShowtheroutingtablefortheregionalISPinFigure22.9.
19.Showtheroutingtableforlocal
ISP1inFigure22.9.
20.Showtheroutingtableforlocal
ISP2inFigure22.9.
21.Showtheroutingtableforlocal
ISP3inFigure22.9.
22.Showtheroutingtableforsmall
ISP1inFigure22.9.
23.Contrast
andcomparedistancevectorroutingwithlinkstaterouting.
24.Arouterhas
thefollowingRIProutingtable:
Net!
Net2
Net3
Net4
4
2
!
5
B
C
F
G
WhatwouldbethecontentsofthetableiftherouterreceivedthefollowingRIP
messagefromrouter
C?
Net! 2
Net2 !
Net3 3
Net4 7
25.HowmanybytesareemptyinaRIPmessagethatadvertises Nnetworks?
26.Arouterhasthefollowing
RIProutingtable:
Net!
Net2
Net3
Net4
4
2
1
5
B
C
F
G
Showtheresponsemessagesent bythisrouter.
27.Showtheautonomoussystemwiththefollowingspecifications:
a.
Thereareeightnetworks (NltoN8).
b.Thereareeightrouters (RltoR8).
c.
Nl,N2,N3,N4,NS,and N6areEthernetLANs.
d.N7andN8arepoint-to-pointWANs.
e.
RlconnectsNlandN2.
f.R2connectsNlandN7.
g.R3connectsN2andN8.
h.
R4connectsN7andN6.
i.RSconnectsN6andN3.
j.
R6connectsN6andN4.
k.R7connects
N6andNS.
1.R8connectsN8 andN5.

SECTION22.8PRACTICESET 699
28.Drawthegraphicalrepresentation oftheautonomoussystem ofExercise27as
seenbyOSPF.
29.WhichofthenetworksinExercise 27isatransientnetwork?Which isastub
network?
30.ArouterusingDVMRPreceivesapacketwithsourceaddress10.14.17.2from
interface
2.Iftherouterforwardsthepacket,whatarethecontents oftheentry
relatedtothisaddressintheunicastroutingtable?
31.DoesRPFactuallycreateashortestpathtree?Explain.
32.DoesRPBactuallycreateashortestpathtree?Explain.Whataretheleaves of
thetree?
33.DoesRPMactuallycreateashortestpathtree?Explain.Whataretheleaves of
thetree?
ResearchActivities
34.IfyouhaveaccesstoUNIX(orLINUX),use netstatandifconfigtofindtherouting
tablefortheservertowhichyouareconnected.
35.FindouthowyourISPusesaddressaggregationandlongestmaskmatchprinciples.
36.FindoutwhetheryourIPaddress
ispartofthegeographicaladdressallocation.
37.Ifyouareusingarouter,findthenumberandnames ofthecolumnsintherouting
table.

TransportLayer
Objectives
Thetransportlayerisresponsibleforprocess-to-processdeliveryoftheentiremessage.
Aprocessisanapplicationprogramrunningonahost.Whereasthenetworklayer
overseessource-to-destinationdeliveryofindividualpackets,itdoesnotrecognizeany
relationshipbetweenthosepackets.
Ittreatseachoneindependently, asthougheach
piecebelongedtoaseparatemessage,whetherornotitdoes.Thetransportlayer,onthe
otherhand,ensuresthatthewholemessagearrivesintactandinorder,overseeingboth
errorcontroland
flowcontrolatthesource-to-destinationlevel.
Thetransportlayerisresponsibleforthedelivery
ofamessagefromoneprocesstoanother.
Computersoftenrunseveralprogramsatthesametime.Forthisreason,source­
to-destinationdeliverymeansdeliverynotonlyfromonecomputertothenextbutalso
fromaspecificprocessononecomputertoaspecificprocessontheother.Thetransport
layerheadermustthereforeincludeatypeofaddresscalleda
service-pointaddress in
theOSImodelandportnumberorportaddressesintheInternetandTCP/IPprotocol
suite.
Atransportlayerprotocolcanbeeitherconnectionlessorconnection-oriented.
Aconnectionlesstransportlayertreatseachsegment
asanindependentpacketand
delivers
ittothetransportlayeratthedestinationmachine.Aconnection-oriented
transportlayermakesaconnection withthetransportlayeratthedestinationmachine
firstbefore deliveringthepackets.Afterallthedataistransferred,theconnectionis
terminated.
Inthetransportlayer,amessageisnormallydividedintotransmittablesegments.A
connectionlessprotocol,such
asUDP,treatseachsegmentseparately.Aconnection­
orientedprotocol,such
asTCPandSCTP,createsarelationshipbetweenthesegments
usingsequencenumbers.
Likethedatalinklayer,thetransportlayermayberesponsiblefor
flowanderror
control.However,flowanderrorcontrolatthislayerisperformedendtoendrather
thanacrossasinglelink.
Wewillseethatoneoftheprotocolsdiscussedinthispartof

thebook,UDP,isnotinvolvedinfloworerrorcontroLOntheotherhand,theothertwo
protocols,TCPandSCTP,useslidingwindowsforflowcontrolandanacknowledgment
systemforerrorcontroL
Part5ofthebookisdevotedtothe transportlayer
andtheservicesprovidedbythislayer.
Chapters
Thispartconsists oftwochapters:Chapters23and24.
Chapter23
Chapter23discussesthreetransportlayerprotocolsintheInternet:UDP,TCP,and
SCTP.Thefirst,UserDatagramProtocol(UDP),isaconnectionless,unreliableproto­
colthatisusedforitsefficiency.Thesecond,TransmissionControlProtocol(TCP),isa
connection-oriented,reliableprotocolthat
isagoodchoicefordatatransfer.Thethird,
StreamControlTransportProtocol(SCTP)isanewtransport-layerprotocoldesigned
formultimediaapplications.
Chapter24
Chapter24discusstworelatedtopics:congestioncontrolandquality ofservice.Although
thesetwoissuescanberelatedtoanylayer,wediscussthemherewithsomereferencesto
otherlayers.

CHAPTER23
Process-la-ProcessDelivery:
UDp,TCp, andSCTP
Webeginthischapterbygivingtherationalefortheexistence ofthetransportlayer­
theneedforprocess-to-processdelivery. Wediscusstheissuesarisingfromthistype of
delivery,andwediscussmethodstohandlethem.
TheInternetmodelhasthreeprotocolsatthetransportlayer:UDP,TCP,andSCTP.
FirstwediscussUDP,which
isthesimplestofthethree.Weseehowwecanusethis
verysimpletransportlayerprotocolthatlackssome
ofthefeaturesoftheothertwo.
WethendiscussTCP,acomplextransportlayerprotocol. Weseehowourpreviously
presentedconceptsareappliedtoTCP.Wepostponethediscussion
ofcongestioncontrol
andquality
ofserviceinTCPuntilChapter24becausethesetwotopicsapplytothedata
linklayerandnetworklayeraswell.
WefinallydiscussSCTP,thenewtransportlayerprotocolthatisdesignedfor
multihomed,multistreamapplicationssuch
asmultimedia.
23.1PROCESS-TO-PROCESS DELIVERY
Thedatalinklayer isresponsiblefordelivery offramesbetweentwoneighboringnodes
overalink.Thisiscallednode-to-nodedelivery.Thenetworklayer
isresponsiblefor
delivery
ofdatagramsbetweentwohosts.Thisiscalledhost-to-hostdelivery.Communi­
cationontheInternetisnotdefinedastheexchange
ofdatabetweentwonodes or
betweentwohosts.Realcommunicationtakesplacebetweentwoprocesses(application
programs).Weneed
process-to-processdelivery. However,atanymoment,severalpro­
cessesmayberunningonthesourcehostandseveralonthedestinationhost.
Tocomplete
thedelivery,weneedamechanismtodeliverdatafromone
oftheseprocessesrunningon
thesourcehosttothecorrespondingprocessrunningonthedestinationhost.
Thetransportlayerisresponsibleforprocess-to-process
delivery-thedeliveryof
apacket,part ofamessage,fromoneprocesstoanother.Twoprocessescommunicate
inaclient/serverrelationship,aswewillseelater.Figure23.1showsthesethreetypes
ofdeliveriesandtheirdomains.
Thetransportlayerisresponsibleforprocess-to-processdelivery.
703

704 CHAPTER23PROCESS-TO-PROCESSDELIVERY:UDp, TCp, ANDSCTP
Figure23.1Typesofdatadeliveries
Processes
D···D
Nodetonode:Datalinklayer
Host
tohost:Networklayer
Processtoprocess:Transportlayer
Processes
D···w
\
\
\
\
\
\
\
\
\
\
\
\
\
\
"
I
'I
--
I
I
Nodeto:Nodeto:
node
1nodeI
I_ ,I
Hosttohost
Nodetonode
Processtoprocess
I
I
~':':f"'> ..:I
I I I
INodetoINodetoI
InodeInodeI
II
'II Jj
I
I'
=-
1
1
I
I
I
I
I
I
I
1
I
/
/
/'Client/ServerParadigm
Althoughthereareseveralwaystoachieveprocess-to-processcommunication,themost
commononeisthroughtheclient/server
paradigm.Aprocessonthelocalhost,called
aclient,needsservicesfromaprocessusuallyontheremotehost,calledaserver.
Bothprocesses(clientandserver)havethesamename.Forexample,togettheday
andtimefromaremotemachine,
weneedaDaytimeclientprocessrunningonthe
localhostandaDaytimeserverprocessrunning
onaremotemachine.
Operatingsystemstodaysupportbothmultiuserandmultiprogrammingenviron­
ments.Aremotecomputercanrunseveralserverprogramsatthesametime,
justas
localcomputerscanrunoneormoreclientprogramsatthesametime.Forcommunica­
tion,wemustdefinethefollowing:
1.Localhost
2.Localprocess
3.Remotehost
4.Remoteprocess
Addressing
Wheneverweneedtodeliversomething toonespecificdestinationamongmany,weneed
anaddress.Atthedatalinklayer,weneedaMACaddress
tochooseonenodeamongsev­
eralnodes
iftheconnectionisnotpoint-to-point.Aframeinthedatalinklayerneedsa
destinationMACaddressfordeliveryandasourceaddressforthenextnode'sreply.
Atthenetworklayer,weneedanIPaddresstochooseonehostamongmillions.A
datagraminthenetworklayerneedsadestinationIPaddressfordeliveryandasource
IPaddressforthedestination'sreply.
Atthetransportlayer,weneedatransportlayeraddress,calleda
portnumber,to
chooseamongmultipleprocessesrunningonthedestinationhost.Thedestinationport
numberisneededfordelivery;thesourceportnumber
isneededforthereply.
IntheInternetmodel,theportnumbersare16-bitintegersbetween0and65,535.
Theclientprogramdefinesitselfwithaportnumber,chosenrandomlybythetransport
layersoftwarerunningontheclienthost.Thisisthe
ephemeralportnumber.

SECTION23.1PROCESS-TV-PROCESS DELWERY 705
Theserverprocessmustalsodefineitselfwithaportnumber.Thisportnumber,
however,cannotbechosenrandomly.
Ifthecomputerattheserversiterunsaserver
processandassignsarandomnumberastheportnumber,theprocessattheclientsite
thatwantstoaccessthatserveranduseitsserviceswillnotknowtheportnumber.
Of
course,onesolutionwouldbetosendaspecialpacketandrequesttheportnumber ofa
specific server,butthisrequiresmoreoverhead.TheInternethasdecidedtouseuniversal
portnumbersforservers;thesearecalled
well-knownportnumbers.Therearesome
exceptionstothisrule;forexample,thereareclientsthatareassignedwell-knownport
numbers.Everyclientprocessknowsthewell-knownportnumber
ofthecorresponding
serverprocess.Forexample,whiletheDaytimeclientprocess,discussedabove,can
useanephemeral(temporary)portnumber52,000toidentifyitself,theDaytimeserver
processmustusethewell-known(permanent)portnumber13.Figure23.2showsthis
concept.
Figure23.2 Portnumbers
Daytime
client
DDD
H52,000
f-----j
Transportlayer
Daytime
server
DDD
f-----j13H
Transportlayer
IDataI13~
ItshouldbeclearbynowthattheIPaddressesandportnumbersplaydifferent
rolesinselectingthefinaldestination
ofdata.ThedestinationIPaddressdefinesthe
hostamongthedifferenthostsintheworld.Afterthehosthasbeenselected,theport
numberdefinesone
oftheprocessesonthisparticularhost(seeFigure23.3).
lANARanges
ThelANA(InternetAssignedNumberAuthority)hasdividedtheportnumbers into
threeranges:wellknown,registered,anddynamic(orprivate),
asshowninFigure23.4.
oWell-knownports. Theportsrangingfrom0to1023areassignedandcontrolled
bylANA.Thesearethewell-knownports.
oRegisteredports. Theportsrangingfrom1024to49,151arenotassignedorcon­
trolledbylANA.TheycanonlyberegisteredwithlANAtopreventduplication.
oDynamicports. Theportsrangingfrom49,152to65,535areneithercontrolled
norregistered.Theycanbeusedbyanyprocess.Thesearetheephemeralports.

706 CHAPTER 23PROCESS-TO-PROCESS DELIVERY: UDp,TCP,ANDSCTP
Figure23.3 IPaddressesversus portnumbers
~------------------~
i~~... :
ILJU I
I I
I I
I
I
I
I
I
I
I
I
I
I
J I
:
~9}}~.~~?. :
Portnumber
selectstheprocess
IPheaderf------I
Transportlayer(---'-----1
header
Figure23.4 lANAranges
IPaddress
selectsthehost
Dynamic
Registered
o 1023 I
49,152
I-----r-l1--1--·--------11If
T1024 49,151
Wellknown
65,535
I
SocketAddresses
Process-to-processdeliveryneedstwoidentifiers,IPaddressandtheportnumber,at
eachendtomakeaconnection.Thecombination
ofanIPaddressandaportnumberis
calledasocket
address.Theclientsocketaddressdefinestheclientprocessuniquely
justastheserversocketaddressdefinestheserverprocessuniquely(seeFigure23.5).
Atransportlayerprotocolneedsapair
ofsocketaddresses:theclientsocketaddress
andtheserversocketaddress.Thesefourpieces
ofinformationarepart oftheIPheader
andthetransportlayerprotocolheader.TheIPheadercontainsthe
IPaddresses;the
UDPorTCPheadercontainstheportnumbers.
Figure23.5 Socketaddress
Portnumber

SECTION23.1PROCESS-TO-PROCESS DELIVERY 707
MultiplexingandDemultiplexing
Theaddressingmechanismallowsmultiplexinganddemultiplexingbythetransport
layer,asshowninFigure23.6.
Figure23.6
Multiplexinganddemultiplexing
Processes Processes
Multiplexing
Atthesendersite,theremaybeseveralprocessesthatneedtosendpackets.However,
there
isonlyonetransportlayerprotocolatanytime.This isamany-to-onerelationship
andrequiresmultiplexing.Theprotocolacceptsmessagesfromdifferentprocesses,
differentiatedbytheirassignedportnumbers.Afteraddingtheheader,thetransportlayer
passesthepackettothenetworklayer.
Demultiplexing
Atthereceiversite,therelationshipisone-to-manyandrequiresdemultiplexing.The
transportlayerreceivesdatagramsfromthenetworklayer.Aftererrorcheckingand
dropping
oftheheader,thetransportlayerdeliverseachmessagetotheappropriate
processbasedontheportnumber.
ConnectionlessVersusConnection-OrientedService
Atransportlayerprotocolcaneitherbeconnectionlessorconnection-oriented.
ConnectionlessService
Inaconnectionlessservice,thepacketsaresentfromonepartytoanotherwithnoneed
forconnectionestablishmentorconnectionrelease.Thepacketsarenotnumbered;they
maybedelayedorlostormayarriveout
ofsequence.Thereisnoacknowledgment
either.
Wewillseeshortlythatone ofthetransportlayerprotocolsintheInternetmodel,
UDP,isconnectionless.
Connection~Oriented Service
Inaconnection-orientedservice,aconnectionisfirstestablishedbetweenthesender
andthereceiver.Dataaretransferred.Attheend,theconnectionisreleased.
Wewillsee
shortlythatTCPandSCTPareconnection-orientedprotocols.

708 CHAPTER 23PROCESS-TO-PROCESS DELNERY:UDp,TCp,ANDSCTP
ReliableVersusUnreliable
Thetransportlayerservicecanbereliableorunreliable. Iftheapplicationlayerprogram
needsreliability,weuseareliabletransportlayerprotocolbyimplementingflowand
errorcontrolatthetransportlayer.Thismeansaslowerandmorecomplexservice.On
theotherhand,
iftheapplicationprogramdoesnotneedreliabilitybecauseitusesits
ownflowanderrorcontrolmechanismoritneedsfastserviceorthenature
oftheservice
does
notdemandflowanderrorcontrol(real-timeapplications),thenanunreliable
protocolcanbeused.
IntheInternet,therearethreecommondifferenttransportlayerprotocols,aswehave
alreadymentioned.UDPisconnectionlessandunreliable;TCPandSCTPareconnection­
orientedandreliable.Thesethreecanrespondtothedemands
oftheapplicationlayer
programs.
Onequestionoftencomestothemind.
Ifthedatalinklayerisreliableandhasflow
anderrorcontrol,doweneedthisatthetransportlayer,too?Theanswerisyes.Reliability
atthedatalinklayerisbetweentwonodes;weneedreliabilitybetweentwoends.Because
thenetworklayerintheInternetisunreliable(best-effortdelivery),weneedtoimplement
reliabilityatthetransportlayer.
Tounderstandthaterrorcontrolatthedatalinklayerdoes
notguaranteeerrorcontrolatthetransportlayer,letuslookatFigure23.7.
Figure23.7 Errorcontrol
- Errorischeckedinthesepathsbythedatalinklayer
- Errorisnotcheckedinthesepathsbythedatalinklayer
Transport
Network
Transport
Network
Datalink
Physical
Aswewillsee,flowanderrorcontrolinTCPisimplementedbytheslidingwindow
protocol,asdiscussedin
Chapter11.Thewindow,however, ischaracter-oriented,
instead
offrame-oriented.
ThreeProtocols
TheoriginalTCP/IPprotocolsuitespecifiestwoprotocolsforthetransportlayer:UDP
andTCP.WefirstfocusonUDP,thesimpler
ofthetwo,beforediscussingTCP.Anew
transportlayerprotocol,SCTP,hasbeendesigned,whichwealsodiscussinthischapter.
Figure23.8showstheposition
oftheseprotocolsintheTCP/IPprotocolsuite.

SECTION23.2USERDATAGRAMPROTOCOL(UDP) 709
Figure23.8 PositionofUDp,TCp,andSCTPinTCPIIPsuite
APPli';:~~~ISillPIBBBI SNMP1·..1BOOTPI
UnderlyingLAN orWAN
technology
Physical
layer
Tm~:;:,II SCTPII_TC-----'pII UDPII
I
jIGMP11ICMPI I
Netwo<' IT I
layer IARPIIRARPI
Datalink
layer
23.2USERDATAGRAM PROTOCOL(UDP)
TheUserDatagramProtocol(UDP) iscalleda connectionless,unreliable transport
protocol.Itdoesnotaddanythingtotheservices ofIPexcepttoprovideprocess-to­
processcommunicationinstead
ofhost-to-hostcommunication.Also,itperformsvery
limitederrorchecking.
IfUDPis sopowerless,whywouldaprocesswanttouseit?Withthedisadvantages
comesomeadvantages.UDPisaverysimpleprotocolusinga
nrinimumofoverhead.If
aprocesswantstosendasmallmessageanddoesnotcaremuchaboutreliability,itcan
use
UDP.SendingasmallmessagebyusingUDPtakesmuchlessinteractionbetween
thesenderandreceiverthanusingTCPorSCTP.
Well-KnownPortsforUDP
Table23.1showssomewell-knownportnumbersusedbyUDP.Someportnumbers
canbeusedbybothUDPand
TCP.WediscussthemwhenwetalkaboutTCPlaterin
thechapter.
Table23.1 Well-knownportsusedwithUDP
Port Protocol Description
7Echo Echoesareceiveddatagrambacktothesender
9Discard Discardsanydatagramthat isreceived
11Users Activeusers

710 CHAPTER23PROCESS-TO-PROCESS DELIVERY: UDp,TCp,ANDSCTP
Table23.1 Well-knownportsusedwithUDP(continued)
Port Protocol Description
13Daytime Returnsthedateandthetime
17Quote Returnsaquoteoftheday
19Chargen Returnsastringofcharacters
53Nameserver DomainNameService
67BOOTPs Serverporttodownloadbootstrapinformation
68BOOTPc Clientporttodownloadbootstrapinformation
69TFTP TrivialFileTransferProtocol
IIIRPC RemoteProcedureCall
123NTP NetworkTimeProtocol
161SNMP SimpleNetworkManagementProtocol
162SNMP SimpleNetworkManagementProtocol(trap)
Example23.1
InUNIX,thewell-knownportsarestoredinafilecalledfetcfservices.Eachlineinthisfilegives
thename
oftheserverandthewell-knownportnumber. Wecanusethegreputilitytoextractthe
linecorrespondingtothedesiredapplication.ThefollowingshowstheportforFTP.Notethat
FrPcanuseport 21witheitherUDPorTCP.
$grep
ftp
fip
ftpfetclservices
21ftcp
211udp
SNMPusestwoportnumbers(161and162),eachforadifferentpurpose,aswe
willseein
Chapter28.
$grep
snmp
snmp
snmptrap
snmpfetclservices
161ftcp
1611udp
162/udp
#SimpleNetMgmtProto
#SimpleNetMgmtProto
#TrapsforSNMP
UserDatagram
UDPpackets,called userdatagrams,haveafixed-sizeheader of8bytes.Figure 23.9
showstheformat ofauserdatagram.
Thefieldsare
asfollows:
oSourceportnumber.Thisistheportnumberusedbytheprocessrunningonthe
sourcehost.
Itis16bitslong,whichmeansthattheportnumbercanrangefrom0to
65,535.
Ifthesourcehostistheclient(aclientsendingarequest),theportnumber, in
mostcases,isanephemeralportnumberrequestedbytheprocessandchosenbythe
UDPsoftwarerunningonthesourcehost. Ifthesourcehostis theserver (aserver
sendingaresponse),theportnumber,inmostcases,isawell-knownportnumber.

SECTION23.2USERDATAGRAMPROTOCOL(UDP) 711
Figure23.9 Userdatagramformat
8bytes
I''I
Data
Sourceportnumber
16bits
Totallength
16bits
Destinationportnumber
16bits
Checksum
16bits
oDestinationportnumber.Thisisthe portnumberused bytheprocessrunning on
thedestinationhost. Itisalso16bitslong. Ifthedestinationhostistheserver (a
clientsendingarequest),the portnumber,inmostcases,isawell-known port
number.Ifthedestinationhostistheclient(aserversendingaresponse),theport
number,
inmostcases,isanephemeralportnumber.Inthiscase,theservercopies
theephemeralportnumber
ithasreceivedintherequestpacket.
oLength.Thisisa16-bitfieldthatdefinesthetotallength oftheuserdatagram,
headerplusdata.
The16bitscandefineatotallength of0to65,535bytes.How­
ever,thetotallengthneedsto
bemuchlessbecausea UDPuserdatagramisstored
inanIPdatagramwithatotallength
of65,535 bytes.
Thelengthfieldina
UDPuserdatagramisactuallynotnecessary.Auser
datagramisencapsulatedinanIPdatagram.
ThereisafieldintheIPdatagram
thatdefinesthetotallength.ThereisanotherfieldintheIPdatagramthatdefines
thelength
oftheheader.Soifwesubtractthevalue ofthesecondfieldfromthe
first,
wecandeducethelengthofaUDPdatagramthatisencapsulatedinan
IPdatagram.
UDPlength
=IPlength- IPheader'slength
However,thedesigners
oftheUDPprotocolfeltthatitwasmoreefficientforthe
destination
UDPtocalculatethelength ofthedatafromtheinformationprovided
intheUDPuserdatagramratherthanasktheIPsoftwaretosupplythisinformation.
Weshouldrememberthatwhen the
IPsoftwaredeliversthe UDPuserdatagramto
the
UDPlayer,ithasalreadydroppedtheIPheader.
oChecksum.Thisfieldisusedtodetecterrorsovertheentireuserdatagram(header
plusdata).Thechecksumisdiscussednext.
Checksum
Wehavealreadytalkedabouttheconcept ofthechecksumandthe wayitiscalculated
inChapter10.WehavealsoshownhowtocalculatethechecksumfortheIPandICMP
packet.WenowshowhowthisisdoneforUDP.

712 CHAPTER 23PROCESS-TO-PROCESS DELIVERY: UDp,TCp,ANDSCTP
TheUDPchecksumcalculationisdifferentfromtheoneforIPandICMP.Here
thechecksumincludesthreesections:apseudoheader,theUDPheader,andthedata
comingfromtheapplicationlayer.
The
pseudoheaderisthepart oftheheaderoftheIPpacketinwhichtheuserdata­
gramisto
beencapsulatedwithsomefieldsfilledwith Os(seeFigure23.10).
Figure23.10Pseudoheaderforchecksumcalculation
32-bitsourceIPaddress
32-bitdestination
IPaddress
AliOs
I8-bitprotocol
16-bit
UDPtotallength
(17)
Sourceportaddress Destinationportaddress
16bits 16bits
UDPtotallength Checksum
16bits 16bits
J)ata
(paddingmustbeaddedtomakethedataamultipleof 16bits)
Ifthechecksumdoesnotincludethepseudoheader,auserdatagrammayarrivesafe
andsound.However,
iftheIPheaderiscorrupted,itmaybedeliveredtothewronghost.
Theprotocolfieldisaddedtoensure thatthepacketbelongstoUDP,andnot
toothertransport-layerprotocols.Wewillseelaterthat
ifaprocesscanuseeitherUDP
orTCP,thedestinationportnumbercanbethesame.Thevalue
oftheprotocolfield
forUDPis17.
Ifthisvalueischangedduringtransmission,thechecksumcalculationat
thereceiverwilldetect
itandUDPdropsthepacket. Itisnotdeliveredtothewrong
protocol.
Notethesimilaritiesbetweenthepseudoheaderfieldsandthelast12bytes
ofthe
IPheader.
Example23.2
Figure23.11showsthechecksumcalculationforaverysmalluserdatagramwithonly7bytes
ofdata.Becausethenumber ofbytesofdataisodd,paddingisaddedforchecksumcalcUlation.
Thepseudoheader
aswellasthepaddingwillbedroppedwhentheuserdatagramisdelivered
to
IP.
OptionalUseoftheChecksum
Thecalculationofthechecksumanditsinclusioninauserdatagramareoptional. If
thechecksumisnotcalculated,thefieldisfilledwith1 s.Notethatacalculatedcheck­
sumcannever
beallIsbecausethisimpliesthatthesumisall Os,whichisimpossible
because
itrequiresthatthevalue offieldsto beOs.

SECTION23.2USERDATAGRAMPROTOCOL(UDP) 713
Figure23.11 Checksumcalculation ofasimpleUDPuserdatagram
--:----:----~--1~
153.18.8.105
171.2.14.10
AllOsI
17I
15
1087
15
13 AllOs
1001100100010010~ 153.18
0000100001101001~ 8.105
101010
1100000010
~ 171.2
0000111000001010~ 14.10
0000000000010001~oand17
0000000000001111~ 15
0000010000111111~ 1087
0000000000001101~ 13
0000000000001111~ 15
00000000 00000000~ 0(checksum)
0101010001000101~ TandE
0101001101010100~ SandT
0100100101001110~ IandN
010001II00000000~ Gand0(padding)
1O01O11011101011~ Sum
HUHIOOl00010100~ Checksum
UDPOperation
UDPusesconceptscommontothetransportlayer.Theseconceptswillbediscussed
herebriefly,andthenexpandedinthenextsectionontheTCPprotocol.
ConnectionlessServices
Asmentionedpreviously,UDPprovidesaconnectionlessservice.Thismeansthateach
userdatagramsentbyUDPisanindependentdatagram.Thereisnorelationship
betweenthedifferentuserdatagramseven
iftheyarecomingfromthesamesourcepro­
cessandgoingtothesamedestinationprogram.Theuserdatagramsarenotnumbered.
Also,thereisnoconnectionestablishment andnoconnectiontermination,asisthecase
for
TCP.Thismeansthateachuserdatagramcantravelonadifferentpath.
One
oftheramificationsofbeingconnectionlessisthattheprocessthatusesUDP
cannotsendastream
ofdatato UDPandexpectUDPtochopthemintodifferent
relateduserdatagrams.Insteadeachrequestmustbesmallenoughtofitintooneuser
datagram.Onlythoseprocessessendingshortmessagesshoulduse
UDP.
Flowand
ErrorControl
UDPisaverysimple,unreliabletransportprotocol.Thereisno flowcontrolandhence
nowindowmechanism.Thereceivermayoverflowwithincomingmessages.
ThereisnoerrorcontrolmechanisminUDPexceptforthechecksum.Thismeans
thatthesenderdoesnotknowifamessagehasbeenlostorduplicated.Whenthereceiver
detectsanerrorthroughthechecksum,theuserdatagramissilentlydiscarded.
Thelack
offlowcontrolanderrorcontrolmeansthattheprocessusingUDP
shouldprovidethese mechanisms.
EncapsulationandDecapsulation
Tosendamessagefromone processtoanother,theUDPprotocolencapsulatesand
decapsulatesmessagesinanIPdatagram.

714 CHAPTER 23PROCESS-TO-PROCESS DELIVERY:UDp,TCp,ANDSCTP
Queuing
Wehavetalkedaboutportswithoutdiscussingtheactualimplementation ofthem.In
UDP,queuesareassociatedwithports(seeFigure23.12).
Figure23.12QueuesinUDP
Daytime Daytime
client server
[j D
Outgoing,
\Incoming Outgoing,
\Incoming
queue queue queue queue
~t ~t
UDP
Port52000 UDP
Port
13
Attheclientsite,whenaprocessstarts,itrequestsaportnumberfromtheoperating
system.Someimplementationscreatebothanincomingandanoutgoingqueueassociated
witheachprocess.Otherimplementationscreateonlyanincomingqueueassociated
witheachprocess.
Notethateven
ifaprocesswantstocommunicatewithmultipleprocesses,it
obtainsonlyoneportnumberandeventuallyoneoutgoingandoneincomingqueue.
Thequeuesopenedbytheclientare,inmostcases,identifiedbyephemeralportnumbers.
Thequeuesfunction
aslongastheprocessisrunning.Whentheprocessterminates,the
queuesaredestroyed.
Theclientprocesscansendmessagestotheoutgoingqueuebyusingthesource
portnumberspecifiedintherequest.UDPremovesthemessagesonebyoneand,after
addingtheUDPheader,deliversthemto
IP.Anoutgoingqueuecanoverflow. Ifthis
happens,theoperatingsystemcanasktheclientprocesstowaitbeforesendingany
moremessages.
Whenamessagearrivesforaclient,UDPcheckstoseeifanincomingqueuehas
beencreatedfortheportnumberspecifiedinthedestinationportnumberfield
ofthe
userdatagram.Ifthereissuchaqueue,UDPsendsthereceiveduserdatagramtothe
end
ofthequeue.Ifthereisnosuchqueue,UDPdiscardstheuserdatagramandasks
theICMPprotocoltosenda
portunreachablemessagetotheserver.Alltheincoming
messagesforoneparticularclientprogram,whethercomingfromthesameoradifferent
server,aresenttothesamequeue.Anincomingqueuecanoverflow.
Ifthishappens,
UDPdropstheuserdatagramandasksforaportunreachablemessagetobesentto
theserver.
Attheserversite,themechanism
ofcreatingqueuesisdifferent.Initssimplestform,
aserverasksforincomingandoutgoingqueues,usingitswell-knownport,whenitstarts
running.Thequeuesremainopen
aslongastheserverisrunning.
Whenamessagearrivesforaserver,UDPcheckstosee
ifanincomingqueuehas
beencreatedfortheportnumberspecifiedinthedestinationportnumberfield
oftheuser

SECTION23.3TCP 715
datagram.Ifthereissuchaqueue,UDPsendsthereceiveduserdatagramtotheend of
thequeue.Ifthereisnosuchqueue,UDPdiscardstheuserdatagramandaskstheICMP
protocoltosendaportunreachablemessagetotheclient.Alltheincomingmessages
foroneparticularserver,whethercomingfromthesameoradifferentclient,aresentto
thesamequeue.Anincomingqueuecanoverflow.
Ifthishappens,UDPdropstheuser
datagramandasksforaportunreachablemessagetobesenttotheclient.
Whenaserverwantstorespondtoaclient,itsendsmessagestotheoutgoingqueue,
usingthesourceportnumberspecified
intherequest.UDPremovesthemessagesone
byoneand,afteraddingtheUDPheader,deliversthemto
IP.Anoutgoingqueuecan
overflow.
Ifthishappens,theoperatingsystemaskstheservertowaitbeforesending
anymoremessages.
UseofUDP
Thefollowinglistssomeuses oftheUDPprotocol:
oUDPissuitableforaprocessthatrequiressimplerequest-responsecommunication
withlittleconcernforflowanderrorcontrol.
Itisnotusuallyusedforaprocess
suchas
FrPthatneedstosendbulkdata(seeChapter26).
oUDPissuitableforaprocesswithinternalflowanderrorcontrolmechanisms.For
example,theTrivialFileTransferProtocol(TFTP)processincludesflowanderror
control.
ItcaneasilyuseUDP.
oUDPisasuitabletransportprotocolformulticasting.Multicastingcapabilityis
embeddedintheUDPsoftwarebutnotintheTCPsoftware.
oUDPisusedformanagementprocessessuchasSNMP(seeChapter28).
oUDPisusedforsomerouteupdatingprotocolssuch asRoutingInformationProtocol
(RIP)(seeChapter22).
23.3TCP
ThesecondtransportlayerprotocolwediscussinthischapteriscalledTransmission
ControlProtocol(TCP).TCP,like
UDP,isaprocess-to-process(program-to-program)
protocol.TCP,therefore,like
UDP,usesportnumbers.UnlikeUDP,TCP isaconnection­
oriented protocol;itcreatesavirtualconnectionbetweentwoTCPstosenddata.In
addition,TCPusesflowanderrorcontrolmechanismsatthetransportlevel.
Inbrief,TCPiscalledaconnection-oriented,reliabletransportprotocol.
Itadds
connection-orientedandreliabilityfeaturestotheservices
ofIP.
TCPServices
BeforewediscussTCPindetail,letusexplaintheservicesofferedbyTCPtothepro­
cessesattheapplicationlayer.
Process-to-ProcessCommunication
LikeUDP,TCPprovidesprocess-to-processcommunicationusingportnumbers.Table23.2
listssomewell-knownportnumbers usedby
TCP.

716 CHAPTER23PROCESS-TO-PROCESS DELIVERY:UDp, TCP,ANDSCTP
Table23.2 Well-knownportsusedbyTCP
Port Protocol Description
7Echo Echoesareceiveddatagrambacktothesender
9Discard Discardsanydatagramthat isreceived
11Users Activeusers
13Daytime Returnsthedateandthetime
17Quote Returnsaquote oftheday
19Chargen Returnsastring ofcharacters
20FIP,Data FileTransferProtocol(dataconnection)
21FIP,ControlFileTransferProtocol(controlconnection)
23TELNET TenninalNetwork
25SMTP SimpleMailTransferProtocol
53DNS DomainNameServer
67BOOTP BootstrapProtocol
79Finger Finger
80HTTP HypertextTransferProtocol
111RPC RemoteProcedureCall
StreamDeliveryService
TCP,unlikeUDP,isastream-orientedprotocol.In UDP,aprocess(anapplicationpro­
gram)sendsmessages,withpredefinedboundaries,toUDPfordelivery.UDPaddsits
ownheadertoeach
ofthesemessagesanddeliversthemtoIPfortransmission.Each
messagefromtheprocess
iscalIedauserdatagramandbecomes,eventually,oneIP
datagram.NeitherIPnorUDPrecognizesanyrelationshipbetweenthedatagrams.
TCP,
ontheotherhand,allows thesendingprocesstodeliverdataasastream of
bytesandallows thereceivingprocesstoobtaindata asastreamofbytes.TCPcreates
anenvironmentinwhichthetwoprocessesseemtobeconnectedbyanimaginary"tube"
thatcarriestheirdataacrosstheInternet.Thisimaginaryenvironmentisdepictedin
Figure23.13.Thesendingprocessproduces(writesto)thestream
ofbytes,andthe
receivingprocessconsumes(readsfrom)them.
Figure23.13 Streamdelivery
Sending
process
Receiving
process
TCP TCP

SECTION23.3TCP 717
SendingandReceivingBuffersBecausethesendingandthereceivingprocessesmay
notwriteorreaddataatthesamespeed,
TCPneedsbuffersforstorage.Therearetwo
buffers,thesendingbufferandthereceivingbuffer,oneforeachdirection.(Wewillsee
laterthatthesebuffersarealsonecessaryforflowanderrorcontrolmechanismsused
byTCP.)Onewaytoimplementabufferistouseacirculararray ofI-bytelocationsas
showninFigure23.14.Forsimplicity,wehaveshowntwobuffers
of20byteseach;
normallythebuffersarehundredsorthousands
ofbytes,dependingontheimplemen­
tation.Wealsoshowthebuffers
asthesamesize,whichisnotalwaysthecase.
Figure23.14Sendingandreceivingbuffers
Sending
process
TCP
Nextbyte
to
write
Receiving
process
Nextbyte
toread
TCP
Figure23.14showsthemovement ofthedatainonedirection. Atthesendingsite,
thebufferhasthreetypesofchambers.Thewhitesectioncontainsemptychambersthat
canbefilled
bythesendingprocess(producer).Thegrayareaholdsbytesthathave
beensentbutnotyetacknowledged.TCPkeepsthesebytesinthebufferuntilitreceives
anacknowledgment.Thecoloredareacontainsbytestobesent
bythesendingTCP.
However,aswewillseelaterinthischapter,TCPmaybeabletosendonlypart
ofthis
coloredsection.Thiscould
beduetotheslowness ofthereceivingprocessorperhaps
tocongestioninthenetwork.Alsonotethatafterthebytesinthegraychambersare
acknowledged,thechambersarerecycledandavailable forusebythesendingprocess.
Thisiswhyweshowacircularbuffer.
Theoperation
ofthebufferatthereceiversiteissimpler. Thecircularbufferis
dividedintotwoareas(shown
aswhiteandcolored).Thewhiteareacontainsempty
chambersto
befilledbybytesreceivedfromthenetwork.Thecoloredsectionscontain
receivedbytesthatcanberead
bythereceivingprocess.Whenabyteisreadbythe
receivingprocess,thechamberisrecycledandaddedtothepoolofemptychambers.
SegmentsAlthoughbufferinghandlesthedisparitybetweenthespeed
oftheproducing
andconsumingprocesses,weneedonemorestepbeforewecansenddata.TheIPlayer,
asaserviceproviderforTCP,needstosenddatainpackets,notasastream ofbytes.At

718 CHAPTER23PROCESS-TO-PROCESS DELIVERY:UDp,TCp, ANDSCTP
thetransportlayer,TCPgroupsanumber ofbytestogetherintoapacketcalledasegment.
TCPaddsaheadertoeachsegment(forcontrol purposes)anddeliversthesegmenttothe
IPlayerfortransmission.Thesegmentsareencapsulatedin
IPdatagramsandtransmit­
ted.Thisentireoperationistransparenttothereceivingprocess.Laterwewillseethat
segmentsmaybereceivedout
oforder,lost,orcorruptedandresent.Allthesearehandled
by
TCPwiththereceiving processunaware ofanyactivities.Figure23.15showshow
segmentsarecreatedfromthebytesinthebuffers.
Figure23.15TCPsegments
Sending
process
Receiving
process
TCP TCP
Nextbyte
toaccept
Nextbyte
todeliver
Segment1
SegmentN
L-----.jI-+JjIUIlii"illiliil·...•••II11Hl..-+-_----1
Notethatthesegmentsarenotnecessarilythesamesize.InFigure23.15,forsim­
plicity,weshowonesegmentcarrying3bytesandtheothercarrying5bytes.Inreality,
segmentscarryhundreds,
ifnotthousands,ofbytes.
Full-DuplexCommunication
TCPoffersfull-duplexservice,inwhichdatacanflowinbothdirectionsatthesametime.
EachTCPthenhasasendingandreceivingbuffer,andsegmentsmoveinbothdirections.
Connection-OrientedService
TCP,unlikeUDP,isaconnection-orientedprotocol.WhenaprocessatsiteAwantsto
sendandreceivedatafromanotherprocessatsiteB,thefollowingoccurs:
1.ThetwoTCPsestablishaconnectionbetweenthem.
2.Dataareexchangedinbothdirections.
3.Theconnectionisterminated.
Notethatthisisavirtualconnection,notaphysicalconnection.The
TCPsegmentis
encapsulatedinan
IPdatagramandcanbesentout oforder,orlost,orcorrupted,andthen
resent.Eachmayuseadifferentpathtoreachthedestination.Thereisnophysicalconnec­
tion.TCPcreatesastream-orientedenvironmentinwhichitacceptstheresponsibility
of

SECT/ON23.3TCP 719
deliveringthebytesinordertotheothersite.Thesituationissimilartocreatingabridge
thatspansmultipleislandsandpassingallthebytesfromoneislandtoanotherinone
singleconnection.
Wewilldiscussthisfeaturelaterinthechapter.
ReliableService
TCPisareliabletransportprotocol. Itusesanacknowledgmentmechanismtocheck
thesafeandsoundarrival
ofdata.Wewilldiscussthisfeaturefurtherinthesection on
errorcontrol.
TCPFeatures
Toprovidetheservicesmentionedintheprevioussection,TCPhasseveralfeaturesthat
arebrieflysummarizedinthissectionanddiscussedlaterindetail.
NumberingSystem
AlthoughtheTCPsoftwarekeepstrack ofthesegmentsbeingtransmittedorreceived,
thereisnofieldforasegmentnumbervalueinthesegmentheader.Instead,thereare
twofieldscalledthe
sequencenumber andtheacknowledgmentnumber. Thesetwo
fieldsrefertothebytenumberandnotthesegmentnumber.
ByteNumber TCPnumbersalldatabytesthataretransmittedinaconnection.Number­
ing
isindependentineachdirection.WhenTCPreceivesbytes ofdatafromaprocess,it
storestheminthesendingbufferandnumbersthem.Thenumberingdoesnotnecessarily
startfrom
O.Instead,TCPgeneratesarandomnumberbetween0and2
32
-
1forthenum­
ber
ofthefirstbyte.Forexample, iftherandomnumberhappenstobe1057andthetotal
datatobesentare6000bytes,thebytesarenumberedfrom1057to7056.
Wewillseethat
bytenumbering
isusedforflowanderrorcontrol.
Thebytesofdatabeingtransferred ineachconnectionarenumberedbyTCP.
Thenumberingstartswitharandomlygeneratednumber.
SequenceNumber Afterthebyteshavebeennumbered, TCPassignsasequence
numbertoeachsegmentthatisbeingsent.Thesequencenumberforeachsegmentis
thenumber
ofthefirstbytecarriedinthatsegment.
Example23.3
Supposea TCPconnectionistransferringafile of5000bytes.Thefirstbyteisnumbered1O,00l.
Whatarethesequencenumbersforeachsegment
ifdataaresentinfivesegments,eachcarrying
1000bytes?
Solution
Thefollowingshowsthesequencenumberforeachsegment:
Segment1 SequenceNumber:10,001(range:10,001to11,(00)
Segment2 SequenceNumber:11,001(range:11,001to12,000)
Segment3 SequenceNumber:12,001(range:12,001to13,000)
Segment4 SequenceNumber:13,001(range:13,001
to14,000)
Segment5 SequenceNumber:14,001(range:14,001
to15,000)

720 CHAPTER23PROCESS-TO-PROCESS DEliVERY:UDp,TCP,ANDSCTP
Thevalueinthesequencenumberfieldofasegmentdefinesthe
numberofthefirst
databytecontainedinthatsegment.
Whenasegmentcarriesacombination ofdataandcontrolinformation(piggy­
backing),itusesasequencenumber.
Ifasegmentdoesnotcarryuserdata,itdoesnot
logicallydefineasequencenumber.Thefieldisthere,butthevalue
isnotvalid.However,
somesegments,whencarryingonlycontrolinformation,needasequencenumberto
allowanacknowledgmentfromthereceiver.Thesesegmentsareusedforconnection
establishment,termination,orabortion.Each
ofthesesegmentsconsumesonesequence
number
asthoughitcarried1byte,buttherearenoactualdata.Iftherandomlygenerated
sequencenumberis
x,thefirstdatabyteisnumbered x+1.Thebytexisconsidereda
phonybytethatisusedforacontrolsegmenttoopenaconnection,aswewillseeshortly.
Acknowledgment
NumberAswediscussedpreviously,communicationinTCP isfull
duplex;whenaconnectionisestablished,bothpartiescansendandreceivedataatthe
sametime.Eachpartynumbersthebytes,usuallywithadifferentstartingbytenumber.
Thesequencenumberineachdirectionshowsthenumber
ofthefirstbytecarriedby
thesegment.Eachpartyalsousesanacknowledgmentnumbertoconfirmthebytesithas
received.However,theacknowledgmentnumberdefinesthenumber
ofthenextbyte
thatthepartyexpectstoreceive.
Inaddition,theacknowledgmentnumberiscumula­
tive,whichmeansthatthepartytakesthenumber
ofthelastbytethatithasreceived,
safeandsound,addsItoit,andannouncesthissum
astheacknowledgmentnumber.
Theterm
cumulativeheremeansthat ifapartyuses5643asanacknowledgmentnumber,
ithasreceivedallbytesfromthebeginningupto5642.Notethatthisdoesnotmean
thatthepartyhasreceived5642bytesbecausethefirstbytenumberdoesnothave
tostart
from
O.
Thevalueoftheacknowledgmentfieldinasegmentdefines
thenumberofthenextbytea
partyexpectstoreceive.
Theacknowledgmentnumberiscumulative.
FlowControl
TCP,unlike UDP,providesflowcontrol.Thereceiverofthedatacontrolstheamount of
datathataretobesentbythesender.Thisisdone topreventthereceiverfrombeingover­
whelmedwithdata.ThenumberingsystemallowsTCPtouseabyte-oriented
flowcontrol.
ErrorControl
Toprovidereliableservice, TCPimplementsanerrorcontrolmechanism.Although
errorcontrolconsidersasegment
astheunitofdataforerrordetection(lossorcorrupted
segments),errorcontrolisbyte-oriented,aswewillseelater.
CongestionControl
TCP,unlikeUDP,takesintoaccountcongestioninthenetwork.Theamount ofdatasent
byasenderisnotonlycontrolledbythe receiver(flowcontrol),butisalsodetennined
bythelevel
ofcongestioninthenetwork.

SECTION23.3TCP 721
Segment
BeforewediscussTCPingreaterdetail,letusdiscusstheTCPpacketsthemselves.A
packetinTCP
iscalleda segment.
Format
Theformat
ofasegmentisshowninFigure23.16.
Figure23.16 TCPsegmentformat
Sequencenumber
32bits
Acknowledgmentnumber
32bits
HLEN
4bits
OptionsandPadding
Windowsize
16bits
Urgentpointer
16bits
Thesegmentconsists ofa20-to60-byteheader,followedbydatafromtheappli­
cationprogram.Theheaderis20bytes
iftherearenooptionsandupto60bytes ifit
containsoptions. Wewilldiscusssome oftheheaderfieldsinthissection.Themeaning
andpurpose
ofthesewillbecomeclearerasweproceedthroughthechapter.
oSourceportaddress.Thisisa16-bitfieldthatdefinestheportnumber ofthe
applicationprograminthehostthatissending thesegment.Thisservesthesame
purposeasthesourceportaddressintheUDPheader.
oDestinationportaddress.Thisisa16-bitfieldthatdefinestheportnumber ofthe
applicationprograminthehostthatisreceivingthesegment.Thisservesthesame
purpose
asthedestinationportaddressintheUDPheader.
oSequencenumber. This32-bitfielddefinesthenumberassignedtothefirstbyte of
datacontainedinthissegment.Aswesaidbefore,TCP isastreamtransportprotocol.
Toensureconnectivity,eachbyte tobetransmittedisnumbered.Thesequencenumber
tellsthedestinationwhichbyteinthissequencecomprisesthefirstbyteintheseg­
ment.Duringconnectionestablishment,eachpartyusesarandomnumbergeneratorto
createan
initialsequencenumber(ISN), whichisusuallydifferent ineachdirection.
oAcknowledgmentnumber. This32-bitfielddefinesthebytenumberthatthe
receiver
ofthesegmentisexpectingtoreceivefromtheotherparty. Ifthereceiver

722 CHAPTER 23PROCESS-TO-PROCESS DELIVERY: UDp,TCp,ANDSCTP
ofthesegmenthassuccessfullyreceivedbytenumber xfromtheotherparty,it
defines
x+Iastheacknowledgmentnumber.Acknowledgmentanddatacanbe
piggybackedtogether.
DHeaderlength.This4-bitfieldindicatesthenumber of4-bytewordsintheTCP
header.Thelength
oftheheadercanbebetween20and60bytes.Therefore,the
value
ofthisfieldcanbebetween5 (5x 4=20)and 15(15x 4=60).
DReserved.Thisisa6-bitfieldreservedforfutureuse.
DControl.Thisfielddefines6differentcontrolbitsorflags asshowninFigure23.17.
Oneormore
ofthesebitscanbesetatatime.
Figure23.17 Controlfield
RST
RST:Resettheconnection
SYN:Synchronizesequencenumbers
FIN:Terminatetheconnection
PSHACK
URG:Urgentpointer isvalid
ACK:Acknowledgmentisvalid
PSH:Requestforpush
URG
SYN
FINI
____01.....-_""""-- _
Thesebitsenableflowcontrol,connectionestablishmentandtermination,connection
abortion,andthemode
ofdatatransferin TCP.Abriefdescription ofeachbitisshownin
Table23.3.
Wewilldiscussthemfurtherwhenwestudythedetailedoperation ofTCP
laterinthechapter.
Table23.3 Descriptionofflagsinthecontrolfield
Flag Description
URG Thevalue oftheurgentpointerfieldisvalid.
ACK Thevalueoftheacknowledgmentfieldisvalid.
PSH Pushthedata.
RST Resettheconnection.
SYN Synchronizesequencenumbersduringconnection.
FIN Terminatetheconnection.
DWindowsize. Thisfielddefinesthesize ofthewindow,inbytes,thattheother
partymustmaintain.Notethatthelength
ofthisfieldis16bits,whichmeansthat
themaximumsize
ofthewindowis65,535bytes. Thisvalueisnormallyreferred
toasthereceivingwindow(rwnd)andisdeterminedbythereceiver.Thesender
mustobeythedictation
ofthereceiverinthis case.
DChecksum.This16-bitfieldcontainsthechecksum.Thecalculation ofthecheck­
sumforTCPfollowsthesameprocedureastheone describedfor
UDP.However,the
inclusion
ofthechecksumintheUDPdatagramisoptional,whereastheinclusion
ofthechecksumforTCPismandatory.Thesamepseudoheader,servingthesame

SECTION23.3TCP 723
purpose,isaddedtothesegment.FortheTCPpseudoheader,thevalueforthepro­
tocolfieldis
6.
oUrgentpointer.Thisl6-bitfield,whichisvalidonly iftheurgentflagisset,is
usedwhenthesegmentcontainsurgentdata.
Itdefinesthenumberthatmustbe
addedtothesequencenumbertoobtainthenumber
ofthelasturgentbyteinthe
datasection
ofthesegment.Thiswillbediscussedlaterinthischapter.
oOptions.Therecanbe upto40bytesofoptionalinformationintheTCPheader.
Wewillnotdiscusstheseoptionshere;pleaserefertothereferencelistformore
information.
ATCPConnection
TCPisconnection-oriented.Aconnection-orientedtransportprotocolestablishesa
virtualpathbetweenthesourceanddestination.Allthesegmentsbelongingtoames­
sagearethensentoverthisvirtualpath.Usingasinglevirtualpathwayfortheentire
messagefacilitatestheacknowledgmentprocess
aswellasretransmissionofdamaged
orlostframes.
Youmaywonderhow TCP,whichusestheservices ofIP,aconnection­
lessprotocol,canbeconnection-oriented.ThepointisthataTCPconnectionisvirtual,
notphysical.TCPoperatesatahigherlevel.TCPusestheservices
ofIPtodeliverindi­
vidualsegmentstothereceiver,butitcontrolstheconnectionitself.
Ifasegmentislost
orcorrupted,itisretransmitted.Unlike
TCP,IPisunaware ofthisretransmission.Ifa
segmentarrivesout
oforder,TCPholdsituntilthemissingsegmentsarrive;IPis
unaware
ofthisreordering.
InTCP,connection-orientedtransmissionrequiresthreephases:connectionestab­
lishment,datatransfer,andconnectiontermination.
ConnectionEstablishment
TCPtransmitsdatainfull-duplexmode.WhentwoTCPsintwomachinesarecon­
nected,theyareabletosendsegmentstoeachothersimultaneously.Thisimpliesthat
eachpartymustinitializecommunicationandgetapprovalfromtheotherpartybefore
anydataaretransferred.
Three-
WayHandshakingTheconnectionestablishmentinTCPiscalled three­
wayhandshaking.Inourexample,anapplicationprogram,calledtheclient,wants to
makeaconnectionwithanotherapplicationprogram,calledtheserver,usingTCP as
thetransportlayerprotocol.
Theprocessstartswiththeserver.TheserverprogramtellsitsTCPthatitisready
toacceptaconnection.Thisiscalledarequestfora
passiveopen. Althoughtheserver
TCPisreadytoacceptanyconnectionfromanymachineintheworld,itcannotmake
theconnectionitself.
Theclientprogramissuesarequestforan
activeopen. Aclientthatwishestocon­
necttoanopenservertellsitsTCPthatitneedstobeconnectedtothatparticular
server.TCPcannowstartthethree-wayhandshakingprocess
asshowninFigure23.18.
Toshowtheprocess,weusetwotimelines:oneateachsite.Eachsegmenthasvalues
forallitsheaderfieldsandperhapsforsome
ofitsoptionfields,too.However,weshow
onlythefewfieldsnecessarytounderstandeachphase.
Weshowthesequencenumber,

724 CHAPTER23PROCESS-TO-PROCESS DELIVERY: UDp,TCP,ANDSCTP
Figure23.18Connectionestablishmentusingthree-wayhandshaking
Client
r
--
A:ACKflag
S:SYNflag
Server
-
Active
open
Time
Passive
gr-~-~~~------l open
Time
theacknowledgmentnumber,thecontrolflags(onlythosethatareset),andthewindow
size,
ifnotempty.Thethreestepsinthisphaseareasfollows.
1.Theclientsendsthefirstsegment,aSYNsegment,inwhichonlytheSYNflag isset.
Thissegment
isforsynchronizationofsequencenumbers. Itconsumesonesequence
number.Whenthedatatransferstarts,thesequencenumberisincrementedby
1.We
cansaythattheSYNsegmentcarriesnorealdata,butwecan thinkofitascontaining
1imaginarybyte.
ASYNsegmentcannotcarrydata, butitconsumesonesequencenumber.
2.Theserversendsthesecondsegment,aSYN +ACKsegment,with2flagbitsset:
SYNandACK.Thissegmenthasadualpurpose.
ItisaSYNsegmentforcommu­
nicationintheotherdirectionandservesastheacknowledgmentfortheSYN
segment.
Itconsumesonesequencenumber.
ASYN+ACKsegmentcannotcarrydata,
butdoesconsumeonesequencenumber.
3.Theclientsendsthethirdsegment.ThisisjustanACKsegment. Itacknowledges
thereceipt
ofthesecond segmentwiththeACKflagandacknowledgmentnumber
field.Note thatthesequencenumberinthissegmentisthesameastheoneinthe
SYNsegment;theACKsegmentdoesnotconsumeanysequencenumbers.
AnACKsegment, ifcarryingnodata,consumesnosequencenumber.

SECTION23.3TCP 725
SimultaneousOpenAraresituation,calledasimultaneousopen,mayoccurwhen
bothprocessesissueanactiveopen.Inthiscase,bothTCPstransmitaSYN
+ACK
segmenttoeachother,andonesingleconnectionisestablishedbetweenthem.
SYNFloodingAttackTheconnectionestablishmentprocedureinTCPissusceptible
toaserioussecurityproblemcalledtheSYNfloodingattack.Thishappenswhenamali­
ciousattackersendsalargenumber
ofSYNsegmentstoaserver,pretendingthateach
ofthemiscorningfromadifferentclientbyfakingthesourceIPaddressesinthedata­
grams.Theserver,assumingthattheclientsareissuinganactiveopen,allocatesthe
necessaryresources,suchascreatingcommunicationtablesandsettingtimers.The
TCPserverthensendstheSYN
+ACKsegmentstothefakeclients,whicharelost.Dur­
ingthistime,however,alot
ofresourcesareoccupiedwithoutbeingused. If,duringthis
shorttime,thenumber
ofSYNsegmentsislarge,theservereventuallyrunsout of
resourcesandmaycrash.ThisSYNfloodingattackbelongstoatype ofsecurityattack
known
asadenial-of-serviceattack,inwhichanattackermonopolizesasystemwith
somanyservicerequeststhatthesystemcollapsesanddeniesservicetoeveryrequest.
Someimplementations
ofTCPhavestrategiestoalleviatethe effects ofaSYN
attack.Somehaveimposedalimitonconnectionrequestsduringaspecifiedperiod
of
time.Othersfilteroutdatagramscomingfromunwantedsourceaddresses.Onerecent
strategyistopostponeresourceallocationuntiltheentireconnectionissetup,using
what
iscalledacookie.SCTP,thenewtransportlayerprotocolthatwediscussinthe
nextsection,usesthisstrategy.
DataTransfer
Afterconnectionisestablished,bidirectional
datatransfercantakeplace.Theclient
andserver
canbothsenddataandacknowledgments. Wewillstudytherules of
acknowledgmentlaterinthechapter;forthemoment,itisenoughtoknowthatdata
travelinginthesamedirection
asanacknowledgmentarecarriedonthesameseg­
ment.Theacknowledgment
ispiggybackedwiththedata.Figure23.19shows anexample.
Inthisexample,afterconnectionisestablished(notshowninthefigure),theclient
sends2000bytes
ofdataintwosegments.Theserverthensends2000bytesinoneseg­
ment.Theclientsendsonemoresegment.Thefirstthreesegmentscarrybothdataand
acknowledgment,butthelastsegmentcarriesonlyanacknowledgmentbecausethere
arenomoredatatobesent.Notethevalues
ofthesequenceandacknowledgment
numbers.ThedatasegmentssentbytheclienthavethePSH(push)flagsetsothatthe
serverTCPknowstodeliverdatatotheserverprocess
assoonastheyarereceived.
Wediscusstheuse ofthisflagingreaterdetaillater.Thesegmentfromtheserver,on
theotherhand,doesnotsetthepushflag.MostTCPimplementationshavetheoption
tosetornotsetthisflag.
Pushing
DataWesawthatthesendingTCPusesabuffertostorethestream ofdata
comingfromthesendingapplicationprogram.ThesendingTCPcanselectthesegment
size.ThereceivingTCPalsobuffersthedatawhentheyarriveanddeliversthemtothe
applicationprogramwhentheapplicationprogramisreadyorwhenitisconvenientfor
thereceivingTCP.Thistype
offlexibilityincreasestheefficiency ofTCP.
However,onoccasiontheapplicationprogramhasnoneedforthis
flexibility_For
example,consider
anapplicationprogramthatcommunicatesinteractivelywithanother

726 CHAPTER 23PROCESS-TO-PROCESS DELIVERY:UDp,TCP,ANDSCTP
Figure23.19 Datatransfer
Server
Client
A:ACKflag
P:PSHflag--
Data
bytes:
8001-9000
Time Time
applicationprogram ontheotherend.Theapplicationprogram ononesitewantsto
sendakeystroketotheapplicationattheothersiteandreceiveanimmediateresponse.
Delayedtransmissionanddelayeddelivery
ofdatamaynotbeacceptablebytheapplica­
tionprogram.
TCPcanhandlesuchasituation.Theapplicationprogramatthesendingsitecan
requesta
pushoperation.ThismeansthatthesendingTCPmustnotwaitforthewindow
tobefilled.
Itmustcreateasegmentandsenditimmediately.ThesendingTCPmust
alsosetthepushbit(PSH)toletthereceivingTCPknowthatthesegmentincludesdata
thatmustbedeliveredtothereceivingapplicationprogramassoonaspossibleandnot
towaitformoredatatocome.
Althoughthepushoperationcanberequestedbytheapplicationprogram,most
currentimplementationsignoresuchrequests.TCPcanchoosewhetherornottouse
thisfeature.
UrgentData TCPisastream-orientedprotocol.Thismeansthatthedataarepresented
fromtheapplicationprogramtoTCP
asastreamofbytes.Eachbyte ofdatahasaposi­
tioninthestream.However,onoccasionanapplicationprogramneedstosend
urgent
bytes.Thismeansthatthesendingapplicationprogramwantsapiece ofdatatoberead
out
oforderbythereceivingapplicationprogram. Asanexample,supposethatthesending

SECTION23.3TCP 727
applicationprogramissendingdatatobeprocessedbythereceivingapplication
program.Whentheresult
ofprocessingcomesback,thesending applicationprogram
findsthateverythingiswrong.
Itwantstoaborttheprocess,butithasalreadysentahuge
amount
ofdata.Ifitissuesanabortcommand(control +C),thesetwocharacterswillbe
storedattheend
ofthereceivingTCPbuffer. Itwillbedeliveredtothereceivingappli­
cationprogramafterallthedatahavebeenprocessed.
ThesolutionistosendasegmentwiththeURGbitset.Thesendingapplication
programtellsthesendingTCPthatthepieceofdataisurgent.ThesendingTCPcreates
asegmentandinsertstheurgentdataatthebeginningofthesegment.Therest
ofthe
segmentcancontainnormaldatafromthebuffer.Theurgentpointerfieldintheheader
definestheend
oftheurgentdataandthestart ofnormaldata.
WhenthereceivingTCPreceivesasegmentwiththeURGbitset,itextractsthe
urgentdatafromthesegment,usingthevalue
oftheurgentpointer,anddeliversthem,
out
oforder,tothereceivingapplicationprogram.
ConnectionTermination
Anyofthetwopartiesinvolvedinexchangingdata(clientorserver)canclosetheconnec­
tion,althoughit
isusuallyinitiatedbytheclient.Mostimplementationstodayallowtwo
optionsforconnectiontermination:three-wayhandshakingandfour-wayhandshaking
withahalf-closeoption.
Three-WayHandshakingMostimplementationstodayallow
three-wayhandshaking
forconnectiontermination asshowninFigure23.20.
1.Inanormalsituation,theclientTCP,after receivingaclosecommandfromthe
clientprocess,sendsthefirstsegment,aFINsegmentinwhichtheFINflagisset.
NotethataFINsegmentcanincludethelastchunk
ofdatasentbytheclient,orit
Figure23.20
Connectionterminationusingthree-wayhandshaking
Client
r_....
Active
close
Time
A:
ACKflag
F:
FINflag
ACK
Server
.-
l:i.:Li::iJ
~
-
Passive
close
Time

728 CHAPTER23PROCESS-TO-PROCESS DELIVERY: UDp,TCp,ANDSCTP
canbejustacontrolsegmentasshowninFigure23.20. Ifitisonlyacontrolseg­
ment,itconsumesonlyonesequencenumber.
TheFINsegmentconsumesonesequencenumber ifitdoesnot carrydata.
2.TheserverTCP,afterreceivingtheFINsegment,informsitsprocess ofthesitua­
tionandsendsthesecondsegment,aFIN
+ACKsegment,toconfirmthereceipt
oftheFINsegmentfromtheclientandatthesametimetoannouncetheclosing of
theconnectionintheotherdirection.Thissegmentcanalsocontainthelastchunk
ofdatafromtheserver. Ifitdoesnotcarrydata,itconsumesonlyonesequence
number.
TheFIN +ACKsegmentconsumesonesequence
number
ifitdoesnotcarrydata.
3.TheclientTCPsendsthelastsegment,anACKsegment,toconfirmthereceipt of
theFINsegmentfromtheTCPserver.Thissegmentcontainstheacknowledgment
number,which
is1plusthesequencenumberreceivedintheFINsegmentfrom
theserver.Thissegmentcannotcarrydataandconsumesnosequencenumbers.
Half-CloseInTCP,oneendcanstopsendingdatawhilestillreceivingdata.This
is
calledahalf-close.Althougheitherendcanissueahalf-close,itisnormallyinitiatedby
theclient.Itcanoccurwhentheserverneedsallthedatabeforeprocessingcanbegin. A
goodexampleissorting.Whenthe clientsendsdatatotheservertobesorted,theserver
needstoreceiveallthedatabeforesortingcanstart.Thismeanstheclient,aftersending
allthedata,canclosetheconnectionintheoutbounddirection.However,theinbound
directionmustremainopentoreceivethesorteddata.Theserver,afterreceivingthe
data,stillneedstimeforsorting;itsoutbounddirectionmustremainopen.
Figure23.21showsanexample
ofahalf-close.Theclienthalf-closestheconnection
bysendingaFINsegment.Theserveracceptsthehalf-closebysendingtheACKsegment.
Thedatatransferfromtheclienttotheserverstops.Theserver,however,canstillsend
data.Whentheserverhassentalltheprocesseddata,itsendsaFINsegment,which
is
acknowledgedbyanACKfromtheclient.
Afterhalf-closing
oftheconnection,datacantravelfromtheservertotheclient
andacknowledgmentscantravelfromtheclienttotheserver.Theclientcannotsendany
moredatatotheserver.Notethesequencenumberswehaveused.Thesecondsegment
(ACK)consumesnosequencenumber.Althoughtheclienthasreceivedsequencenumber
y-1andisexpecting y,theserversequencenumberisstill y-1.Whentheconnection
finallycloses,thesequencenumber
ofthelastACKsegmentisstill x,becauseno
sequencenumbersareconsumedduringdatatransferinthatdirection.
FlowControl
TCPusesaslidingwindow,asdiscussedinChapter11,tohandleflowcontrol.The
slidingwindowprotocolusedbyTCP,however,issomethingbetweenthe
Go-Back-N
andSelectiveRepeatslidingwindow.TheslidingwindowprotocolinTCPlookslike

SECTION23.3TCP 729
Figure23.21Half-close
Server
Client
r
--
Active
close
Time
A:ACKfiag
F:FINflag
f
servertoclient
...Datasegmentsrom
ACknoWled
gmentsfromclienttoserver.
ACK
Passive
close
Time
theGo-Back-Nprotocolbecause itdoesnotuseNAKs;itlookslikeSelectiveRepeat
becausethereceiver holdstheout-of-ordersegmentsuntilthemissingonesarrive.There
aretwobigdifferencesbetweenthisslidingwindowandtheoneweusedatthedata
linklayer.First,theslidingwindow
ofTCPisbyte-oriented;theonewediscussedinthe
datalinklayerisframe-oriented.Second,theTCP'sslidingwindowis
ofvariablesize;
theonewediscussedinthedatalinklayerwas
offixedsize.
Figure23.22showstheslidingwindowinTCP.Thewindowspansaportion
ofthe
buffercontainingbytesreceivedfromtheprocess.Thebytesinsidethewindowarethe
bytesthatcanbeintransit;theycanbesentwithoutworryingaboutacknowledgment.
Theimaginarywindowhastwowalls:oneleftandoneright.
Thewindowis
opened,closed, orshrunk.Thesethreeactivities,aswewillsee,are
inthecontrol
ofthe receiver(anddependoncongestioninthenetwork),notthesender.
Thesendermustobeythecommands
ofthereceiverinthismatter.
Openingawindowmeansmovingtherightwall
totheright.Thisallowsmorenew
bytesinthebufferthatareeligibleforsending.Closingthewindowmeansmovingthe
leftwall
totheright.Thismeansthatsomebyteshavebeenacknowledgedandthesender

730 CHAPTER23PROCESS-TO-PROCESS DELNERY:UDp,TCP,ANDSCTP
Figure23.22Slidingwindow
IWindowsize=minimum(rwnd,cwnd)
p gClosg
Shrinking
I•••In-InIn+ll...1m-IImm+ll...
I
Slidingwindow
in
oenin
neednotworryaboutthemanymore.
Sluinkingthewindowmeansmovingtherightwall
totheleft.Thisisstronglydiscouragedandnotallowed
insomeimplementations
becauseitmeansrevokingtheeligibility
ofsomebytesforsending.Thisisaproblem if
thesenderhasalreadysentthesebytes.Notethattheleftwallcannotmovetotheleft
becausethiswouldrevokesome
ofthepreviouslysentacknowledgments.
Aslidingwindowisusedto maketransmissionmoreefficientas weDas
tocontroltheflow
ofdatasothatthedestinationdoesnotbecome
overwhelmedwithdata.
TCPslidingwindows arebyte-oriented.
Thesizeofthewindowatoneend isdeterminedbythelesser oftwovalues:receiver
window(rwnd)orcongestionwindow(cwnd).Thereceiverwindowisthevalueadver­
tisedbytheoppositeendinasegmentcontainingacknowledgment.
Itisthenumber of
bytestheotherendcanacceptbeforeitsbufferoverflowsanddataarediscarded.The
congestionwindowisavaluedeterminedbythenetworktoavoidcongestion.
Wewill
discusscongestionlaterinthechapter.
Example23.4
Whatisthevalue ofthereceiverwindow (rwnd)forhostA ifthereceiver,hostB,hasabuffer
size
of5000bytesand1000bytes ofreceivedandunprocesseddata?
Solution
Thevalue ofrwnd=5000-1000 =4000.HostBcanreceiveonly4000bytes ofdatabefore
overflowingitsbuffer.HostBadvertisesthisvalueinitsnextsegmentto
A.
Example23.5
Whatisthesize ofthewindowforhostA ifthevalueofrwndis3000bytesandthevalue ofcwnd
is3500bytes?
Solution
Thesizeofthewindowisthesmaller ofrwndandcwnd,whichis3000bytes.
Example23.6
Figure23.23showsanunrealisticexample ofaslidingwindow.Thesenderhassentbytesupto
202.
Weassumethatcwndis20(inrealitythisvalueisthousands ofbytes).Thereceiverhassent

SECTION23.3TCP 731
Figure23.23 Example23.6
Windowsize=minimum(20, 9 )=9
Sent,not
acknowledgedICanbesentinunediately
~~,. ~.~ ~"~c"':c-c:: "
1•••11992001201120212031204120520612071208 2091•••1
~'= ·YT"""
Sentand
acknowledged •
Nextbytetobesent
Can'tbe
sentuntilwindow
opens
anacknowledgmentnumber of200withan rwndof9bytes(inrealitythisvalueisthousands of
bytes).Thesize ofthesenderwindowistheminimum ofrwndandcwnd,or9bytes.Bytes200to
202aresent,butnotacknowledged.Bytes203to208canbesentwithout worryingabout
acknowledgment.Bytes209andabovecannotbesent.
Somepoints
aboutTCPslidingwindows:
oThesizeofthewindowisthelesser ofrwndandcwnd.
oThesourcedoesnothavetosendafullwindow'sworth ofdata.
oThewindowcanbeopened orclosedbythereceiver,butshouldnotbeshrunk.
oThedestinationcansendanacknowledgmentatanytime aslongasitdoesnotresultin
ashrinkingwindow.
oThereceivercantemporarilyshutdownthewindow;thesender,however,canalways
sendasegment
of1byteafterthewindowisshutdown.
ErrorControl
TCPisareliabletransportlayerprotocol.Thismeansthat anapplicationprogramthat
deliversastream
ofdatatoTCPreliesonTCPtodelivertheentirestream totheappli­
cationprogramontheotherendin
order,withouterror,andwithoutanypartlostor
duplicated.
TCPprovidesreliabilityusingerrorcontrol.Errorcontrolincludesmechanismsfor
detectingcorruptedsegments,lostsegments,out-of-ordersegments,andduplicated
segments.Errorcontrolalsoincludesamechanismforcorrectingerrorsaftertheyare
detected.ErrordetectionandcorrectioninTCPisachievedthroughtheuse
ofthree
simpletools:checksum,acknowledgment,andtime-out.
Checksum
Eachsegmentincludesachecksumfieldwhich isusedtocheckforacorruptedsegment.
Ifthesegmentiscorrupted,it isdiscardedbythedestinationTCPandisconsidered
aslost.TCPusesa16-bitchecksumthatismandatoryineverysegment. Wewill
see,in
Chapter24,thatthe16-bitchecksumisconsideredinadequateforthenewtransport

732 CHAPTER 23PROCESS-TO-PROCESS DELIVERY: UDp,TCp,ANDSCTP
layer,SCTP.However,itcannotbechangedforTCPbecausethiswouldinvolverecon­
figuration
oftheentireheaderformat.
Acknowledgment
TCPusesacknowledgmentstoconfirmthereceipt ofdatasegments.Controlsegments
thatcarry
nodatabutconsumeasequencenumberarealsoacknowledged.ACKsegments
areneveracknowledged.
ACKsegmentsdo notconsumesequence numbersandarenotacknowledged.
Retransmission
Theheartoftheerrorcontrolmechanismistheretransmission ofsegments.Whena
segmentiscorrupted,lost,ordelayed,itisretransmitted.Inmodernimplementations,a
segment
isretransmittedontwooccasions:whena retransmissiontimerexpiresor
whenthesenderreceivesthreeduplicateACKs.
Inmodernimplementations,aretransmissionoccurs iftheretransmission
timerexpiresorthreeduplicateACKsegmentshavearrived.
Notethatnoretransmissionoccursforsegmentsthatdonotconsumesequence
numbers.Inparticular,thereisnotransmissionforanACKsegment.
Noretransmissiontimerissetfor anACKsegment.
RetransmissionAfterRTOArecentimplementation ofTCPmaintainsoneretrans­
mission
time-out(RTO)timerforalloutstanding(sent,butnotacknowledged)seg­
ments.Whenthetimermatures,theearliestoutstandingsegment
isretransmittedeven
thoughlack
ofareceivedACKcanbeduetoadelayedsegment,adelayedACK,oralost
acknowledgment.Notethatnotime-outtimerissetforasegmentthatcarriesonlyan
acknowledgment,whichmeansthatnosuchsegmentisresent.Thevalue
ofRTOis
dynamicinTCPandisupdatedbasedonthe
round-triptime(RTT) ofsegments.An
RTIisthetimeneededforasegmenttoreachadestinationandforanacknowledgment
tobereceived.Itusesaback-offstrategysimilar toonediscussedinChapter 12.
RetransmissionAfterThreeDuplicateACKSegmentsThepreviousruleabout
retransmissionofasegmentissufficient ifthevalueofRTOisnotverylarge.Sometimes,
however,onesegmentislostandthereceiverreceivessomanyout-of-ordersegments
thattheycannotbesaved(limitedbuffersize).
Toalleviatethissituation,mostimple­
mentationstodayfollowthethree-duplicate-ACKsruleandretransmitthemissing
segmentimmediately.Thisfeatureisreferredtoasfastretransmission,whichwewill
seeinanexampleshortly.
Out-oj-OrderSegments
Whenasegmentisdelayed,lost,ordiscarded,thesegmentsfollowingthatsegmentarrive
out
oforder.Originally,TCPwasdesignedtodiscard allout-of-ordersegments,resulting

SECTION23.3TCP 733
intheretransmissionofthemissingsegmentandthefollowingsegments.Mostimple­
mentationstodaydonotdiscardtheout-of-ordersegments.Theystorethemtemporarily
and
flagthemasout-of-ordersegmentsuntilthemissingsegmentarrives.Note,however,
thattheout-of-ordersegmentsarenotdeliveredtotheprocess.TCPguaranteesthatdata
aredeliveredtotheprocessinorder.
Datamayarrive outoforderandbetemporarilystoredbythereceivingTCP,
butyepguaranteesthatnoout-of-ordersegmentisdeliveredtotheprocess.
SomeScenarios
Inthissectionwegivesomeexamplesofscenariosthatoccurduringtheoperationof
TCP.Inthesescenarios,weshowasegmentbyarectangle. Ifthesegmentcarriesdata,
weshowtherangeofbytenumbersandthevalueoftheacknowledgmentfield.
Ifit
carriesonlyanacknowledgment,weshowonlytheacknowledgmentnumberina
smallerbox.
NormalOperationThefirstscenarioshowsbidirectionaldatatransferbetweentwo
systems,asinFigure23.24.TheclientTCPsendsonesegment;theserverTCPsends
three.Thefigureshowswhichruleappliestoeachacknowledgment.Therearedatato
besent,sothesegmentdisplaysthenextbyteexpected.Whentheclientreceivesthe
firstsegmentfromtheserver,itdoesnothaveanymoredata
tosend;itsends onlyan
Figure23.24
Nonnaloperation
Server
Client
_....
Seq:1201-1400
Act:4001
Time
Seq:4001-5000
Ack:1401
Seq:5001--6000
Ack:1401
Seq:6001-7000
Ack:1401
Time

734 CHAPTER 23PROCESS-TO-PROCESS DELIVERY: UDp,TCp,ANDSCTP
ACKsegment.However,theacknowledgmentneedsto bedelayedfor500mstosee if
anymoresegmentsarrive. Whenthetimermatures,ittriggersanacknowledgment.
Thisissobecausetheclienthas
noknowledgeifothersegmentsarecoming;itcannot
delaytheacknowledgmentforever.
Whenthenextsegmentarrives,anotheracknowl­
edgmenttimerisset.However,before
itmatures,thethirdsegmentarrives. Thearrival
ofthethirdsegmenttriggersanotheracknowledgment.
LostSegmentInthisscenario,weshow whathappenswhenasegmentislost orcor­
rupted.Alostsegmentandacorruptedsegmentaretreatedthesamewaybythe
receiver.Alostsegmentisdiscardedsomewhereinthenetwork;acorruptedsegmentis
discarded
bythereceiveritself. Bothareconsideredlost.Figure23.25showsasitua­
tioninwhichasegmentislostanddiscarded bysomerouterinthenetwork,perhaps
duetocongestion.
Figure23.25Lostsegment
Receiver
buffer
Out
oforder
Gap
~
IIIII
Receiver
1"""
Seq:801-900
Ack:x
Seq:70l-800
Ack:x
Seq:501-600
:=::;=A:=c:.=k::::x:::::=!-.----------1------1L..O.l..--_-----1
Seq:601-700
Ack:'x Ack:701 -----1'-.1-1-,-I_-----1
--
Sender
1"""
RTO
Time Time
Weareassumingthatdatatransferisunidirectional:onesiteissending,theotheris
receiving.In
ourscenario,thesendersendssegments1 and2,whichareacknowledged
immediatelyby
anACK.Segment3,however,islost. Thereceiverreceivessegment4,
whichis
outoforder.Thereceiverstoresthedatainthesegment initsbufferbutleaves
agaptoindicatethatthereis
nocontinuityinthedata.Thereceiverimmediatelysends
anacknowledgmentto thesender,displaying thenextbyteitexpects.Notethatthe
receiverstoresbytes801to900,butneverdeliversthesebytestotheapplicationuntil
thegapisfilled.
ThereceiverTCPdeliversonlyordered datatotheprocess.

SECTION23.3TCP 735
Wehaveshownthetimerfortheearliestoutstandingsegment.Thetimerforthis
definitelyrunsoutbecausethereceivernever sendsanacknowledgmentforlostorout­
of-ordersegments.Whenthetimermatures,thesendingTCPresendssegment
3,which
arrivesthistimeandisacknowledgedproperly.Notethatthevalueinthesecondand
thirdacknowledgmentsdiffersaccordingtothecorrespondingrule.
FastRetransmission Inthisscenario,wewanttoshowtheidea offastretransmis­
sion.Ourscenarioisthesame
asthesecondexceptthatthe RTOhasahighervalue(see
Figure23.26).
Figure23.26 Fastretransmission
Sender
r
Seq:101-200
Ack:x
Seq:201~3oo
Ack:x
Seq:301-400
Ack:x
Seq:401-500
Ack:x
Seq:501-600
Ack:x
3ACKs--
Time
Lost
Receiver
r
Receiver
buffer
IIII
Allinorder
Time
Whenthereceiverreceivesthefourth,fifth,andsixthsegments,ittriggersan
acknowledgment.Thesenderreceivesfouracknowledgmentswiththesamevalue(three
duplicates).Althoughthetimerforsegment3hasnotmaturedyet,thefasttransmission
requiresthatsegment
3,thesegmentthatisexpectedbyalltheseacknowledgments,be
resentimmediately.
Notethatonlyonesegmentisretransmittedalthoughfoursegmentsarenot
acknowledged.WhenthesenderreceivestheretransmittedACK,itknowsthatthefour
segmentsaresafeandsoundbecauseacknowledgment
iscumulative.
CongestionControl
WediscusscongestioncontrolofTCPinChapter24.

736 CHAPTER 23PROCESS-TO-PROCESS DELIVERY: UDp,TCp,ANDSCTP
23.4SCTP
StreamControlTransmissionProtocol(SCTP)isanewreliable,message-oriented
transportlayerprotocol.SCTP,however,ismostlydesignedforInternetapplications
thathaverecentlybeenintroduced.Thesenewapplications,such
asIUA(ISDNover
IP),M2UAandM3UA(telephonysignaling),H.248(mediagatewaycontrol),H.323
(IPtelephony),andSIP(IPtelephony),needamoresophisticatedservicethanTCPcan
provide.SCTPprovidesthisenhancedperformanceandreliability.
Webrieflycompare
UDP,TCP,andSCTP:
oUDPisamessage-orientedprotocol.Aprocessdeliversamessageto UDP,which
isencapsulatedinauserdatagramandsentoverthenetwork.UDP
conservesthe
messageboundaries;
eachmessage isindependentofanyothermessage.Thisisa
desirablefeaturewhenwearedealingwithapplicationssuch
asIPtelephonyand
transmission
ofreal-timedata,aswewillseelaterinthetext.However,UDPis
unreliable;thesendercannotknowthedestiny
ofmessagessent.Amessagecanbe
lost,duplicated,
orreceivedout oforder.UDPalsolackssomeotherfeatures,such
ascongestioncontroland flowcontrol,neededforafriendlytransportlayerprotocol.
oTCPisa byte-orientedprotocol.Itreceivesamessageormessagesfromapro­
cess,storesthem
asastreamofbytes,andsendstheminsegments.Thereisno
preservation
ofthemessageboundaries.However,TCPisareliableprotocol.
Theduplicatesegmentsaredetected,thelostsegmentsareresent,andthebytes
aredeliveredtotheendprocessinorder.TCPalsohascongestioncontroland
flowcontrolmechanisms.
oSCTPcombinesthebestfeatures ofUDPand TCP.SCTPisareliablemessage­
orientedprotocol.Itpreservesthemessageboundariesandatthesametimedetects
lostdata,duplicatedata,andout-of-orderdata.
Italsohascongestioncontroland
flowcontrolmechanisms.Later
wewillseethatSCTPhasotherinnovativefeatures
unavailableinUDPand
TCP.
SCTPisamessage-oriented,reliable protocolthat
combinesthebestfeatures ofUDPandTCP.
SCTPServices
Beforewediscusstheoperation ofSCTP,letusexplaintheservicesofferedbySCTPto
theapplicationlayerprocesses.
Process-to-ProcessCommunication
SCTPusesallwell-knownportsintheTCPspace.Table23.4listssomeextraport
numbersusedbySCTP.
MultipleStreams
WelearnedintheprevioussectionthatTCPisastream-orientedprotocol.Eachcon­
nectionbetweenaTCPclientandaTCPserverinvolvesonesinglestream.Theproblem

SECTION23.4SCTP 737
Table23.4 SomeSCTPapplications
Protocol PortNumber Description
IVA 9990 ISDN overIP
M2UA 2904 SS7telephonysignaling
M3UA 2905 SS7telephonysignaling
H.248 2945 Mediagatewaycontrol
H.323 1718,1719,1720,11720IPtelephony
SIP 5060 IPtelephony
withthisapproachisthatalossatanypointinthestreamblocksthedelivery oftherest
ofthedata.Thiscanbeacceptablewhenwearetransferringtext;itisnotwhenweare
sendingreal-timedatasuchasaudioorvideo.SCTPallows
multistreamservicein
eachconnection,whichiscalledassociationinSCTPterminology. Ifoneofthestreams
isblocked,theotherstreamscanstilldelivertheirdata.Theideaissimilartomultiple
lanesonahighway.Eachlanecanbeusedforadifferenttype
oftraffic.Forexample,
onelanecanbeusedforregulartraffic,anotherforcarpools.
Ifthetrafficisblockedfor
regularvehicles,carpoolvehiclescanstillreachtheirdestinations.Figure
23.27shows
theidea
ofmultiple-streamdelivery.
Figure23.27Multiple-streamconcept
Receiving
process
Sending
process
D D

~.
"')""

·•
..\
SCTP

SCTP
AnassociationinSCTPcaninvolvemultiplestreams.
Multihoming
ATCPconnectioninvolvesonesourceandonedestinationIPaddress.Thismeansthat
even
ifthesenderorreceiverisamultihomedhost(connectedtomorethanonephysi­
caladdresswithmultipleIPaddresses),onlyone
oftheseIPaddressesperendcanbe
utilizedduringtheconnection.AnSCTPassociation,onthe
otherhand,supports
multihomingservice.ThesendingandreceivinghostcandefinemultipleIPaddresses
ineachendforanassociation.
Inthisfault-tolerantapproach,whenonepathfails,
anotherinterfacecanbeusedfordatadeliverywithoutinterruption.Thisfault-tolerant

738 CHAPTER23PROCESS-TO-PROCESS DELIVERY: UDP,TCP,ANDseTP
featureisveryhelpfulwhenwearesendingandreceivingareal-timepayloadsuch as
Internettelephony.Figure23.28showstheidea ofmultihoming.
Figure23.28Multihomingconcept
Client
r
Internet
Server
­
.-.
InFigure23.28,theclientisconnectedtotwolocalnetworkswithtwoIPaddresses.
TheserverisalsoconnectedtotwonetworkswithtwoIPaddresses.Theclientandthe
servercanmakeanassociation,using fourdifferentpairsofIPaddresses.However,note
thatinthecurrentimplementations
ofSCTP,onlyonepair ofIFaddressescanbechosen
fornormalcommunication;thealternativeisused
ifthemainchoicefails.Inother
words,atpresent,SCTPdoesnotallowloadsharingbetweendifferentpaths.
SCTPassociationallowsmultiple IPaddressesforeachend.
Full-DuplexCommunication
LikeTCP,SCTPoffersfull-duplexservice,inwhichdatacanflowinbothdirectionsat
thesametime.EachSCTPthen hasasendingandreceivingbuffer,andpacketsaresent
inbothdirections.
Connection-OrientedService
LikeTCP,SCTPisaconnection-orientedprotocol.However,inSCTP,aconnectionis
calledanassociation.WhenaprocessatsiteAwantstosendandreceivedatafrom
anotherprocessatsiteB,thefollowingoccurs:
1.ThetwoSCTPsestablishanassociationbetweeneachother.
2.Dataareexchangedinbothdirections.
3.Theassociationisterminated.
ReliableService
SCTP,likeTCP,
isareliabletransportprotocol.Itusesanacknowledgmentmechanism
tocheckthesafeandsoundarrival
ofdata.Wewilldiscussthisfeaturefurtherinthe
sectiononerrorcontrol.
SCTPFeatures
LetusfirstdiscussthegeneralfeaturesofSCTPandthencomparethemwiththoseofTCP.

SECTION23.4SCTP 739
TransmissionSequenceNumber
TheunitofdatainTCP isabyte.DatatransferinTCP iscontrolledbynumberingbytes
byusingasequencenumber.Ontheotherhand,theunit
ofdatainSCTP isaDATAchunk
whichmayormaynothaveaone-to-onerelationshipwiththemessagecomingfromthe
processbecause
offragmentation(discussedlater),DatatransferinSCTP iscontrolled
bynumberingthedatachunks.SCTPusesa
transmissionsequence number(TSN)to
numberthedatachunks.Inotherwords,theTSNinSCTPplaystheanalogousroleto
thesequencenumberin
TCP.TSNsare32bitslongandrandomlyinitializedbetween0
and2
32
-
1.EachdatachunkmustcarrythecorrespondingTSNinitsheader.
In
SCTP,adatachunkisnumberedusinga TSN.
StreamIdentifier
InTCP,thereisonlyonestreamineachconnection.InSCTP,theremaybeseveral
streamsineachassociation.EachstreaminSCTPneedsto
beidentifiedbyusinga
streamidentifier(SI). EachdatachunkmustcarrytheSIinitsheadersothatwhenit
arrivesatthedestination,itcanbeproperlyplacedinitsstream.The
51isa16-bitnumber
startingfrom
O.
Todistinguishbetweendifferentstreams,SCTPuses anSI.
StreamSequenceNumber
WhenadatachunkarrivesatthedestinationSCTP, itisdeliveredtotheappropriate
streamandintheproperorder.Thismeansthat,inadditiontoanSI,SCTPdefineseach
datachunkineachstreamwitha
streamsequencenumber(SSN).
Todistinguishbetweendifferent datachunksbelonging
tothesamestream,SCTPusesSSNs.
Packets
InTCP,asegmentcarriesdataandcontrolinformation.Dataarecarriedasacollection
ofbytes;controlinformationisdefinedbysixcontrolflagsintheheader.Thedesign of
SCTPistotallydifferent:dataarecarriedasdatachunks,controlinformationiscarried
ascontrolchunks.Severalcontrolchunksanddatachunkscanbepackedtogetherina
packet.Apacket
inSCTPplaysthesamerole asasegmentin TCP.Figure23.29compares
asegmentinTCPandapacketinSCTP.Letusbriefly listthedifferencesbetweenan
SCTPpacketandaTCPsegment:
TCPhassegments;SCTPhaspackets.
1.ThecontrolinformationinTCPispart oftheheader;thecontrolinformationin
SCTPisincludedinthecontrolchunks.Thereareseveraltypes
ofcontrolchunks;
each
isusedforadifferentpurpose.

740 CHAPTER 23PROCESS-TO-PROCESS DELIVERY: UDp,TCp,ANDSCTP
Figure23.29 ComparisonbetweenaTCPsegment andanSCTPpacket
Checksum
]
§oControlchunks ;:
J;
SourceportaddressDestinationportaddress] "":~
Verificationtag ~
ro[.,
Cl
AsegmentinTCP ApacketinSCTP
2.ThedatainaTCPsegmenttreatedasoneentity;anSCTPpacketcancarryseveral
datachunks;eachcanbelong
toadifferentstream.
3.Theoptionssection,whichcanbepartofaTCPsegment,doesnotexistinan
SCTPpacket.OptionsinSCTParehandledbydefiningnewchunktypes.
4.ThemandatorypartoftheTCPheaderis20bytes,whilethegeneralheaderin
SCTPisonly
12bytes.TheSCTPheaderisshorterdue tothefollowing:
a.AnSCTPsequencenumber(TSN)belongs toeachdatachunkandhence is
locatedinthechunk'sheader.
b.Theacknowledgmentnumberandwindowsizearepartofeachcontrolchunk.
c.Thereisnoneedforaheaderlengthfield(shownasHLintheTCPsegment)
becausetherearenooptionstomakethelength
oftheheadervariable;the
SCTPheaderlengthisfixed(12bytes).
d.ThereisnoneedforanurgentpointerinSCTP.
5.ThechecksuminTCPis 16bits;inSCTP,itis32bits.
6.TheverificationtaginSCTPisanassociationidentifier,whichdoesnotexistin
TCP.InTCP,thecombination
ofIPandportaddressesdefinesaconnection;in
SCTPwemayhavemultihorningusingdifferentIPaddresses.Auniqueverification
tagisneededtodefineeachassociation.
7.TCPincludesonesequencenumberintheheader,whichdefinesthenumberofthe
firstbyteinthedatasection.AnSCTPpacketcanincludeseveraldifferentdata
chunks.TSNs,SIs,andSSNsdefineeachdatachunk.
8.SomesegmentsinTCPthatcarrycontrolinformation(such asSYNandFIN)need
toconsumeonesequencenumber;controlchunksinSCTPneveruseaTSN,SI,or
SSN.Thesethreeidentifiersbelongonlytodatachunks,not
tothewholepacket.
InSCTP,controlinformation anddatainformationarecarriedinseparatechunks.
InSCTP,wehavedatachunks,streams,andpackets. Anassociationmaysendmany
packets,apacketmaycontainseveralchunks,andchunksmaybelongtodifferent
streams.
Tomakethedefinitions ofthesetermsclear,letussupposethatprocessA
needs
tosend11messagestoprocessBinthreestreams.Thefirstfourmessagesarein

SECTION23.4SCTP 741
thefirststream,thesecondthreemessagesareinthesecondstream,andthelastfour
messagesareinthethirdstream.
Althoughamessage,
iflong,canbecarriedbyseveraldatachunks,weassumethat
eachmessage
fitsintoonedatachunk.Therefore,wehave 11datachunks inthreestreams.
Theapplicationprocessdelivers
11messagestoSCTP,whereeachmessageis
ear­
markedfortheappropriatestream.Althoughtheprocesscoulddeliveronemessagefrom
thefirststreamandthenanotherfromthesecond,weassumethatitdeliversallmessages
belongingtothefirststreamfirst,
allmessagesbelongingtothesecondstreamnext,and
finally,allmessagesbelongingtothelaststream.
Wealsoassumethatthenetworkallowsonlythreedatachunksperpacket,which
meansthatwe
need.fourpacketsasshowninFigure23.30.Datachunksinstream0are
carried
inthefirstpacketandpart ofthesecondpacket;thoseinstream1arecarried in
thesecondandthirdpackets;thoseinstream2arecarriedinthethirdandfourthpackets.
Figure23.30Packet,datachunks, andstreams
Firstpacket
Controlchunks
TSN:101
SI:OSSN:0
TSN:102
SI:OSSN:1
TSN:103
'-SI:0SSN:2
Secondpacket
~~~~r:~;{?~i
Controlchunks
T5N:104
SI:OSSN:3
TSN:105
SI:1SSN:0
TSN:106
'-SI:1SSN:1
Thirdpacket
~~f~j~~~t\~r~~f£~
Controlchunks
TSN:107
SI:1SSN:2
::rSN:108
SI:2SSN:0
TSN:109
SI:2SSN:1
Fourthpacket
Controlchunks
TSN:llO
SI:2SSN:2
TSN:III
51:2SSN:3
Flowofpacketsfromsendertoreceiver
Notethateachdatachunkneedsthreeidentifiers:TSN,SI,andSSN.TSNisa
cumulativenumberandisused,aswewillseelater,forflowcontrolanderrorcontrol.
SIdefinesthestreamtowhichthechunkbelongs.SSNdefinesthechunk'sorderina
particularstream.
Inourexample,SSNstartsfrom0foreachstream.
Datachunksareidentifiedbythreeitems:TSN,SI, andSSN.
TSNisacumulative
numberidentifyingtheassociation;
SIdefinesthestream;SSNdefinesthechunk inastream.
AcknowledgmentNumber
TCPacknowledgmentnumbersarebyte-orientedandrefertothesequencenumbers.
SCTPacknowledgmentnumbersarechunk-oriented.TheyrefertotheTSN.Asecond
differencebetweenTCPandSCTPacknowledgmentsisthecontrolinformation.Recall
thatthisinformationispart
ofthesegmentheaderinTCP. Toacknowledgesegments
thatcarryonlycontrolinformation,TCPusesasequencenumberandacknowledgment
number(forexample,aSYNsegmentneedstobeacknowledgedbyanACKsegment).
InSCTP,however,thecontrolinformationiscarriedbycontrolchunks,whichdonot

742 CHAPTER 23PROCESS-TO-PROCESSDELIVERY: UDp,TCp,ANDSCTP
needaTSN.Thesecontrolchunksareacknowledged byanothercontrolchunk ofthe
appropriatetype(someneednoacknowledgment).Forexample,anINITcontrolchunk
isacknowledged
byanINITACKchunk.Thereisnoneedforasequencenumberoran
acknowledgmentnumber.
In
SCTP,acknowledgmentnumbers areusedtoacknowledgeonlydatachunks;
controlchunksareacknowledged
byothercontrolchunks ifnecessary.
FlowControl
LikeTCP,SCTPimplementsflowcontroltoavoidoverwhelmingthereceiver.Wewill
discuss
SCTPflowcontrollater inthechapter.
ErrorControl
LikeTCP, SCTPimplementserrorcontroltoprovidereliability. TSNnumbersand
acknowledgmentnumbersareusedforerrorcontrol.Wewilldiscusserrorcontrollater
inthechapter.
CongestionControl
LikeTCP, SCTPimplementscongestion controltodeterminehowmanydatachunks
can
beinjectedintothenetwork.WewilldiscusscongestioncontrolinChapter24.
PacketFormat
Inthissection,weshowtheformat ofapacketanddifferenttypes ofchunks.Most of
theinformationpresented inthissectionwillbecomeclearlater;thissectioncanbe
skippedinthefirstreadingorusedonlyasareference.
AnSCTPpackethasamandatory
generalheaderandaset
ofblockscalledchunks.Therearetwotypes ofchunks:control
chunksanddatachunks.Acontrolchunkcontrolsandmaintainsthe association;adata
chunkcarriesuserdata.Inapacket,thecontrolchunkscornebeforethedatachunks.
Figure23.31showsthegeneralformat
ofanSCTPpacket.
Figure23.31SCTPpacketformat
Generalheader
(12bytes)
-,
Chunkt.
;
", (variable:length)
···
Ch.UJ;!k:N
(variable'length)"
" ".-

SECTION23.4SCTP 743
InanSCTPpacket,controlchunkscomebeforedatachunks.
GeneralHeader
Thegeneralheader (packetheader)definestheendpoints ofeachassociationtowhich
thepacketbelongs,guaranteesthatthepacketbelongstoaparticularassociation,and
preservestheintegrity
ofthecontentsofthepacketincludingtheheaderitself.Thefonnat
ofthegeneralheaderisshowninFigure23.32.
Figure23.32 Generalheader
Sourceportaddress
I
Destinationportaddress
16bits 16bits
Verificationtag
32bits
Checksum
32bits
Therearefourfieldsinthegeneralheader:
oSourceportaddress.Thisisa16-bitfieldthatdefinesthe portnumberofthepro­
cesssendingthepacket.
oDestinationportaddress.Thisisa16-bitfieldthatdefinestheport numberofthe
processreceivingthepacket.
oVerificationtag. Thisisanumberthatmatchesapacketto anassociation.This
preventsapacketfromapreviousassociationfrombeingmistakenasapacketin
thisassociation.Itservesasanidentifierfortheassociation;itisrepeatedinevery
packetduringtheassociation.Thereisaseparateverificationusedforeachdirection
intheassociation.
oChecksum.This32-bitfieldcontainsaCRC-32checksum.Notethatthesize of
thechecksumisincreasedfrom16(inUDP,TCP,andIP)to32bits toallowthe
use
oftheCRC-32checksum.
Chunks
Controlinfonnation oruserdataarecarriedinchunks.Thedetailedfonnat ofeachchunk
isbeyondthescope
ofthisbook.See[For06]fordetails. Thefirstthreefieldsarecom­
montoallchunks;theinformationfielddependsonthetype
ofchunk.Theimportant
pointtorememberisthatSCTPrequirestheinformationsection tobeamultipleof
4bytes;ifnot,paddingbytes(eightas)areaddedattheend ofthesection.SeeTable23.5
foralist
ofchunksandtheirdescriptions.
AnSCTPAssociation
SCTP,likeTCP,isaconnection-orientedprotocol.However,aconnectionin SCTPis
calledan
associationtoemphasizemultihoming.

744 CHAPTER 23PROCESS-TO-PROCESS DEliVERY:UDp,TCp' ANDSCTP
Table23.5Chunks
Type Chunk Description
0 DATA Userdata
1 INIT Setsupanassociation
2 INITACK AcknowledgesINITchunk
3 SACK Selectiveacknowledgment
4 HEARTBEAT Probesthepeerforliveliness
5 HEARTBEATACK AcknowledgesHEARTBEATchunk
6 ABORT Abortsanassociation
7 SHUTDOWN Terminatesanassociation
8 SHUTDOWNACK AcknowledgesSHUTDOWN chunk
9 ERROR Reportserrorswithoutshuttingdown
10 COOKIEECHO Thirdpacketinassociationestablishment
11 COOKIEACK AcknowledgesCOOKIEECHOchunk
14 SHUTDOWN COMPLETE Thirdpacketinassociationtermination
192 FORWARDTSN ForadjustingcumulativeTSN
Aconnectionin SCTPiscalledanassociation.
AssociationEstablishment
AssociationestablishmentinSCTPrequiresa four-wayhandshake.Inthisproce­
dure,aprocess,normallyaclient,wants toestablishanassociationwithanotherprocess,
normallyaserver,using SCTPasthetransportlayerprotocol.SimilartoTCP,the
SCTPserverneedstobepreparedtoreceiveanyassociation(passiveopen).Associa­
tionestablishment,however,isinitiated
bytheclient(activeopen). SCTPassociation
establishmentisshown
inFigure23.33.Thesteps, inanormalsituation,areasfollows:
1.Theclientsendsthefirstpacket,whichcontainsan INITchunk.
2.Theserversendsthesecondpacket,whichcontainsan INITACKchunk.
3.Theclientsendsthethirdpacket,whichincludesa COOKIEECHOchunk.This
isaverysimplechunkthatechoes,withoutchange,thecookiesentbytheserver.
SCTPallowstheinclusion ofdatachunks inthispacket.
4.Theserversendsthefourthpacket,whichincludesthe
COOKIEACKchunkthat
acknowledgesthereceipt
oftheCOOKIE ECHOchunk.SCTPallowstheinclusion
ofdatachunkswiththispacket.
Nootherchunkisallowed inapacketcarrying anINITorINITACKchunk.
ACOOKIE
ECHOoraCOOKIEACKchunkcan carrydatachunks.
CookieWediscusseda SYNfloodingattack intheprevioussection.WithTCP,a
maliciousattackercanflooda
TCPserverwithahugenumber ofphonySYNsegments
usingdifferentforgedIPaddresses.Eachtimetheserverreceivesa
SYNsegment,it

SECTION23.4SCTP 745
Figure23.33 Four-wayhandshaking
Client
r
--
INIT
COOKIEECHO
Cookie
Time
INITACK
Cookie
COOKIEACK
Server
~
Time
setsupastatetableandallocatesotherresourceswhilewaitingforthenextsegmentto
arrive.Afterawhile,however,theservermaycollapsedue
totheexhaustionofresources.
Thedesigners
ofSCTPhaveastrategytopreventthistype ofattack.Thestrategy
istopostponetheallocation
ofresourcesuntilthereception ofthethirdpacket,when
theIPaddress
ofthesenderisverified.Theinformationreceivedinthefirstpacketmust
somehowbesaveduntilthethirdpacketarrives.But
iftheserversavedtheinformation,
thatwouldrequiretheallocation
ofresources(memory);thisisthedilemma.Thesolution
istopacktheinformationandsenditbacktotheclient.Thisiscalledgeneratinga
cookie.Thecookieissentwiththesecondpackettotheaddressreceivedinthefirst
packet.Therearetwopotentialsituations.
1.Ifthesenderofthefirstpacketisanattacker,theserverneverreceivesthethird
packet;thecookie
islostandnoresourcesareallocated.Theonlyeffortforthe
serveris"baking"the cookie.
2.Ifthesender ofthefirstpacketisanhonestclientthatneedstomakeaconnection,
itreceivesthesecondpacket,withthecookie.
Itsendsapacket(thirdintheseries)
withthecookie,withnochanges.Theserverreceivesthethirdpacketandknows
thatithascomefromanhonestclientbecausethecookiethatthesenderhassentis
there.Theservercannowallocateresources.
Theabovestrategyworks
ifnoentitycan"eat"acookie"baked"bytheserver. Toguar­
anteethis,theservercreatesadigest(seeChapter30)fromtheinformation,usingits
ownsecret
key.Theinformationandthedigesttogethermakethe cookie,whichissent
totheclientinthesecondpacket.Whenthecookieisreturnedinthethirdpacket,the
servercalculatesthedigestfromtheinformation.
Ifthedigestmatchestheonethatis
sent,thecookiehasnotbeenchangedbyanyotherentity.
DataTransfer
Thewholepurpose ofanassociationistotransferdatabetweentwoends.Afterthe
associationisestablished,bidirectionaldatatransfercantakeplace.Theclientandthe
servercanbothsenddata.Like
TCP,SCTPsupportspiggybacking.

746 CHAPTER 23PROCESS-TO-PROCESS DELNERY:UDp,TCp,ANDSCTP
Thereisamajordifference,however,betweendatatransferinTCPandSCTP.TCP
receivesmessagesfromaprocessasastream
ofbyteswithoutrecognizinganyboundary
betweenthem.Theprocessmayinsertsomeboundariesforitspeeruse,butTCPtreats
thatmarkaspart
ofthetext.In otherwords,TCPtakeseachmessageandappendsitto
itsbuffer.Asegmentcancarryparts
oftwodifferentmessages.Theonlyorderingsys­
temimposedbyTCPisthebytenumbers.
SCTP,ontheotherhand,recognizesandmaintainsboundaries.Eachmessagecom­
ingfromtheprocessistreatedasoneunitandinsertedintoa
DATAchunkunlessit is
fragmented(discussedlater).Inthissense,SCTPislikeUDP,withonebigadvantage:
datachunksarerelatedtoeachother.
Amessagereceivedfromaprocessbecomesa
DATAchunk,orchunks iffrag­
mented,byaddinga
DATAchunkheader tothemessage.Each DATAchunkformedby
amessageorafragment
ofamessagehasoneTSN.Weneedtorememberthatonly
DATAchunksuseTSNsandonly DATAchunksareacknowledgedbySACKchunks.
InSCTP,only DATAchunksconsumeTSNs;
DATAchunksaretheonlychunks thatareacknowledged.
LetusshowasimplescenarioinFigure23.34.Inthisfigureaclientsendsfour
DATAchunksandreceivestwo DATAchunksfromtheserver.Later,wewilldiscuss
Figure23.34 Simpledatatransfer
Server
Client
i
a
c:u:;:::;:J
E3
==
~I
TSN:7105
I
DATAchunk
I
......
TSN:7106
r
DATAchunk
~1
TSN:7107
1
DATAchunk
.....
[ I
TSN:7108
~
DATAchunk
~\
\
cumTSN:7108
SACKchunk
t
f---
TSN:121
DATAchunk
.....[
TSN:122
t~....- DATAchunk
r---
cumTSN:122
I
.....
SACKchunk --..
Time Time

SECTION23.4SCTP 747
theuseofflowanderrorcontrolin SCTP.Forthemoment,weassumethateverything
goeswellinthisscenario.
1.Theclientsendsthefirstpacketcarryingtwo DATAchunkswithTSNs7105and
7106.
2.Theclientsendsthesecondpacketcarryingtwo DATAchunkswithTSNs7107
and7108.
3.Thethirdpacketisfromtheserver.ItcontainstheSACKchunkneededto
acknowledgethereceipt
ofDATAchunksfromtheclient.ContrarytoTCP,
SCTPacknowledgesthelastin-orderTSNreceived,notthenextexpected.The
thirdpacketalsoincludesthefirst
DATAchunkfromtheserverwithTSN 121.
4.Afterawhile,theserversendsanotherpacketcarryingthelast DATAchunkwith
TSN122,butitdoesnotincludeaSACKchunkinthepacketbecausethelast
DATAchunkreceivedfromtheclientwasalreadyacknowledged.
5.Finally,theclientsendsapacketthatcontainsaSACKchunkacknowledgingthe
receipt
ofthelasttwo DATAchunksfromtheserver.
TheacknowledgmentinSCTPdefinesthecumulativeTSN,
theTSN
ofthelastdatachunkreceivedinorder.
MultihomingDataTransferWediscussedthemultihomingcapability ofSCTP,a
featurethatdistinguishes SCTPfromUDPand
TCP.Multihomingallowsbothendsto
definemultipleIPaddressesforcommunication.However,onlyone
oftheseaddresses
canbedefined
astheprimaryaddress;therestarealternativeaddresses.Theprimary
addressisdefinedduringassociationestablishment.Theinterestingpointisthatthepri­
maryaddress
ofanendisdeterminedbytheotherend.Inotherwords,asourcedefines
theprimaryaddressforadestination.
MultistreamDeliveryOneinterestingfeature
ofSCTPisthedistinctionbetween
datatransferanddatadelivery.SCTPusesTSNnumbers
tohandledatatransfer,move­
ment
ofdatachunksbetweenthesourceanddestination.Thedelivery ofthedatachunks
iscontrolledbySIsandSSNs.SCTPcansupportmultiplestreams,whichmeansthat
thesenderprocesscandefinedifferentstreamsandamessagecanbelongtoone
of
thesestreams.Eachstreamisassignedastreamidentifier(SI)whichuniquelydefines
thatstream.
FragmentationAnotherissueindatatransferis fragmentation.AlthoughSCTP
sharesthistermwith
IP,fragmentationinIPandinSCTPbelongstodifferentlevels:
theformeratthenetworklayer,thelatteratthetransportlayer.
SCTPpreservestheboundaries
ofthemessagefromprocesstoprocesswhen
creatinga
DATAchunkfromamessage ifthesizeofthemessage(whenencapsu­
latedinanIPdatagram)doesnotexceedtheMTU
ofthepath.Thesize ofanIP
datagramcarryingamessagecanbedeterminedbyaddingthesize
ofthemessage,in
bytes,tothefouroverheads:datachunkheader,necessarySACKchunks,SCTPgen­
eralheader,andIPheader.
IfthetotalsizeexceedstheMTU,themessageneedstobe
fragmented.

748 CHAPTER 23PROCESS-TO-PROCESS DELIVERY: UDp,TCp,ANDSCTP
AssociationTermination
InSCTP,likeTCP,either ofthetwopartiesinvolvedinexchangingdata(clientor
server)canclosetheconnection.However,unlikeTCP,SCTPdoesnotallowahalf­
closesituation.
Ifoneendclosestheassociation,theotherendmuststopsendingnew
data.
Ifanydataareleftoverinthequeueoftherecipient oftheterminationrequest,
theyaresentandtheassociation
isclosed.Association terminationusesthreepackets,
asshowninFigure23.35.Note thatalthoughthefigureshowsthecaseinwhichtermi­
nationisinitiatedbytheclient,itcanalsobeinitiatedbytheserver.Notethattherecan
beseveralscenariosofassociationtermination.
Weleavethisdiscussiontothereferences
mentionedattheendofthechapter.
Figure23.35Associationtermination
Client
r
--
SHUTDOWN
Active
closer------i~~_c;;__,..""
SHUTDOWN
COMPLETE
Time
FlowControl
SHUTDOWN ACK
Server
-=
c::;:::u)
~
-
Passive
close
Time
FlowcontrolinSCTPissimilar tothatinTCP.InTCP,weneedtodealwithonlyone
unitofdata,thebyte.InSCTP,weneedtohandletwounitsofdata,thebyteandthe
chunk.
Thevaluesofrwndandcwndareexpressedinbytes;thevalues ofTSNand
acknowledgmentsareexpressedinchunks.
Toshowtheconcept,wemakesomeunre­
alisticassumptions.
Weassumethatthereisnevercongestioninthenetworkandthat
thenetwork
iserror-free.Inotherwords,weassumethatcwnd isinfiniteandnopacket is
lostordelayedorarrivesout oforder.Wealsoassumethatdatatransferisunidirectional.
Wecorrectourunrealisticassumptionsinlatersections.CurrentSCTPimplementa­
tionsstilluseabyte-orientedwindowforflowcontrol.We,however,showthebufferin
terms
ofchunkstomaketheconcepteasiertounderstand.
ReceiverSite
Thereceiverhasonebuffer(queue)andthreevariables.Thequeueholdsthereceived
datachunksthathavenotyetbeenreadbytheprocess.Thefirstvariableholdsthelast
TSNreceived,
cumTSN.Thesecondvariableholdstheavailablebuffersize, winsize.

SECTION23.4SCTP 749
Thethirdvariableholdsthelastaccumulativeacknowledgment, lastACK.Figure23.36
showsthequeueandvariablesatthereceiversite.
Figure23.36 Flowcontrol,receiversite
winSize
Received
---------l.~
Toprocess
26BBBB
Receivingqueue
winSize
lastACK
1.Whenthesitereceivesadatachunk,itstoresitattheend ofthebuffer(queue)and
subtractsthesize
ofthechunkfromwinSize.TheTSNnumberofthechunkis
storedinthe
cumTSNvariable.
2.Whentheprocessreadsachunk,itremovesitfromthequeueandaddsthesize of
theremovedchunkto winSize(recycling).
3.Whenthereceiverdecides tosendaSACK,itchecksthevalue oflastAck;ifitis
lessthan
cumTSN,itsendsaSACKwithacumulativeTSNnumberequal tothe
cumTSN.Italsoincludesthevalue ofwinSizeastheadvertisedwindowsize.
SenderSite
Thesenderhasonebuffer(queue)andthreevariables: curTSN,rwnd, andinTransit,as
showninFigure23.37.Weassumeeachchunkis100byteslong.
Figure23.37 Flowcontrol,sendersite
curTSN
rwnd
inTransit
Outstandingchunks
BBB8BBBBB8BBBI~Tosend
Sendingqueue
'"
'~::?~:/37,''
~::1dPO"
:t~1W'
Fromprocess
L:
Thebufferholdsthechunksproducedbytheprocessthateitherhavebeensentorare
readytobesent.Thefirstvariable,
curTSN,referstothenextchunk tobesent.Allchunks
inthequeuewithaTSNlessthanthisvaluehavebeensent,butnotacknowledged;they
areoutstanding.Thesecondvariable,
rwnd,holdsthelastvalueadvertisedbythereceiver
(inbytes).Thethirdvariable,
inTransit,holdsthenumber ofbytesintransit,bytessent
butnotyetacknowledged.Thefollowing
istheprocedureusedbythesender.

750 CHAPTER23PROCESS-TO-PROCESS DELIVERY: UDp,TCp,ANDSCTP
1.Achunkpointed tobycurTSNcanbesent ifthesizeofthedataislessthan or
equaltothequantity
rwnd-inTransit. Aftersendingthechunk,thevalue ofcurTSN
isincrementedby1andnowpointstothenextchunktobesent.Thevalue of
inTransitisincrementedbythesize ofthedatainthetransmittedchunk.
2.WhenaSACKisreceived,thechunkswithaTSNlessthanorequaltothecumula­
tiveTSNintheSACKareremovedfromthequeueanddiscarded.Thesenderdoes
nothavetoworryaboutthemanymore.Thevalue
ofinTransitisreducedbythe
totalsize
ofthediscardedchunks.Thevalue ofrwndisupdatedwiththevalueof
theadvertisedwindowintheSACK.
AScenario
LetusgiveasimplescenarioasshowninFigure23.38.Atthestartthevalueof rwndat
thesendersiteandthevalue
ofwinSizeatthereceiversiteare2000(advertisedduring
associationestablishment).Originally,therearefourmessagesinthesenderqueue.The
sendersendsonedatachunkandaddsthenumberofbytes(1000)tothe
inTransitvari­
able.Afterawhile,thesenderchecksthedifferencebetweenthe
rwndandinTransit,
whichis1000bytes,soitcansendanotherdatachunk.Nowthedifferencebetweenthe
twovariablesis0andnomoredatachunkscanbesent.Afterawhile,aSACKarrives
thatacknowledgesdatachunks1and
2.Thetwochunksareremovedfromthequeue.
Thevalueof
inTransitisnow O.TheSACK,however,advertisedareceiverwindowof
value
0,whichmakesthesender.update rwndtoO.Nowthesenderisblocked;itcannot
sendanydatachunks(withoneexceptionexplainedlater).
Figure23.38Flowcontrolscenario
Sender
r
DATA
TSN:1
Receiver
r
cumTSN~
winSize2000~
lastACK ~
1000bytesr-"--1
DATA
cumTSN~
winSize1000
lastACK
I~
curTSN
@]~~0 0 ~wnd_
=== 0 znTranslt
:esswrites
iand6
TSN:2 1000bytesr-.-.---I
SACK
ACK:2 rwnd:°
SACK
l---....~L::A:..::.C::::K~: 2::....-__rw_n_d_:2_0_0_0......
.
.
cumTSN
~
winSize 0
[astACK
cumTSN~ ~
winSize2000
[astACK 2
Processreads
1and2
Time Time

SECTION23.4SCTP 751
Atthereceiversite,thequeueisemptyatthebeginning.Afterthefirstdatachunk
isreceived,thereisonemessageinthequeueandthevalue
ofcumTSNis1.Thevalue
ofwinSizeisreducedto1000becausethefirstmessageoccupies1000bytes.Afterthe
seconddatachunkisreceived,thevalue
ofwindowsizeis aandcumTSNis2.Now,as
wewillsee,thereceiver
isrequiredtosendaSACKwithcumulativeTSN of2.After
thefirstSACKwassent,theprocessreadsthetwomessages,whichmeansthatthereis
nowroom
inthequeue;thereceiveradvertisesthesituationwithaSACKtoallowthe
sendertosendmoredatachunks.Theremainingeventsarenotshowninthefigure.
ErrorControl
SCTP,like TCP,isareliabletransportlayerprotocol. ItusesaSACKchunktoreport
thestate
ofthereceiverbuffertothe sender.Eachimplementationusesadifferentset of
entitiesandtimersforthereceiverandsendersites. Weuseaverysimpledesigntoconvey
theconcepttothereader.
ReceiverSite
Inourdesign,thereceiverstoresallchunksthathavearrivedinitsqueueincludingthe
out-of-orderones.However,itleavesspacesforanymissingchunks.
Itdiscardsdupli­
catemessages,butkeepstrack
ofthemforreportstothesender.Figure23.39showsa
typicaldesignforthereceiversiteandthestate
ofthereceivingqueueataparticular
pointintime.
Figure23.39 Errorcontrol,receiversite
Duplicate
·
··
OutOfOrder
cumTSN
winSize
lastACK
Thelastacknowledgmentsentwasfordatachunk20.Theavailablewindowsizeis
1000bytes.Chunks
21to23havebeenreceivedinorder.Thefirstout-of-orderblock
containschunks26to28.Thesecondout-of-orderblockcontainschunks
31to34.A
variableholdsthevalue
ofcumTSN.Anarrayofvariableskeepstrack ofthebeginning
andtheend
ofeachblockthatisout oforder.Anarrayofvariablesholdstheduplicate
chunksreceived.Notethatthereisnoneedforstoringduplicatechunksinthequeue;
theywillbediscarded.ThefigurealsoshowstheSACKchunkthatwillbesentto

752 CHAPTER 23PROCESS-TO-PROCESS DELNERY:UDp,TCp,ANDSCTP
reportthestate ofthereceivertothesender.TheTSNnumbersforout-of-orderchunks
arerelative(offsets)
tothecumulativeTSN.
SenderSite
Atthesendersite,ourdesigndemandstwobuffers(queues):asendingqueueanda
retransmissionqueue.
Wealsousethethreevariables rwnd,inTransit, andcurTSNas
describedintheprevioussection.Figure23.40showsatypicaldesign.
Figure23.40
Errorcontrol,sendersite
Fromprocess
L
BBBBBB
Outstandingchunks
...BBB~Tosend
inTransit
curTSN
rwnd
Retransmission
queue
Addwhentimer ~'~I
expiresorthree-----l..~:4'~,1"~Tosend
SACKsarereceived. .,...
-----====
Sendingqueue
Thesendingqueueholdschunks23to40.Thechunks 23to36havealreadybeen
sent,butnotacknowledged;theyareoutstandingchunks.The
curTSNpointstothe
nextchunk
tobesent(37). Weassumethateachchunkis100bytes,whichmeansthat
1400bytes
ofdata(chunks 23to36)isintransit.Thesenderatthismomenthasa
retransmissionqueue.Whenapacketissent,aretransmissiontimerstartsforthat
packet(alldatachunksinthatpacket).Someimplementationsuseonesingletimerfor
theentireassociation,butwecontinuewithourtradition
ofonetimerforeachpacketfor
simplification.Whentheretransmissiontimerforapacketexpires,orfourduplicate
SACKsarrivethatdeclareapacketasmissing(fastretransmissionwasdiscussedin
Chapter12),thechunksinthatpacketaremovedtotheretransmissionqueuetobe
resent.Thesechunksareconsideredlost,ratherthanoutstanding.Thechunksinthe
retransmissionqueuehavepriority.Inotherwords,thenexttimethesendersendsa
chunk,itwouldbechunk
21fromtheretransmissionqueue.
SendingDataChunks
Anendcansendadatapacketwhenevertherearedatachunksinthesendingqueue
withaTSNgreaterthanorequalto
curTSNoriftherearedatachunksintheretransmis­
sionqueue.Theretransmissionqueuehaspriority.However,thetotalsize
ofthedata
chunkorchunksincludedinthepacketmustnotexceed
rwnd-inTrans it,andthetotal
size
oftheframemustnotexceedtheMTUsize aswediscussedinprevioussections.

SECTION23.5RECOMMENDED READING 753
RetransmissionTocontrolalostordiscardedchunk,SCTP,likeTCP,employstwo
strategies:usingretransmissiontimersandreceivingfourSACKswiththesamemissing
chunks.
GeneratingSACKChunks
Anotherissueinerrorcontrolisthegeneration ofSACKchunks.Therulesforgenerating
SCTPSACKchunksaresimilartotherulesusedforacknowledgmentwiththeTCP
ACKflag.
CongestionControl
SCTP,likeTCP,isatransportlayerprotocolwithpacketssubjecttocongestioninthenet­
work.TheSCTPdesignershaveusedthesamestrategieswewilldescribeforcongestion
control
inChapter24for TCP.SCTPhasslowstart(exponentialincrease),congestion
avoidance(additiveincrease),andcongestiondetection(multiplicativedecrease)phases.
LikeTCP,SCTPalsousesfastretransmissionandfastrecovery.
23.5RECOMMENDED READING
Formoredetailsaboutsubjectsdiscussedinthischapter,werecommendthefollowing
booksandsites.Theitemsinbrackets[
...]refertothereferencelistattheend ofthetext.
Books
UDPisdiscussedinChapter 11of[For06],Chapter 11of[Ste94],andChapter12 of
[ComOO].TCPisdiscussedinChapter 12of[For06],Chapters 17to24of[Ste94],and
Chapter
13of[ComOO].SCTPisdiscussedinChapter 13of[For06]and[SX02].Both
UDPandTCParediscussedinChapter6
of[Tan03].
Sites
owww.ietf.org/rfc.htmlInformationaboutRFCs
RFCs
AdiscussionofUDPcanbefound inRFC768.
Adiscussion
ofTCPcanbefoundinthefollowingRFCs:
675,700,721,761,793,879,896,1078,1106,1110,1144,1145,1146,1263,1323,1337,
1379,1644,1693,1901,1905,2001,2018,2488,2580
AdiscussionofSCTPcanbefoundinthefollowingRFCs:
.
2960,3257,3284,3285,3286,3309,3436,3554,3708,3758

754 CHAPTER23PROCESS-TO-PROCESS DELIVERY: UDp,TCp,ANDSCTP
23.6KEYTERMS
acknowledgmentnumber
association
associationestablishment
associationtermination
byte-oriented
chunk
client
client/serverparadigm
connectionabortion
connection-orientedservice
connectionlessservice
connectionless,unreliabletransport
protocol
cookie
COOKIEACKchunk
COOKIEECHOchunk
cumulativeTSN
DATAchunk
datatransfer
denial-of-serviceattack
dynamicport
ephemeralportnumber
errorcontrol
fastretransmission
flowcontrol
four-wayhandshaking
fragmentation
full-duplexservice
generalheader
half-close
inboundstream
INITACKchunk
INITchunk
initialsequencenumber(ISN)
message-oriented
multihomingservice
multistreamservice
portnumber
primaryaddress
process-to-processdelivery
pseudoheader
queue
registeredport
retransmissiontime-out(RTO)
retransmissiontimer
round-triptime(RTT)
SACKchunk
segment
sequencenumber
server
simultaneousclose
simultaneousopen
socketaddress
streamidentifier(SI)
streamsequencenumber(SSN)
SYNfloodingattack
three-wayhandshaking
TransmissionControlProtocol(TCP)
transmissionsequencenumber(TSN)
transportlayer
userdatagram
UserDatagramProtocol(UDP)
verificationtag
well-knownportnumber
23.7SUMMARY
oIntheclient/serverparadigm,anapplicationprogramonthelocalhost,calledthe
client,needsservicesfromanapplicationprogramontheremote
host,'calleda
server.

SECTION23.7 SUMMARY 755
oEach applicationprogramhasaportnumberthatdistinguishesitfromotherpro­
gramsrunningatthesametimeonthesamemachine.
oTheclientprogramisassignedarandomportnumbercalledanephemeralport
number;theserverprogramisassignedauniversalportnumbercalledawell­
knownportnumber.
oTheICANNhasspecifiedrangesforthedifferenttypes ofportnumbers.
oThecombinationoftheIPaddressandtheportnumber,calledthesocketaddress,
definesaprocessand ahost.
oUDPisaconnectionless,unreliabletransportlayerprotocolwithnoembedded
floworerrorcontrolmechanismexceptthechecksumforerrordetection.
oTheUDPpacket iscalledauserdatagram.Auserdatagramisencapsulatedinthe
datafield
ofanIPdatagram.
oTransmissionControlProtocol(TCP)isone ofthetransportlayerprotocolsinthe
TCP/IPprotocolsuite.
oTCPprovidesprocess-to-process,full-duplex,andconnection-orientedservice.
oTheunitofdatatransferbetweentwodevicesusingTCPsoftwareiscalledasegment;
ithas20to60bytes
ofheader,followedbydatafromtheapplicationprogram.
oATCPconnectionnormallyconsists ofthreephases:connectionestablishment,
datatransfer,andconnectiontermination.
oConnectionestablishmentrequiresthree-wayhandshaking;connectiontermination
requiresthree-orfour-wayhandshaking.
oTCPusesflowcontrol,implementedasaslidingwindowmechanism,toavoid
overwhelmingareceiverwithdata.
oTheTCPwindowsizeisdeterminedbythereceiver-advertisedwindowsize (rwnd)
orthecongestionwindowsize (cwnd),whicheverissmaller.Thewindowcanbe
openedorclosedbythereceiver,butshouldnotbeshrunk.
oThebytesofdatabeingtransferredineachconnectionarenumberedby TCP.The
numberingstartswitharandomlygeneratednumber.
oTCPuseserrorcontroltoprovideareliableservice.Errorcontrolishandledbythe
checksum,acknowledgment,andtime-out.Corruptedandlostsegmentsareretrans­
mitted,andduplicatesegmentsarediscarded.Datamayarriveout
oforderandare
temporarilystoredbythereceiving
TCP,butTCPguaranteesthatnoout-of-order
segmentisdeliveredtotheprocess.
oInmodemimplementations,aretransmissionoccurs iftheretransmissiontimer
expiresorthreeduplicateACKsegmentshavearrived.
oSCTPisamessage-oriented,reliableprotocolthatcombinesthegoodfeatures of
UDPand TCP.
oSCTPprovidesadditional servicesnotprovidedbyUDPor Tep,suchasmultiple-
streamandmultihomingservices.
oSCTPisaconnection-orientedprotocol.AnSCTPconnectioniscalled anassociation.
oSCTPusestheterm packettodefineatransportationunit.
oInSCTP,controlinformationanddatainformationarecarriedinseparatechunks.

756 CHAPTER 23PROCESS-TO-PROCESS DELIVERY:UDp,TCP,ANDSCTP
oAnSCTPpacketcancontaincontrolchunksanddatachunkswithcontrolchunks
comingbeforedatachunks.
oInSCTP,eachdatachunkisnumberedusingatransmissionsequencenumber(TSN).
oTodistinguishbetweendifferentstreams,SCTPusesthesequenceidentifier(SI).
oTodistinguishbetweendifferentdatachunksbelongingtothesamestream,SCTP
usesthestreamsequencenumber(SSN).
oDatachunksareidentifiedbythreeidentifiers:TSN,SI,andSSN.TSNisacumula­
tivenumberrecognizedbythewholeassociation;SSNstartsfrom0ineachstream.
oSCTPacknowledgmentnumbersareusedonlytoacknowledgedatachunks;control
chunksareacknowledged,
ifneeded,byanothercontrolchunk.
oAnSCTPassociation isnormallyestablishedusingfourpackets(four-wayhand­
shaking).Anassociationisnormallyterminatedusingthreepackets(three-way
handshaking).
oAnSCTPassociationusesacookietopreventblindfloodingattacksandaverifica­
tiontagtoavoidinsertionattacks.
oSCTPprovidesflowcontrol,errorcontrol,andcongestioncontrol.
oTheSCTPacknowledgmentSACKreportsthecumulativeTSN,theTSN ofthe
lastdatachunkreceivedinorder,andselectiveTSNsthathavebeenreceived.
23.8PRACTICESET
ReviewQuestions
1.Incaseswherereliabilityisnot ofprimaryimportance,UDPwouldmakeagood
transportprotocol.Giveexamples
ofspecificcases.
2.ArebothUDPandIPunreliabletothesamedegree?Whyorwhynot?
3.Doportaddressesneedtobeunique?Whyorwhynot?Whyareportaddresses
shorterthanIPaddresses?
4.Whatisthedictionarydefinition ofthewordephemeral?Howdoesitapplytothe
concept
oftheephemeralportnumber?
5.Whatistheminimumsize ofaUDPdatagram?
6.Whatisthemaximumsize ofaUDPdatagram?
7.WhatistheminimumsizeoftheprocessdatathatcanbeencapsulatedinaUDP
datagram?
8.Whatisthemaximumsize oftheprocessdatathatcanbeencapsulatedinaUDP
datagram?
9.ComparetheTCPheaderandtheUDPheader.Listthefields intheTCPheader
thataremissingfromUDPheader.Givethereasonfortheirabsence.
10.UDPisamessage-orientedprotocol.TCPisabyte-orientedprotocol. Ifanappli­
cationneedstoprotecttheboundaries
ofitsmessage,whichprotocolshouldbe
used,UDPorTCP?

SECTION23.8PRACTICESET 757
11.WhatcanyousayabouttheTCPsegmentinwhichthevalue ofthecontrolfieldis
one
ofthefollowing?
a.000000
b.000001
c.010001
12.Whatisthemaximumsize oftheTCPheader?Whatistheminimumsize ofthe
TCPheader?
Exercises
13.Showtheentriesfortheheader ofaUDPuserdatagramthatcarriesamessagefrom
aTFTPclienttoaTFTPserver.Fillthechecksumfieldwith
Os.Chooseanappro­
priateephemeralportnumberandthecorrectwell-knownportnumber.Thelength
ofdatais40bytes.ShowtheUDPpacket,usingtheformatinFigure23.9.
14.AnSNMPclientresidingonahostwith IPaddress122.45.12.7sendsamessageto
anSNMPserverresiding
onahostwithIPaddress200.112.45.90.Whatis thepair
ofsocketsusedinthiscommunication?
15.ATFTPserverresidingonahostwithIPaddress130.45.12.7sendsamessagetoa
TFTPclientresidingonahostwithIPaddress14.90.90.33.
Whatisthepair of
socketsusedinthiscommunication?
16.Aclienthasapacket of68,000bytes.Showhowthispacketcan betransferredby
usingonlyoneUDPuserdatagram.
17.AclientusesUDPtosenddatatoaserver.Thedataare16bytes.Calculatetheeffi­
ciency
ofthistransmissionattheUDPlevel(ratio ofusefulbytestototalbytes).
18.RedoExercise17,calculatingtheefficiency oftransmissionattheIPleveLAssume
nooptionsforthe
IPheader.
19.RedoExercise 18,calculatingtheefficiency oftransmissionatthedatalinklayer.
AssumenooptionsfortheIPheaderanduseEthernetatthedatalinklayer.
20.Thefollowingisadump
ofaUDPheaderinhexadecimalformat.
0632000DOOlCE217
a.Whatisthesourceportnumber?
b.Whatisthedestinationportnumber?
c.Whatisthetotallength oftheuserdatagram?
d.Whatisthelength ofthedata?
e.Isthepacketdirectedfromaclienttoaserverorviceversa?
f.Whatistheclientprocess?
21.
AnIPdatagramiscarryingaTCPsegmentdestinedforaddress 130.14.16.17/16.The
destinationportaddressiscorrupted,and
itarrivesatdestination130.14.16.19/16.
HowdoesthereceivingTCPreacttothiserror?
22.InTCP,
ifthevalueofHLENis0111,howmanybytes ofoptionareincludedin
thesegment?

758 CHAPTER 23PROCESS-TO-PROCESSDELNERY:UDp,TCp,ANDSCTP
23.Showtheentriesfortheheader ofaTCPsegmentthatcarriesamessagefroman
FTPclienttoanFTPserver.Fillthechecksumfieldwith
Os.Chooseanappropriate
ephemeralportnumberandthecorrectwell-knownportnumber.Thelength
ofthe
datais
40bytes.
24.Thefollowingisadump
ofaTCPheaderinhexadecimalformat.
05320017
000ססoo1 000000005OO207FF00000000
a.Whatisthesourceportnumber?
b.Whatisthedestinationportnumber?
c.Whatthesequencenumber?
d.Whatistheacknowledgmentnumber?
e.Whatisthelength oftheheader?
f.Whatisthetype ofthesegment?
g.Whatisthewindowsize?
25.
Tomaketheinitialsequencenumberarandomnumber,mostsystemsstartthecounter
at1duringbootstrapandincrementthecounterby64,000every0.5
s.Howlong
doesittakeforthecountertowraparound?
26.Inaconnection,thevalue ofcwndis3000andthevalue ofrwndis5000.Thehosthas
sent2000byteswhichhasnotbeenacknowledged.Howmanymorebytescanbesent?
27.TCPopensaconnectionusinganinitialsequencenumber(ISN)
of14,534.The
otherpartyopenstheconnectionwithanISN
of21,732.ShowthethreeTCPseg­
mentsduringtheconnectionestablishment.
28.AclientusesTCPtosenddatatoaserver.Thedataare16bytes.Calculatetheeffi­
ciency
ofthistransmissionattheTCPlevel(ratio ofusefulbytestototalbytes).
Calculatetheefficiency
oftransmissionattheIPlevel.Assumenooptionsforthe
IPheader.Calculatetheefficiency
oftransmissionatthedatalinklayer.Assumeno
optionsfortheIFheaderanduseEthernetatthedata
linklayer.
29.TCPissendingdataat1Mbyte/s.
Ifthesequencenumberstartswith7000,how
longdoesittakebeforethesequencenumbergoesbacktozero?
30.ATCPconnectionisusingawindowsize
of10,000bytes,andtheprevious
acknowledgmentnumberwas22,001.
Itreceivesasegmentwithacknowledgment
number24,001andwindowsizeadvertisementof12,000.Drawadiagramtoshow
thesituation
ofthewindowbeforeandafter.
31.Awindow holdsbytes2001to5000.Thenextbytetobesent
is3001.Drawafigure
toshowthesituation
ofthewindowafterthefollowingtwoevents.
a.AnACKsegmentwiththeacknowledgmentnumber2500andwindowsize
advertisement4000
isreceived.
b.Asegmentcarrying1000bytesissent.
32.
InSCTP,thevalue ofthecumulativeTSNinaSACKis23.Thevalue oftheprevious
cumulativeTSNintheSACKwas29.Whatistheproblem?
33.InSCTP,thestate
ofareceiverisasfollows:
a.Thereceivingqueuehaschunks1to 8,11to14,and 16to20.
b.Thereare1800bytes ofspaceinthequeue.

SECTION23.8PRACTICESET 759
c.ThevalueoflastAckis4.
d.Noduplicatechunkhasbeenreceived.
e.Thevalue
ofcumTSNis5.
Showthecontents ofthereceivingqueueandthevariables.
34.In
SCTP,thestateofasenderisasfollows:
a.Thesendingqueuehaschunks 18to23.
b.ThevalueofcumTSNis20.
c.Thevalueofthewindowsize is2000bytes.
d.ThevalueofinTransitis200.
Ifeachdatachunkcontains100bytes ofdata,howmany DATAchunkscanbesent
now?Whatisthenext
DATAchunkto besent?
ResearchActivities
35.FindmoreinformationaboutICANN.What wasitcalledbeforeitsnamewaschanged?
36.TCPusesatransitionstatediagramtohandlesendingandreceivingsegments.
Findoutaboutthisdiagramandhowithandles
flowandcontrol.
37.SCTPusesatransitionstatediagramtohandlesendingandreceivingsegments.
Findoutaboutthisdiagramandhowithandles
flowandcontrol.
38.Whatisthehalf-opencaseinTCP?
39.Whatisthehalf-duplexclosecaseinTCP?
40.The
tcpdumpcommandinUNIX orLINUXcanbeusedtoprinttheheaders
ofpacketsofanetworkinterface.Use tcpdumptoseethesegmentssentandreceived.
41.InSCTP,findoutwhathappens
ifaSACKchunkisdelayedorlost.
42.Findthenameandfunctions
oftimersusedin TCP.
43.Findthenameandfunctions oftimersusedinSCTP.
44.FindoutmoreaboutECNinSCTP.Findtheformat
ofthesetwochunks.
45.Someapplicationprograms,such
asFTP,needmorethanoneconnectionwhen
usingTCP.Findhowthemultistreamservice
ofSCTPcanhelptheseapplications
establishonlyoneassociationwithseveralstreams.

CHAPTER24
CongestionControland
Quality
ofService
Congestioncontrolandquality ofservicearetwoissuessocloselyboundtogetherthat
improvingonemeansimprovingtheotherandignoringoneusually meansignoringthe
other.Mosttechniquestopreventoreliminatecongestionalsoimprovethequality
of
serviceinanetwork.
Wehavepostponedthediscussion oftheseissuesuntilnowbecausetheseareissues
relatednottoonelayer,buttothree:thedatalinklayer,thenetworklayer,andthe
transportlayer.
Wewaiteduntilnowsothatwecandiscusstheseissuesonceinstead of
repeatingthesubjectthreetimes.Throughoutthechapter,wegiveexamples ofconges­
tioncontrolandquality
ofserviceatdifferentlayers.
24.1DATATRAFFIC
Themainfocus ofcongestioncontrolandquality ofserviceisdatatraffic.Incongestion
controlwetrytoavoidtrafficcongestion.Inquality
ofservice,wetrytocreatean
appropriateenvironmentforthetraffic.So,beforetalkingaboutcongestioncontroland
quality
ofservice,wediscussthedatatrafficitself.
TrafficDescriptor
Trafficdescriptorsarequalitativevaluesthatrepresentadata flow.Figure24.1showsa
trafficflowwithsome
ofthesevalues.
Figure24.1 Trafficdescriptors
Datarate
Maximum
burstsize
~
~-"'CC - - - - - - - Peakdatarate
- - - - -Averagedatarate
Seconds
761

762 CHAPTER 24CONGESTIONCONTROL ANDQUAliTYOFSERVICE
AverageDataRate
Theaveragedatarateisthenumber ofbitssentduringaperiod oftime,dividedbythe
number
ofsecondsinthatperiod. Weusethefollowingequation:
Averagedatarate=amount
ofdata
time
Theaveragedatarateisaveryusefulcharacteristic oftrafficbecauseitindicatesthe
averagebandwidthneededbythetraffic.
PeakDataRate
Thepeakdataratedefinesthemaximumdatarate ofthetraffic.InFigure 24.1itisthe
maximum
yaxisvalue.Thepeakdatarateisaveryimportantmeasurementbecause
itindicatesthepeakbandwidththatthenetworkneedsfortraffictopassthroughwithout
changingitsdata
flow.
MaximumBurstSize
Althoughthepeakdatarateisacriticalvalueforthenetwork,itcanusuallybeignored
ifthedurationofthepeakvalue isveryshort.Forexample, ifdataareflowingsteadily
attherate
of1Mbpswithasuddenpeakdatarate of2Mbpsforjust1ms,thenetwork
probablycanhandlethesituation.However,
ifthepeakdataratelasts60
ms,theremay
beaproblemforthenetwork.The
maximumburstsize normallyrefers tothemaximum
length
oftimethetrafficisgeneratedatthepeakrate.
EffectiveBandwidth
Theeffectivebandwidth isthebandwidththatthenetworkneedstoallocateforthe
flow
oftraffic.Theeffectivebandwidth isafunctionofthreevalues:averagedatarate,
peakdatarate,andmaximumburstsize.Thecalculation
ofthisvalueisverycomplex.
TrafficProfiles
Forourpurposes,adataflowcanhaveone ofthefollowingtrafficprofiles:constantbit
rate,variablebitrate,orburstyasshowninFigure
24.2.
ConstantBitRate
Aconstant-bit-rate(CBR), orafixed-rate,trafficmodelhasadataratethatdoesnot
change.Inthistype
offlow,theaveragedataratcandthcpeakdataratearethesame.
Themaximumburstsizeisnotapplicable.Thistype
oftrafficisveryeasyforanetwork
tohandlesinceit
ispredictable.Thenetworkknowsinadvancehowmuchbandwidthto
allocateforthistype
offlow.
VariableBitRate
Inthevariable-bit-rate(VBR) category,therate ofthedataflowchangesintime,with
thechangessmoothinstead
ofsuddenandsharp.Inthistype offlow,theaveragedata

SECTION24.2CONGESTION 763
Figure24.2 Threetrafficprofiles
Datarate
t--L-
Time
a.Constantbitrate
Datarate
Datarate
L:_~~~.
Time
b.Variablebitrate
Time
c.Bursty
rateandthepeakdataratearedifferent.Themaximumburstsizeisusuallyasmall
value.Thistype
oftrafficismoredifficulttohandlethanconstant-bit-ratetraffic,butit
normallydoesnotneedtobereshaped,aswewillseelater.
Bursty
Intheburstydata category,thedataratechangessuddenlyinaveryshorttime. It
mayjumpfromzero,forexample,to1Mbpsinafewmicrosecondsandviceversa. It
mayalsoremainatthisvalueforawhile.Theaveragebitrateandthepeakbitrateare
verydifferentvaluesinthistype
offlow.Themaximumburstsizeissignificant.This
isthemostdifficulttype
oftrafficforanetworktohandlebecausetheprofileisvery
unpredictable.
Tohandlethistype oftraffic,thenetworknormallyneedstoreshapeit,
usingreshapingtechniques,aswewillseeshortly.Burstytrafficisone
ofthemain
causes
ofcongestioninanetwork.
24.2CONGESTION
Animportantissueinapacket-switchednetworkis congestion.Congestioninanetwork
mayoccur
iftheloadonthenetwork-thenumberofpacketssenttothe network-is
greaterthanthecapacity ofthenetwork-thenumberofpacketsanetworkcanhandle.
Congestioncontrol referstothemechanismsandtechniquestocontrolthecongestion
andkeeptheloadbelowthecapacity.
Wemayaskwhythereiscongestiononanetwork.Congestionhappensinany
systemthatinvolveswaiting.Forexample,congestionhappensonafreewaybecause
anyabnonnalityinthe
flow,suchasanaccidentduringrushhour,createsblockage.

Input
Output
764 CHAPTER 24CONGESTIONCONTROL ANDQUALITYOFSERVICE
Congestioninanetworkorinternetworkoccursbecauseroutersandswitcheshave
queues-buffersthatholdthepacketsbeforeandafterprocessing.Arouter,forexample,
has
aninputqueueandanoutputqueueforeachinterface.Whenapacketarrivesatthe
incominginterface,itundergoesthreestepsbeforedeparting,asshowninFigure24.3.
Figure24.3 Queuesinarouter
1
..
~~lIllll~lnput
QueuesI 't:: c'\,~ ,'~~','
~~IIIIn~ Output
Input~~jIp~~ ~ J-Queu;~"'" ',
Output~t1llll 1'1+~
.,Q~eue~ ,.,~~.....T
L
_
1.Thepacketisputattheend oftheinputqueuewhilewaitingtobechecked.
2.Theprocessingmodule oftherouterremovesthepacketfromtheinputqueueonce
itreachesthefront
ofthequeueandusesitsroutingtableandthedestination
addresstofindtheroute.
3.Thepacketisputintheappropriateoutputqueueandwaitsitstumtobesent.
Weneedtobeaware
oftwoissues.First, iftherateofpacketarrivalishigherthanthe
packetprocessingrate,theinputqueuesbecomelongerandlonger.Second,
ifthepacket
departurerateislessthanthepacketprocessingrate,theoutputqueuesbecomelonger
andlonger.
NetworkPerformance
Congestioncontrolinvolvestwofactorsthatmeasuretheperformance ofanetwork:delay
andthroughput.Figure24.4showsthesetwoperformancemeasures asfunctionofload.
Figure24.4 Packetdelay andthroughputasfunctions ofload
Delay Throughput
Capacity
NocongestionareaCongestionarea
Capacity Load
Nocongestion
area
Congestionarea
Load
a.Delayasafunction
ofload b.Throughputasafunctionofload

SECTION24.3CONGESTIONCONTROL 765
DelayVersus Load
Notethatwhentheloadismuchlessthanthecapacity ofthenetwork,thedelayisata
minimum.Thisminimumdelayiscomposedofpropagationdelayandprocessingdelay,
bothofwhicharenegligible.However,whentheloadreachesthenetworkcapacity,the
delayincreasessharplybecause wenowneedtoaddthewaitingtimeinthequeues(forall
routersinthepath)tothetotaldelay.Notethatthedelaybecomesinfinitewhentheloadis
greaterthanthecapacity.
Ifthisisnotobvious,considerthesize ofthequeueswhen
almostnopacketreachesthedestination,orreachesthedestinationwithinfinitedelay;the
queuesbecomelongerandlonger.Delayhasanegativeeffectontheloadandconse­
quentlythecongestion.Whenapacketisdelayed,thesource,notreceivingtheacknowl­
edgment,retransmitsthepacket,whichmakesthedelay,andthecongestion,worse.
ThroughputVersus
Load
WedefinedthroughputinChapter3 asthenumber ofbitspassingthroughapointina
second.
Wecanextendthatdefinitionfrombitstopacketsandfromapointtoanet­
work.Wecandefine
throughputinanetworkasthenumber ofpacketspassing
throughthenetworkinaunit
oftime.Noticethatwhentheloadisbelowthecapacity
ofthenetwork,thethroughputincreasesproportionallywiththeload. Weexpectthe
throughputtoremainconstantaftertheloadreachesthecapacity,
butinsteadthe
throughputdeclinessharply.Thereasonisthediscarding
ofpacketsbytherouters.
Whentheloadexceedsthecapacity,thequeuesbecomefullandtheroutershavetodis­
cardsomepackets.Discarding
packet;'doesnotreducethenumber ofpacketsinthe
networkbecausethesourcesretransmitthepackets,usingtime-outmechanisms,when
thepacketsdonotreachthedestinations.
24.3CONGESTION CONTROL
Congestioncontrolreferstotechniquesandmechanismsthatcaneitherpreventconges­
tion,beforeithappens,orremovecongestion,afterithashappened.Ingeneral,wecan
dividecongestioncontrolmechanismsintotwobroadcategories:open-loopcongestion
control(prevention)andclosed-loopcongestioncontrol(removal)
asshowninFigure24.5.
Figure24.5Congestioncontrolcategories
Retransmissionpolicy
Windowpolicy
Acknowledgmentpolicy
Discardingpolicy
Admissionpolicy
Backpressure
Chokepacket
Implicitsignaling
Explicitsignaling

766 CHAPTER 24CONGESTIONCONTROL ANDQUALITYOFSERVICE
Open-LoopCongestionControl
Inopen-loopcongestioncontrol,policiesareappliedtopreventcongestionbeforeit
happens.Inthesemechanisms,congestioncontrolishandledbyeitherthesourceorthe
destination.
Wegiveabrieflist ofpoliciesthatcanpreventcongestion.
RetransmissionPolicy
Retransmissionissometimesunavoidable. Ifthesenderfeelsthatasentpacketislost
orcorrupted,the packetneedsto
beretransmitted.Retransmissioningeneralmay
increasecongestioninthenetwork.However,agoodretransmissionpolicycanprevent
congestion.Theretransmissionpolicyandtheretransmissiontimersmustbedesigned
tooptimizeefficiencyandatthesametimepreventcongestion.
Forexample,the
retransmissionpolicyusedbyTCP(explainedlater)isdesignedtopreventoralleviate
congestion.
WindowPolicy
Thetype ofwindowatthesendermayalsoaffectcongestion.TheSelectiveRepeat
windowisbetterthantheGo-Back-Nwindowforcongestioncontrol.Inthe
Go-Back-N
window,whenthetimerforapackettimesout,severalpacketsmayberesent,although
somemayhavearrivedsafeandsoundatthereceiver.Thisduplicationmaymakethe
congestionworse.TheSelectiveRepeatwindow,ontheotherhand,triestosendthe
specificpacketsthathavebeenlostorcorrupted.
AcknowledgmentPolicy
Theacknowledgmentpolicyimposedbythereceivermayalsoaffectcongestion. Ifthe
receiverdoesnotacknowledgeeverypacketitreceives,
itmayslowdownthesender
andhelppreventcongestion.Severalapproachesareusedinthiscase.Areceivermay
sendanacknowledgmentonly
ifithasapackettobesentoraspecialtimerexpires.A
receivermaydecidetoacknowledgeonly
Npacketsatatime. Weneedtoknowthat
theacknowledgmentsarealsopart
oftheloadinanetwork.Sendingfeweracknowl­
edgmentsmeansimposinglessloadonthenetwork.
DiscardingPolicy
Agooddiscardingpolicybytheroutersmaypreventcongestionandatthesametime
maynotharmtheintegrity
ofthetransmission.Forexample,inaudiotransmission, if
thepolicyistodiscardlesssensitivepacketswhencongestionislikelytohappen,the
quality
ofsoundisstillpreservedandcongestionispreventedoralleviated.
AdmissionPolicy
Anadmissionpolicy,which isaquality-of-servicemechanism,canalsopreventconges­
tioninvirtual-circuitnetworks.Switchesinaflowfirstchecktheresourcerequirement
ofaflowbeforeadmittingittothenetwork.Aroutercandenyestablishingavirtual­
circuitconnection
ifthereiscongestioninthenetworkor ifthereisapossibility offuture
congestion.

SECTION24.3CONGESTIONCONTROL 767
Closed-LoopCongestion Control
Closed-loopcongestioncontrol mechanismstrytoalleviatecongestionafterithap­
pens.Severalmechanismshavebeenusedbydifferentprotocols.
Wedescribeafew of
themhere.
Backpressure
Thetechniqueofbackpressurereferstoacongestioncontrolmechanisminwhicha
congestednodestopsreceivingdatafromtheimmediateupstreamnodeornodes.This
maycausetheupstreamnodeornodestobecomecongested,andthey,inturn,reject
datafromtheirupstreamnodesornodes.Andsoon.Backpressureisanode-to-node
congestioncontrolthatstartswithanodeandpropagates,intheoppositedirection
of
dataflow,tothesource.Thebackpressuretechniquecanbeappliedonlytovirtualcircuit
networks,inwhicheachnodeknowsthe upstreamnodefromwhichaflow
ofdatais
corning.Figure24.6 showstheidea
ofbackpressure.
Figure24.6 Backpressuremethod foralleviatingcongestion
Source
Backpressure
......-
Dataflow
Congestion Destination
NodeIIIinthefigurehasmoreinputdatathanitcanhandle.Itdropssomepackets
initsinputbufferandinformsnodeIItoslowdown.NodeII,inturn,maybecongested
becauseitisslowingdowntheoutputflow
ofdata.IfnodeIIiscongested,itinforms
nodeItoslowdown,whichinturnmaycreatecongestion.
Ifso,nodeIinformsthe
source
ofdatatoslowdown.This, intime,alleviatesthecongestion.Notethatthe pressure
onnodeIIIismovedbackwardtothesourcetoremovethecongestion.
Noneofthevirtual-circuitnetworkswestudied
inthisbookusebackpressure.It
was,however,implementedinthefirstvirtual-circuitnetwork,X.25.Thetechnique
cannotbeimplementedinadatagramnetwork becauseinthistype
ofnetwork,anode
(router)doesnothavetheslightest knowledgeoftheupstreamrouter.
ChokePacket
Achokepacket isapacketsentbyanodetothesourcetoinformit ofcongestion.
Notethedifferencebetweenthebackpressureandchokepacketmethods.
Inbackpres­
sure,thewarning
isfromonenodetoitsupstreamnode,althoughthewarningmay
eventuallyreachthesourcestation.Inthechokepacketmethod,thewarningisfromthe
router,whichhasencounteredcongestion,tothesourcestationdirectly.Theinter­
mediatenodesthroughwhichthepackethastraveledarenotwarned.
Wehaveseen
anexample
ofthistypeofcontrolinICMP.WhenarouterintheInternetisover­
wheh:nedwithIPdatagrams,itmaydiscardsome ofthem;butitinformsthesource

768 CHAPTER 24CONGESTIONCONTROL ANDQUALITYOFSERVICE
host,usingasourcequenchICMPmessage.Thewarningmessagegoesdirectlytothe
sourcestation;theintermediaterouters,anddoesnottakeanyaction.Figure24.7
showstheidea
ofachokepacket.
Figure24.7 Chokepacket
Choke
packet
Source
Congestion
Dataflow
Destination
ImplicitSignaling
Inimplicitsignaling,thereisnocommunicationbetweenthecongestednodeornodes
andthesource.Thesourceguessesthatthereisacongestionsomewhereinthenetwork
fromothersymptoms.Forexample,whenasourcesendsseveralpacketsandthere
is
noacknowledgmentforawhile,oneassumptionisthatthenetworkiscongested.The
delayinreceivinganacknowledgment
isinterpretedascongestioninthenetwork;the
sourceshouldslowdown.
Wewillseethistype ofsignalingwhenwediscussTCP
congestioncontrollaterinthechapter.
ExplicitSignaling
Thenodethatexperiencescongestioncanexplicitlysendasignal tothesourceordesti­
nation.Theexplicitsignalingmethod,however,isdifferentfromthechokepacket
method.Inthechokepacketmethod,aseparatepacketisusedforthispurpose;inthe
explicitsignalingmethod,thesignalisincludedinthepacketsthatcarrydata.Explicit
signaling,aswewillseeinFrameRelaycongestioncontrol,canoccurineitherthe
forwardorthebackwarddirection.
BackwardSignalingAbitcanbesetinapacketmovinginthedirectionopposite
tothecongestion.Thisbitcanwarnthesourcethatthereiscongestionandthatitneeds
toslowdowntoavoidthediscarding
ofpackets.
ForwardSignalingAbitcanbesetinapacketmoving inthedirectionofthe
congestion.Thisbitcanwarnthedestinationthatthereiscongestion.Thereceiverin
thiscasecanusepolicies,such
asslowingdowntheacknowledgments,toalleviatethe i
congestion.
24.4TWOEXAMPLES
Tobetterunderstandtheconcept ofcongestioncontrol,let usgivetwoexamples:onein
TCPandtheotherinFrameRelay.

SECTION24.41WOEXAMPLES 769
CongestionControl inTCP
WediscussedTCPinChapter23. WenowshowhowTCPusescongestioncontrolto
avoidcongestionoralleviatecongestioninthenetwork.
CongestionWindow
InChapter23,wetalkedabout flowcontrolandtriedtodiscusssolutionswhenthereceiver
isoverwhelmedwithdata.
Wesaidthatthesenderwindowsizeisdeterminedbytheavail­
ablebufferspaceinthereceiver
(rwnd).Inotherwords,weassumedthatitisonlythe
receiverthatcandictatetothesenderthesizeofthesender'swindow.
Wetotallyignored
anotherentity
here-thenetwork.Ifthenetworkcannotdeliverthedata asfastastheyare
createdbythesender,itmusttellthesendertoslowdown.
Inotherwords,inadditionto
thereceiver,thenetworkisasecondentitythatdeterminesthesize
ofthesender'swindow.
Today,thesender'swindowsizeisdeterminednotonlybythereceiverbutalsoby
congestioninthenetwork.
Thesenderhastwopieces
ofinformation:thereceiver-advertisedwindowsizeand
thecongestionwindowsize.Theactualsizeofthewindowistheminimumofthesetwo.
Actualwindow
size;;;;;;minimum(rwnd,cwnd)
Weshowshortlyhowthesize ofthecongestionwindow (cwnd)isdetermined.
CongestionPolicy
TCP'sgeneralpolicyforhandlingcongestionisbasedonthreephases:slowstart,con­
gestionavoidance,andcongestiondetection.Intheslow-startphase,thesenderstarts
withaveryslowrate
oftransmission,butincreasestheraterapidlytoreachathreshold.
Whenthethresholdisreached,thedatarate
isreducedtoavoidcongestion.Finally if
congestionisdetected,thesendergoesbacktotheslow-startorcongestionavoidance
phasebasedonhowthecongestionisdetected.
Slow
Start:ExponentialIncreaseOneofthealgorithmsused inTCPcongestion
controliscalledslow
start.Thisalgorithmisbasedontheideathatthesizeofthecon­
gestionwindow
(cwnd)startswithonemaximumsegmentsize(MSS).TheMSSis
determinedduringconnectionestablishmentbyusinganoption
ofthesamename.The
size
ofthewindowincreasesoneMSSeachtimeanacknowledgment isreceived.Asthe
nameimplies,thewindowstartsslowly,butgrowsexponentially.
Toshowtheidea,let us
lookatFigure24.8.Notethatwehaveusedthreesimplificationstomakethediscussion
moreunderstandable.Wehaveusedsegmentnumbersinstead
ofbytenumbers(asthough
eachsegmentcontainsonly1byte).
Wehaveassumedthat rwndismuchhigherthan
cwnd,sothatthesenderwindowsizealwaysequals cwnd.Wehaveassumedthateach
segment
isacknowledgedindividually.
Thesenderstartswith
cwnd=1MSS.Thismeansthatthesendercansendonly
onesegment.Afterreceipt
oftheacknowledgmentforsegment 1,thesizeofthe
congestionwindowisincreasedby1,whichmeansthat
cwndisnow2.Nowtwo
moresegmentscan
besent.Wheneachacknowledgmentisreceived,thesize of
thewindowisincreased by1MSS.Whenallsevensegmentsareacknowledged,
cwnd=8.

770 CHAPTER24CONGESTIONCONTROL ANDQUALITYOFSERVICE
Figure24.8 Slowstart,exponentialincrease
Rnd:Round oftransmission
cwnd=20=1D
cwnd=2
1
=2o::::J
cwnd=2
2
=41.---0----.----'---'
LI
Sender
Time
Segment4
Segment
5
Segment6
Segment
7
Receiver
r
--
Time
Ifwelookatthesize ofcwndintermsofrounds(acknowledgment ofthewhole
window
ofsegments),wefindthattherateisexponential asshownbelow:
Start
.....cwnd=l
Afterround1 .....cwnd=2
1
=2
Afterround2 .....cwnd=2
2
=4
Afterround3 .....cwnd=2
3
=8
Weneedtomentionthat ifthereisdelayedACKs,theincreaseinthesize ofthe
windowislessthanpower
of2.
Slowstartcannotcontinueindefinitely.Theremustbeathresholdtostopthis
phase.Thesenderkeepstrack
ofavariablenamed ssthresh(slow-startthreshold).
Whenthesize
ofwindowinbytesreachesthisthreshold,slowstartstopsandthenext
phasestarts.Inmostimplementationsthevalue
ofssthreshis65,535bytes.
Intheslow-startalgorithm,thesize ofthecongestionwindow
increasesexponentially
untilitreachesathreshold.
CongestionAvoidance:AdditiveIncrease Ifwestartwiththeslow-startalgorithm,
thesize
ofthecongestionwindowincreasesexponentially. Toavoidcongestionbefore
ithappens,onemustslowdownthisexponentialgrowth.TCPdefinesanotheralgo­
rithmcalledcongestionavoidance,whichundergoesanadditiveincreaseinsteadof
anexponentialone.Whenthesize
ofthecongestionwindowreachestheslow-start
threshold,theslow-startphasestopsandtheadditivephasebegins.Inthisalgorithm,
eachtimethewholewindow
ofsegmentsisacknowledged(oneround),thesize ofthe

SECTION24.41WOEXAMPLES 771
congestionwindowisincreasedby 1.Toshowtheidea,weapplythisalgorithmtothesame
scenario
asslowstart,althoughwewillseethatthecongestionavoidancealgorithmusually
startswhenthesizeofthewindow
ismuchgreaterthan 1.Figure24.9showstheidea.
Figure24.9Congestionavoidance,additiveincrease
Rnd:Round oftransmissionSender Receiver-- --
cwnd=e10
~[
Segment1
cwnd=e1+1=2c:::::I:J
~[
Segment2
Segment3
cwnd=2+1=3 I
<")
Segment5"0
c:
~
cwnd=3+1=4I,----,------,----l.....--'
Time Time
Inthiscase,afterthesenderhasreceivedacknowledgmentsforacompletewindow
size
ofsegments,thesize ofthewindow isincreasedbyonesegment.
Ifwelookatthesizeof cwndintermsofrounds,wefindthattherate isadditiveas
shownbelow:
Start
Afterround1
After
round2
After
round3
......
......
......
......
cwnd=l
cwnd=1+1=2
cwnd=2+1=3
cwnd=3+1=4
Inthecongestionavoidancealgorithm, thesizeofthecongestion
windowincreasesadditivelyuntilcongestion
isdetected.
CongestionDetection:MultiplicativeDecrease Ifcongestionoccurs,thecongestion
windowsizemustbedecreased.Theonlywaythesendercanguessthatcongestionhas
occurredisbytheneedtoretransmitasegment.However,retransmissioncanoccurin
one
oftwocases:whenatimertimesout orwhenthreeACKsarereceived.Inboth
cases,thesize
ofthethresholdisdroppedtoone-half,amultiplicativedecrease.Most
TCPimplementationshavetworeactions:
I.Ifatime-outoccurs,thereisastrongerpossibility ofcongestion;asegmenthas
probablybeendroppedinthenetwork,andthereisnonewsaboutthesentsegments.

772 CHAPTER24CONGESTIONCONTROL ANDQUALITYOFSERVICE
InthiscaseTCPreactsstrongly:
a.Itsetsthevalue ofthethresholdtoone-half ofthecurrentwindowsize.
b.Itsetscwndtothesize ofonesegment.
c.Itstartstheslow-startphaseagain.
2.IfthreeACKsarereceived,thereisaweakerpossibility ofcongestion;asegment
mayhavebeendropped,butsomesegmentsafterthatmayhavearrivedsafelysince
threeACKsarereceived.Thisiscalledfasttransmissionandfastrecovery.Inthis
case,
TCPhasaweakerreaction:
a.Itsetsthevalue ofthethresholdtoone-half ofthecurrentwindowsize.
b.Itsetscwndtothevalue ofthethreshold(someimplementationsaddthree
segmentsizestothethreshold).
c.
Itstartsthecongestionavoidancephase.
Animplementationsreacts tocongestiondetection inoneofthefollowingways:
oIfdetectionisbytime-out,anew slow-startphasestarts.
oIfdetectionis bythreeACKs,anew congestionavoidance phasestarts.
SummaryInFigure24.10,wesummarizethecongestionpolicy ofTCPandtherela­
tionshipsbetweenthethreephases.
Figure24.10TCPcongestionpolicysummary
ssthresh=112window
cwnd=1MSS
{-
Time-outSlowstart3 ACKs
Congestion Congestion
cwnd;:::ssthresh
ssthresh
=112window
cwnd=ssthresh
Time-out
Congestion
3
ACKs
Congestion avoidance Congestion
t
ssthresh=112wmdow
cwnd=ssthresh
WegiveanexampleinFigure24.11.Weassumethatthemaximumwindowsizeis
32segments.Thethresholdissetto
16segments(one-half ofthemaximumwindow
size).Inthe
slow-startphasethewindowsizestartsfrom 1andgrowsexponentially
untilitreachesthethreshold.Afteritreachesthethreshold,the
congestionavoidance
(additiveincrease)
procedureallowsthewindowsizetoincreaselinearlyuntilatime­
outoccurs
orthemaximumwindowsizeisreached.InFigure24.11,thetime-outoccurs
whenthewindowsizeis20.Atthismoment,the
multiplicativedecrease proceduretakes

SECTION24.4TWO EXAMPLES 773
Figure24.11 Congestionexample
cwnd
58
234
SS:Slowstart
AI:Additiveincrease
MD:Multiplicativedecrease
Time-out
7 8 9 10111213141516Rounds
26
24
22
20
18Threshold=16
16
14
12
10
08
06
04
02
overandreducesthethresholdtoone-half ofthepreviouswindowsize.Theprevious
windowsizewas20whenthetime-outhappenedsothenewthresholdisnow10.
TCPmovestoslowstartagainandstartswithawindowsize of1,andTCPmoves
toadditiveincreasewhenthenewthresholdisreached.Whenthewindowsizeis12,a
three-ACKseventhappens.
Themultiplicativedecreaseproceduretakesoveragain.
Thethresholdis setto6andTCPgoestotheadditiveincreasephasethistime. It
remainsinthisphaseuntilanothertime-outoranotherthreeACKshappen.
CongestionControl inFrameRelay
CongestioninaFrameRelaynetworkdecreasesthroughputandincreasesdelay.Ahigh
throughputandlowdelayarethemaingoals
oftheFrameRelayprotocol.FrameRelay
does
nothaveflowcontrol.Inaddition,FrameRelayallowstheusertotransmitbursty
data.ThismeansthataFrameRelaynetworkhasthepotentialto
bereallycongested
withtraffic,thusrequiringcongestioncontrol.
CongestionAvoidance
Forcongestionavoidance,theFrameRelayprotocoluses2bitsintheframetoexplicitly
warnthesourceandthedestination
ofthepresenceofcongestion.
BECN Thebackwardexplicitcongestionnotification(BECN) bitwarnsthesender of
congestioninthenetwork.Onemightaskhowthisisaccomplishedsincetheframesare
travelingawayfromthesender.Infact,therearetwomethods:Theswitchcanuseresponse
framesfromthereceiver(full-duplexmode),orelsetheswitchcanuseapredefinedconnec­
tion(DLCI
=1023)tosendspecialframesforthisspecificpurpose.Thesendercanrespond
tothiswarningbysimplyreducingthedatarate.Figure24.12showstheuseofBECN.
FECN Theforwardexplicitcongestionnotification(FECN) bitisusedtowarn
thereceiver
ofcongestioninthenetwork.Itmightappearthatthereceivercannotdo
anythingtorelievethecongestion.However,theFrameRelayprotocolassumesthatthe
senderandreceiverarecommunicatingwitheachotherandareusingsometype
offlow
controlatahigherlevel.
Forexample,ifthereisanacknowledgmentmechanism atthis

774 CHAPTER24CONGESTIONCONTROL ANDQUALITYOFSERVICE
Figure24.12 BECN
Directionofcongestion
~
FrameRelaynetwork
higherlevel,thereceivercandelaytheacknowledgment,thusforcingthesenderto
slowdown.Figure24.13showstheuseofFECN.
Figure24.13 FECN
FrameRelaynetwork
WhentwoendpointsarecommunicatingusingaFrameRelaynetwork,foursitua­
tionsmayoccurwithregardtocongestion.Figure24.14showsthesefoursituations
andthevalues
ofFECNandBECN.
Figure24.14 Fourcasesofcongestion
~~ B~NI
I~B~N~
a.Nocongestion b.Congestion inthedirectionA-B
~~N BE~NI
IFE~N BE~N~
~~B~NI
!FE;NBE~~
c.CongestioninthedirectionB-A d.Congestioninbothdirections

SECTION24.5QUALITYOFSERVICE 775
24.5QUALITY OFSERVICE
Qualityofservice(QoS)isaninternetworkingissuethathasbeendiscussedmorethan
defined.
Wecaninformallydefinequality ofserviceassomethinga flowseekstoattain.
FlowCharacteristics
Traditionally,fourtypes ofcharacteristicsareattributedtoaflow:reliability,delay,
jitter,andbandwidth,
asshowninFigure24.15.
Figure24.15
Flowcharacteristics
Reliability
Reliabilityisacharacteristicthataflowneeds.Lack ofreliabilitymeanslosinga
packetoracknowledgment,whichentailsretransmission.However,thesensitivity
of
applicationprogramstoreliabilityisnotthesame.Forexample,itismoreimportant
thatelectronicmail,filetransfer,andInternetaccesshavereliabletransmissionsthan
telephonyoraudioconferencing.
Delay
Source-to-destinationdelayisanother flowcharacteristic.Againapplicationscantolerate
delayindifferentdegrees.
Inthiscase,telephony,audioconferencing,videoconferenc­
ing,andremotelog-inneedminimumdelay,whiledelayin
filetransferore-mailisless
important.
Jitter
Jitteristhevariationindelayforpacketsbelongingtothesameflow.Forexample, if
fourpacketsdepartattimes 0,1,2,3andarriveat20,21,22, 23,allhavethesame
delay,20unitsoftime.Ontheotherhand,
iftheabovefourpacketsarriveat21,23,21,
and28,theywillhavedifferentdelays:21,22,19,and24.
Forapplicationssuch
asaudioandvideo,thefirstcaseiscompletelyacceptable;
thesecondcaseisnot.Fortheseapplications,itdoesnotmatter
ifthepacketsarrive
withashortorlongdelay
aslongasthedelayisthesameforallpackets.Forthisappli­
cation,thesecondcaseisnotacceptable.
Jitterisdefinedasthevariationinthepacketdelay.Highjittermeansthedifference
betweendelaysislarge;lowjittermeansthevariationissmall.
InChapter29,weshowhowmultimediacommunicationdealswithjitter.
Ifthe
jitterishigh,someactionisneededinorder
tousethereceiveddata.

776 CHAPTER 24CONGEST/ONCONTROL ANDQUALITYOFSERVICE
Bandwidth
Differentapplicationsneeddifferentbandwidths.Invideoconferencingweneedto
sendmillions
ofbitspersecondtorefreshacolor screenwhilethetotalnumber ofbits
inane-mailmaynotreachevenamillion.
FlowClasses
Basedontheflowcharacteristics,wecanclassifyflowsintogroups,witheachgroup
havingsimilarlevels
ofcharacteristics.Thiscategorizationisnotformaloruniversal;
someprotocolssuchasATMhavedefinedclasses,
aswewillseelater.
24.6lECHNIQUESTOIMPROVEQoS
InSection24.5wetriedtodefineQoSinterms ofitscharacteristics.Inthissection,we
discusssometechniquesthatcanbeusedtoimprovethequality
ofservice.Webriefly
discussfour
commonmethods:scheduling,trafficshaping,admissioncontrol,and
resourcereservation.
Scheduling
Packetsfromdifferentflowsarriveataswitchorrouterforprocessing. Agoodscheduling
techniquetreatsthedifferentflowsinafairandappropriatemanner.Severalscheduling
techniquesaredesignedtoimprovethequality
ofservice.Wediscussthree ofthemhere:
FIFOqueuing,priorityqueuing,andweightedfairqueuing.
FIFOQueuing
Infirst-in,first-out(FIFO)queuing, packetswait inabuffer(queue)untilthenode
(routerorswitch)isreadytoprocessthem.
Iftheaveragearrivalrateishigherthanthe
averageprocessingrate,thequeuewillfillupandnewpacketswillbediscarded.AFIFO
queue
isfamiliartothosewhohavehad towaitforabusatabusstop.
Figure24.16shows
aconceptualview
ofaFIFOqueue.
Figure24.16 FIFOqueue
Arrival Departure
PriorityQueuing
Inpriorityqueuing, packetsarefirstassignedtoapriorityclass.Eachpriorityclasshas
itsownqueue.Thepacketsinthehighest-priorityqueueareprocessedfirst.Packetsin
thelowest-priorityqueueareprocessedlast.Notethatthesystemdoesnotstopserving

SECTION24.6TECHNIQUESTOIMPROVEQoS 777
aqueueuntilitisempty.Figure24.17showspriorityqueuingwithtwoprioritylevels
(forsimplicity).
Figure24.17Priorityqueuing
Theswitchturnstotheother
1-
-queuewhenthecurrentone
:isempty.
I
I
Arrival
4ocesso~ Departure
Discard
ApriorityqueuecanprovidebetterQoSthantheFIFOqueuebecausehigher­
prioritytraffic,suchasmultimedia,canreachthedestinationwithlessdelay.However,
thereisapotentialdrawback.
Ifthereisacontinuousflowinahigh-priorityqueue,the
packetsinthelower-priorityqueueswillneverhaveachancetobeprocessed.Thisisa
conditioncalledstarvation.
WeightedFairQueuing
Abetterschedulingmethodisweighted fairqueuing.Inthistechnique,thepacketsare
stillassignedtodifferentclassesandadmittedtodifferentqueues.Thequeues,how­
ever,areweightedbasedonthepriority
ofthequeues;higherprioritymeansahigher
weight.Thesystemprocessespacketsineachqueueinaround-robinfashionwiththe
number
ofpacketsselectedfromeachqueuebasedonthecorrespondingweight.For
example,
iftheweightsare 3,2,and1,threepacketsareprocessedfromthefirstqueue,
twofromthesecondqueue,and
onefromthethirdqueue. Ifthesystemdoesnot
imposepriorityontheclasses,allweightscanbeequaLInthisway,wehavefairqueuing
withpriority.Figure24.18showsthetechniquewiththreeclasses.
TrafficShaping
Trafficshapingisamechanismtocontroltheamountandtherate ofthetrafficsentto
thenetwork.Twotechniquescanshapetraffic:leakybucketandtokenbucket.
LeakyBucket
Ifabuckethasasmallholeatthebottom,thewaterleaksfromthebucketataconstantrate
aslongasthereiswaterinthebucket.Therateatwhichthewaterleaksdoesnotdepend
ontherateatwhichthewater
isinputtothebucketunlessthebucketisempty.Theinput
ratecanvary,buttheoutputrateremainsconstant.Similarly,innetworking,atechnique
calledleaky
bucketcansmoothoutburstytraffic.Burstychunksarestoredinthebucket
andsentoutatanaveragerate.Figure24.19showsaleakybucketanditseffects.

778 CHAPTER24CONGESTIONCONTROL ANDQUALITYOFSERVICE
Figure24.18 Weightedfairqueuing
Arrival
Thetumingswitchselects
3packetsfromfirstqueue,
1------,then2packetsfromthesecond
'---'---'--'-'-............-L.....J queue,then Ipacketfromthe
thirdqueue.Thecyclerepeats.
Departure
Figure24.19 Leakybucket
Burstyflow
I---12Mbps
2Mbps
I I
012345678910
Burstydata
o
1--1-1_~_Mb_1 -=-P~-I-I-I-~
2345678910 s
,Fixedflow
Fixed-ratedata
Inthefigure,weassumethatthenetworkhascommittedabandwidth of3Mbps
forahost.Theuse
oftheleakybucketshapestheinputtrafficto makeitconformtothis
commitment.
InFigure24.19thehostsendsaburst ofdataatarate of12Mbpsfor2 s,
foratotalof24Mbitsofdata.Thehostissilentfor5 sandthensendsdataatarate of
2Mbpsfor3s,foratotal of6Mbitsofdata.Inall,thehosthassent30Mbits ofdatain
lOs.Theleakybucketsmoothsthetraffic bysendingout dataatarateof3Mbpsduring
thesame10
s.Withouttheleakybucket,thebeginningburstmayhavehurtthenetwork
byconsumingmorebandwidththanissetasideforthishost.We canalsoseethatthe
leakybucketmaypreventcongestion.Asananalogy,consider thefreewayduringrush
hour(burstytraffic).If,instead,commuterscouldstaggertheirworkinghours,congestion
o'nourfreewayscouldbeavoided.
Asimple leakybucketimplementationisshown
inFigure24.20.AFIFOqueue
holdsthepackets.Ifthetrafficconsistsoffixed-sizepackets(e.g.,cells inATM

SECTION24.6TECHNIQUESTOIMPROVEQoS 779
Figure24.20Leakybucketimplementation
Leakybucketalgorithm
Arrival Departure
networks),theprocessremovesafixednumber ofpacketsfromthequeueateachtick
oftheclock.Ifthetrafficconsists ofvariable-lengthpackets,thefixedoutputratemust
bebasedonthenumber
ofbytesorbits.
Thefollowingisanalgorithmforvariable-lengthpackets:
1.Initializeacounterto natthetick oftheclock.
2.
Ifnisgreaterthanthesize ofthepacket,sendthepacketanddecrementthe
counter
bythepacketsize.Repeatthisstepuntil nissmallerthanthepacketsize.
3.Resetthecounterandgotostep
1.
Aleakybucketalgorithmshapesburstytrafficintofixed-ratetrafficby
averagingthedatarate.
Itmaydropthepackets ifthebucketisfull.
TokenBucket
Theleakybucketisveryrestrictive. Itdoesnotcreditanidlehost.Forexample, ifa
hostisnotsendingforawhile,itsbucketbecomesempty.Now
ifthehosthasbursty
data,theleakybucketallowsonlyanaveragerate.Thetimewhenthehostwasidleis
nottakenintoaccount.
Ontheotherhand,the tokenbucketalgorithmallowsidle
hoststoaccumulatecreditforthefutureintheform
oftokens.Foreachtick ofthe
clock,thesystemsends
ntokenstothebucket. Thesystemremovesonetokenfor
everycell(orbyte)
ofdatasent.Forexample, ifnis100andthehostisidlefor100ticks,
thebucketcollects10,000tokens.Nowthehostcanconsumeallthesetokensinone
tick
with10,000cells, orthehosttakes1000tickswith10cells pertick.In other
words,thehostcansendburstydataaslong asthebucketisnotempty.Figure24.21
showstheidea.
Thetokenbucketcaneasily
beimplementedwithacounter.Thetokenisinitial­
izedtozero.Eachtimeatokenisadded,thecounterisincrementedby
1.Eachtimea
unit
ofdataissent,thecounterisdecremented by1.Whenthecounteriszero,thehost
cannotsenddata.
Thetokenbucketallowsburstytraffic ataregulatedmaximumrate.

780 CHAPTER 24CONGESTIONCONTROLAND QUAliTYOFSERVICE
Figure24.21Tokenbucket
Onetokenadded
pertick
~
Arrival Departure
CombiningTokenBucket andLeakyBucket
Thetwotechniquescanbecombinedtocreditanidlehostandatthesametimeregulate
thetraffic.Theleakybucket
isappliedafterthetokenbucket;therate oftheleakybucket
needstobehigherthantherate
oftokensdroppedinthebucket.
ResourceReservation
Aflowofdataneedsresourcessuchasabuffer,bandwidth,CPUtime,andsoon.The
quality
ofserviceisimproved iftheseresourcesare reservedbeforehand.Wediscussin
thissectiononeQoSmodelcalledIntegratedServices,whichdependsheavilyonresource
reservationtoimprovethequality
ofservice.
AdmissionControl
Admissioncontrolreferstothemechanismusedbyarouter,oraswitch,toaccept or
rejectaflowbasedonpredefinedparameterscalledflowspecifications.Beforearouter
acceptsaflowforprocessing,itcheckstheflowspecificationstosee
ifitscapacity(in
terms
ofbandwidth,buffersize,CPUspeed,etc.)anditspreviouscommitmentstoother
flowscanhandlethenew
flow.
24.7INTEGRATED SERVICES
BasedonthetopicsinSections24.5and24.6,twomodelshavebeendesignedtoprovide
quality
ofserviceintheInternet:IntegratedServicesandDifferentiatedServices.Both
modelsemphasizetheuse
ofqualityofserviceatthenetworklayer(IP),althoughthe
modelcanalsobeusedinotherlayerssuch
asthedata
linleWediscussIntegratedServices
inthissectionandDifferentiatedServiceinSection24.8.
AswelearnedinChapter20,IPwasoriginallydesignedfor
best-effortdelivery.
Thismeansthateveryuserreceivesthesamelevel
ofservices.Thistype ofdelivery

SECTION24.7 INTEGRATEDSERVICES 781
doesnotguaranteetheminimum ofaservice,suchasbandwidth,toapplicationssuch
asreal-timeaudioandvideo.
Ifsuchanapplicationaccidentallygetsextrabandwidth,
itmaybedetrimentaltootherapplications,resultingincongestion.
IntegratedServices, sometimescalled IntServ,isafiow-basedQoSmodel,which
meansthatauserneedstocreatea
flow,akindofvirtualcircuit,fromthesourcetothe
destinationandinformallrouters
oftheresourcerequirement.
IntegratedServicesisa
flow~based QoSmodeldesignedforIP.
Signaling
ThereadermayrememberthatIPisaconnectionless,datagram,packet-switchingpro­
tocol.Howcanweimplementaflow-basedmodeloveraconnectionlessprotocol?The
solutionisasignalingprotocoltorunover IPthatprovidesthesignalingmechanismfor
makingareservation.Thisprotocol
iscalledResourceReservationProtocol(RSVP)
andwillbediscussedshort! y.
Flow Specification
Whenasourcemakesareservation,itneedstodefineaflowspecification.Aflowsped­
ficationhastwoparts:Rspec(resourcespecification)andTspec(trafficspecification).
Rspecdefinestheresourcethattheflowneedstoreserve(buffer,bandwidth,etc.).Tspec
definesthetrafficcharacterization
oftheflow.
Admission
Afterarouterreceivestheflowspecificationfromanapplication,itdecidestoadmitor
denytheservice.Thedecisionisbasedonthepreviouscommitments
oftherouterand
thecurrentavailability
oftheresource.
ServiceClasses
TwoclassesofserviceshavebeendefinedforIntegratedServices:guaranteedservice
andcontrolled-loadservice.
GuaranteedServiceClass
Thistype ofserviceisdesignedforreal-timetrafficthatneedsaguaranteedminimum
end-to-enddelay.Theend-to-enddelayisthesum
ofthedelaysintherouters,theprop­
agationdelayinthemedia,andthesetupmechanism.Onlythefirst,thesum
ofthe
delaysintherouters,canbeguaranteedbytherouter.Thistype
ofserviceguarantees
thatthepacketswillarrivewithinacertaindeliverytimeandarenotdiscarded
ifflow
trafficstayswithintheboundary
ofTspec.Wecansaythatguaranteedservicesare
quantitativeservices,inwhichtheamount
ofend-to-enddelayandthedataratemustbe
definedbytheapplication.

782 CHAPTER 24CONGESTIONCONTROL ANDQUALITYOFSERVICE
Controlled-LoadServiceClass
This typeofserviceisdesigned forapplicationsthatcanacceptsomedelays,butare
sensitivetoanoverloadednetworkandtothedanger
oflosingpackets.Goodexamples
ofthesetypes ofapplicationsarefiletransfer,e-mail,andInternetaccess.Thecontrolled­
loadserviceisaqualitativetype
ofserviceinthattheapplicationrequeststhepossibility
oflow-lossorno-losspackets.
RSVP
IntheIntegratedServicesmodel,anapplicationprogramneedsresourcereservation.As
welearnedinthediscussion
oftheIntServmodel,theresourcereservationisfora flow.
Thismeansthat ifwewanttouseIntServatthe IPlevel,weneedtocreateaflow,akind
ofvirtual-circuitnetwork,out oftheIP,whichwasoriginallydesignedasadatagram
packet-switchednetwork.Avirtual-circuitnetworkneedsasignalingsystemtosetupthe
virtualcircuitbeforedatatrafficcanstart.TheResourceReservationProtocol(RSVP)
is
asignalingprotocoltohelpIPcreateaflowandconsequentlymakearesourcereserva­
tion.BeforediscussingRSVP,weneedtomentionthat
itisanindependentprotocol
separatefromtheIntegratedServicesmodel.Itmay
beusedinothermodels inthefuture.
MulticastTrees
RSVPisdifferentfromsomeothersignalingsystemswehaveseenbeforeinthatitisa
signalingsystemdesignedformulticasting.However,
RSVPcanbealsousedforuni­
castingbecauseunicastingis
justaspecialcase ofmulticastingwithonlyonemember
inthemulticastgroup. ThereasonforthisdesignistoenableRSVPtoprovideresource
reservationsforallkinds
oftrafficincludingmultimediawhichoftenusesmulticasting.
Receiver-BasedReservation
InRSVP,thereceivers,notthesender,makethereservation.Thisstrategymatchesthe
othermulticastingprotocols.Forexample,
inmulticastroutingprotocols,thereceivers,
notthesender,makeadecisionto
joinorleaveamulticastgroup.
RSVPMessages
RSVPhasseveraltypes ofmessages.However,for ourpurposes,wediscussonlytwo
ofthem:PathandResv.
PathMessagesRecall thatthereceiversinaflowmakethereservationinRSVP.
However,thereceiversdonotknowthepathtraveledbypacketsbeforethereservation
ismade.
Thepathisneededforthereservation.Tosolvetheproblem, RSVPusesPath
messages.APathmessagetravelsfromthesenderandreachesallreceivers inthemulti­
castpath.
Ontheway,aPathmessagestoresthenecessaryinformationforthereceivers.
APathmessageissent
inamulticastenvironment;anewmessageiscreatedwhenthe
pathdiverges.Figure24.22showspathmessages.
ResvMessagesAfterareceiverhasreceivedaPathmessage,itsendsa
Resvmessage.
TheResvmessagetravelstowardthesender(upstream)andmakesaresourcereservation
ontheroutersthatsupportRSVP. IfarouterdoesnotsupportRSVPonthepath,itroutes

SECTION24.7 INTEGRATEDSERVICES 783
Figure24.22Pathmessages
Path
~
81
Path
0-
Path
0-
ReI
Path
0-
~path
Rc2
Rc3
thepacketbasedonthebest-effortdeliverymethodswediscussedbefore.Figure24.23
showstheResvmessages.
Figure24.23Resvmessages
81
Resv
~D
Resv
~
Rcl Rc2
ReservationMerging
InRSVP,theresourcesarenotreservedforeachreceiverinaflow;thereservationis
merged.
InFigure24.24,Rc3requestsa2-MbpsbandwidthwhileRc2requestsaI-Mbps
bandwidth.RouterR3,whichneedstomakeabandwidthreservation,mergesthetwo
requests.Thereservationismadefor2Mbps,thelarger
ofthetwo,becausea2-Mbps
inputreservationcanhandlebothrequests.ThesamesituationistrueforR2.The
readermayaskwhyRc2andRc3,bothbelongingtoonesingle
flow,requestdifferent
amounts
ofbandwidth.Theansweristhat,inamultimediaenvironment,different
receiversmayhandledifferentgrades
ofquality.Forexample,Rc2maybe
able'to
receivevideoonlyat1Mbps(lowerquality),whileRc3maybeabletoreceivevideoat
2Mbps(higherquality).
Figure24.24
Reservationmerging
3Mbps
~ R2
Rcl
2Mbps
~
Rc2

784 CHAPTER 24CONGESTIONCONTROL ANDQUALITYOFSERVICE
ReservationStyles
Whenthereismorethanone
flow,therouterneedstomakeareservationtoaccommodate
all
ofthem.RSVPdefinesthreetypes ofreservationstyles, asshowninFigure24.25.
Figure24.25 Reservationstyles
WildCardFilterStyleInthisstyle,theroutercreatesasinglereservationforall
senders.Thereservationisbasedonthelargestrequest.Thistype
ofstyleisusedwhen
theflowsfromdifferentsendersdonotoccuratthesametime.
FixedFilterStyleInthisstyle,theroutercreatesadistinctreservationforeach flow.
Thismeansthat ifthereare nflows,ndifferentreservationsaremade.Thistype ofstyle
isusedwhenthereisahighprobabilitythatflowsfromdifferentsenderswilloccurat
thesametime.
SharedExplicitStyle Inthisstyle,theroutercreatesasinglereservationwhichcan
besharedbyaset
offlows.
SoftState
Thereservationinformation(state)storedineverynodeforaflowneedstoberefreshed
periodically.Thisisreferredtoasasoftstateascomparedtothehardstateused
in
othervirtual-circuitprotocolssuchasATM orFrameRelay,wheretheinformation
abouttheflowismaintaineduntil
itiserased.Thedefaultintervalforrefreshingis
currently30
s.
ProblemswithIntegrated Services
Thereareatleasttwoproblems withIntegratedServicesthatmaypreventitsfullimple­
mentationintheInternet:scalabilityandservice-typelimitation.
Scalability
TheIntegratedServicesmodelrequiresthateachrouterkeepinformationforeach
flow.
AstheInternetisgrowingeveryday,thisisaseriousproblem.
Service-TypeLimitation
TheIntegratedServicesmodelprovidesonlytwotypes
ofservices,guaranteedand
control-load.Thoseopposingthismodelarguethatapplicationsmayneedmorethan
thesetwotypes
ofservices.

SECTION24.8DIFFERENTIATEDSERVICES 785
24.8DIFFERENTIATED SERVICES
DifferentiatedServices(DSorDiffserv)wasintroducedbytheIETF(InternetEngi­
neeringTaskForce)tohandletheshortcomingsofIntegratedServices.
Twofundamental
changesweremade:
1.Themainprocessingwasmovedfromthecoreofthenetworktotheedge ofthe
network.Thissolvesthescalabilityproblem.Theroutersdonothavetostore
informationaboutflows.Theapplications,orhosts,definethetype
ofservicethey
needeachtimetheysendapacket.
2.Theper-flowserviceischangedtoper-classservice.Therouterroutesthepacket
basedontheclass
ofservicedefinedinthepacket,notthe flow.Thissolvesthe
service-typelimitationproblem.
Wecandefinedifferenttypes ofclassesbasedon
theneeds
ofapplications.
DifferentiatedServicesisaclass-basedQoSmodeldesignedforIP.
DSField
InDiffserv,eachpacketcontainsafieldcalledtheDSfield.Thevalue ofthisfieldisset
attheboundaryofthenetworkbythehostorthefirstrouter designated
astheboundary
router.IETFproposestoreplacetheexistingTOS(type
ofservice)fieldinIPv4orthe
classfieldinIPv6bythe
DSfield,asshowninFigure24.26.
Figure24.26
DSfield
DSCP
.I~
TheDSfieldcontainstwosubfields:DSCPandCU.TheDSCP(Differentiated
ServicesCodePoint)isa6-bitsubfieldthatdefinestheper-hopbehavior(PHB).The
2-bitCU(currentlyunused)subfieldisnotcurrentlyused.
TheDiffservcapablenode(router)usestheDSCP6bits
asanindextoatable
definingthepacket-handlingmechanismforthecurrentpacketbeingprocessed.
Per-HopBehavior
TheDiffservmodeldefinesper-hopbehaviors(PHBs)foreachnodethatreceivesa
packet.SofarthreePHBsaredefined:DEPHB,EFPHB,andAFPHB.
DEPHBTheDEPHB(defaultPHB)isthesameasbest-effortdelivery,whichis
compatiblewithTOS.
EFPHBTheEFPHB(expeditedforwardingPHB) providesthefollowingservices:
oLowloss

786 CHAPTER 24CONGESTIONCONTROLANDQUALITYOFSERVICE
oLowlatency
oEnsuredbandwidth
Thisisthesame
ashavingavirtualconnectionbetweenthesourceanddestination.
AF
PHBTheAFPHB(assuredforwardingPHB)deliversthepacketwithahigh
assurance
aslongastheclasstrafficdoesnotexceedthetrafficprofile ofthenode.The
usersofthenetworkneedtobeawarethatsomepacketsmaybediscarded.
TrafficConditioner
ToimplementOiffserv,theOSnodeusestrafficconditionerssuchasmeters,markers,
shapers,anddroppers,
asshowninFigure24.27.
Figure24.27Trafficconditioner
Trafficconditioner
I"£&J
Input
-----""J
'-......-......
Dropped
kd
I-I-~~ Output
MetersThemetercheckstosee iftheincomingflowmatchesthenegotiatedtraffic
profile.Themeteralsosendsthisresulttoothercomponents.Themetercanuseseveral
toolssuch
asatokenbuckettochecktheprofile.
MarkerAmarkercanremarkapacketthatisusingbest-effortdelivery(OSCP:
000000)ordown-markapacketbasedoninformationreceivedfromthemeter.Down­
marking(loweringtheclass
oftheflow)occurs iftheflowdoesnotmatchtheprofile.A
markerdoesnotup-mark(promotetheclass)apacket.
ShaperAshaperusestheinformationreceivedfromthemetertoreshapethetraffic if
itisnotcompliantwiththenegotiatedprofile.
DropperAdropper,whichworks asashaperwithnobuffer,discardspackets ifthe
flowseverelyviolatesthenegotiatedprofile.
24.9QoSINSWITCHEDNETWORKS
WediscussedtheproposedmodelsforQoSintheIPprotocols.LetusnowdiscussQoS
asusedintwoswitchednetworks:FrameRelayandATM.Thesetwonetworksare
virtual-circuitnetworksthatneedasignalingprotocolsuch
asRSVP.

SECTION24.9QoSINSWITCHEDNETWORKS 787
QoSin FrameRelay
FourdifferentattributestocontroltraffichavebeendevisedinFrameRelay:accessrate,
committedburstsize
Be'committedinformationrate(CIR),andexcessburstsize Be'
Thesearesetduringthenegotiationbetweentheuserandthenetwork.ForPVCcon­
nections,theyarenegotiatedonce;forSVCconnections,theyarenegotiatedforeach
connectionduringconnectionsetup.Figure24.28showstherelationshipsbetweenthese
fourmeasurements.
Figure24.28 Relationshipbetweentrafficcontrolattributes
Rate
(bps)
Access
1-- _
rate
Area=B.
eIR1----------------
T(s)
AccessRate
Foreveryconnection,an accessrate(inbitspersecond)isdefined.Theaccessrate
actuallydependsonthebandwidth
ofthechannelconnectingtheusertothenetwork.
Theusercanneverexceedthisrate.Forexample,
iftheuserisconnectedtoaFrame
RelaynetworkbyaT-lline,theaccessrateis1.544Mbpsandcanneverbeexceeded.
CommittedBurstSize
Foreveryconnection,FrameRelaydefinesa committedburstsizeBe.Thisisthe
maximumnumber
ofbitsinapredefinedtimethatthenetworkiscommittedtotransfer
withoutdiscardinganyframeorsettingtheDEbit.Forexample,
ifaBeof400kbitsfor
aperiod
of4 sisgranted,theusercansendupto400kbitsduringa4-sintervalwithout
worryingaboutanyframeloss.Notethatthisisnotaratedefinedforeachsecond.
Itis
acumulativemeasurement.Theusercansend300kbitsduringthefirstsecond,nodata
duringthesecondandthethirdseconds,andfinally100kbitsduringthefourthsecond.
CommittedInformationRate
Thecommittedinformationrate (CIR)issimilarinconcepttocommittedburstsize
exceptthatitdefinesanaveragerateinbitspersecond.
Iftheuserfollowsthisratecon­
tinuously,thenetworkiscommittedtodelivertheframes.However,becauseitisan
averagemeasurement,ausermaysenddataatahigherratethantheCIRattimesorat

788 CHAPTER24CONGESTIONCONTROL ANDQUALITYOFSERVICE
alowerrateothertimes.Aslongastheaverageforthepredefinedperiodismet,the
frameswillbedelivered.
Thecumulativenumber
ofbitssentduringthepredefinedperiodcannotexceed
Be
NotethattheCIR isnotanindependentmeasurement;itcanbecalculatedbyusingthe
followingformula:
B
CIR==....Ebps
T
Forexample,iftheBeis5kbitsinaperiod of5s,theCIRis5000/5,or1kbps.
Excess
BurstSize
Foreveryconnection,FrameRelaydefinesan
excessburstsizeBe"Thisisthemaximum
number
ofbitsinexcess ofBethatausercansendduringapredefinedtime.Thenetwork
iscommittedtotransferthesebits
ifthereisnocongestion.Notethatthereislesscom­
mitmentherethaninthecase
of
BeThenetworkiscommittingitselfconditionally.
UserRate
Figure24.29showshowausercansendburstydata.
IftheuserneverexceedsB
C'the
networkiscommittedtotransmittheframeswithoutdiscarding
any.Iftheuserexceeds
Bebylessthan Be(thatis,thetotalnumber ofbitsislessthan Be+Be)'thenetwork is
committedtotransferalltheframes ifthereisnocongestion. Ifthereiscongestion,
someframeswillbediscarded.Thefirstswitchthatreceivestheframesfromtheuser
hasacounterandsetsthe
DEbitfortheframesthatexceed
BeTherestoftheswitches
willdiscardtheseframes
ifthereiscongestion.Notethatauserwhoneedstosenddata
fastermayexceedthe
Belevel.Aslongasthelevelisnotabove Be+Be'thereisa
chancethattheframeswillreachthedestinationwithoutbeingdiscarded.Remember,
however,thatthemomenttheuserexceedsthe
Be+Belevel,alltheframessentafter
thatarediscardedbythefirstswitch.
Figure24.29 Userrateinrelationto BeandBe+Be
Ifareaislessthan Be'nodiscarding(DE =0).
Rate
Ifareaisbetween BeandBe+Be'possiblediscarding ifcongestion(DE =1).
(bps)
Ifareaisgreaterthan Be+Be'discardingoccurs.
Accessrate
r---------------------- ---------
Actual Actualrate
Actualrate rate
eIR
f------ --------------
Actualrate
Area=totalbitssentinTs
Actualrate
T(s)

SECTION24.9QoSINSWITCHEDNETWORKS 789
QoSinATM
TheQoS inATMisbasedontheclass,user-relatedattributes,andnetwork-relatedattributes.
Classes
TheATMForumdefinesfourserviceclasses: CBR,VBR,ABR,andUBR(seeFig­
ure24.30).
Figure24.30 Serviceclasses
CBRTheconstant-bit-rate(CBR)classisdesignedforcustomerswhoneedreal­
timeaudio
orvideoservices.Theservice issimilartothatprovidedbyadedicatedline
such
asa Tline.
VBRThe
variable-bit-rate(VBR)classisdividedintotwosubclasses:real-time
(VBR-RT)andnon-real-time(VBR-NRT).VBR-RTisdesignedforthoseuserswho
needreal-timeservices(suchasvoiceandvideotransmission)andusecompression
techniquestocreateavariablebitrate.VBR-NRTisdesignedforthoseuserswhodo
notneedreal-timeservicesbutusecompressiontechniques
tocreateavariablebitrate.
ABRTheavailable-bit-rate(ABR)classdeliverscellsataminimumrate. Ifmore
networkcapacityisavailable,thisminimumratecanbeexceeded.ABRisparticularly
suitableforapplicationsthatarebursty.
UBRTheunspecified-bit-rate(UBR)class isabest-effortdeliveryservicethatdoes
notguaranteeanything.
Figure24.31showstherelationship
ofdifferentclassestothetotalcapacity ofthe
network.
Figure24.31 Relationshipofserviceclassestothetotalcapacity ofthenetwork
Capacity
Time

790 CHAPTER24CONGESTIONCONTROLAND QUAUTYOFSERVICE
User-RelatedAttributes
ATMdefinestwosets ofattributes.User-relatedattributesarethoseattributesthat
definehowfasttheuserwants
tosenddata.Thesearenegotiatedatthetime ofcontract
betweenauserandanetwork.Thefollowingaresomeuser-relatedattributes:
SCRThesustainedcellrate (SCR)istheaveragecellrateoveralongtimeinterval.
Theactualcellratemaybelowerorhigherthanthisvalue,buttheaverageshouldbe
equal
toorlessthantheSCR.
PCRThepeakcellrate (PCR)definesthesender'smaximumcellrate.Theuser's
cellratecansometimesreachthispeak,
aslongastheSCRismaintained.
MCR Theminimumcellrate (MCR)definestheminimumcellrateacceptable tothe
sender.Forexample,
iftheMCRis50,000,thenetworkmustguaranteethatthesender
cansendatleast50,000cellspersecond.
CVDT The
cellvariationdelaytolerance (CVDT)isameasure ofthevariationin
celltransmissiontimes.Forexample,
iftheCVDTis5ns,thismeansthatthediffer­
encebetweentheminimumandthemaximumdelaysindeliveringthecellsshouldnot
exceed5ns.
Network-RelatedAttributes
Thenetwork-relatedattributesarethosethatdefinecharacteristics ofthenetwork.The
followingaresomenetwork-relatedattributes:
CLRThecelllossratio (CLR)definesthefraction ofcellslost(ordeliveredsolate
thattheyareconsideredlost)duringtransmission.Forexample,
ifthesendersends
100cellsandone
ofthemislost,theCLR is
CLR=_1_=10-
2
100
CTDThecelltransferdelay (CTD)istheaveragetimeneededforacell totravel
fromsource
todestination.ThemaximumCTDandtheminimumCTDarealsocon­
sideredattributes.
CDVThe
celldelayvariation (CDV)isthedifferencebetweentheCTDmaximum
andtheCTDminimum.
CERThecellerrorratio (CER)definesthefraction ofthecellsdeliveredinerror.
24.10RECOMMENDED READING
Formoredetailsaboutsubjectsdiscussedinthischapter,werecommendthefollowing
booksandsites.Theitemsinbrackets[
...]refertothereferencelistattheend of
thetext.

SECTION24.12SUMMARY 791
Books
CongestioncontrolandQoSarediscussedinSections5.3and5.5 of[Tan03]and in
Chapter3 of[Sta9S].EasyreadingaboutQoScanbefoundin[FH98].Thefulldiscus­
sion
ofQoSiscoveredin [BlaOO].
24.11KEYTERMS
accessrate
additiveincrease
availablebitrate(ABR)
averagedatarate
backwardexplicitcongestionnotification
(BECN)
burstydata
chokepacket
closed-loopcongestioncontrol
committedburstsize
Be
committedinformationrate(CIR)
congestion
congestionavoidance
congestioncontrol
constantbitrate(CBR)
delay
DifferentiatedServices(DS
orDiffserv)
effectivebandwidth
excessburstsize
Be
first-in,first-out(FIFO)queuing
forwardexplicitcongestionnotification
(FECN)
IntegratedServices(IntServ)
jitter
leakybucket
load
maximumburstsize
multiplicativedecrease
open-loopcongestioncontrol
Pathmessage
peakdatarate
per-hopbehavior(PHB)
priorityqueuing
quality
ofservice(QoS)
reliability
ResourceReservationProtocol(RSVP)
Resvmessage
slowstart
throughput
tokenbucket
trafficshaping
unspecifiedbitrate(UBR)
variablebitrate(VBR)
weightedfairqueuing
24.12SUMMARY
oTheaveragedatarate,peakdatarate,maximumburstsize,andeffectivebandwidth
arequalitativevaluesthatdescribeadata
flow.
oAdataflowcanhaveaconstantbitrate,avariablebitrate, ortrafficthat isbursty.
oCongestioncontrolrefers tothemechanismsandtechniquestocontrolcongestion
andkeeptheloadbelowcapacity.
oDelayandthroughputmeasuretheperformance ofanetwork.
oOpen-loopcongestioncontrolpreventscongestion;closed-loopcongestioncontrol
removescongestion.

792 CHAPTER 24CONGESTIONCONTROL ANDQUALITYOFSERVICE
oTCPavoidscongestionthroughtheuse oftwostrategies:thecombination ofslow
startandadditiveincrease,andmultiplicativedecrease.
DFrameRelayavoidscongestionthroughtheuse oftwostrategies:backward
explicitcongestionnotification(BECN)andforwardexplicitcongestionnotification
(FECN).
DAflowcanbecharacterizedbyitsreliability,delay,jitter,andbandwidth.
oScheduling,trafficshaping,resourcereservation,andadmissioncontrolaretech-
niquestoimprovequality
ofservice(QoS).
DFIFOqueuing,priorityqueuing,andweightedfairqueuingareschedulingtechniques.
oLeakybucketandtokenbucketaretrafficshapingtechniques.
DIntegratedServicesisaflow-basedQoSmodeldesignedfor IP.
oTheResourceReservationProtocol(RSVP)isasignalingprotocolthathelpsIP
createaflowandmakesaresourcereservation.
oDifferentialServicesisaclass-basedQoSmodeldesignedfor IP.
oAccessrate,committedburstsize,committedinformationrate,andexcessburst
sizeareattributestocontroltrafficinFrameRelay.
oQualityofservicein ATMisbasedonserviceclasses,user-relatedattributes,and
network-relatedattributes.
24.13PRACTICESET
ReviewQuestions
I.Howarecongestioncontrolandquality ofservicerelated?
2.Whatisatrafficdescriptor?
3.Whatistherelationshipbetweentheaveragedatarateandthepeakdatarate?
4.Whatisthedefinition
ofburstydata?
5.Whatisthedifferencebetweenopen-loopcongestioncontrolandclosed-loop
congestioncontrol?
6.Namethepoliciesthatcanpreventcongestion.
7.Namethemechanismsthatcanalleviatecongestion.
8.WhatdeterminesthesenderwindowsizeinTCP?
9.HowdoesFrameRelaycontrolcongestion?
10.Whatattributescanbeusedtodescribeaflow
ofdata?
11.Whatarefourgeneraltechniquestoimprovequality ofservice?
12.Whatistrafficshaping?Nametwomethodstoshapetraffic.
13.WhatisthemajordifferencebetweenIntegratedServicesandDifferentiatedServices?
14.HowisResourceReservationProtocolrelatedtoIntegratedServices?
IS.WhatattributesareusedfortrafficcontrolinFrameRelay?
16.Inregardtoquality ofservice,howdouser-relatedattributesdifferfromnetwork­
relatedattributesinATM?

SECTION24.13PRACTICESET 793
Exercises
17.Theaddressfield ofaFrameRelayframeis1011000000010 Ill.Isthereanycon­
gestionintheforwarddirection?Isthereanycongestioninthebackwarddirection?
18.AframegoesfromAtoB.Thereiscongestioninbothdirections.Isthe
PECNbit
set?Isthe
BECNbitset?
19.Inaleakybucketusedtocontrolliquid
flow,howmanygallons ofliquidareleft inthe
bucket
iftheoutputrateis5gal/min,thereisaninputburst of100gal/minfor12s,
andthereisnoinputfor48s?
20.
Anoutputinterfaceinaswitchisdesignedusingtheleaky bucketalgorithmto
send8000bytes/s(tick).
Ifthefollowingframesarereceived insequence, showthe
framesthataresentduringeachsecond.
Frames
1,2,3,4:4000byteseach
Frames5,6,
7:3200byteseach
Frames8,
9:400byteseach
Frames10,11,12:2000byteseach
21.AuserisconnectedtoaFrameRelaynetworkthrougha
T-lline.Thegranted CIR
is1Mbpswitha Beof5millionbits/5sand Beof1millionbits/5s.
a.Whatistheaccessrate?
b.
Cantheusersenddataat1.6Mbps?
c.Cantheusersenddataat1Mbpsallthetime?Isitguaranteedthatframesare
neverdiscardedinthiscase?
d.Cantheusersenddataat1.2Mbpsallthetime?Isitguaranteedthatframesare
neverdiscardedinthiscase?
Iftheanswerisno,isitguaranteedthatframesare
discardedonly
ifthereiscongestion?
e.Repeatthequestion
inpart(d)foraconstantrate of1.4Mbps.
f.Whatisthemaximumdataratetheusercanuseallthetimewithoutworrying
abouttheframesbeingdiscarded?
g.
Iftheuserwantstotakearisk,whatisthemaximumdataratethatcan beused
withnochance
ofdiscardingifthereisnocongestion?
22.
InExercise21theusersendsdataat1.4Mbpsfor2 sandnothingforthenext3 s.
Isthereadanger ofdiscardeddata ifthereisnocongestion?Isthereadanger of
discardeddata ifthereiscongestion?
23.InATM,
ifeachcelltakes10
Jlstoreachthedestination,whatistheCTD?
24.
AnATMnetworkhaslost5cellsout of10,000and2areinerror.WhatistheCLR?
WhatistheCER?

ApplicationLayer
Objectives
Theapplicationlayerenablestheuser,whetherhumanorsoftware,toaccessthenet­
work.Itprovidesuserinterfacesandsupportforservicessuch
aselectronicmail,file
accessandtransfer,accesstosystemresources,surfingtheworldwideweb,andnet­
workmanagement.
Theapplicationlayerisresponsibleforprovidingservicesto theuser.
Inthispart, webrieflydiscusssomeapplicationsthataredesigned asaclient/server
pairintheInternet.Theclientsendsarequestforaservicetotheserver;theserver
respondstotheclient.
Part6ofthebookisdevotedto theapplicationlayer
andtheservicesprovided bythislayer.
Chapters
Thispartconsists offivechapters:Chapters 25to29.
Chapter25
Chapter25discussestheDomainNameSystem(DNS).DNS isaclient/serverapplication
thatprovidesnameservicesforotherapplications.Itenablestheuse
ofapplication­
layeraddresses,suchasanemailaddress,instead
ofnetworklayerlogicaladdresses.
Chapter26
Chapter26discussesthreecommonapplicationsintheInternet:remotelogin,electronic
mail,and
filetransfer.Aremoteloginapplicationallowstheusertoremotelyaccessthe
resources
ofasystem.Anelectronicmailapplicationsimulatesthetasks ofsnailmailata
muchhigherspeed.Afiletransferapplicationtransfersfilesbetweenremotesystems.

Chapter27
Chapter27discusstheideasandissuesinthefamousworldwideweb(WWW). Italso
brieflydescribestheclient/serverapplicationprogram(HTTP)thatiscommonlyused
toaccesstheweb.
Chapter28
Chapter28isdevotedtonetworkmanagement.Wefirstdiscussthegeneralideabehind
networkmanagement.Wethenintroducetheclient/serverapplication,SNMP,thatis
usedforthispurposeintheInternet.Althoughnetworkmanagementcanbeimplemented
ineverylayer,theInternethasdecidedtouseaclient/serverapplication.
Chapter29
Chapter29discussesmultimediaandaset ofwiely-usedapplicationprograms.These
programshavegeneratednewissuessuchastheneedfornewprotocolsinotherlayers
tohandlethespecificproblemsrelatedtomultimedia.Webrieflydiscusstheseissuesin
thischapter.

CHAPTER25
DomainNameSystem
Thereareseveralapplicationsintheapplicationlayer oftheInternetmodelthatfollow
theclient/serverparadigm.Theclient/serverprogramscanbedividedintotwocategories:
thosethatcanbedirectlyusedbytheuser,suchase-mail,andthosethatsupportother
applicationprograms.TheDomainNameSystem(DNS)isasupportingprogramthat
isusedbyotherprogramssuch
ase-mail.
Figure25.1showsanexample
ofhowaDNSclient/serverprogramcansupportan
e-mailprogramtofindtheIP address
ofane-mailrecipient.Auser ofane-mailpro­
grammayknowthee-mailaddress
oftherecipient;however,theIPprotocolneedsthe
IPaddress.TheDNSclientprogramsendsarequesttoaDNSservertomapthee-mail
addresstothecorrespondingIPaddress.
Figure25.1 Exampleofusingthe DNSservice
User
SMTP:SimpleMailTransferProtocol(e-mail)
DNS:DomainNameSystem
[email protected]
Application
layer
wonderful.com
200.200.200.5
wonderfuI.com
200.200.200.5
DNS
client
200.200.200.5
Transportlayer
Toidentifyanentity,TCPIIPprotocolsusetheIPaddress,whichuniquelyidenti­
fiestheconnection
ofahosttotheInternet.However,peopleprefertousenames
instead
ofnumericaddresses.Therefore,weneedasystemthatcanmapanametoan
addressoranaddresstoaname.
797

798 CHAPTER 25DOMAINNAMESYSTEM
WhentheInternetwassmall,mappingwasdonebyusinga hostfile.Thehostfile
hadonlytwocolumns:nameandaddress.Everyhostcouldstorethehostfileonits
diskandupdateitperiodicallyfromamasterhostfile.Whenaprogram
orauser
wantedtomapanametoanaddress,thehostconsultedthehostfileandfoundthe
mapping.
Today,however,itisimpossible
tohaveonesinglehostfiletorelateeveryaddress
withanameandviceversa.Thehostfilewouldbetoolargetostoreineveryhost.In
addition,itwouldbeimpossibletoupdateallthehostfileseverytimetherewasa
change.
Onesolutionwouldbetostoretheentirehostfileinasinglecomputerandallow
accesstothiscentralizedinformationtoeverycomputerthatneedsmapping.Butwe
knowthatthiswouldcreateahugeamount
oftrafficontheInternet.
Anothersolution,theoneusedtoday,istodividethishugeamount
ofinformation
intosmallerpartsandstoreeachpartonadifferentcomputer.Inthismethod,thehost
thatneedsmappingcancontacttheclosestcomputerholdingtheneededinformation.
Thismethodisusedbythe
DomainNameSystem(DNS). Inthischapter,wefirst
discusstheconceptsandideasbehindtheDNS.
WethendescribetheDNSprotocol
itself.
25.1NAMESPACE
Tobeunambiguous,thenamesassignedtomachinesmustbecarefullyselectedfroma
namespacewithcompletecontroloverthebindingbetweenthenamesandIPaddresses.
Inotherwords,thenamesmustbeuniquebecausetheaddressesareunique.A
name
space
thatmapseachaddresstoauniquenamecanbeorganizedintwoways:fiator
hierarchical.
FlatNarneSpace
Inaflatnamespace, anameisassignedtoanaddress.Anameinthisspaceisa
sequence
ofcharacterswithoutstructure.Thenames mayormaynothaveacommon
section;
iftheydo,ithas nomeaning.Themaindisadvantage ofafiatnamespaceis
thatitcannotbeusedinalargesystemsuch
astheInternetbecauseitmustbecentrally
controlledtoavoidambiguityandduplication.
HierarchicalNarneSpace
Inahierarchicalnamespace, eachnameismade ofseveralparts.Thefirstpartcan
definethenature
oftheorganization,thesecondpartcandefinethename ofanorganiza­
tion,thethirdpartcandefinedepartmentsintheorganization,andsoon.Inthiscase,the
authoritytoassignandcontrolthenamespacescanbedecentralized.Acentralauthority
canassignthepart
ofthenamethatdefinesthenature oftheorganizationandthename
oftheorganization.Theresponsibility oftherestofthenamecanbegiventotheorgani­
zationitself.Theorganizationcanaddsuffixes(orprefixes)tothenametodefineitshost
orresources.Themanagement
oftheorganizationneednotworrythattheprefixchosen
forahostistakenbyanotherorganizationbecause,even
ifpartofanaddressisthe

SECTION25.2DOMAINNAMESPACE 799
same,thewholeaddressisdifferent.Forexample,assumetwocollegesandacompany
callone
oftheircomputers challenger.Thefirstcollegeisgivenanamebythecentral
authoritysuch
asjhda.edu,thesecondcollegeisgiventhename berkeley.edu,andthe
company
isgiventhename smart.com. Whentheseorganizationsaddthename chal­
lenger
tothenametheyhavealreadybeengiven,theendresultisthreedistinguishable
names:
challenger.jhda.edu,challenger.berkeley.edu, andchallenger.smart.com.Thenames
areuniquewithouttheneedforassignmentbyacentralauthority.Thecentralauthority
controlsonlypart
ofthename,notthewhole.
25.2DOMAINNAMESPACE
Tohaveahierarchicalnamespace,a domainnamespace wasdesigned.Inthisdesign
thenamesaredefinedinaninverted-treestructurewiththerootatthetop.Thetreecan
haveonly128levels:level0(root)tolevel127(seeFigure25.2).
Figure25.2 Domainnamespace
Label
Eachnodeinthe treehasa label,whichisastringwithamaximum of63characters.
Theroot labelisanullstring(emptystring).DNSrequiresthatchildren
ofanode
(nodesthatbranchfromthesamenode)havedifferentlabels,whichguaranteesthe
uniqueness
ofthedomainnames.
DomainName
Eachnodeinthe treehasadomainname.Afull domainname isasequenceoflabels
separatedbydots(.).Thedomainnamesarealwaysreadfromthenodeuptotheroot.
Thelastlabelisthelabel
oftheroot(null).Thismeansthatafulldomainnamealways
endsinanulllabel,whichmeansthelastcharacterisadotbecausethenullstringis
nothing.Figure25.3showssomedomainnames.

800 CHAPTER25DOMAINNAMESYSTEM
Figure25.3Domainnames andlabels
Root
~
~dU
FullyQualifiedDomainName
Ifalabelisterminatedbyanullstring, itiscalledafullyqualified domainname
(FQDN).AnFQDNisadomainnamethatcontainsthefullname ofahost.Itcontains
alllabels,fromthemostspecifictothemostgeneral,thatuniquelydefinethename
of
thehost.Forexample,thedomainname
challenger.ate.tbda.edu.
istheFQDNofacomputernamed challengerinstalledattheAdvancedTechnology
Center(ATC)atDeAnzaCollege.ADNSservercanonlymatchanFQDNto
an
address.Notethatthenamemustendwithanulllabel,butbecausenullmeansnothing,
thelabelendswithadot(.).
PartiallyQualifiedDomain Name
Ifalabelisnotterminatedbyanullstring,itiscalleda partiallyqualifieddomain
name(PQDN).APQDNstartsfromanode,butitdoesnotreachtheroot.Itisused
whenthenametoberesolvedbelongstothesamesite
astheclient.Heretheresolver
cansupplythemissingpart,calledthe
suffix,tocreateanFQDN.Forexample,ifauser
atthe
jhda.edu.sitewantstogettheIPaddressofthechallengercomputer,heorshe
candefinethepartialname
challenger
TheDNSclientaddsthesuffix atc.jhda.edu.beforepassingtheaddresstotheDNS
server.
TheDNSclientnormallyholds alist
ofsuffixes.Thefollowingcanbethelistof
suffixesatDeAnzaCollege.Thenullsuffixdefinesnothing.Thissuffix
isaddedwhen
theuserdefines
anFQDN.

SECTION25.3DISTRIBUTIONOFNAMESPACE 801
atc.fhda.edu
fhda.edu
null
Figure25.4showssomeFQDNsandPQDNs.
Figure25.4 FQDNandPQDN
FQDN
challenger.atc.fhda.edu.
cs.hnune.com.
www.funny.int.
Domain
PQDN
chal1engocMc.fhda.edll
cs.hmme
www
Adomainisasubtreeofthedomainnamespace.Thename ofthedomainisthedomain
name
ofthenodeatthetop ofthesubtree.Figure25.5showssomedomains.Notethata
domainmayitselfbedividedintodomains(orsubdomainsastheyaresometimescalled).
Figure25.5 Domains
25.3DISTRIBUTIONOFNAMESPACE
Theinformationcontainedinthedomainnamespacemustbestored.However,itis
veryinefficientandalsounreliabletohavejustonecomputerstoresuchahugeamount
ofinformation.Itisinefficientbecauserespondingtorequestsfromallovertheworld
placesaheavyloadonthesystem.Itisnotunreliablebecauseanyfailuremakesthedata
inaccessible.

802 CHAPTER25DOMAINNAMESYSTEM
HierarchyofNameServers
Thesolutiontotheseproblemsistodistributetheinformationamongmanycomputers
calledDNSservers.Onewaytodothisistodividethewholespaceintomanydomains
basedonthefirstlevel.Inotherwords,welettherootstandaloneandcreate
asmany
domains(subtrees)astherearefirst-levelnodes.Becauseadomaincreatedinthisway
couldbeverylarge,DNSallowsdomainstobedividedfurtherintosmallerdomains
(subdomains).Eachservercan
beresponsible(authoritative)foreitheralargeora
smalldomain.Inotherwords,wehaveahierarchy
ofserversinthesamewaythat we
haveahierarchy ofnames(seeFigure25.6).
Figure25.6Hierarchyofnameservers
Rootserver
irwin.com
comserver usserver
~
"\
==0.-....
mcgraw.com
eduserverarpaserver
Zone
Sincethecompletedomainnamehierarchycannotbestoredonasingleserver,it is
dividedamongmanyservers.Whataserverisresponsiblefororhasauthorityover is
calledazone.Wecandefineazone asacontiguouspart oftheentiretree. Ifaserver
acceptsresponsibilityforadomainanddoesnotdividethedomainintosmaller
domains,the
domainandthezonerefertothesamething.Theservermakesadatabase
calleda
zonefileandkeepsalltheinformationforeverynodeunderthatdomain.How­
ever,
ifaserverdividesitsdomainintosubdomainsanddelegatespart ofitsauthorityto
otherservers, domainandzonerefertodifferentthings.Theinformationaboutthe
nodesinthesubdomainsisstoredintheserversatthelowerlevels,withtheoriginal
serverkeepingsomesort
ofreferencetotheselower-levelservers. Ofcoursetheorigi­
nalserverdoesnotfreeitselffromresponsibilitytotally:Itstillhasazone,butthe
detailedinformationiskeptbythelower-levelservers(seeFigure25.7).
Aservercanalsodividepart
ofitsdomainanddelegateresponsibilitybutstillkeep
part
ofthedomainforitself.Inthiscase,itszoneismade ofdetailedinformationforthe
part
ofthedomainthatisnotdelegatedandreferencestothosepartsthataredelegated.

SECTION25.4DNSINTHEINTERNET 803
Figure25.7 Zonesanddomains
Root
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
I
I
,
I
,
...-......,---Zone
,
,
.
......,l(f---Domain
I
,
.. Zoneand
"\.'-+--';-,--domain
.
,
I
1
,
,
--..._------.._--------
RootServer
Arootserver isaserverwhosezoneconsists ofthewholetree. Arootserverusually
doesnotstoreanyinformationaboutdomainsbutdelegatesitsauthoritytootherservers,
keepingreferencestothoseservers.Thereareseveralrootservers,eachcoveringthe
wholedomainnamespace.Theserversaredistributedallaroundtheworld.
PrimaryandSecondaryServers
DNSdefinestwotypes ofservers:primaryandsecondary. Aprimaryserverisaserver
thatstoresafileaboutthezoneforwhichitisanauthority.
Itisresponsibleforcreating,
maintaining,andupdatingthezonefile.
Itstoresthezone fileonalocaldisk.
Asecondaryserver isaserverthattransfersthecompleteinformationabouta
zonefromanotherserver(primaryorsecondary)andstoresthefileonitslocaldisk.The
secondaryserverneithercreatesnorupdatesthezonefiles.
IfupdaJingisrequired,it
mustbedonebytheprimaryserver,whichsendstheupdatedversiontothesecondary.
Theprimaryandsecondaryserversare
bothauthoritativeforthezonestheyserve.
Theideaisnottoputthesecondaryserveratalowerlevel
ofauthoritybuttocreate
redundancyforthedatasothat
ifoneserverfails,theothercancontinueservingclients.
Notealsothataservercanbeaprimaryserverforaspecificzoneandasecondaryserver
foranotherzone.Therefore,whenwerefertoaserverasaprimaryorsecondaryserver,
weshouldbecarefultowhichzonewerefer.
Aprimaryserverloadsallinformationfrom thediskfile;thesecondaryserver
loadsallinformationfromtheprimaryserver.Whenthesecondarydownloads
informationfromtheprimary,
it
iscalledzonetransfer.
25.4DNS INTHEINTERNET
DNSisaprotocolthatcanbeusedindifferentplatforms.IntheInternet,thedomain
namespace(tree)isdividedintothreedifferentsections:genericdomains,country
domains,andtheinversedomain(seeFigure25.8).

804 CHAPTER25DOMAINNAMESYSTEM
Figure25.8 DNSusedintheInternet
Inverse
domain
GenericDomains
Generic
domains
Country
domains
Thegenericdomains defineregisteredhostsaccordingtotheirgenericbehavior.Each
nodeinthetreedefinesadomain,whichisanindextothedomainnamespacedatabase
(seeFigure25.9).
Figure25.9 Genericdomains
Rootlevel
Indextoaddresses
Genericdomains

SECTION25.4DNSINTHEINTERNET 805
Lookingatthetree,weseethatthefirstlevelinthegenericdomainssectionallows
14possiblelabels.TheselabelsdescribetheorganizationtypesaslistedinTable25.1.
Table25.1
Genericdomainlabels
Label Description
aero Airlinesandaerospacecompanies
biz Businessesorfirms(similarto"com")
com Commercialorganizations
coop Cooperative businessorganizations
edu Educationalinstitutions
gov Governmentinstitutions
info Informationserviceproviders
int Internationalorganizations
mil Militarygroups
museum Museumsandothernonprofitorganizations
name Personalnames(individuals)
net Networksupportcenters
org Nonprofitorganizations
pro Professionalindividualorganizations
CountryDomains
Thecountrydomains sectionusestwo-charactercountryabbreviations(e.g.,usfor
UnitedStates).Secondlabelscan
beorganizational,ortheycan bemorespecific,
nationaldesignations.TheUnitedStates,forexample,usesstate abbreviationsasa
subdivision
ofus(e.g.,ca.us.).
Figure25.10showsthecountrydomainssection.Theaddress
anza.cup.ca.uscan
betranslatedtoDeAnzaCollegeinCupertino,California,intheUnitedStates.
InverseDomain
Theinversedomain isusedtomapanaddresstoaname.Thismayhappen,forexam­
ple,whenaserverhasreceivedarequestfromaclienttodoatask.Althoughtheserver
hasafilethatcontainsalist
ofauthorizedclients,onlytheIPaddress oftheclient
(extractedfromthereceivedIPpacket)islisted.Theserverasksitsresolvertosenda
querytotheDNSservertomapanaddresstoanametodetermine
iftheclientisonthe
authorizedlist.
Thistype
ofqueryiscalledaninverseorpointer(PTR)query. Tohandleapointer
query,theinversedomainisaddedtothedomainnamespacewiththefirst-levelnode
called
arpa(forhistoricalreasons).Thesecondlevelisalsoonesinglenodenamed
in-addr(forinverseaddress).Therest ofthedomaindefines IPaddresses.
Theserversthathandletheinversedomainarealsohierarchical.Thismeansthenetid
part
oftheaddressshouldbeatahigherlevelthanthesubnetidpart,andthesubnetidpart

806 CHAPTER 25DOMAINNAMESYSTEM
Figure25.10Countrydomains
Rootlevel
anza.cup.ca.us.
Indextoaddresses
Countrydomains
higherthanthehostidpart.Inthisway,aserverservingthewholesiteisatahigherlevel
thantheserversservingeachsubnet.Thisconfigurationmakesthedomainlookinverted
whencomparedtoagenericorcountrydomain.
Tofollowtheconvention ofreadingthe
domainlabelsfromthebottomtothetop,anIFaddresssuch
as132.34.45.121(aclassB
addresswithnetid132.34)isread
as121.45.34.132.in-addr.arpa.SeeFigure25.11foran
illustration
oftheinversedomainconfiguration.
25.5RESOLUTION
Mappinganametoanaddressoranaddresstoanameiscalled name-addressresolution.
Resolver
DNSisdesignedasaclient/serverapplication.Ahostthatneedstomapanaddresstoa
nameoranametoanaddresscallsaDNSclientcalledaresolver.Theresolveraccesses
theclosestDNSserverwithamappingrequest.
Iftheserverhastheinformation, it
satisfiestheresolver;otherwise,iteitherreferstheresolvertootherserversorasksother
serverstoprovidetheinfonnation.
Aftertheresolverreceivesthemapping,itinterpretstheresponsetosee
ifitisa
realresolutionoranerror,andfinallydeliverstheresulttotheprocessthatrequestedit.

SECTION25.5RESOLUTION 807
Figure25.11 Inversedomain
Rootlevel
l21.45.34.132.in-addr.arpa.
Indextonames
Inversedomain
MappingNames toAddresses
Mostofthetime,theresolvergivesadomainnametotheserverandasksforthecorre­
spondingaddress.
Inthiscase,theserverchecksthegenericdomains orthecountry
domainstofindthemapping.
Ifthedomainnameisfromthegenericdomainssection,theresolverreceivesa
domainnamesuchas
"chal.atc.jhda.edu.".Thequeryissentbytheresolvertothelocal
DNSserverforresolution.
Ifthelocalservercannotresolvethequery, iteitherrefers
theresolvertootherserversorasksotherserversdirectly.
Ifthedomainnameisfromthecountrydomainssection,theresolverreceivesa
domainnamesuchas
"ch.jhda.cu.ca.us.".Theprocedureisthesame.
MappingAddressestoNames
Aclientcansend anIPaddresstoaservertobemappedtoadomainname. Asmentioned
before,this
iscalledaPTRquery. Toanswerqueries ofthiskind,DNSusestheinverse
domain.However,intherequest,the
IPaddressisreversedandthetwolabels in-addrand
arpaareappendedtocreateadomainacceptablebytheinversedomainsection.For
example,
iftheresolverreceivestheIFaddress132.34.45.121,theresolverfirstinverts
theaddressandthenaddsthetwolabelsbeforesending.Thedomainnamesentis
"121.45.34.132.in-addr.arpa."whichisreceivedbythelocalDNSandresolved.

808 CHAPTER25DOMAINNAMESYSTEM
RecursiveResolution
Theclient(resolver)canaskforarecursiveanswerfromanameserver.Thismeansthat
theresolverexpectstheservertosupplythefinalanswer.
Iftheserveristheauthority
forthedomainname,itchecksitsdatabaseandresponds.
Iftheserverisnottheauthor­
ity,itsendstherequesttoanotherserver(theparentusually)andwaitsfortheresponse.
Iftheparentistheauthority, itresponds;otherwise,itsendsthequerytoyetanother
server.Whenthequeryisfinallyresolved,theresponsetravelsbackuntil
itfinally
reachestherequestingclient.Thisiscalled
recursiveresolutionandisshownin
Figure25.12.
Figure25.12Recursiveresolution
Rootserver
&
~*'ed& g:m
~ ~
[I.&!l...
~..-fhda.edu mcgraw.com
Client
10
IterativeResolution
Iftheclientdoesnotaskforarecursiveanswer,themappingcanbedoneiteratively. If
theserverisanauthorityforthename,itsendstheanswer. Ifitisnot,itreturns(tothe
client)theIPaddress
oftheserverthatitthinkscanresolvethequery.Theclientis
responsibleforrepeatingthequerytothissecondserver.
Ifthenewlyaddressed server
canresolvetheproblem,itanswersthequerywiththeIPaddress;otherwise,itreturns
theIPaddress
ofanewservertotheclient.Nowtheclientmustrepeatthequerytothe
thirdserver.Thisprocessiscallediterativeresolutionbecausetheclientrepeatsthe
samequerytomultipleservers.InFigure25.13theclientqueriesfourserversbefore
it
getsananswerfromthemcgraw.comserver.
Caching
Eachtimeaserverreceivesaqueryforanamethatisnot initsdomain,itneedsto
searchitsdatabaseforaserverIPaddress.Reduction
ofthissearchtimewouldincrease
efficiency.DNShandlesthiswithamechanismcalledcaching.Whenaserverasksfor
amappingfromanotherserverandreceivestheresponse,itstoresthisinformationin
itscachememorybeforesendingittotheclient.
Ifthesameoranotherclientasksfor
thesamemapping,itcancheckitscachememoryandsolvetheproblem.However,to

SECTION25.6DNSMESSAGES 809
Figure25.13Iterativeresolution
Rootserver
r-;::=5==&
6
Client
.e._D.I((_I:da.edU
2
7
8
10
[Jeorn
~
informtheclientthattheresponseiscomingfromthecachememoryandnotfroman
authoritativesource,theservermarkstheresponseas
unauthoritative.
Cachingspeedsupresolution,butitcanalsobeproblematic. Ifaservercachesa
mappingforalongtime,itmaysendanoutdatedmappingtotheclient.
Tocounterthis,
twotechniquesareused.First,theauthoritativeserveralwaysaddsinformationtothe
mappingcalled
time-to-live(TTL).Itdefinesthetimeinsecondsthatthereceiving
servercancachetheinformation.Afterthattime,themapping
isinvalidandanyquery
mustbesentagaintotheauthoritativeserver.Second,DNSrequiresthateachserver
keepaTTLcounterforeachmappingitcaches.Thecachememorymustbesearched
periodically,andthosemappingswithanexpiredTTLmustbepurged.
25.6DNSMESSAGES
DNShastwotypes ofmessages:queryandresponse.Bothtypeshavethesameformat.
The
querymessageconsists ofaheaderandquestionrecords;theresponsemessage
consists
ofaheader,questionrecords,answerrecords,authoritativerecords,andaddi­
tionalrecords(seeFigure25.14).
Header
Bothqueryandresponsemessageshavethesameheaderformatwithsomefieldsset
tozeroforthequerymessages.Theheaderis12bytes,anditsformatisshownin
Figure25.15.
The
identificationsubfieldisusedbytheclienttomatchtheresponsewiththequery.
Theclientusesadifferentidentificationnumbereachtimeitsendsaquery.Theserver
duplicatesthisnumberinthecorrespondingresponse.The
flagssubfieldisacollection of

810 CHAPTER25DOMAINNAMESYSTEM
Figure25.14 Queryandresponsemessages
,~r '_c-:;:f-'~ J
.--~~~-;_:-:;.'.-. :,,_'~t': -';:-~Y--k-;."_:.;~<
Questionsection ",,""
a.Query
Figure25.15 Headerformat
.--~
c
-- Header
--
-- -
-'
...,:.7
Questionsection L
7'
Z Answersection Z
Z Authoritativesection Z
Z Additionalsection .<
b.Response
Identification Flags
Number
ofquestionrecords
Number
ofanswerrecords
(all
Osinquerymessage)
Number
ofauthoritativerecords Number ofadditionalrecords
(all
Osinquerymessage) (all Osinquerymessage)
subfieldsthatdefinethetype ofthemessage,thetype ofanswerrequested,thetype of
desiredresolution(recursiveoriterative),andso on.Thenumberofquestionrecords sub­
fieldcontainsthenumberofqueriesinthequestionsection
ofthemessage.The number
ofanswerrecords subfieldcontainsthenumber ofanswerrecordsintheanswersection
oftheresponsemessage.Itsvalueiszerointhequerymessage.The numberofauthorita­
tiverecords
subfieldcontainsthenumberofauthoritativerecordsintheauthoritativesec­
tion
ofaresponsemessage.Itsvalueiszerointhequerymessage.Finally,the numberof
additionalrecords subfieldcontainsthenumberadditionalrecordsintheadditional
sec­
tionofaresponsemessage.Itsvalueiszerointhequerymessage.
QuestionSection
Thisisasectionconsisting ofoneormorequestionrecords.Itispresentonbothquery
andresponsemessages.
Wewilldiscussthequestionrecordsinafollowingsection.
AnswerSection
Thisisasectionconsisting ofoneormoreresourcerecords.Itispresentonlyonresponse
messages.Thissectionincludestheanswerfromtheservertotheclient(resolver).We
willdiscussresourcerecordsinafollowingsection.

SECTION25.8REGISTRARS 811
AuthoritativeSection
Thisisasectionconsisting ofoneormoreresourcerecords. Itispresentonlyonresponse
messages.Thissectiongivesinfonnation(domainname)aboutone
ormoreauthoritative
serversforthequery.
AdditionalInformationSection
Thisisasectionconsisting ofoneormoreresourcerecords. Itispresentonlyonresponse
messages.Thissectionprovidesadditionalinfonnationthatmayhelptheresolver.For
example,aservermaygivethedomainname
ofanauthoritativeservertotheresolverin
theauthoritativesection,andincludetheIPaddress
ofthesameauthoritativeserverinthe
additionalinformationsection.
25.7TYPESOFRECORDS
AswesawinSection25.6,twotypes ofrecordsareusedinDNS.Thequestionrecords
areusedinthequestionsection
ofthequeryandresponsemessages.Theresource
recordsareusedintheanswer,authoritative,andadditionalinformationsections
ofthe
responsemessage.
QuestionRecord
Aquestionrecord isusedbytheclienttogetinformationfromaserver.Thiscontains
thedomainname.
-ResourceRecord
Eachdomainname(eachnodeonthetree)isassociatedwitharecordcalledthe resource
record.
Theserverdatabaseconsists ofresourcerecords.Resourcerecordsarealsowhat
isreturnedbytheservertotheclient.
25.8REGISTRARS
Howarenewdomainsadded toDNS?Thisisdonethrougha registrar,acommercial
entityaccreditedby
ICANN.Aregistrarfirstverifiesthattherequesteddomainnameis
uniqueandthenentersitintothe
DNSdatabase.Afeeischarged.
Today,therearemanyregistrars;theirnamesandaddressescanbefoundat
http://www.intenic.net
Toregister,theorganizationneedstogivethename
ofitsserverandthe IPaddress
oftheserver.Forexample,anewcommercialorganizationnamed wonderfulwitha
servernamed
wsandIPaddress200.200.200.5needstogivethefollowinginformation
toone
oftheregistrars:
Domainname: WS.wonderful.com
IPaddress:200.200.200.5

812 CHAPTER 25DOMAINNAMESYSTEM
25.9DYNAMICDOMAINNAMESYSTEM(DDNS)
WhentheDNSwasdesigned,noonepredictedthattherewouldbesomanyaddress
changes.InDNS,whenthereisachange,such
asaddinganewhost,removingahost,
orchanginganIPaddress,thechangemustbemadetotheDNSmasterfile.Thesetypes
ofchangesinvolvealot ofmanualupdating.Thesize oftoday'sInternetdoesnotallow
forthiskind
ofmanualoperation.
TheDNSmasterfilemustbeupdateddynamically.TheDynamicDomainName
System(DDNS)thereforewasdevisedtorespondtothisneed.InDDNS,whenabind­
ingbetweenanameand
anaddressisdetermined,theinformationissent,usuallyby
DHCP(seeChapter21)toaprimaryDNSserver.Theprimaryserverupdatesthezone.
Thesecondaryserversarenotifiedeitheractivelyorpassively.
Inactivenotification,the
primaryserversendsamessagetothesecondaryserversaboutthechangeinthezone,
whereas
inpassivenotification,thesecondaryserversperiodicallycheckfor anychanges.
Ineithercase,afterbeingnotifiedaboutthechange,thesecondaryrequestsinformation
abouttheentirezone(zonetransfer).
ToprovidesecurityandpreventunauthorizedchangesintheDNSrecords,DDNS
canuseanauthenticationmechanism.
25.10ENCAPSULATION
DNScanuseeitherUDPor TCP.Inbothcasesthe
well-knownportusedbytheserver
isport53.UDPisusedwhenthesize
oftheresponsemessageislessthan512bytes
becausemostUDPpackageshavea512-bytepacketsizelimit.
Ifthesizeofthe
responsemessageismorethan512bytes,aTCPconnection
isused.Inthatcase,one of
twoscenarioscanoccur:
oIftheresolverhaspriorknowledgethatthesize oftheresponsemessageismore
than512bytes,itusestheTCPconnection.Forexample,
ifasecondaryname
server(acting
asaclient)needsazonetransferfromaprimaryserver,itusesthe
TCPconnectionbecausethesize
oftheinformationbeingtransferredusually
exceeds512bytes.
oIftheresolverdoesnotknowthesize oftheresponsemessage,itcanusetheUDP
port.However,
ifthesizeoftheresponsemessageismorethan512bytes,the
servertruncatesthemessageandturnsontheTCbit.Theresolvernowopensa
TCPconnectionandrepeatstherequesttogetafullresponsefromtheserver.
DNScanusetheservices ofUDPorTCPusingthewell-known port53.
25.11RECOMMENDED READING
Formoredetailsaboutsubjectsdiscussedinthischapter,werecommendthefollowing
booksandsites.Theitemsinbrackets[
...]refertothereferencelistattheendofthetext.

SECTION25.13SUMMARY 813
Books
DNSisdiscussed in[AL98],Chapter 17of[For06],Section 9.1of[PD03],andSection7.1
of[Tan03].
Sites
Thefollowingsitesarerelated totopicsdiscussedinthischapter.
owww.intenic.net/Informationaboutregistrars
Dwww.ietf.org/rfc.htmlInformationaboutRFCs
RFCs
ThefollowingRFCsarerelatedtoDNS:
799,811.819,830,881,882,883,897,920,921,1034,1035,1386,1480,1535,1536,1537,
1591,~1637,1664, 1706,1112,1713.1982,2065,2137,2317,2535,2671
25.12KEYTERMS
caching
countrydomain
DNSserver
domain
domainname
domainnamespace
DomainNameSystem(DNS)
DynamicDomainNameSystem(DDNS)
flatnamespace
fullyqualifieddomainname(FQDN)
genericdomain
hierarchicalnamespace
hostfile
inversedomain
iterativeresolution
label
namespace
partiallyqualifieddomainname(PQDN)
primaryserver
querymessage
questionrecord
recursiveresolution
registrar
resolver
resourcerecord
responsemessage
rootserver
secondaryserver
subdomain
suffix
zone
25.13SUMMARY
oTheDomainNameSystem(DNS)isaclient/serverapplicationthatidentifieseach
hostontheInternetwithauniqueuser-friendlyname.
DDNSorganizesthenamespace inahierarchicalstructuretodecentralizethe
responsibilitiesinvolvedinnaming.

814 CHAPTER25DOMAINNAMESYSTEM
DDNScanbepicturedasaninvertedhierarchicaltreestructurewithonerootnodeat
thetopandamaximum
of128levels.
DEachnodeinthetreehasadomainname.
DAdomainisdefinedasanysubtree ofthedomainnamespace.
DThenamespaceinformationisdistributedamongDNSservers.Eachserverhas
jurisdictionoveritszone.
DArootserver'szoneistheentireDNStree.
DAprimaryservercreates,maintains,andupdatesinformationaboutitszone.
DAsecondaryservergetsitsinformationfromaprimaryserver.
DThedomainnamespaceisdividedintothreesections:genericdomains,country
domains,andinversedomain.
DThereare 14genericdomains,eachspecifyinganorganizationtype.
DEachcountrydomainspecifies acountry.
DTheinversedomainfindsadomainnameforagivenIPaddress.Thisiscalled
address-to-nameresolution.
DNameservers,computersthatruntheDNSserverprogram,areorganizedina
hierarchy.
DTheDNSclient,calledaresolver,mapsanametoanaddressoranaddress toaname.
DInrecursiveresolution,the clientsendsitsrequesttoaserverthateventually
returnsaresponse.
DIniterativeresolution,theclientmaysenditsrequesttomultipleserversbefore
gettingananswer.
DCachingisamethodwherebyananswertoaqueryisstoredinmemory(foralimited
time)foreasyaccesstofuturerequests.
DAfullyqualifieddomain name(FQDN)isadomainnameconsisting oflabelsbegin­
ningwiththehostandgoingbackthrougheachleveltotherootnode.
DApartiallyqualifieddomainname(PQDN) isadomainnamethatdoesnotinclude
allthelevelsbetweenthehostandtherootnode.
DTherearetwotypes ofDNSmessages:queriesandresponses.
DTherearetwotypes ofDNSrecords:questionrecordsandresourcerecords.
DDynamicDNS(DDNS)automaticallyupdatestheDNSmasterfile.
DDNSusestheservices ofUDPformessagesoflessthan512bytes;otherwise,TCP
isused.
25.14PRACTICESET
ReviewQuestions
I.Whatisanadvantageofahierarchicalnamespaceoveraflatnamespaceforasystem
thesize
oftheInternet?
2.Whatisthedifferencebetweenaprimaryserverandasecondaryserver?
3.Whatarethethreedomains ofthedomainnamespace?

SECTION25.14PRACTICESET 815
4.Whatisthepurpose oftheinversedomain?
5.Howdoesrecursiveresolutiondifferfromiterative resolution?
6.WhatisanFQDN?
7.WhatisaPQDN?
8.Whatisazone?
9.Howdoescachingincreasetheefficiency ofnameresolution?
10.Whatarethetwomaincategories
ofDNSmessages?
11.WhywasthereaneedforDDNS?
Exercises
12.Determinewhich ofthefollowingisanFQDNandwhichisaPQDN.
a.xxx
b.xxx.yyy.
c.xxx.yyy.net
d.zzz.yyy.xxx.edu.
13.Determinewhich
ofthefollowingisanFQDNandwhichisaPQDN.
a.mil.
b.edu.
c.xxx.yyy.net
d.zzz.yyy.xxx.edu
14.Whichdomainisusedbyyoursystem,generic orcountry?
15.WhydoweneedaDNSsystemwhenwecandirectlyusean IPaddress?
16.TofindtheIPaddress ofadestination,weneedtheservice ofDNS.DNSneedsthe
service
ofUDPorTCP.UDPorTCPneedstheservice ofIP.IPneedsanIPdesti­
nationaddress.Isthisaviciouscyclehere?
17.IfaDNSdomainnameis voyager.fhda.edu,howmanylabelsareinvolvedhere?
Howmanylevels
ofhierarchy?
18.IsaPQDNnecessarilyshorterthanthecorrespondingFQDN?
19.Adomainnameis hello.customer.info. Isthisagenericdomainoracountrydomain?
20.Doyouthinkarecursiveresolutionisnormallyfasterthananinteractiveone?
Explain.
21.Canaquerymessagehaveonequestionsectionbutthecorrespondingresponse
messagehaveseveralanswersections?

CHAPTER26
RemoteLogging,ElectronicMail,
andFileTransfer
Themaintask oftheInternetistoprovideservicesforusers.Amongthemostpopular
applicationsareremotelogging,electronicmail,andfiletransfer.
Wediscussthesethree
applicationsinthischapter;wediscussanotherpopularuse
oftheInternet,accessingthe
WorldWideWeb,inChapter27.
26.1REMOTELOGGING
IntheInternet,usersmaywanttorunapplicationprogramsataremotesiteandcreate
resultsthatcanbetransferredtotheirlocalsite.Forexample,studentsmaywanttocon­
necttotheiruniversitycomputerlabfromtheirhometoaccessapplicationprogramsfor
doinghomeworkassignmentsorprojects.Onewaytosatisfythatdemandandothersis
tocreateaclient/serverapplicationprogramforeachdesiredservice.Programssuchas
filetransferprograms(FTPs),e-mail(SMTP),andsoonarecurrentlyavailable.How­
ever,itwouldbeimpossibletowriteaspecificclient/serverprogramforeachdemand.
Thebettersolutionisa
general-purp<Dseclient/serverprogramthatletsauseraccess
anyapplicationprogramonaremotecomputer;inotherwords,allowtheusertologon
toaremotecomputer.Afterloggingon,ausercanusetheservicesavailable
onthe
remotecomputerandtransfertheresultsbacktothelocalcomputer.
TELNET
Inthissection,wediscusssuchaclient/serverapplicationprogram:TELNET. TELNET
isanabbreviationfor TErminaLNETwork. ItisthestandardTCP/IPprotocolforvirtual
terminalserviceasproposedbytheInternationalOrganizationforStandards(ISO).
TELNETenablestheestablishment
ofaconnectiontoaremotesysteminsuchaway
thatthelocalterminalappearstobeaterminalattheremotesystem.
TELNETisageneral-purposeclient/serverapplication program.
817

818 CHAPTER26REMOTELOGGING,ELECTRONICMAIL, ANDFILETRANSFER
TimesharingEnvironment
TELNETwasdesignedatatimewhenmostoperatingsystems,suchasUNIX,were
operatingina
timesharingenvironment.Insuchanenvironment,alargecomputer
supportsmultipleusers.Theinteractionbetweenauserandthecomputeroccursthrough
aterminal,whichisusuallyacombination
ofkeyboard,monitor,andmouse.Evena
microcomputercansimulateaterminalwithaterminalemulator.
Logging
Inatimesharingenvironment,usersarepart ofthesystemwithsomeright toaccess
resources.EachauthorizeduserhasanidentificationandprobablY,apassword.Theuser
identificationdefinestheuser
aspartofthesystem.Toaccessthesystem,theuserlogs
intothesystemwithauser
idorlog-inname.Thesystemalsoincludespassword
checkingtopreventanunauthorizeduserfromaccessing
th~resources.Figure26.1
showstheloggingprocess.
Figure26.1 Localandremotelog-in
Applicationprograms
Operating
system
/
,
,...,
/
,
,
,
Tenninal
r-
a.Locallog-in
TELNET
\ I
\ I I
\ I I
'\1•••1
\ I /
\ I I
\ II
Applicationprograms
I~;...~I~~ :;;
server
Operating
system
Internet
TELNET
client
Operating
system
Tenninal
r-~
b.Remotelog-in

SECTION26.1REMOTELOGGING 819
Whenauserlogsintoalocaltimesharingsystem,itiscalledlocallog-in.Asauser
typesataterminalorataworkstationrunningaterminalemulator,thekeystrokesare
acceptedbytheterminaldriver.Theterminaldriverpassesthecharacters
totheoperat­
ingsystem.Theoperatingsystem,inturn,interpretsthecombination
ofcharactersand
invokesthedesiredapplicationprogramorutility.
Whenauserwants
toaccessanapplicationprogramorutilitylocatedonaremote
machine,sheperformsremotelog-in.HeretheTELNETclientandserverprograms
comeintouse.Theusersendsthekeystrokestotheterminaldriver,wherethelocal
operatingsystemacceptsthecharactersbutdoesnotinterpretthem.Thecharactersare
sent
totheTELNETclient,whichtransformsthecharacters toauniversalcharacterset
called
networkvirtualterminal(NVT)characters anddeliversthemtothelocal TCP/IP
protocolstack.
Thecommandsortext,inNVTform,travelthroughtheInternetandarriveatthe
TCP/IPstackattheremotemachine.Herethecharactersaredeliveredtotheoperat­
ingsystemandpassedtotheTELNETserver,whichchangesthecharacterstothe
correspondingcharactersunderstandablebytheremotecomputer.However,thechar­
acterscannotbepasseddirectlytotheoperatingsystembecausetheremoteoperating
systemisnotdesignedtoreceivecharactersfromaTELNETserver:
Itisdesignedto
receivecharactersfromaterminaldriver.Thesolutionistoaddapiece
ofsoftware
calleda
pseudoterminaldriver whichpretendsthatthecharactersarecomingfrom
aterminal.Theoperatingsystemthenpassesthecharacterstotheappropriateappli­
cationprogram.
NetworkVirtualTerminal
Themechanism toaccessaremotecomputeriscomplex.This issobecauseeverycom­
puteranditsoperatingsystemacceptaspecialcombinationofcharactersastokens.For
example,theend-of-filetokeninacomputerrunningtheDOSoperatingsystemis
Ctrl+z,whiletheUNIXoperatingsystemrecognizesCtrl+d.
Wearedealingwithheterogeneoussystems. Ifwewanttoaccessanyremotecom­
puterintheworld,wemustfirstknowwhattype
ofcomputerwewillbeconnectedto,
and
wemustalsoinstallthespecificterminalemulatorusedbythatcomputer.TELNET
solvesthisproblembydefiningauniversalinterfacecalledthe
networkvirtualtermi­
nal(NVT)characterset.Viathisinterface,theclientTELNETtranslatescharacters
(dataorcommands)thatcomefromthelocalterminalintoNVTformanddeliversthem
tothenetwork.TheserverTELNET,ontheotherhand,translatesdataandcommands
fromNVTformintotheformacceptablebytheremotecomputer.Foranillustration
of
thisconcept,seeFigure26.2.
NVT
CharacterSetNVTusestwosets ofcharacters, onefordataandtheother
forcontrol.Bothare8-bitbytes.Fordata,NVTis
an8-bitcharactersetinwhichthe
7lowest-orderbitsarethesame
asASCIIandthehighest-orderbitis O.Tosendcontrol
charactersbetweencomputers(fromclient toserverorviceversa),NVTuses an8-bit
charactersetinwhichthehighest-orderbit
issettol.
Table26.1listssome ofthecontrol charactersandtheirmeanings.

820 CHAPTER 26REMOTELOGGING,ELECTRONICMAIL, ANDFILETRANSFER
Figure26.2 ConceptofNVT
Terminal
r,
TELNET
client
Internet
TELNET
server
Pseudoterminal
driver
Datacharacter
Table26.1SomeNVTcontrolcharacters
Controlcharacter
CharacterDecimal
Binary Meaning
EOF 236 11101100End offile
EOR 239 11101111End ofrecord
SE 240 11110000Suboptionend
NOP 241 11110001Nooperation
DM 242 11110010Datamark
BRK 243 11110011Break
IP 244 11110100Interruptprocess
AO 245 11110101Abortoutput
AYT 246 11110110Areyouthere?
EC 247 11110111Erasecharacter
EL 248 11111000Eraseline
GA 249 11111001Goahead
SB 250 11111010Suboptionbegin
WILL 251 11111011Agreementtoenableoption
WONT 252 11111100Refusaltoenableoption
DO 253 11111101Approvaltooptionrequest
DONT 254 11111110Denial ofoptionrequest
lAC 255 11111111Interpret(thenextcharacter)ascontrol
Embedding
TELNETusesonlyoneTCPconnection.Theserverusesthewell-knownport23,and
theclientusesanephemeralport.Thesameconnectionisusedforsendingbothdataand

SECTION26.1REMOTELOGGING 821
controlcharacters.TELNETaccomplishesthisbyembeddingthecontrolcharactersinthe
datastream.However,todistinguishdatafromcontrolcharacters,eachsequence
ofcon­
trolcharactersispreceded
byaspecialcontrolcharactercalled interpretascontrol (lAC).
Forexample,imagineauserwantsaserver
todisplayafile (filel)onaremoteserver.
Shecantype
catfilel
However,supposethename
ofthefilehasbeenmistyped (fileainsteadoffilel).The
userusesthebackspacekeytocorrectthissituation.
catjllea<backspace>l
However,inthedefaultimplementation
ofTELNET,theusercannoteditlocally;the
editingisdoneattheremoteserver.Thebackspacecharacteristranslatedintotwo
remotecharacters(lACEC),whichareembeddedinthedataandsenttotheremote
server.Whatissent
totheserverisshowninFigure26.3.
Figure26.3Anexampleofembedding
Typedattheremoteterminal
Options
TELNETletstheclientandservernegotiateoptionsbeforeorduringtheuse oftheser­
vice.Optionsareextrafeaturesavailabletoauserwithamoresophisticatedterminal.
Userswithsimplerterminalscanusedefaultfeatures.Somecontrolcharactersdiscussed
previouslyareusedtodefineoptions.Table26.2showssomecommonoptions.
Table26.2 Options
Code Option Meaning
0 Binary Interpret as8-bitbinarytransmission.
1 Echo Echothedatareceivedononesidetotheother.
3 SuppressgoaheadSuppress
go-aheadsignalsafterdata.
5 Status Requestthestatus
ofTELNET.
6 Timingmark Definethetimingmarks.
24 Terminaltype Set
theterminaltype.
32 Terrninalspeed Settheterminalspeed.
34 Linemode Changetolinemode.

822 CHAPTER 26REMOTELOGGING,ELECTRONICMAIL, ANDFILETRANSFER
OptionNegotiationTouseanyoftheoptionsmentionedintheprevioussectionfirst
requiresoptionnegotiationbetweentheclientandtheserver.Fourcontrolcharacters
areusedforthispurpose;theseareshowninTable26.3.
Table26.3
NVTcharacterset for
optionnegotiation
CharacterDecimal Binary Meaning
WILL 251 11111011 1.Offeringtoenable
2.Acceptingarequesttoenable
WONT 252 11111100 1.Rejectingarequesttoenable
2.Offeringtodisable
3.Acceptingarequesttodisable
DO 253 11111101 1.Approvinganoffertoenable
2.Requestingtoenable
DONT 254 11111110 1.Disapprovinganoffertoenable
2.Approvinganoffertodisable
3.Requestingtodisable
Apartycanoffertoenableordisableanoption ifithastherighttodoso.The
offeringcanbeapprovedordisapprovedbytheotherparty.
Toofferenabling,theoffer­
ingpartysendstheWILLcommand,whichmeans"WillIenabletheoption?"The
otherpartysendseithertheDOcommand,whichmeans"Pleasedo,"
ortheDONT
command,whichmeans"Pleasedon't."
Toofferdisabling,theofferingpartysendsthe
WONTcommand,whichmeans"Iwon'tusethisoptionanymore."Theanswermust
betheDONTcommand,whichmeans"Don'tuseitanymore."
Apartycanrequestfromtheotherpartytheenablingorthedisabling
ofanoption.
Torequestenabling,therequestingpartysendsthe
DOcommand,whichmeans
"Pleasedoenablethe option."TheotherpartysendseithertheWILLcommand,which
means"Iwill,"ortheWONTcommand,whichmeans"Iwon't."
Torequestdisabling,
therequestingpartysendstheDONTcommand,whichmeans"Pleasedon'tusethis
optionanymore."TheanswermustbetheWONTcommand,whichmeans"Iwon'tuse
itanymore."
Example26.1
Figure26.4showsanexample ofoptionnegotiation.Inthisexample,theclientwantstheserverto
echoeachcharactersenttotheserver.Inotherwords,whenacharacteristypedattheuserkeyboard
terminal,itgoestotheserverandissentbacktothescreen
oftheuserbeforebeingprocessed.The
echooptionisenabledbytheserverbecauseitistheserverthatsendsthecharactersbacktotheuser
tenninal.Therefore,theclientshouldrequestfromtheservertheenabling
oftheoptionusingDO.
Therequestconsists ofthreecharacters:lAC,DO,andECHO.Theserveracceptstherequest
andenablestheoption. Itinformstheclientbysendingthethree-characterapproval:lAC,WILL,
andECHO.
SuboptionNegotiationSomeoptionsrequireadditionalinformation.Forexample,
todefinethetypeorspeed
ofaterminal,thenegotiationincludesastringoranumber

SECTION26.1REMOTELOGGING 823
Figure26.4 Example26.1:Echooption
Client
Server
==
cu:::u:::J
~
-
todefinethetype orspeed.Ineithercase,thetwosuboptioncharactersindicated
inTable26.4areneededforsuboptionnegotiation.
Table26.4
NVTcharacterset forsuboptionnegotiation
CharacterDecimal Binary Meaning
SE 240 11110000 Suboptionend
SB 250 11111010 Suboptionbegin
Example26.2
Figure26.5showsanexample ofsuboptionnegotiation.Inthisexample,theclientwantsto
negotiatethetype
oftheterminal.
Figure26.5 Exampleofsuboptionnegotiation
Server
==
cu:::u:::J
E:::3
-
Iwillenabletheterminaloption
1-------1TerminaltypeHWrLL~~f--------J"~1
Client
r
Doenableterminaloption
~-----IIAC t~1 Terminaltype1------1
Settheterminaltypeto"VT"
IrAC~[!J-~I Terminaltypet[}!}~
ModeofOperation
MostTELNETimplementationsoperateinone ofthreemodes:defaultmode,character
mode,orlinemode.
DefaultModeThe
defaultmodeisusedifnoothermodesareinvokedthrough
optionnegotiation.Inthismode,theechoingisdonebytheclient.Theusertypesa

824 CHAPTER 26REMOTELOGGING,ELECTRONICMAIL, ANDFILETRANSFER
character,andtheclientechoesthecharacteronthescreen(orprinter)butdoesnot
sendituntilawholelineiscompleted.
CharacterModeInthe charactermode,eachcharactertypedissentbytheclient to
theserver.Theservernormallyechoesthecharacterback tobedisplayedontheclient
screen.Inthismodetheechoingofthecharactercanbedelayed
ifthetransmission
timeislong(such
asinasatelliteconnection). Italsocreatesoverhead(traffic)forthe
networkbecausethreeTCPsegmentsmustbesentforeachcharacterofdata.
LineModeAnewmodehasbeenproposedtocompensateforthedeficiencies
ofthe
defaultmodeandthecharactermode.Inthismode,calledthelinemode,lineediting
(echoing,charactererasing,lineerasing,and
soon)isdonebytheclient.Theclient
thensendsthewholelinetotheserver.
26.2ELECTRONIC MAIL
OneofthemostpopularInternetservicesiselectronicmail(e-mail).Thedesigners of
theInternetprobablyneverimaginedthepopularity ofthisapplicationprogram.Its
architectureconsists
ofseveralcomponentsthat wediscussinthischapter.
Atthebeginningofthe Internetera,themessagessentbyelectronicmailwereshort
andconsisted
oftextonly;theyletpeopleexchangequickmemos.Today,electronic
mailismuchmorecomplex.Itallowsamessage
toincludetext,audio,andvideo.Italso
allowsonemessagetobesenttooneormorerecipients.
Inthischapter,wefirststudythegeneralarchitecture
ofane-mailsystemincluding
thethreemaincomponents:useragent,messagetransferagent,andmessageaccess
agent.
Wethendescribetheprotocolsthatimplementthesecomponents.
Architecture
Toexplainthearchitectureofe-mail,wegivefourscenarios. Webeginwiththesimplest
situationand addcomplexity
asweproceed.Thefourthscenarioisthemostcommon in
theexchangeofemail.
FirstScenario
Inthefirstscenario,thesenderandthereceiver ofthee-mailareusers(orapplication
programs)onthesamesystem;theyaredirectlyconnectedtoasharedsystem.The
administratorhascreatedonemailboxforeachuserwherethereceivedmessagesare
stored.A
mailboxispartofalocalharddrive,aspecialfilewithpermissionrestrictions.
Onlytheownerofthemailboxhasaccesstoit.WhenAlice,auser,needstosenda
messagetoBob,anotheruser,Alicerunsa
useragent(VA) programtopreparethe
messageandstoreitinBob'smailbox.Themessagehasthesenderandrecipientmail­
boxaddresses(namesoffiles).Bobcanretrieveandreadthecontents
ofhismailboxat
hisconvenience,usingauseragent.Figure26.6showstheconcept.
Thisissimilartothetraditionalmemoexchangebetweenemployeesinanoffice.
Thereisamailroomwhereeachemployeehasamailboxwithhisorhernameonit.

SECTION26.2ELECTRONICMAIL 825
Figure26.6Firstscenarioinelectronicmail
VA:useragent
System
WhenAliceneedstosendamemotoBob,shewritesthememoandinsertsitinto
Bob'smailbox.WhenBobcheckshismailbox,hefindsAlice'smemoandreadsit.
Whenthesenderandthereceiverofane-mailareonthesamesystem,
weneedonlytwo
useragents.
SecondScenario
Inthesecondscenario,thesenderandthereceiver ofthee-mailareusers(orapplication
programs)ontwodifferentsystems.ThemessageneedstobesentovertheInternet.Herewe
need
useragents(VAs)and messagetransferagents (MTAs),asshowninFigure26.7.
Figure26.7Secondscenarioinelectronicmail
VA:useragent
MTA:messagetransferagent
VA
D
System
(mailserver)
System
(mailserver)
VA
D
Aliceneedstouseauseragentprogram tosendhermessagetothesystemather
ownsite.Thesystem(sometimescalledthemailserver)athersiteusesaqueuetostore
messageswaitingto
besent.Bobalsoneedsauseragentprogramtoretrievemessages
storedinthemailbox
ofthesystemathissite.Themessage,however,needstobesent
throughtheInternetfromAlice'ssitetoBob'ssite.Heretwomessagetransferagents
areneeded:one
'clientandoneserver.Likemostclient/serverprograms ontheInternet,
theserverneedstorunallthetimebecauseitdoesnotknowwhenaclientwillaskfora

826 CHAPTER26 REMOTELOGGING,ELECTRONICMAIL, ANDFILETRANSFER
connection.Theclient,ontheotherhand,can bealertedbythesystemwhenthere isa
messageinthequeuetobesent.
Whenthesenderandthereceiverofane-mailareondifferentsystems,
weneedtwoVAs
andapairofMTAs(clientandserver).
ThirdScenario
Inthethirdscenario,Bob, asinthesecondscenario,isdirectlyconnectedtohissystem.
Alice,however,isseparatedfromhersystem.EitherAliceisconnectedtothesystemvia
apoint-to-point
WAN,suchasadial-upmodem,aDSL,oracablemodem;orsheiscon­
nectedtoaLANinanorganizationthatusesonemailserverforhandling
e-mails-all
usersneedtosendtheirmessagestothismailserver.Figure26.8showsthesituation.
Figure26.8 Thirdscenarioinelectronicmail
MTA
VA Aliceclient
[ja.[j
,
,
,
,
LANmWA;\
,
,
,
II
a
I~~
System
(mailserver)
VA:useragent
MTA:messagetransferagent
System
(mailserver)
Alicestill needsauseragenttopreparehermessage.Shethenneedstosendthe
messagethroughtheLANor
WAN.Thiscanbedone throughapair ofmessagetransfer
agents(clientandserver).WheneverAlicehasamessagetosend,shecallstheuser
agentwhich,intum,callstheMTAclient.TheMTAclientestablishesaconnection
withtheMTAserveronthesystem,whichisrunningallthetime.ThesystematAlice's
sitequeuesallmessagesreceived.Itthenusesan
MTAclienttosendthemessagesto
thesystematBob'ssite;thesystemreceivesthemessageandstoresitinBob'smailbox.

SECTION26.2ELECTRONICMAIL 827
Athisconvenience,Bobuseshisuseragenttoretrievethemessageandreadsit.Note
thatweneedtwopairs
ofMTAclient/serverprograms.
WhenthesenderisconnectedtothemailserverviaaLAN oraWAN,
weneedtwo VAsandtwopaIrsofMTAs(clIent andserver).
FourthScenario
Inthefourthandmostcommonscenario,Bob isalsoconnectedtohismailserverbya
WANoraLAN.AfterthemessagehasarrivedatBob'smailserver,Bobneedstoretrieve
it.Here,weneedanotherset
ofclient/serveragents,whichwecallmessageaccess
agents(MAAs).BobusesanMAAclienttoretrievehismessages.Theclientsendsa
requesttotheMAAserver,which
isrunningallthetime,andrequeststhetransfer ofthe
messages.ThesituationisshowninFigure26.9.
Figure26.9Fourthscenarioinelectronicmail
MTA
UA Alice client
DaD
\
\
\
LANOCW~'\
\
\
\
~
~
a
UA:useragent
MTA:messagetransferagent
MAA:messageaccessagent
MAA
clientBob UA
D&·D,
,
,
/lAhWAN
,
,
,
Therearetwoimportantpointshere.First,Bobcannotbypassthemailserverand
usetheMTAserverdirectly.
TouseMTAserverdirectly,Bobwouldneed torunthe
MTAserverallthetimebecausehedoesnotknow whenamessagewillarrive.This
impliesthatBobmustkeephiscomputeronallthetime
ifheisconnectedtohissystem
throughaLAN.
Ifheisconnectedthrough a-WAN,hemustkeeptheconnectionupall
thetime.Neither
ofthesesituationsisfeasibletoday.

828 CHAPTER26 REMOTELOGGING,ELECTRONICMAIL, ANDFILETRANSFER
Second,notethatBobneedsanotherpair ofclient/serverprograms:message
accessprograms.Thisissobecause anMTAclient/serverprogramisa
pushprogram:
theclientpushesthemessagetotheserver.Bobneedsa
pullprogram.Theclientneeds
topullthemessagefromtheserver.Figure26.10showsthedifference.
Figure26.10
Pushversus pullinelectronicemail
MTA MTA
client server
D
Clientpushesmessages
D
»
MAA MAA
client server
D
Clientpullsmessages
D
0(
Whenbothsender andreceiverareconnectedtothemailserverviaaLAN oraWAN,
weneedtwo VAs,twopairsofMTAs(clientandserver), andapairofMAAs
(client
andserver).Thisisthemostcommonsituationtoday.
UserAgent
Thefirstcomponent ofanelectronicmailsystemistheuseragent (VA).Itprovides
servicetotheuser
tomaketheprocess ofsendingandreceivingamessageeasier.
ServicesProvidedbyaUser Agent
Auseragentisasoftwarepackage(program)thatcomposes,reads,repliesto,andfor­
wardsmessages.
Italsohandlesmailboxes.Figure26.11showstheservices ofatypical
useragent.
Figure26.11
Servicesofuseragent
Useragent
I
I I I I I
Composing Reading Replyingto Forwarding Handling
messages messages messages messages mailboxes
ComposingMessagesAuseragenthelpstheusercomposethee-mailmessagetobe
sentout.Mostuseragentsprovideatemplateonthescreentobefilledinbytheuser.
Someevenhaveabuilt-ineditorthatcandospellchecking,grammarchecking,and

SECTION26.2ELECTRONICMAIL 829
othertasksexpectedfromasophisticatedwordprocessor.Auser, ofcourse,couldalter­
nativelyusehisorherfavoritetexteditor
orwordprocessortocreatethemessageand
importit,orcutandpasteit,intotheuseragenttemplate.
ReadingMessagesThesecondduty
oftheuseragentistoreadtheincomingmes­
sages.Whenauserinvokesauseragent,itfirstchecksthemailintheincomingmailbox.
Mostuseragentsshowaone-linesummary
ofeachreceivedmail.Eache-mailcontains
thefollowingfields.
1.Anumberfield.
2.Aflagfieldthatshowsthestatus ofthemailsuchasnew,alreadyreadbutnot
repliedto,orreadandrepliedto.
:).Thesizeofthemessage.
4.Thesender.
5.Theoptionalsubjectfield.
Replying
toMessagesAfterreadingamessage,ausercanusetheuseragenttoreply
toamessage.Auseragentusuallyallowstheusertoreplytotheoriginalsenderorto
replytoallrecipients
ofthemessage.Thereplymessagemaycontaintheoriginalmes­
sage(forquickreference)andthenewmessage.
ForwardingMessagesReplyingisdefinedassendingamessagetothesender or
recipientsofthecopy.Forwardingisdefinedassendingthemessagetoathirdparty.A
useragentallowsthereceivertoforwardthemessage,withorwithoutextracomments,
toathirdparty.
HandlingMailboxes
Auseragentnormallycreatestwomailboxes:aninboxandanoutbox.Eachboxisafile
withaspecialformatthatcanbehandledbytheuseragent.Theinboxkeepsallthereceived
e-mailsuntiltheyaredeletedbytheuser.Theoutboxkeepsallthesente-mailsuntil the
userdeletesthem.Mostuseragentstodayarecapable
ofcreatingcustomizedmailboxes.
UserAgentTypes
Therearetwotypes ofuseragents:command-drivenandGUI-based.
Command-DrivenCommand-drivenuseragentsbelongtotheearlydays
ofelectronic
mail.Theyarestillpresentastheunderlyinguseragentsinservers.Acommand-driven
useragentnormallyacceptsaone-charactercommandfromthekeyboardtoperformits
task.Forexample,ausercantypethecharacter
r,atthecommandprompt, toreplytothe
sender
ofthemessage,ortypethecharacterRtoreplytothesenderandallrecipients.
Someexamples
ofcommand-drivenuseragentsare mail,pine, andelm.
Someexamplesofcommand-drivenuseragentsare mail,pine, andelm.
GUI-BasedModemuseragentsareGUI-based.Theycontaingraphical-userinter­
face(GUI)componentsthatallowtheusertointeractwiththesoftwarebyusingboth
thekeyboardandthemouse.Theyhavegraphicalcomponentssuchasicons,menu

830 CHAPTER26REMOTELOGGING,ELECTRONICMAIL, ANDFILETRANSFER
bars,andwindowsthatmaketheserviceseasytoaccess.Someexamples ofGUI-based
useragentsareEudora,Microsoft'sOutlook,andNetscape.
Someexamples ofGUI·baseduseragentsareEudora,Outlook, andNetscape.
SendingMail
Tosendmail,theuser,throughtheUA,createsmailthatlooksverysimilartopostal
mail.
Ithasanenvelopeandamessage(seeFigure26.12).
Figure26.12Formatofane-mail
BehrollzForouzan
DeAnzaCollege
Cupertino,CA96014
SophiaFegan
Com-Net
Cupertino,CA95014
a.Postalmail
MailFrom:[email protected]
v
0-
0
RCPTTo:[email protected] ;:;
:>
l::
~
From:BehrouzForouzan
...
TQ:SophiaFegan
v
'0
Date:liS/OS
cd
tlJ
Subject:Network
::c
tlJ
O/j
cd
'"
DearMs.Fegan: '"v
Wewanttoinformyouthat
;;S
ournetworkisworkingpro- :>-.
'0
perlyafterthelastrepair.
0
Il:I
Yourstruly,.
BehrouzPorouzan
b.Electromcmall
EnvelopeTheenvelopeusuallycontainsthesenderandthereceiveraddresses.
MessageThemessagecontainsthe
headerandthebody.Theheader ofthemessage
definesthesender,thereceiver,thesubject
ofthemessage,andsomeotherinformation
(such
asencodingtype,asweseeshortly).Thebody ofthemessagecontainstheactual
informationtobereadbytherecipient.
ReceivingMail
Theuseragentistriggeredbytheuser(oratimer).
Ifauserhasmail,the VAinforms
theuserwithanotice.
Iftheuserisreadytoread themail.alistisdisplayedinwhich
eachlinecontainsasummary
oftheinformationaboutaparticularmessageinthemail­
box.Thesummaryusuallyincludesthesendermailaddress,thesubject,andthetime
themailwassentorreceived.Theusercanselectany
ofthemessagesanddisplayits
contentsonthescreen.

SECTION26.2ELECTRONICMAIL 831
Addresses
Todelivermail,amailhandlingsystemmustuseanaddressingsystemwithunique
addresses.IntheInternet,theaddress consists
oftwoparts:alocal partandadomain
name,separatedbyan @sign(seeFigure26.13).
Figure26.13
E-mailaddress
Addressofthe
mailboxonthe
mailserver
@
Thedomain
name
ofthe
mailserver
LocalPartThelocalpartdefinesthenameofaspecialfile,calledtheusermailbox,
whereallthemailreceivedforauserisstoredforretrievalbythemessageaccessagent.
DomainNameThesecondpart
oftheaddressisthedomainname. Anorganization
usuallyselectsoneormorehoststoreceiveandsende-mail;thehostsaresometimes
called
mailserversorexchangers.Thedomainnameassigned toeachmailexchanger
eithercomesfromtheDNSdatabaseorisalogicalname(forexample,thenameofthe
organization).
MailingList
Electronicmailallowsonename,an
alias,torepresentseveraldifferent
e-mail
addresses;thisiscalledamailinglist.Everytimeamessageistobesent,thesystem
checkstherecipient'snameagainstthealiasdatabase;
ifthereisamailinglistforthe
definedalias,separatemessages,oneforeachentryinthelist,mustbepreparedand
handedtothe
MTA.Ifthereis nomailinglistforthealias,thenameitselfisthereceiving
addressandasinglemessageisdeliveredtothemailtransferentity.
MIME
Electronicmailhasasimplestructure.Itssimplicity,however,comesataprice.Itcan
sendmessagesonlyinNVT7-bitASCIIformat.Inotherwords,ithassomelimita­
tions.Forexample,itcannotbeusedforlanguagesthatarenotsupportedby7-bit
ASCIIcharacters(such
asFrench,German,Hebrew,Russian,Chinese,andJapanese).
Also,
itcannotbeusedtosendbinaryfilesorvideooraudiodata.
Multipurpose
InternetMailExtensions(MIME)isasupplementaryprotocolthat
allowsnon-ASCIIdatatobesentthroughe-mail.MIMEtransformsnon-ASCIIdataat
thesendersitetoNVTASCIIdataanddeliversthemtotheclient
MTAtobesentthrough
theInternet.Themessageatthereceivingsideistransformedbacktotheoriginaldata.
WecanthinkofMIME asasetofsoftwarefunctionsthattransformsnon-ASCII
data(streamofbits)toASCIIdataandviceversa,asshowninFigure26.14.

832 CHAPTER 26REMOTELOGGING,ELECTRONICMAIL, ANDFILETRANSFER
Figure26.14MIME
User
Non-ASCIIcode
7-bitNVTASCII
7-bitNVTASCII
User
Non-ASCIIcode
7-bitNVTASCII
MIMEdefinesfiveheadersthatcan beaddedtotheoriginale-mailheadersection
todefinethetransformationparameters:
1.MIME-Version
2.Content-Type
3.Content-Transfer-Encoding
4.Content-
Id
5.Content-Description
Figure26.15showsthe
MIMEheaders.Wewilldescribeeachheaderindetail.
Figure26.15MIMEheader
E-mailheader
MIME-Version:
1.1
Content-Type:type/subtype
Content-Transfer-Encoding:encodingtype MIMEheaders
Content-Id:messageid
Content-Description:textualexplanation
ofnontextualcontents
MIME-VersionThisheaderdefinestheversion ofMIMEused.Thecurrentversion
is
1.1.

SECTION26.2ELECTRONICMAIL 833
Content-TypeThisheaderdefinesthetype ofdatausedinthebody ofthemessage.
Thecontenttypeandthecontentsubtypeareseparatedbyaslash.Dependingonthe
subtype,theheadermaycontainotherparameters.
CDBtent-'I)pe:~Jsubtjl;pe;parameters>.
MIMEallowssevendifferenttypes ofdata.ThesearelistedinTable26.5.
Table26.5
DatatypesandsubtypesinMIME
Type Subtype Description
Text
Plain Unformatted
HTML HTML format(seeChapter27)
Mixed Bodycontainsorderedparts
ofdifferentdatatypes
MultipartParallel Sameasabove,butnoorder
Digest Similartomixedsubtypes,butthedefaultismessage/
RFC822
Alternative Partsaredifferentversions
ofthesamemessage
RFC822 Bodyisanencapsulatedmessage
Message Partial Bodyisafragment
ofabiggermessage
External-BodyBodyisareferencetoanothermessage
Image IPEG ImageisinIPEGformat
GIF ImageisinGIFformat
Video MPEG VideoisinMPEGformat
Audio Basic Single-channelencoding
ofvoiceat8kHz
ApplicationPostScript AdobePostScript
Octet-streamGeneralbinarydata(8-bitbytes)
Content-Transfer-EncodingThisheaderdefinesthemethodusedtoencodethe
messagesinto
OsandIsfortransport:
::,i·:.~on~~Tta~~;ltne{)~iIlg: <tyti,~
.,o~, '
Thefivetypes ofencodingmethodsarelistedinTable26.6.
Content-IdThisheaderuniquelyidentifiesthewholemessageinamultiple-message
environment.

834 CHAPTER 26REMOTELOGGING,ELECTRONICMAIL, ANDFILETRANSFER
Table26.6 Content-transfer-encoding
Type Description
7-bit NVTASCIIcharactersandshortlines
8-bit Non-ASCIIcharactersandshortlines
Binary Non-ASCIIcharacterswithunlimited-lengthlines
Base-64 6-bitblocks
ofdataencodedinto8-bitASCIIcharacters
Quoted-printableNon-ASCIIcharactersencodedasanequalssignfollowed
byanASCIIcode
Content-DescriptionThisheaderdefineswhetherthebodyisimage,audio,orvideo.
Content-Description:<description>
MessageTransferAgent:SMTP
Theactualmailtransferisdonethroughmessagetransferagents. Tosendmail,asystem
musthavetheclientMTA,andtoreceivemail,asystemmusthaveaserverMTA.The
formalprotocolthatdefinesthe
MTAclientandserverintheInternetiscalledthe Simple
MailTransferProtocol(SMTP).
Aswesaidbefore,twopairs ofMTAclient/server
programsareusedinthemostcommonsituation(fourthscenario).Figure26.16shows
therange
oftheSMTPprotocolinthisscenario.
Figure26.16SMTPrange
SMTP SMTP
13~~ceiver
,
,
,
,
"LANorWAN,
,
,
,
sende~a._I~
,
,
,
,
LANorWAN"
,
,
,
,
Mailserver Mailserver
SMTPisusedtwotimes,betweenthesenderandthesender'smailserverand
betweenthetwomailservers.Aswewillseeshortly,anotherprotocolisneeded
betweenthemailserverandthereceiver.
SMTPsimplydefineshowcommandsandresponsesmustbesentbackandforth.
Eachnetworkisfree
tochooseasoftwarepackageforimplementation. Wediscussthe
mechanism
ofmailtransferbySMTPintheremainder ofthesection.

SECTION26.2ELECTRONICMAIL 835
CommandsandResponses
SMTPusescommandsandresponsestotransfermessages betweenanMTAclientand
anMTAserver(seeFigure26.17).
Figure26.17Commandsandresponses
Commands
MTA
client
Responses
MTA
server
Eachcommandorreplyisterminatedbyatwo-character(carriagereturnandlinefeed)
end-of-linetoken.
Commands Commandsaresentfromtheclienttotheserver.Thefonnat ofacommand
isshowninFigure26.18.
Itconsistsofakeywordfollowedbyzeroormorearguments.
SMTPdefines14commands.Thefirstfivearemandatory;everyimplementationmust
supportthesefivecommands.Thenextthreeareoftenusedandhighlyrecommended.The
lastsixareseldomused.
Figure26.18Commandformat
Keyword:argument(s)
ThecommandsarelistedinTable26.7.
Table26.7 Commands
Keyword Argument(
s)
HELO Sender'shostname
MAILFROM Sender
ofthemessage
RCPTTO Intendedrecipient ofthemessage
DATA Bodyofthemail
QUIT
RSET
VRFY Nameofrecipienttobeverified
NOOP
TURN
EXPN Mailinglistto beexpanded
HELP Commandname

836 CHAPTER 26REMOTELOGGING,ELECTRONICMAIL, ANDFILETRANSFER
Table26.7 Commands(continued)
Keyword Argument(s)
SENDFROM Intendedrecipient ofthemessage
SMOLFROM Intendedrecipientofthemessage
SMALFROM Intendedrecipient
ofthemessage
ResponsesResponsesaresentfromtheservertotheclient.Aresponseisathree­
digitcodethatmaybefollowedbyadditionaltextualinformation.Table26.8listssome
oftheresponses.
Table26.8
Responses
Code Description
PositiveCompletionReply
211Systemstatusorhelpreply
214Helpmessage
220Serviceready
221Serviceclosingtransmissionchannel
250Requestcommandcompleted
251Usernotlocal;themessagewill beforwarded
Positive
IntermediateReply
354Startmailinput
TransientNegativeCompletionReply
421Servicenotavailable
450Mailboxnotavailable
451Commandaborted:localerror
452Commandaborted:insufficientstorage
PermanentNegativeCompletionReply
500Syntaxerror;unrecognizedcommand
501Syntaxerrorinparametersorarguments
502Commandnotimplemented
503Badsequenceofcommands
504Commandtemporarilynotimplemented
550Commandisnotexecuted;mailboxunavailable
551Usernotlocal
552Requestedactionaborted;exceededstoragelocation
553Requestedactionnottaken;mailboxnamenotallowed
554Transactionfailed

SECTION26.2ELECTRONICMAIL 837
Asthetableshows,responsesaredividedintofourcategories. Theleftmostdigit of
thecode(2,3,4, and5)definesthecategory.
MailTransferPhases
Theprocessoftransferringamail messageoccursinthreephases:connectionestab­
lishment,mailtransfer,
andconnectiontermination.
Example26.3
LetusseehowwecandirectlyuseSMTPtosendane-mailandsimulatethecommands
andresponseswedescribedinthissection.
WeuseTELNET tologintoport 25(theweIl­
knownportforSMTP).
Wethenusethecommandsdirectly tosendane-mail.Inthisexample,
[email protected]
tohimself.Thefirst fewlinesshowTELNETtry­
ing
toconnecttotheAdelphiamailserver.
Afterconnection,wecantypetheSMTPcommandsandthenreceivetheresponses,as
shownbelow.
Wehaveshownthecommandsinblackandtheresponsesincolor.Notethatwe
haveadded,forclarification,somecommentlines,designated
bythe"="signs.Theselinesare
notpartofthee-mailprocedure.
$teJnetmail.adelphia.netJ5~­
Trying68.168.78.100•••,
Co~nected ro~~.ad.elp~~~et\6~~1~~;~8!1~).,
======== c\lnnectionEStablishment'--:===,==::::=
220mta13.auelphia.netSMTPserverreadyFri,6Aug2004...-
HELO maP-.a9~lphia.net ..'
250mtal3:.adeJphia.net.
==-=::::===== MailTrallSfer
MAILFROM;.forouzanb({fad~hia.nef ~
ZSOSender:<iorouzanb0i;deJphia.net>:Ok
R~T TO~fOl'(1nzanb.@aa~pbia.net
.f50Recipie~t <forouzanbW'adelpbia.llet~ Ok
DATA
354OkSenddataendiQg~:with <CRLF>.<CRLF>
})~~lD: lt~ro~.~ ..' 'C<.... '
..TO:F'orotJzan:::: .. .. ..
Tfiisisatest~age
to'showSMTPinaction...
~-==...:--==ConneetIDnTermination=:=:==-==:..:.-.-:::!:---::::::
,[email protected]
QUIT ,.
•'\0•.221mta:13~ade]phia.ntit SMTPservcJ;..closingcOl1l1ection
~ ," , ,
COOnectionclosedbyforeignhost:.
MessageAccessAgent: POPandIMAP
ThefirstandthesecondstagesofmaildeliveryuseSMTP.However, SMTPisnot
involvedinthethirdstagebecause SMTPisapushprotocol;itpushesthemessagefrom

838 CHAPTER 26REMOTELOGGING,ELECTRONICMAIL, ANDFILETRANSFER
theclienttotheserver.Inotherwords,thedirection ofthebulk:data(messages)isfrom
theclienttotheserver.Ontheotherhand,thethirdstageneedsa
pullprotocol;theclient
mustpullmessagesfromtheserver.Thedirection
ofthebulkdataisfromtheserverto
theclient.Thethirdstageusesamessageaccessagent.
Currentlytwomessageaccessprotocolsareavailable:PostOfficeProtocol,version3
(POP3)andInternetMailAccessProtocol,version4(IMAP4).Figure26.19showsthe
position
ofthesetwoprotocolsinthemostcommonsituation(fourthscenario).
Figure26.19 POP3andIMAP4
ISMTP
Alic~[I
sende~
..
..
..
..
LANorWAN....
..
....
..
Mailserver
SMTP
POP3
IMAP4I
(]~~b
~eiver
;
;
;
;
;;LANorWAN
;
;
;
;
Mailserver
POP3
PostOfficeProtocol,version3(POP3) issimpleandlimitedinfunctionality.The
clientPOP3softwareisinstalledontherecipientcomputer;theserverPOP3software
isinstalled
onthemailserver.
Mailaccessstartswiththeclientwhentheuserneedstodownloade-mailfromthe
mailboxonthemailserver.TheclientopensaconnectiontotheserveronTCPport110.
Itthensendsitsusernameandpasswordtoaccessthemailbox.Theusercanthenlist
andretrievethemailmessages,onebyone.Figure26.20showsanexample
ofdown­
loadingusingPOP3.
POP3hastwomodes:thedeletemodeandthekeepmode.Inthedeletemode,the
mailisdeleted
fromthemailboxaftereachretrieval. Inthekeepmode,themail
remainsinthemailboxafterretrieval.Thedeletemodeisnormallyusedwhentheuser
isworkingatherpermanentcomputerandcansaveandorganizethereceivedmailafter
readingorreplying.Thekeepmodeisnormallyusedwhentheuseraccesseshermail
awayfromherprimarycomputer(e.g.,alaptop).Themailisreadbutkeptinthesystem
forlaterretrievalandorganizing.
IMAP4
Anothermailaccessprotocolis InternetMailAccessProtocol,version4(IMAP4).
IMAP4issimilartoPOP3,butithasmorefeatures;IMAP4ismorepowerfulandmore
complex.

SECTION26.2ELECTRONICMAIL 839
Figure26.20TheexchangeofcommandsandresponsesinPOP3
Mailserver Bob'scomputer
POP3isdeficient inseveralways.Itdoesnotallowtheusertoorganizehermailon
theserver;theusercannothavedifferentfoldersontheserver.(Ofcourse,theusercan
createfolders
onherowncomputer.)Inaddition,POP3does notallowtheuserto
partiallycheckthecontents
ofthemailbeforedownloading.
IMAP4providesthefollowingextrafunctions:
oAusercancheckthee-mailheaderpriortodownloading.
oAusercansearchthecontents ofthee-mailforaspecificstring ofcharactersprior
todownloading.
oAusercanpartiallydownloade-mail.Thisisespeciallyuseful ifbandwidthislimited
andthe
e-mailcontainsmultimediawithhighbandwidthrequirements.
oAusercancreate,delete,orrenamemailboxesonthemailserver.
oAusercancreateahierarchy ofmailboxesinafolderfore-mailstorage.
Web-BasedMail
E-mailissuchacommonapplicationthatsomewebsitestodayprovidethisserviceto
anyonewhoaccessesthesite.TwocommonsitesareHotmailandYahoo.Theideaisvery
simple.MailtransferfromAlice'sbrowsertohermailserverisdonethroughHTTP(see
Chapter27).Thetransfer
ofthemessagefromthesendingmailservertothereceiving

840 CHAPTER 26REMOTELOGGING,ELECTRONICMAIL, ANDFILETRANSFER
mailserverisstillthroughSMTP.Finally,themessagefromthereceivingserver(theWeb
server)toBob'sbrowserisdonethroughHTIP.
Thelastphaseisveryinteresting.InsteadofPOP3orIMAP4,HTTPisnormally
used.WhenBobneedstoretrievehise-mails,hesendsamessagetothewebsite(Hotmail,
forexample).ThewebsitesendsaformtobefilledinbyBob,whichincludesthelog-in
nameandthepassword.
Ifthelog-innameandpasswordmatch,thee-mailistransferred
fromthe
WebservertoBob'sbrowserinHTMLformat.
26.3FILETRANSFER
Transferringfilesfromonecomputertoanotherisone ofthemostcommontasks
expectedfromanetworkingorinternetworkingenvironment.Asamatter
offact,the
greatestvolume
ofdataexchangeintheInternettodayisduetofiletransfer.Inthis
section,wediscussonepopularprotocolinvolvedintransferringfiles:FileTransfer
Protocol
(FTP).
FileTransferProtocol(FTP)
FileTransferProtocol(FTP)isthestandardmechanismprovidedby TCP/IPfor
copyingafilefromonehosttoanother.Althoughtransferringfilesfromonesystemto
anotherseemssimpleandstraightforward,someproblemsmustbedealtwithfirst.For
example,two systemsmayusedifferentfilenameconventions.Twosystemsmayhave
differentwaystorepresenttextanddata.Twosystemsmayhavedifferentdirectory
structures.AlltheseproblemshavebeensolvedbyFTPinaverysimpleandelegant
approach.
FTPdiffersfromotherclient/serverapplicationsinthatitestablishestwoconnec­
tionsbetweenthehosts.Oneconnectionisusedfordatatransfer,theotherforcontrol
information(commandsandresponses).Separation
ofcommandsanddatatransfer
makesFTPmoreefficient.Thecontrolconnectionusesverysimplerules
ofcommuni­
cation.
Wcneedtotransferonlyaline ofcommandoralineofresponseatatime.The
dataconnection,ontheotherhand,needsmorecomplexrulesduetothevariety
ofdata
typestransferred.However,thedifferenceincomplexity
isattheFTPlevel,not TCP.
ForTCP,bothconnectionsaretreatedthesame.
FTPusestwowell-knownTCPports:Port
21isusedforthecontrolconnection,
andport20
isusedforthedataconnection.
FTPusestheservices ofTCP.Itneedstwo TCPconnections.
Thewell-known
port21isusedforthe controlconnection
andthewell-knownport20forthe dataconnection.
Figure26.21showsthebasicmodel ofFTP.Theclienthasthreecomponents:user
interface,clientcontrolprocess,andtheclientdatatransferprocess.Theserverhastwo
components:theservercontrolprocessandtheserverdatatransferprocess.Thecontrol
connectionismadebetweenthecontrolprocesses.Thedataconnectionismadebetween
thedatatransferprocesses.

SECTION26.3FILETRANSFER 841
Figure26.21FTP
User
t
User
interface
Client Server
ThecontrolconnectionremainsconnectedduringtheentireinteractiveFTPses­
sion.The
dataconnectionisopenedandthenclosedforeachfiletransferred. Itopens
eachtimecommandsthatinvolvetransferringfilesareused,anditcloseswhenthefile
istransferred.Inotherwords,whenauserstartsanFTPsession,thecontrolconnection
opens.Whilethecontrolconnectionisopen,thedataconnectioncan
beopenedand
closedmultipletimes
ifseveralfilesaretransferred.
CommunicationoverControlConnection
FTPusesthesameapproachasSMTPtocommunicateacrossthecontrolconnection. It
usesthe7-bitASCIIcharacterset(seeFigure26.22).Communicationisachieved
throughcommandsandresponses.Thissimplemethodisadequateforthecontrolcon­
nectionbecausewesendonecommand(orresponse)atatime.Eachcommandor
responseisonlyoneshortline,soweneednotworryaboutfileformatorfilestructure.
Eachlineisterminatedwithatwo-character(carriagereturnandlinefeed)end-of-line
token.
Figure26.22Usingthecontrolconnection
Local
code
,
";,ConttO:(,,
',;;:t't9C~~ "'
Client
NVTASCII
Control
connection
Local
code
'C6ntrol
"prt-icess
" '
Server

842 CHAPTER 26REMOTELOGGING,ELECTRONICMAIL, ANDFILETRANSFER
CommunicationoverDataConnection
Thepurposeofthedataconnectionisdifferentfromthat ofthecontrolconnection. We
wanttotransferfilesthroughthedataconnection.Filetransferoccursoverthedata
connectionunderthecontrol
ofthecommandssentoverthecontrolconnection.How­
ever,weshouldrememberthatfiletransferin
FTPmeansone ofthreethings:
oAfileistobecopiedfromtheservertotheclient.Thisiscalled retrievingaft/e. It
isdoneunderthesupervision oftheRETRcommand,
oAfileisto becopiedfromtheclienttotheserver.Thisiscalled storingaft/e. Itis
doneunderthesupervision
oftheSTORcommand.
oAlistofdirectoryorfilenamesistobesentfromtheservertotheclient.Thisis
doneunderthesupervision
oftheLISTcommand.Notethat FTPtreatsalist of
directoryorfilenames asafile.Itissentoverthedataconnection.
Theclientmustdefinethetype
offiletobetransferred,thestructure ofthedata,
andthetransmissionmode.Beforesendingthefilethroughthedataconnection,we
preparefortransmissionthroughthecontrolconnection.Theheterogeneityproblemis
resolvedbydefiningthreeattributes
ofcommunication:filetype,datastructure,and
transmissionmode(seeFigure26.23).
Figure26.23 Usingthedataconnection
Localdatatype
andstructure
Client
Filetype,datastructure,
andtransmissionmode
aredefined
bytheclient
Localdatatype
andstructure
Data
lTIlnSfe!.~----...r
process
Server
FileType FTPcantransferone ofthefollowingfiletypesacrossthedataconnection:
anASCIIfile,EBCDICfile,orimagefile.The
ASCIIfile isthedefaultformatfortrans­
ferringtextfiles.Eachcharacterisencodedusing7-bitASCII.Thesendertransforms
thefilefromitsownrepresentationintoASCIIcharacters,andthereceivertransforms
theASCIIcharacterstoitsownrepresentation.
Ifoneorbothends oftheconnection
useEBCDICencoding(thefileformatusedbyIBM),thefilecan
betransferredusing
EBCDICencoding.
Theimagefile isthedefaultformatfortransferringbinaryfiles.
Thefileissentascontinuousstreams ofbitswithoutanyinterpretation orencoding.
Thisismostlyusedtotransferbinaryfilessuchascompiledprograms.
DataStructureFTPcantransferafileacrossthedataconnection byusingone ofthe
followinginterpretationsaboutthestructure
ofthedata:filestructure,recordstructure,
andpagestructure.Inthe
filestructureformat,thefileisacontinuousstream ofbytes.In
the
recordstructure, thefileisdividedintorecords.Thiscanbeusedonlywithtextfiles.
Inthepagestructure,thefileisdividedintopages,witheachpagehavingapagenumber
andapageheader.Thepagescan
bestoredandaccessedrandomlyorsequentially.

SECTION26.3FILETRANSFER 843
TransmissionModeFTPcantransferafileacrossthedataconnectionbyusingone
ofthefollowingthreetransmissionmodes:streammode,blockmode,andcompressed
mode.The
streammodeisthedefaultmode.DataaredeliveredfromFTP toTCPasa
continuousstream
ofbytes.TCPisresponsibleforchoppingdataintosegments of
appropriatesize. Ifthedataaresimplyastream ofbytes(filestructure),noend-of-file
isneeded.End-of-fileinthiscase
istheclosingofthedataconnectionbythesender. If
thedataaredividedintorecords(recordstructure),eachrecordwillhaveaI-byteend­
of-record(EOR)characterandtheend
ofthefilewillhaveaI-byteend-of-file(EOF)
character.In
blockmode,datacanbedeliveredfromFTP toTCPinblocks.Inthis
case,eachblockisprecededbya3-byteheader.Thefirstbyteiscalledtheblock
descriptor;thenext2bytesdefinethesize
oftheblockinbytes.Inthe compressed
mode,ifthefileisbig,thedatacanbecompressed.Thecompressionmethodnormally
usedisrun-lengthencoding.Inthismethod,consecutiveappearances
ofadataunitare
replacedbyoneoccurrenceandthenumber
ofrepetitions.Inatextfile,thisisusually
spaces(blanks).
Inabinaryfile,nullcharactersareusuallycompressed.
Example26.4
Thefollowingshowsanactual FTPsessionforretrievingalist ofitemsinadirectory. Thecol­
oredlinesshowtheresponsesfromtheservercontrolconnection;theblacklinesshowthecom­
mandssentbytheclient.
Thelinesinwhitewithablackbackgroundshowdatatransfer.
$ftpvoyager.deanza.tbda.edu
Connectedtovoyager.deanza.tbda.edu.
220(vsFTPd1.2.1)
530
PleaseloginwithUSER andPASS.
Name(voyager.deanza.tbda.edu:forouzan):forouzan
331Pleasespecifythepassword.
Password:
230Loginsuccessful.
RemotesystemtypeisUNIX.
Usingbinarymodetotransferfiles.
ftp>
Isreports
227EnteringPassiveMode (153,18,17,11,238,169)
150
Herecomesthedirectorylisting.
drwxr-xr-x23027 411 4096Sep242002business
drwxr-xr-x
23027 411 4096Sep242002personal
drwxr-xr-x
23027 411 4096Sep242002school
226
Directorysend OK.
ftp>quit
221Goodbye.
1.Afterthecontrolconnectioniscreated,the FIPserversendsthe220(serviceready)response
onthecontrolconnection.
2.Theclientsendsitsname.
3.Theserverrespondswith331(usernameisOK,password
isrequired).

844 CHAPTER26REMOTELOGGING,ELECTRONICMAIL, ANDFILETRANSFER
4.Theclientsendsthepassword(notshown).
5.Theserverrespondswith230(userlog-inisOK).
6.Theclientsendsthelistcommand Osreports)tofindthelist offilesonthedirectorynamed
report.
7.Nowtheserverrespondswith150andopensthedataconnection.
8.Theserverthensendsthelist ofthefilesordirectories(asafile)onthedataconnection.
Whenthewholelist(file)issent,theserverrespondswith226(closingdataconnection)
overthecontrolconnection.
9.Theclientnowhastwochoices.ItcanusetheQUITcommandtorequesttheclosing ofthe
controlconnection,oritcansendanothercommandtostartanotheractivity(andeventually
openanotherdataconnection).Inourexample,theclientsendsaQUITcommand.
10.AfterreceivingtheQUITcommand,theserverrespondswith 221(serviceclosing)andthen
closesthecontrolconnection.
AnonymousFTP
TouseFfP,auserneedsanaccount(username)andapasswordontheremoteserver.
Somesiteshaveaset
offilesavailableforpublicaccess,toenable anonymousFTP.To
accessthesefiles,auserdoesnotneedtohave anaccountorpassword.Instead,theuser
canuseanonymous
astheusernameandguestasthepassword.
Useraccesstothesystemisverylimited.Somesitesallowanonymoususersonly
asubset
ofcommands.Forexample,mostsitesallowtheusertocopysomefiles,butdo
notallownavigationthroughthedirectories.
Example26.5
Weshowanexample ofanonymousFTP.Weassumethatsomepublicdataareavailableat
intemic.net.
$ftp
intemic.net
Connectedtointernic.net
220Serverready
Name:anonymous
331Guestlogin
OK,send"guest".aspassword'
.Password~guest .. .
-ftp>pwd"
257'I'iscurrentdirectory
jip>1s
:200-0K
150OpeningASCIImode
bin
...
ttp>close
221Goodbye
ftp>quit

SECTION26.5KEYTERMS 845
26.4RECOMMENDED READING
Formoredetailsaboutsubjectsdiscussedinthischapter,werecommendthefollowing
booksandsites.Theitemsinbrackets[
...]refertothereferencelistattheendofthetext.
Books
RemoteloggingisdiscussedinChapter18 of[For06]andChapter26 of[Ste94].
ElectronicmailisdiscussedinChapter20
of[For06],Section9.2 of[PD03],Chapter32
of[Com04],Section7.2 of[Tan03],andChapter 28of[Ste94].FTPisdiscussedin
Chapter
19of[For06],Chapter27of[Ste94],andChapter34of[Com04].
Sites
Thefollowingsitesarerelatedtotopicsdiscussedinthischapter.
owww.ietf.org/rfc.htrnlInformationaboutRFCs
RFCs
ThefollowingRFCsarerelatedtoTELNET:
.~.:131~ 3~0, 393:i;4itj;'~~$.:,4~2;i·~,~4~S~$13f:529,,;~~2, ~~S; ~&6;.:$99;i~6~~.b79,7()t,'<7{)2, 103""
128~1Q4,:78~}g~8,~~4;~5;~j.&4~bas~ i~~~;;;. .,.".',.:".....'....,..,,,
"," ~ ~ ~ ~, ~,,~,,~--:~-/,', 0-',-,','~~ ~', :,"o'Y' ~o~,~'oo; ;
ThefollowingRFCsarerelatedtoSMTP, POP,andIMAP:
'/196/221,224,~18".~;ij.::5$:sl;1$( '~2~;7~(1;!f)6~ 82i;9j4~974;t041; 1081"lO~2;::1~Z5;
'1.400';f.4~6:·:14:26.:1£it2~;:f{j5'2;:'",<;l*i(~i:',>f7'l.5:i'¥34''174iY'r'~J:;j/'}67:lS6~r 1810·~();:tS':;'
':2~6:201t~;"~~~:::~~:11r2~SO: '2'f~2~;2OC~~';1~~:f~l~~i:~3$9::~~~~g~'~Q;:' ,"'';.;,'."',
ThefollowingRFCsarerelatedtoFTP:
..114;,133;i4j~ 16.3.,:rii:.'~~~ •.2~~.Z4i;;zS~,25~~~;~~t i~~h~,81~,2~l.~54:~85~41i:;414,Ai~, ;'
··430··4~;~:448;·:463;'if.~~:~18:':1J:~6:505~°00'5'S4Z~~3;~24,630:61iO;'69t·765,·91j··9S~······ ;"
o:'}(;3kt1:S§~;'?~~8~~~~1~::;.J;;~1;;'/ ;,;:~;.~.,.~; •.;~.:·;:;·t:;;;..';;;;<';'>:.,",.'. ..;..~
DNSisdiscussedin[AL98],chapter 17of[For06],section9.1of[PD03],and
section7.1of[Tan03].
26.5KEYTERMS
alias
anonymousFTP
ASCIIfile
blockmode
body
charactermode
compressedmode
controlcharacter
controlconnection
dataconnection

846 CHAPTER 26REMOTELOGGING,ELECTRONICMAIL, ANDFILETRANSFER
defaultmode
domainname
envelope
filestructure
FileTransferProtocol(FTP)
header
imagefile
InternetMailAccessProtocol,version4
(IMAP4)
linemode
locallog-in
localpart
messageaccessagent(MAA)
messagetransferagent(MTA)
MultipurposeInternetMailExtensions
(MIME)
networkvirtualterminal(NVT)
optionnegotiation
pagestructure
PostOfficeProtocol,version3(POP3)
recordstructure
remotelog-in
SimpleMailTransferProtocol(SMTP)
streammode
suboptionnegotiation
terminalnetwork(TELNET)
timesharing
useragent
(VA)
26.6SUMMARY
oTELNETisaclient/serverapplicationthatallowsausertologontoaremote
machine,givingtheuseraccesstotheremotesystem.
oTELNETusesthenetworkvirtualterminal(NVT)systemtoencodecharacterson
thelocalsystem.Ontheservermachine,NVTdecodesthecharacterstoaform
acceptabletotheremotemachine.
oNVTusesasetofcharactersfordataandasetofcharactersforcontrol.
oInTELNET,controlcharactersareembedded inthedatastreamandprecededby
the
interpretascontrol (lAC)controlcharacter.
DOptionsarefeaturesthatenhancetheTELNETprocess.
oTELNETallowsnegotiation tosettransferconditionsbetweentheclientandserver
beforeandduringtheuse
oftheservice.
DATELNETimplementationoperatesinthedefault,character,orlinemode.
1.Inthedefaultmode,theclientsendsonelineatatimetotheserver.
2.Inthecharactermode,theclientsendsonecharacteratatimetotheserver.
3.Inthelinemode,theclientsendsonelineatatimetotheserver.
DSeveralprograms,includingSMTP,POP3,andIMAP4,areused intheInternetto
provideelectronicmailservices.
DInelectronicmail,the VApreparesthemessage,createstheenvelope,andputsthe
messageintheenvelope.
DInelectronicmail,themailaddressconsists oftwoparts:alocalpart(usermailbox)
andadomainname.Theformislocalpart@domainname.
oInelectronicmail,MultipurposeInternetMailExtension(MIME)allowsthetransfer
ofmultimediamessages.
oInelectronicmail,theMTAtransfersthemailacrosstheInternet,aLAN,ora WAN.

SECTION26.7 PRACTICESET 847
oSMTPusescommandsandresponsestotransfermessagesbetweenanMTAclient
andanMTAserver.
oThestepsintransferringamailmessageare
1.Connectionestablishment·
2.Mailtransfer
3.Connectiontermination
oPostOfficeProtocol,version3(POP3)andInternetMailAccessProtocol,version4
(IMAP4)areprotocolsusedforpullingmessagesfromamailserver.
oOneoftheprogramsusedforfiletransferintheInternetisFileTransferProtocol
(FTP).
oFTPrequirestwoconnectionsfordatatransfer:acontrolconnectionand adata
connection.
oFTPemploysNVTASCIIforcommunicationbetweendissimilarsystems.
oPriortotheactualtransfer offiles,thefiletype,datastructure,andtransmission
modearedefinedbythe clientthroughthecontrolconnection.
oResponsesaresentfromtheservertotheclientduringconnectionestablishment.
oTherearethreetypesoffiletransfer:
1.Afileiscopiedfromtheservertotheclient.
2.Afileiscopiedfromtheclienttotheserver.
3.Alist
ofdirectoriesorfilenamesissentfromtheservertotheclient.
oAnonymousFTPprovidesamethodforthegeneralpublictoaccessfilesonremote
sites.
26.7PRACTICESET
ReviewQuestions
1.Whatisthedifferencebetweenlocalandremotelog-ininTELNET?
2.HowarecontrolanddatacharactersdistinguishedinNVT?
3.HowareoptionsnegotiatedinTELNET?
4.DescribetheaddressingsystemusedbySMTP.
5.Inelectronicmail,whatarethetasks
ofauseragent?
6.Inelectronicmail,whatisMIME?
7.WhydoweneedPOP3orIMAP4forelectronicmail?
8.Whatisthepurpose ofFTP?
9.Describethefunctions ofthetwoFTPconnections.
10.Whatkinds
offiletypescanFTPtransfer?
11.WhatarethethreeFTPtransmissionmodes?
12.Howdoesstoringafiledifferfromretrievingafile?
13.WhatisanonymousFTP?

848 CHAPTER26REMOTELOGGING,ELECTRONICMAIL, ANDFILETRANSFER
Exercises
14.Showthesequence ofbitssentfromaclientTELNETforthebinarytransmission
of111100110011110011111111.
15.IfTELNETisusingthecharactermode,howmanycharactersaresentbackand
forthbetweentheclientandservertocopyafilenamedfile
1toanotherfilenamed
file2usingthecommand
cpfile1file2?
16.Whatis theminimumnumber ofbitssentattheTCPleveltoaccomplishthetask
inExercise
IS?
17.Whatistheminimumnumber ofbitssentatthedatalinklayerlevel(usingEthernet)
toaccomplishthetaskinExercise15?
18.Whatistheratio
oftheusefulbitstothetotalbitsinExercise17?
19.Interpretthefollowingsequences ofcharacters(inhexadecimal)receivedbya
TELNETclientorserver.
a.FFFB01
b.FFFEOI
c.FFF4
d.FFF9
20.Asendersendsunformattedtext.ShowtheMIMEheader.
21.Asendersendsa
IPEGmessage.ShowtheMIMEheader.
22.Whyisaconnectionestablishmentformailtransferneeded
ifTCPhasalready
establishedaconnection?
23.Whyshouldthere
belimitationsonanonymousFTP?Whatcouldanunscrupulous
userdo?
24.ExplainwhyFTPdoesnothaveamessageformat.
ResearchActivities
25.Showthesequence ofcharactersexchangedbetweentheTELNETclientandthe
servertoswitchfromthedefaultmodetothecharactermode.
26.Showthesequence
ofcharactersexchangedbetweentheTELNETclientandthe
servertoswitchfromthedefaultmodetolinemode.
27.InSMTP,[email protected]
[email protected].
28.InSMTP,[email protected]@yyy.com.
Themessageis"Goodmorningmyfriend."
29.InSMTP,[email protected]
[email protected].
30.Whatdoyouthinkwouldhappen
ifthecontrolconnectionwereaccidentallysevered
duringan
FTPtransfer?

SECTION26.7PRACTICESET 849
31.FindtheextendedoptionsproposedforTELNET.
32.Anotherlog-inprotocoliscalledRlogin.FindsomeinformationaboutRloginand
compareitwithTELNET.
33.Amoresecurelog-inprotocolinUNIXiscalledSecureShell(SSH).Findsome
informationaboutthisprotocol.

CHAPTER27
WWWandHTTP
TheWorldWideWeb (WWW)isarepositoryofinformationlinkedtogetherfrom
pointsallovertheworld.TheWWWhasauniquecombination
offlexibility,portability,
anduser-friendlyfeaturesthat distinguishitfromotherservicesprovidedbytheInternet.
The
WWWprojectwasinitiatedbyCERN(EuropeanLaboratoryforParticlePhysics)
tocreateasystemtohandledistributedresourcesnecessaryforscientificresearch.
In
thischapterwefirstdiscussissuesrelatedtotheWeb. Wethendiscussaprotocol,
HTTP,thatisusedtoretrieveinformationfromthe
Web.
27.1ARCHITECTURE
TheWWWtodayisadistributedclientJserverservice, inwhichaclientusingabrowser
canaccessaserviceusingaserver.However,theserviceprovidedisdistributedover
manylocationscalled
sites,asshowninFigure27.1.
Figure27.1 ArchitectureofWWW
Client
WebpageA
SiteA
-D
SiteB
-
851

852 CHAPTER 27WWWANDHTTP
Eachsiteholdsoneormoredocuments,referredtoas Webpages.EachWebpagecan
containalinktootherpagesinthesamesiteoratothersites.Thepagescanberetrieved
andviewedbyusingbrowsers.LetusgothroughthescenarioshowninFigure27.1.The
clientneedstoseesomeinformationthatitknowsbelongstositeA.Itsendsarequest
throughitsbrowser,aprogramthatisdesignedtofetchWebdocuments.Therequest,
amongotherinformation,includestheaddress
ofthesiteandtheWebpage,calledthe
URL,whichwewilldiscussshortly.TheserveratsiteAfindsthedocumentandsendsit
totheclient.Whentheuserviewsthedocument,shefindssomereferencestoother
docu­
ments,includingaWebpageatsite B.ThereferencehastheURLforthenewsite.The
user
isalsointerestedinseeingthisdocument.Theclientsendsanotherrequesttothenew
site,andthenewpageisretrieved.
Client(Browser)
AvarietyofvendorsoffercommercialbrowsersthatinterpretanddisplayaWebdocu­
ment,andallusenearlythesamearchitecture.Each
browserusuallyconsists ofthree
parts:acontroller,clientprotocol,andinterpreters.Thecontrollerreceivesinputfrom
thekeyboardorthemouseandusestheclientprogramstoaccessthedocument.After
thedocumenthasbeenaccessed,thecontrollerusesone
oftheinterpreterstodisplaythe
documentonthescreen.Theclientprotocolcanbeone
oftheprotocolsdescribedprevi­
ouslysuch
as
FfPorHTIP(describedlaterinthechapter).TheinterpretercanbeHTML,
Java,or JavaScript,depending onthetypeofdocument.Wediscusstheuse ofthese
interpretersbasedonthedocumenttypelaterinthechapter(seeFigure27.2).
Figure27.2Browser
Browser
Interpreters
Server
TheWebpageisstoredattheserver.Eachtimeaclientrequestarrives,thecorresponding
documentissenttotheclient.
Toimproveefficiency,serversnormallystorerequested
filesinacache
inmemory;memoryisfastertoaccessthandisk.Aserver canalso
becomemoreefficientthroughmultithreadingormultiprocessing.Inthiscase,aserver
cananswermorethanonerequestatatime.

SECTION27.1ARCHITECTURE 853
UniformResourceLocator
AclientthatwantstoaccessaWebpageneedstheaddress. Tofacilitatetheaccess ofdoc­
umentsdistributedthroughouttheworld,HTTPuseslocators.The
uniformresource
locator
(URL)isastandardforspecifyinganykind ofinformationontheInternet.The
URLdefinesfourthings:protocol,hostcomputer,port,andpath(seeFigure27.3).
Figure27.3 URL
I
Protocol1://IHost
Theprotocolistheclient/serverprogramusedtoretrievethedocument.Many
differentprotocolscanretrieveadocument;amongthemareFTPorHTTP.Themost
commontodayisHTTP.
The
hostisthecomputer onwhichtheinformation islocated,althoughthenameof
thecomputercanbe
analias.Webpagesareusuallystoredincomputers,andcomputers
aregivenaliasnamesthatusuallybeginwiththecharacters"www".This
isnotmandatory,
however,
asthehostcanbeanynamegiventothecomputerthathoststheWebpage.
The
URLcanoptionallycontaintheport numberoftheserver.Iftheportis
included,itisinsertedbetweenthehostandthepath,andit
isseparatedfromthehost
byacolon.
Pathisthepathname ofthefilewheretheinformationislocated.Notethatthepath
canitselfcontainslashesthat,intheUNIXoperatingsystem,separatethedirectories
fromthesubdirectoriesandfiles.
Cookies
TheWorldWideWebwasoriginallydesignedasastatelessentity.Aclientsendsa
request;aserverresponds.Theirrelationshipisover.Theoriginaldesign
ofWWW,
retrievingpubliclyavailabledocuments, exactlyfitsthispurpose.TodaytheWebhas
otherfunctions;somearelistedhere.
I.Somewebsitesneedtoallowaccesstoregisteredclientsonly.
2.Websitesarebeingusedaselectronicstoresthatallowuserstobrowsethroughthe
store,selectwanteditems,puttheminanelectroniccart,andpayattheendwitha
creditcard.
3.Somewebsitesareusedasportals:theuserselectstheWebpageshewantstosee.
4.Somewebsitesarejustadvertising.
Forthesepurposes,thecookiemechanismwasdevised.
Wediscussedtheuse ofcook­
iesatthetransportlayerinChapter23;wenowdiscusstheiruseinWebpages.
Creation
andStorageofCookies
Thecreationandstorageofcookiesdependontheimplementation;however,theprinciple
isthesame.

854 CHAPTER27WWWANDHTTP
1.Whenaserverreceivesarequestfromaclient, itstoresinformationabouttheclient
inafileorastring.Theinformationmayincludethedomainname
oftheclient,the
contents
ofthecookie(informationtheserverhasgatheredabouttheclientsuch as
name,registrationnumber,andsoon),atimestamp,andotherinformation'depend­
ing
ontheimplementation.
2.Theserverincludesthecookieintheresponsethat itsendstotheclient.
3.Whentheclientreceivestheresponse,thebrowserstoresthecookieinthecookie
directory,whichissortedbythedomainservername.
UsingCookies
Whenaclientsendsarequesttoaserver,thebrowserlooksinthecookiedirectoryto
see
ifitcanfindacookiesentbythatserver. Iffound,thecookieisincludedinthe
request.Whentheserverreceivestherequest,
itknowsthatthisisanoldclient,nota
newone.Notethatthecontents
ofthecookieareneverreadbythebrowserordisclosed
totheuser.
Itisacookiemadebytheserverand eatenbytheserver.Nowletusseehow
acookieisusedforthefourpreviouslymentionedpurposes:
1.Thesitethatrestrictsaccesstoregisteredclientsonlysendsacookietotheclient
whentheclientregistersforthefirsttime.Foranyrepeatedaccess,onlythoseclients
thatsendtheappropriatecookieareallowed.
2.Anelectronicstore(e-commerce)canuseacookieforitsclientshoppers.Whena
clientselectsanitemandinsertsitintoacart,acookiethatcontainsinformation
abouttheitem,such
asitsnumberandunitprice,issenttothebrowser. Iftheclient
selectsaseconditem,thecookie
isupdatedwiththenewselectioninformation.And
soon.Whentheclientfinishesshoppingandwantstocheckout,thelastcookieis
retrievedandthetotalchargeiscalculated.
3.AWebportalusesthecookieinasimilarway.Whenauserselectsherfavorite
pages,acookieismadeandsent.
Ifthesiteisaccessedagain,thecookieissentto
theservertoshowwhattheclientislookingfor.
4.Acookieisalsousedbyadvertisingagencies. Anadvertisingagencycanplace
bannerads
onsomemainwebsitethatisoftenvisitedbyusers.Theadvertising
agencysuppliesonlyaURLthatgivesthebanneraddressinstead
ofthebanneritself.
Whenauservisitsthemainwebsiteandclicksontheicon
ofanadvertisedcorpora­
tion,arequestissenttotheadvertisingagency.The advertisingagencysendsthe
banner,aGIFfile,forexample,butitalsoincludesacookiewiththe
illoftheuser.
Anyfutureuse
ofthebannersaddstothedatabasethatprofilestheWebbehavior of
theuser.Theadvertisingagencyhascompiledtheinterests oftheuserandcansell
thisinformationtootherparties.Thisuse
ofcookieshasmadethemverycontrover­
sial.Hopefully,somenewregulationswillbedevisedtopreservetheprivacy
ofusers.
27.2WEBDOCUMENTS
Thedocumentsinthe WWWcanbegroupedintothreebroadcategories:static,dynamic,
andactive.Thecategoryisbasedonthetimeatwhichthecontents
ofthedocumentare
determined.

SECTION27.2WEBDOCUMENTS 855
StaticDocuments
Staticdocuments arefixed-contentdocumentsthatarecreatedandstoredinaserver.
Theclientcangetonlyacopy
ofthedocument.Inotherwords,thecontents ofthefile
aredeterminedwhenthefileiscreated,notwhenitisused.
Ofcourse,thecontentsin
theservercanbechanged,buttheusercannotchangethem.Whenaclientaccessesthe
document,acopy
ofthedocumentissent.Theusercanthenuseabrowsingprogramto
displaythedocument(seeFigure27.4).
Figure27.4 Staticdocument
Server
Client
r
--
Request
StaticHTMLdocument
HTML
HypertextMarkupLanguage(HTML) isalanguageforcreatingWebpages.The
term
markuplanguage comesfromthebookpublishingindustry.Beforeabook istype­
setandprinted,acopyeditorreadsthemanuscriptandputs marksonit.Thesemarks
tellthecompositorhowtoformatthetext.Forexample,
ifthecopyeditorwantspart of
alinetobeprintedinboldface,heorshedrawsawavylineunderthatpart.Inthesame
way,dataforaWebpageareformattedforinterpretationbyabrowser.
Letusclarifytheideawithanexample.
Tomakepartofatextdisplayedinboldface
withHTML,weputbeginningandendingboldface
tags(marks)inthetext, asshown
inFigure27.5.
Figure27.5 Boldfacetags
I
BOl~ 1 !!7bOld]
<B> Thisisthetexttobeboldfaced.<!B>
Thetwotags<B>and</B>areinstructionsforthebrowser.Whenthebrowser
seesthesetwomarks,itknowsthatthetext mustbeboldfaced(seeFigure27.6).
Amarkuplanguagesuch
asHTMLallowsustoembedformattinginstructionsin
thefileitself.Theinstructionsareincludedwiththetext.Inthisway,anybrowsercan
readtheinstructionsandformatthetextaccordingtothespecificworkstation.Onemight

856 CHAPTER 27WWWANDHTTP
Figure27.6 Effectofboldfacetags
Browser
askwhywedonotusethefonnattingcapabilitiesofwordprocessorstocreateandsave
formattedtext.Theansweristhatdifferentwordprocessorsusedifferenttechniquesor
proceduresforformattingtext.Forexample,imaginethatausercreatesformattedtexton
aMacintoshcomputerandstoresitinaWebpage.AnotheruserwhoisonanIBMcom­
puterwouldnotbeabletoreceivetheWebpagebecausethetwocomputersusedifferent
fonnattingprocedures.
HTMLletsususeonlyASCIIcharactersforboththemaintextandformatting
instructions.Inthisway,everycomputercanreceivethewholedocumentasanASCII
document.Themaintextisthedata,andtheformattinginstructionscanbeusedbythe
browsertoformatthedata.
AWebpage
ismadeup oftwoparts:theheadandthebody.Thehead isthefirstpart
ofaWebpage.Theheadcontainsthetitle ofthepageandotherparametersthatthe
browserwilluse.Theactualcontents
ofapageareinthebody,whichincludesthetextand
thetags.Whereasthetextistheactualinfonnationcontainedinapage,thetagsdefinethe
appearance
ofthedocument.EveryHTMLtag isanamefollowedbyanoptionallist of
attributes,allenclosedbetweenless-thanandgreater-thansymbols «and>).
Anattribute,ifpresent,isfollowedbyanequalssignandthevalue oftheattribute.
Sometagscanbeusedalone;othersmustbeusedinpairs.Thosethatareusedinpairs
arecalled
beginningandendingtags.Thebeginningtagcanhaveattributesandvalues
andstartswiththename
ofthetag.Theendingtagcannothaveattributes orvaluesbut
musthaveaslashbeforethename
ofthetag.Thebrowsermakesadecisionaboutthe
structure
ofthetextbasedonthetags,whichareembeddedintothetext.Figure27.7
showsthefonnat
ofatag.
Figure27.7 Beginningandendingtags
<TagNarne
a.Beginningtag
Attribute=Value Attribute =Value •••>
1_- <_rr_a_gN_arn_e_> 1
b.Endingtag
Onecommonlyusedtagcategoryisthetextformattingtagssuch as<B>and <!B>,
whichmakethetextbold; <1>and<II>,whichmakethetextitalic;and<U>and <IV>,
whichunderlinethetext.

SECTION27.2WEBDOCUMENTS 857
Anotherinterestingtagcategoryistheimagetag.Nontextualinformationsuchas
digitizedphotos
orgraphicimagesisnotaphysicalpart ofanHTMLdocument.But
wecanuseanimagetagtopointtothefile
ofaphotoorimage.Theimagetagdefines
theaddress(URL)
oftheimagetoberetrieved. Italsospecifieshowtheimagecanbe
insertedafterretrievaLWecanchoosefromseveralattributes.Themostcommonare
SRC(source),whichdefinesthesource(address),andALIGN,whichdefinesthealign­
ment
oftheimage.TheSRCattributeisrequired.Mostbrowsersacceptimagesinthe
GIFor
IPEGformats.Forexample,thefollowingtagcanretrieveanimagestoredas
imagel.gifinthedirectory/bin/images:
Athirdinterestingcategoryisthehyperlinktag,which
isneededtolinkdocuments
together.Anyitem(word,phrase,paragraph,orimage)canrefertoanotherdocument
throughamechanismcalledan
anchor.Theanchorisdefinedby<A ...>and<!A>tags,
andtheanchoreditemusestheURLtorefer
toanotherdocument.Whenthedocument
isdisplayed,theanchoreditemisunderlined,blinking,orboldfaced.Theusercanclick
ontheanchoreditemtogotoanotherdocument,which
mayormaynotbestoredon
thesameserverastheoriginaldocument.Thereferencephraseisembeddedbetweenthe
beginningandendingtags.Thebeginningtagcanhaveseveralattributes,buttheone
requiredisHREF(hyperlinkreference),whichdefinestheaddress(URL)
ofthelinked
document.Forexample,thelinktotheauthor
ofabookcanbe
Whatappearsinthetextistheword
Author,onwhichtheusercanclicktogotothe
author'sWebpage.
DynamicDocuments
Adynamicdocument iscreatedbyaWebserverwheneverabrowserrequeststhedoc­
ument.Whenarequestarrives,theWebserverrunsanapplicationprogram
orascript
thatcreatesthedynamicdocument.Theserverreturnstheoutput
oftheprogram or
scriptasaresponsetothebrowserthatrequestedthedocument.Becauseafreshdocu­
mentiscreatedforeachrequest,thecontents
ofadynamicdocumentcanvaryfrom
onerequesttoanother.Averysimpleexample
ofadynamicdocumentistheretrieval
ofthetimeanddatefromaserver.Timeanddatearekinds ofinformationthatare
dynamicinthattheychangefrommomenttomoment.Theclientcanasktheserverto
runaprogramsuchasthe
dateprograminUNIXandsendtheresult oftheprogramto
theclient.
CommonGatewayInterface(CGI)
TheCommonGatewayInterface(CGI)isatechnology thatcreatesandhandles
dynamicdocuments.CGIisaset
ofstandardsthatdefines howadynamicdocument is
written,howdataareinputtotheprogram,andhowtheoutputresultisused.

858 CHAPTER 27WWWANDHTTP
COlisnotanewlanguage;instead, itallowsprogrammerstouseany ofseveral
languagessuchasC,C++,BoumeShell,KomShell,CShell,Tcl,orPerl.Theonly
thingthatCGIdefinesisaset
ofrulesandtennsthattheprogrammermustfollow.
The
tenncommonin COlindicatesthatthestandarddefinesaset ofrulesthatis
commontoanylanguage
orplatfonn.The tenngatewayheremeansthata COlpro­
gramcanbeusedtoaccessotherresourcessuchasdatabases,graphicalpackages,and
soon.The
tenninterfaceheremeansthatthereisaset ofpredefinedtenns,variables,
calls,andsoon thatcanbeusedinany
COlprogram.A COlprograminitssimplest
fonniscodewritteninone ofthelanguagessupportingCOLAnyprogrammerwhocan
encodeasequence
ofthoughtsinaprogramandknowsthesyntax ofoneoftheabove­
mentionedlanguagescanwriteasimpleCGIprogram.Figure27.8illustratesthesteps
increatingadynamicprogramusing
COltechnology.
Figure27.8DynamicdocumentusingCGI
Client
Request
Dynamic
HTMLdocument
Server
i
Program
InputIntraditionalprogramming,whenaprogramisexecuted,parameterscanbe
passedtotheprogram.Parameterpassingallowstheprogrammertowriteageneric
programthatcanbeusedindifferentsituations.Forexample,agenericcopyprogram
canbewrittentocopyanyfiletoanother.Ausercanusetheprogramtocopyafile
named
xtoanotherfilenamed ybypassingxandyasparameters.
Theinputfromabrowsertoaserverissentbyusingaform.
Iftheinfonnationina
fonnissmall(such
asaword),itcanbeappendedtotheURLafteraquestionmark.For
example,thefollowingURLiscarrying
fonninfonnation(23,avalue):
http://www.deanzalcgi-binlprog.pl?23
WhentheserverreceivestheURL,itusesthepart oftheURLbeforethequestion
marktoaccesstheprogramtoberun,anditinterpretsthepartafterthequestionmark
(23)astheinputsentbytheclient.
Itstoresthisstringinavariable.WhentheCGI
programisexecuted,itcanaccessthisvalue.
Iftheinputfromabrowseristoolongto fitinthequerystring,thebrowsercanask
theservertosendafonn.Thebrowsercanthenfillthefonnwiththeinputdataand
sendittotheserver.Theinfonnation
inthefonncanbeusedastheinputtotheCOl
program.

SECTION27.2ltEBDOCUMENTS 859
OutputThewholeideaofCGIistoexecuteaCGIprogramattheserversiteand
sendtheoutputtotheclient(browser).Theoutputisusuallyplaintextoratextwith
HTMLstructures;however,theoutputcanbeavarietyofotherthings.
Itcanbegraphics
orbinarydata,astatuscode,instructionstothebrowsertocachetheresult,orinstruc­
tionstotheservertosendan existingdocumentinsteadoftheactualoutput.
Tolettheclientknowaboutthetypeofdocumentsent,aCGIprogramcreates
headers.Asamatteroffact,theoutputoftheCGIprogramalwaysconsists
oftwo
parts:aheaderandabody.Theheaderisseparatedbyablanklinefromthebody.This
meansanyCGIprogramcreatesfirsttheheader,thenablankline,andthenthebody.
Althoughtheheaderandtheblanklinearenotshownonthebrowserscreen,theheader
isusedbythebrowsertointerpretthebody.
ScriptingTechnologies forDynamicDocuments
TheproblemwithCGItechnologyistheinefficiencythatresults ifpartofthedynamic
documentthatistobecreatedisfixedandnotchangingfromrequesttorequest.For
example,assumethatweneedtoretrievealist
ofspareparts,theiravailability,and
pricesforaspecificcarbrand.Althoughtheavailabilityandpricesvaryfromtimeto
time,thename,description,andthepictureofthepartsarefixed.IfweuseCGI,the
programmustcreateanentiredocumenteachtimearequestismade.Thesolutionisto
createafilecontainingthefixedpart
ofthedocumentusingHTMLandembedascript,
asourcecode,thatcanberunbytheservertoprovidethevaryingavailabilityandprice
section.Figure27.9showstheidea.
Figure27.9Dynamicdocumentusingserver-sitescript
Client
f""
--
Request
Server
~
DynamicHTMLdocument
1-------ir;:;t1Runthescript(8)
insidethe
HTML
document
Afewtechnologieshavebeeninvolvedincreatingdynamicdocumentsusingscripts.
AmongthemostcommonareHypertextPreprocessor(pHP),whichusesthePerllan­
guage;
JavaServerPages(JSP),whichusestheJavalanguageforscripting;Active
ServerPages(ASP),aMicrosoftproductwhichusesVisualBasiclanguageforscripting;
andColdFusion,whichembedsSQLdatabasequeriesintheHTMLdocument.
Dynamicdocumentsaresometimesreferredtoas
server-sitedynamicdocuments.

860 CHAPTER 27WWWANDHTTP
ActiveDocuments
Formanyapplications,weneedaprogramorascripttoberunattheclientsite.These
arecalled
activedocuments. Forexample,supposewewanttorunaprogramthat
createsanimatedgraphicsonthescreenoraprogramthatinteractswiththeuser.The
programdefinitelyneedstoberunatthe clientsitewheretheanimationorinteraction
takesplace.Whenabrowserrequestsanactivedocument,theserversendsacopy
ofthe
documentorascript.Thedocument
isthenrunattheclient(browser)site.
JavaApplets
OnewaytocreateanactivedocumentistouseJava
applets.Javaisacombinationofa
high-levelprogramminglanguage,arun-timeenvironment,andaclasslibrarythat
allowsaprogrammertowriteanactivedocument(anapplet)and abrowsertorunit.
It
canalsobeastand-aloneprogramthatdoesn'tuseabrowser.
AnappletisaprogramwritteninJavaontheserver.
Itiscompiledandreadytobe
run.Thedocument
isinbyte-code(binary)format.Theclientprocess(browser)creates
aninstance
ofthisappletandrunsit.AJavaappletcanberunbythebrowserintwo
ways.Inthefirstmethod,thebrowsercandirectlyrequesttheJavaappletprogramin
theURLandreceivetheappletinbinaryform.Inthesecondmethod,thebrowser can
retrieveandrunanHTMLfilethathasembeddedtheaddressoftheappletasatag.Fig­
ure27.10showshowJavaappletsareusedinthefirstmethod; thesecondissimilarbut
needstwotransactions.
Figure27.10 ActivedocumentusingJavaapplet
Client
--
Request
Server
-
~-----l Applett------I
Runtheapplet
togettheresult
Result
JavaScript
Theidea
ofscriptsindynamicdocumentscanalsobeusedforactivedocuments. Ifthe
activepart
ofthedocumentissmall,itcanbewritteninascriptinglanguage;thenitcan
beinterpretedandrunbytheclientatthesametime.Thescriptisinsourcecode(text)
andnotinbinaryform.ThescriptingtechnologyusedinthiscaseisusuallyJavaScript.
JavaScript,whichbearsasmallresemblancetoJava,isaveryhighlevelscripting
languagedevelopedforthispurpose.Figure27.11showshowJavaScriptisused
tocreate
anactivedocument.

SECTION27.3HTTP 861
Figure27.11 Activedocumentusingclient-sitescript
Server
Client
Request
RuntheJavaScript(JS)
togettheresult
Result
Activedocuments aresometimesreferredtoasclient-sitedynamicdocuments.
27.3HTTP
TheHypertextTransferProtocol(HTTP)isaprotocolusedmainlytoaccessdataon
theWorldWide
Web.HTTPfunctions asacombinationofFTPand SMTP.Itissimilarto
FfPbecauseittransfersfilesandusestheservices ofTCP.However,itismuchsimpler
than
FfPbecauseitusesonlyoneTCPconnection.Thereis noseparatecontrolconnec­
tion;onlydataaretransferredbetweentheclientandtheserver.
HTTPislikeSMTPbecausethedatatransferredbetweentheclientandtheserver
looklikeSMTPmessages.Inaddition,theformat
ofthemessagesiscontrolledby
MIME-likeheaders.UnlikeSMTP,theHTTPmessagesarenotdestinedtobereadby
humans;theyarereadandinterpretedbytheHTTPserverandHTTPclient(browser).
SMTPmessagesarestoredandforwarded,butHTTPmessagesaredeliveredimmedi­
ately.Thecommandsfromtheclienttotheserverareembeddedinarequestmessage.
Thecontents
oftherequestedfileorotherinformationareembeddedinaresponse
message.HTTPusestheservices
ofTCPonwell-knownport 80.
HTTPusestheservices ofTCPonwell-knownport80.
HTTPTransaction
Figure27.12illustratestheHTTPtransactionbetweentheclientandserver.Although
HTTPusestheservices
ofTCP,HTTPitselfisastatelessprotocol.Theclientinitializes
thetransactionbysendingarequestmessage.Theserverrepliesbysendingaresponse.
Messages
Theformatsoftherequestandresponsemessagesaresimilar;bothareshowninFig­
ure27.13.Arequestmessageconsists
ofarequestline,aheader,andsometimesabody.
Aresponsemessageconsists
ofastatusline,aheader,andsometimesabody.

862 CHAPTER 27WWWANDHTTP
Figure27.12HTTPtransaction
Client
Request
Figure27.13Requestandresponsemessages
Headers
Ablankline
Requestmessage
Server
===
u:u::u
E::::l
-
Ablankline
Responsemessage
RequestandStatusLinesThefirstlineinarequestmessageiscalleda requestline;
thefirstlineintheresponsemessageiscalledthe
statusline.Thereisonecommon
field,asshowninFigure27.14.
Figure27.14Requestandstatuslines
Space Space
Requesttype
I
~ ~IHTTPversion
a.
Requestline
Space Space
I
~ ~I
HTTPversion Statusphrase
b.Statusline

SECTION27.3HTTP 863
oRequesttype.Thisfieldisusedintherequestmessage. Inversion1.1ofHTTP,
severalrequesttypesaredefined.The
requesttypeiscategorizedinto methodsas
definedinTable
27.1.
Table27.1 Methods
Method Action
GET Requestsadocumentfromtheserver
HEAD Requestsinformationaboutadocumentbutnotthedocumentitself
POST Sendssomeinformationfromtheclienttotheserver
PUT Sendsadocumentfromtheservertotheclient
TRACE Echoestheincomingrequest
CONNECT Reserved
OPTION Inquiresaboutavailableoptions
oURL.WediscussedtheURLearlierinthechapter.
oVersion.Themostcurrentversion ofHTTPis1.1.
oStatuscode.Thisfieldisusedintheresponsemessage.The statuscodefieldis
similar
tothoseinthe FTPandthe SMTPprotocols.Itconsistsofthreedigits.
Whereasthecodes
inthe100rangeareonlyinformational,thecodesinthe200
rangeindicateasuccessfulrequest.Thecodesinthe300rangeredirecttheclient
toanotherURL,andthecodesinthe400rangeindicateanerrorattheclientsite.
Finally,thecodesinthe500rangeindicateanerrorattheserversite.Welistthe
mostcommoncodesinTable
27.2.
oStatusphrase.Thisfieldisusedintheresponsemessage. Itexplainsthestatus
codeintextform.Table
27.2alsogivesthestatusphrase.
Table27.2
Statuscodes
Code Phrase Description
Informational
100Continue Theinitialpart oftherequesthasbeenreceived,andthe
clientmaycontinuewithitsrequest.
101Switching Theserveriscomplyingwithaclientrequestto switch
protocolsdefined
intheupgradeheader.
Success
200OK Therequestissuccessful.
201Created Anew URLiscreated.
202Accepted Therequestisaccepted,butitisnotimmediatelyactedupon.
204Nocontent Thereisnocontentinthebody.

864 CHAPTER 27WWWAND HITP
Table27.2 Statuscodes(continued)
Code Phrase Description
Redirection
301MovedpermanentlyTherequestedURLisnolongerusedbytheserver.
302MovedtemporarilyTherequestedURLhasmovedtemporarily.
304Notmodified Thedocumenthasnotbeenmodified.
ClientError
400Badrequest Thereisasyntaxerrorintherequest.
401Unauthorized Therequestlacksproperauthorization.
403Forbidden Serviceisdenied.
404Notfound Thedocumentisnotfound.
405MethodnotallowedThemethodisnot supportedinthisURL.
406Notacceptable Theformatrequestedisnotacceptable.
ServerError
500InternalservererrorThereisanerror,suchasacrash,attheserversite.
501Notimplemented Theactionrequestedcannotbeperformed.
503ServiceunavailableTheserviceistemporarilyunavailable,butmayberequested
inthefuture.
HeaderTheheaderexchangesadditionalinformationbetweentheclientandtheserver.
Forexample,theclientcanrequestthatthedocumentbesentinaspecialformat,orthe
servercansendextrainformationaboutthedocument.Theheadercanconsist
ofoneor
moreheaderlines.Eachheaderlinehasaheadername,acolon,aspace,andaheader
value(seeFigure27.15).
Wewillshowsomeheaderlinesintheexamplesattheend of
thischapter.Aheaderlinebelongstoone offourcategories:generalheader,request
header,responseheader,
andentityheader.A requestmessagecancontainonlygen­
eral,request,andentityheaders.Aresponsemessage,ontheotherhand,cancontainonly
general,response,andentityheaders.
Figure27.15 Headerformat
Space
I
HeadernamelOtIHeadervalueI
oGeneralheaderThegeneralheadergivesgeneralinformationaboutthemessage
andcanbepresentinbotharequestandaresponse.Table27.3listssomegeneral
headerswiththeirdescriptions.

SECTION27.3HTTP 865
Table27.3 Generalheaders
Header Description
Cache-controlSpecifiesinfonnationaboutcaching
Connection Showswhethertheconnectionshouldbeclosed
ornot
Date Showsthecurrentdate
MIME-versionShowstheMIMEversionused
Upgrade Specifiesthepreferredcommunicationprotocol
oRequestheaderTherequestheadercanbepresentonlyinarequestmessage. It
specifiestheclient'sconfigurationandtheclient'spreferreddocumentformat.See
Table27.4foralist
ofsomerequestheadersandtheirdescriptions.
Table27.4
Requestheaders
Header Description
Accept Showsthemediumfonnattheclientcanaccept
Accept-charset Showsthecharactersettheclientcanhandle
Accept-encoding Showstheencodingschemetheclientcanhandle
Accept-language Showsthelanguagetheclientcanaccept
Authorization Showswhatpennissionstheclienthas
From Showsthe e-mailaddress
oftheuser
Host Showsthehostandportnumber
oftheserver
If-modified-sinceSendsthedocument
ifnewerthanspecifieddate
If-match Sendsthedocumentonly
ifitmatchesgiventag
If-non-match Sendsthedocumentonly
ifitdoesnotmatchgiventag
~'-'-_._-- -- _._---.__.._-
If-range Sendsonlytheportion ofthedocumentthatismissing
If-unmodified-sinceSendsthedocument
ifnotchangedsincespecifieddate
Referrer SpecifiestheURL
ofthelinkeddocument
User-agent Identifiestheclientprogram
oResponseheaderTheresponseheadercanbepresentonlyinaresponsemessage.
Itspecifiestheserver'sconfigurationandspecialinformationabouttherequest.
SeeTable27.5foralist
ofsomeresponseheaderswiththeirdescriptions.
Table27.5
Responseheaders
Header Description
Accept-rangeShows ifserveracceptstherangerequestedbyclient
Age Showstheage
ofthe document
Public Showsthesupportedlist
ofmethods
Retry-afterSpecifiesthedateafterwhichthe serverisavailable
Server Showstheservernameandversionnumber

866 CHAPTER 27WWWANDHTTP
oEntityheaderTheentityheadergivesinfonnationaboutthebody ofthedocu­
ment.Althoughitismostlypresentinresponsemessages,somerequestmessages,
suchasPOSTorPUTmethods,thatcontainabodyalsousethistype
ofheader.
SeeTable27.6foralist
ofsomeentityheadersandtheirdescriptions.
Table27.6
Entityheaders
Header Description
Allow ListsvalidmethodsthatcanbeusedwithaURL
Content-encodingSpecifiestheencodingscheme
Content-languageSpecifiesthelanguage
Content-lengthShowsthelength
ofthedocument
Content-range Specifiestherange
ofthedocument
Content-type Specifiesthemediumtype
Etag Givesanentitytag
Expires Givesthedateandtimewhencontentsmaychange
Last-modified Givesthedateandtime
ofthelastchange
Location Specifiesthelocation
ofthecreatedormoveddocument
BodyThebodycanbepresentinarequestorresponsemessage.Usually,itcontains
thedocumenttobesentorreceived.
Example27.1
Thisexampleretrievesadocument. WeusetheGETmethodtoretrieveanimagewiththe
path/usr/bin/imagel.Therequestlineshowsthemethod(GET),theURL,andtheHTTPver­
sion
(1.1).TheheaderhastwolinesthatshowthattheclientcanacceptimagesintheGIFor
JPEGformat.Therequestdoesnothaveabody.Theresponsemessagecontainsthestatusline
andfourlines
ofheader.Theheaderlinesdefinethedate,server,MIMEversion,andlength ofthe
document.Thebody
ofthedocumentfollowstheheader(seeFigure27.16).
Figure27.16 Example27.1
Server
crtlen =
g
~
cu:::u::J
E::I
Request(GETmethod)
-=p=
GETlusrlbinlimage1 HTTP/l.l
Accept:image/gif
Accept:image/jpeg
HTIP/l.l200OK
Date:Mon,07-Jan-0513:15:14GMT
Server:Challenger
MIME-version:
l.0
Content-length:2048
(Bodyofthedocument)
Response

SECTION27.3HTTP 867
Example27.2
Inthisexample,theclientwantstosenddatatotheserver. WeusethePOSTmethod.Therequest
lineshowsthemethod(POST),URL,andHTTPversion
(1.1).Therearefourlines ofheaders.
Therequestbodycontainstheinputinformation.Theresponsemessagecontainsthestatusline
andfourlinesofheaders.Thecreateddocument,whichisaCGIdocument,isincludedasthebody
(seeFigure27.17).
Figure27.17 Example27.2
Request(POSTmethod)
POST/cgi-binldoc.pl
HTIP/1.l
Accept:*/*
Accept:image/gif
I-----tAccept:image/jpeg
Content-length:
50
(Inputinformation)
HTTP/l.1200 OK
Date:Mon,07-Jan-0213:15:14GMT
Server:Challenger~---t MIME-version:1.0
Content-length:2000
(Body
ofthedocument)
Response
Example27.3
HTTPusesASCIIcharacters.AclientcandirectlyconnecttoaserverusingTELNET,which
logsintoport80.Thenextthreelinesshowthattheconnectionissuccessful.
Wethentypethreelines.Thefirstshowstherequestline(GETmethod),thesecondisthe
header(definingthehost),thethirdisablank,terminatingtherequest.
Theserverresponseissevenlinesstartingwiththestatusline.Theblanklineattheend
termi­
natestheserverresponse.Thefile of14,230linesisreceivedaftertheblankline(notshownhere).
Thelastline
istheoutputbytheclient.
$teinetwww.mhhe.com80
Trying198.45.24.104...
Connectedtowww.mhhe.com(198.45.24.104).
Escapecharacteris
11\]'.
GET/engcslcompscilforouzanHTTP/I.t
From:[email protected]
HTTP/t.l200OK
Date:Thu,
28Oct200416:27:46GMT
Server:Apache/l.3.9(Unix)ApacheJServ/1.1.2PHP/4.1.2PHP/3.0.18
MIME-version:1.0
Content-Type:text/html

868 CHAPTER 27WWWANDHTTP
Last-modified:
Friday,15-0ct-0402:11:31GMT
Content-length:14230
Connectionclosed byforeignhost.
PersistentVersusNonpersistentConnection
HTTPpriortoversion 1.1specifiedanonpersistentconnection,whileapersistentcon­
nectionisthedefaultinversion1.1.
NonpersistentConnection
Inanonpersistentconnection, oneTCPconnectionismadeforeachrequest/response.
Thefollowingliststhestepsinthisstrategy:
1.TheclientopensaTCPconnectionandsendsarequest.
2.Theserversendstheresponseandclosestheconnection.
3.Theclientreadsthedatauntilitencounters anend-of-filemarker; itthenclosesthe
connection.
Inthisstrategy,for
Ndifferentpicturesindifferentfiles,theconnectionmustbeopened
andclosed
Ntimes.Thenonpersistentstrategyimposeshighoverheadontheserver
becausetheserverneeds
Ndifferentbuffersandrequiresaslowstartprocedureeach
timeaconnectionisopened.
PersistentConnection
HTTPversion 1.1specifiesa persistentconnection bydefault.Inapersistentconnection,
theserverleavestheconnectionopenformorerequestsaftersendingaresponse.The
servercanclosetheconnectionattherequest
ofaclientor ifatime-outhasbeenreached.
Thesenderusuallysendsthelength
ofthedatawitheachresponse.However,thereare
someoccasionswhenthesenderdoesnotknowthelength
ofthedata.Thisisthecase
whenadocumentiscreateddynamically
oractively.Inthesecases,theserverinforms
theclientthatthelengthisnotknownandclosestheconnectionaftersendingthedata
so
theclientknowsthattheend ofthedatahasbeenreached.
HTTPversion1.1specifiesa persistentconnectionbydefault.
ProxyServer
HTTPsupports proxyservers.Aproxyserverisacomputerthatkeepscopies of
responsestorecentrequests.TheHTTPclientsendsarequesttotheproxyserver.The
proxyserverchecksitscache.
Iftheresponseisnotstoredinthecache,theproxy
serversendstherequesttothecorrespondingserver.Incomingresponsesaresent
tothe
proxyserverandstoredforfuturerequestsfromotherclients.
Theproxyserverreducestheloadontheoriginalserver,decreasestraffic,and
improveslatency.However,tousetheproxyserver,theclientmustbeconfiguredto
accesstheproxyinstead
ofthetargetserver.

SECTION27.5KEYTERMS 869
27.4RECOMMENDED READING
Formoredetailsaboutsubjectsdiscussedinthischapter,werecommendthefollowing
booksandsites.Theitemsinbrackets[
...]refertothereferencelistattheend ofthetext.
Books
HTTPisdiscussedinChapters 13and14of[Ste96],Section9.3 of[PD03],Chapter 35
of[Com04],andSection7.3 of[Tan03].
Sites
Thefollowingsitesarerelated totopicsdiscussed inthischapter.
owww.ietf.org/rfc.htmlInformationaboutRFCs
RFCs
ThefollowingRFCsarerelatedtoWWW:
1614,1630,1737,1738
ThefollowingRFCsarerelatedtoHTTP:
2068,2109
27.5KEYTERMS
activedocument
ActiveServerPages(ASP)
applet
browser
ColdFusion
CommonGatewayInterface(CGI)
dynamicdocument
entityheader
generalheader
host
HypertextMarkupLanguage
(HTML)
HypertextPreprocessor(PHP)
HypertextTransferProtocol(HTTP)
Java
JavaScript
JavaServerPages(JSP)
nonpersistentconnection
path
persistentconnection
proxyserver
requestheader
requestline
requesttype
responseheader
staticdocument
statuscode
statusline
tag
uniformresourcelocator(URL)
Web
WorldWideWeb(WWW)

870 CHAPTER27WWWANDHITP
27.6SUMMARY
oTheWorldWideWeb(WWW)isarepository ofinformationlinkedtogetherfrom
pointsallovertheworld.
oHypertextsaredocumentslinkedtooneanotherthroughtheconcept ofpointers.
oBrowsersinterpretanddisplayaWebdocument.
oAbrowserconsists ofacontroller,clientprograms,andinterpreters.
oAWebdocumentcanbeclassifiedasstatic,dynamic,oractive.
oAstaticdocumentisoneinwhichthecontentsarefixedandstoredinaserver.The
clientcanmakenochangesintheserverdocument.
oHypertextMarkupLanguage(HTML)isalanguageusedtocreatestaticWebpages.
oAnybrowsercanreadformattinginstructions(tags)embeddedinanHTML
document.
oTagsprovidestructuretoadocument,definetitlesandheaders,formattext,control
thedataflow,insertfigures,linkdifferentdocumentstogether,anddefineexecut­
ablecode.
oAdynamicWebdocumentiscreated byaserveronlyatabrowserrequest.
oTheCommonGatewayInterface(CGI)isastandardforcreatingandhandling
dynamicWebdocuments.
oACGIprogramwithitsembeddedCGIinterfacetagscanbewritteninalanguage
suchasC,C++,ShellScript,orPerl.
oAnactivedocumentisacopy ofaprogramretrievedbytheclientandrunatthe
clientsite.
oJavaisacombination ofahigh-levelprogramminglanguage,arun-timeenviron­
ment,andaclasslibrarythatallowsaprogrammertowriteanactivedocumentand
abrowsertorunit.
oJavaisusedtocreateapplets(smallapplicationprograms).
oTheHypertextTransferProtocol(HTTP)isthemainprotocolusedtoaccessdata
ontheWorldWideWeb(WWW).
oHTTPusesaTCPconnectiontotransferfiles.
oAnHTTPmessageissimilarinformtoanSMTPmessage.
oTheHTTPrequestlineconsists ofarequesttype,aURL,andtheHTTPversion
number.
oTheuniformresourcelocator(URL)consists ofamethod,hostcomputer,optional
portnumber,andpathnametolocateinformationontheWWW.
oTheHTTPrequesttypeormethodistheactualcommandorrequestissued bythe
clienttotheserver.
oThestatuslineconsists oftheHTTPversionnumber,astatuscode,andastatus
phrase.
oTheHTTPstatuscoderelaysgeneralinformation,informationrelatedtoasuccessful
request,redirectioninformation,orerrorinformation.
oTheHTTPheaderrelaysadditionalinformationbetweentheclientandserver.

SECTION27.7 PRACTICESET 871
DAnHTTPheaderconsists ofaheadernameandaheadervalue.
DAnHTTPgeneralheadergivesgeneralinformationabouttherequestorresponse
message.
DAnHTTPrequestheaderspecifiesaclient'sconfigurationandpreferreddocument
format.
DAnHTTPresponseheaderspecifiesaserver'sconfigurationandspecialinformation
abouttherequest.
DAnHTTPentityheaderprovidesinformationaboutthe body ofadocument.
DHTTP,version1.1,specifiesapersistentconnection.
DAproxyserverkeepscopies ofresponsestorecentrequests.
27.7PRACTICESET
ReviewQuestions
1.HowisHTTPrelatedto WWW?
2.HowisHTTPsimilartoSMTP?
3.HowisHTTPsimilarto FTP?
4.WhatisaURLandwhatareitscomponents?
5.WhatisaproxyserverandhowisitrelatedtoHTTP?
6.Namethecommonthreecomponents ofabrowser.
7.Whatarethethreetypes
ofWebdocuments?
8.WhatdoesHTMLstandforandwhatisitsfunction?
9.Whatisthedifferencebetweenanactivedocumentandadynamicdocument?
10.WhatdoesCGIstandforandwhatisitsfunction?
11.DescribetherelationshipbetweenJavaandanactivedocument.
Exercises
12.Wherewilleachfigure beshownonthescreen?
Lookatthefollowingpicture:
thentellmewhatyoufeel:
<IMGSRC="PictureslFunnyl.gif"ALIGN=middle>
<lMGSRC="Pictures/Funny2.gif"ALIGN=bottom>
<B>Whatisyourfeeling?<IE>
13.Showtheeffect ofthefollowingHTMLsegment.
Thepublisher
ofthisbookis<AHREF="www.mhhe">
McGraw-HillPublisher
<fA>
14.Showarequestthatretrievesthedocument/usr/users/doc/docl.Useatleasttwo
generalheaders,tworequest headers,andoneentityheader.
15.ShowtheresponsetoExercise14forasuccessfulrequest.
16.ShowtheresponsetoExercise14foradocumentthathaspermanentlymovedto
/usr/deads/doc1.

872 CHAPTER27WWWANDHTTP
17.ShowtheresponsetoExercise14 ifthereisasyntaxerrorintherequest.
18.ShowtheresponsetoExercise 14iftheclientisunauthorizedtoaccessthedocument.
19.Showarequestthatasksforinformationaboutadocumentat/bin/users/file.Useat
leasttwogeneralheadersandonerequestheader.
20.ShowtheresponsetoExercise19forasuccessfulrequest.
21.Showtherequesttocopythefileatlocation/bin/usr/bin/file1to/bin/file 1.
22.ShowtheresponsetoExercise21.
23.Showtherequesttodeletethefileatlocation/bin/file!.
24.ShowtheresponsetoExercise23.
25.Showarequesttoretrievethe fileatlocation/bin/etc/file!.Theclientneedsthe
documentonlyifitwasmodifiedafterJanuary23,1999.
26.ShowtheresponsetoExercise25.
27.Showarequesttoretrievethefileatlocation/bin/etc/filel.Theclientshouldiden­
tify itself.
28.ShowtheresponsetoExercise27.
29.Showarequesttostoreafileatlocation/bin/letter.Theclientidentifiesthetypes
ofdocumentsitcanaccept.
30.ShowtheresponsetoExercise29.Theresponseshowstheage
ofthedocumentas
wellasthedateandtimewhenthecontentsmaychange.

CHAPTER28
NetworkManagement:SNMP
Wecandefinenetworkmanagementasmonitoring,testing,configuring,andtrouble­
shootingnetworkcomponentstomeetaset
ofrequirementsdefinedbyanorganiza­
tion.Theserequirementsincludethesmooth,efficientoperation
ofthenetworkthat
providesthepredefinedquality
ofserviceforusers. Toaccomplishthistask,anetwork
managementsystemuseshardware,software,andhumans.Inthischapter,firstwe
brieflydiscussthefunctions
ofanetworkmanagementsystem.Thenweconcentrate
onthemostcommonmanagementsystem,theSimpleNetworkManagementProtocol
(SNMP).
28.1NETWORK MANAGEMENT SYSTEM
Wecansaythatthefunctionsperformedbyanetworkmanagementsystemcanbe
dividedintofivebroadcategories:configurationmanagement,faultmanagement,per­
formancemanagement,securitymanagement,andaccountingmanagement,asshown
inFigure28.1.
Figure28.1
Functionsofanetworkmanagementsystem
Response
time
Functionsofanetwork
managementsystem
I
I I I I I
Configuration Fault Performance Security Accounting
management management management management management
~Reconfiguration~Reactive -Capacity
'--Documentation'--Proactive f--Traffic
~Throughput
'--,
873

874 CHAPTER 28NETWORKMANAGEMENT: SNMP
ConfigurationManagement
Alargenetworkisusuallymadeup ofhundredsofentitiesthatarephysicallyorlogically
connectedtooneanother.Theseentitieshaveaninitialconfigurationwhenthenetwork
issetup,butcanchangewithtime.Desktopcomputersmaybereplacedbyothers;
applicationsoftwaremaybeupdatedtoanewerversion;andusersmaymovefromone
group
toanother.Theconfigurationmanagementsystemmustknow,atanytime,the
status
ofeachentityanditsrelationtootherentities.Configurationmanagementcan
bedividedintotwosubsystems:reconfigurationanddocumentation.
Reconfiguration
Reconfiguration,whichmeansadjustingthenetworkcomponentsandfeatures,canbea
dailyoccurrenceinalargenetwork.Therearethreetypes
ofreconfiguration:hardware
reconfiguration,softwarereconfiguration,anduser-accountreconfiguration.
Hardwarereconfigurationcoversallchangestothe hardware.Forexample,adesk­
topcomputermayneedtobereplaced.Aroutermayneedtobemovedtoanotherpart
ofthenetwork.Asubnetworkmaybeaddedorremovedfromthenetwork.Allthese
needthetimeandattention
ofnetworkmanagement.Inalargenetwork,theremustbe
specializedpersonneltrainedforquickandefficienthardwarereconfiguration.Unfortu­
nately,thistype
ofreconfigurationcannotbeautomatedandmustbemanuallyhandled
casebycase.
Softwarereconfigurationcoversallchanges
tothesoftware.Forexample,new
softwaremayneedtobeinstalledonservers
orclients.Anoperatingsystemmayneed
updating.Fortunately,mostsoftwarereconfigurationcanbeautomated.Forexample,
updatinganapplicationonsome
orallclientscanbeelectronicallydownloadedfrom
theserver.
User-accountreconfiguration
isnotsimplyaddingordeletingusersonasystem.
Youmustalsoconsidertheuserprivileges,both
asanindividualandasamember ofa
group.Forexample,ausermayhavereadandwritepermissionwithregardtosome
files,butonlyreadpermissionwithregardtootherfiles.User-accountreconfiguration
canbe,tosomeextent,automated.Forexample,inacollegeoruniversity,atthebegin­
ning
ofeachquarterorsemester,newstudentsareaddedtothesystem.Thestudentsare
normallygroupedaccordingtothecoursestheytakeorthemajorstheypursue.
Documentation
Theoriginalnetworkconfigurationandeachsubsequentchangemustberecorded
meticulously.Thismeansthattheremustbedocumentationforhardware,software,and
useraccounts.
Hardwaredocumentationnormallyinvolvestwosets
ofdocuments:mapsand
specifications.Mapstrackeachpiece
ofhardwareanditsconnectiontothenetwork.
Therecanbeonegeneralmapthatshowsthelogicalrelationshipbetweeneachsubnet­
work.Therecanalsobeasecondgeneralmapthatshowsthephysicallocation
ofeach
subnetwork.Foreachsubnetwork,then,thereisoneormoremapsthatshowallpieces
ofequipment.Themapsusesomekind ofstandardizationtobeeasilyreadandunder­
stoodbycurrentandfuturepersonnel.Mapsarenotenough
perse.Eachpiece ofhard­
warealsoneedstobedocumented.Theremustbeaset
ofspecificationsforeachpiece

SECTION28.1NETWORKMANAGEMENT SYSTEM 875
ofhardwareconnectedtothenetwork.Thesespecificationsmustincludeinformation
suchashardwaretype,serialnumber,vendor(addressandphonenumber),time
of
purchase,andwarrantyinformation.
Allsoftwaremustalsobedocumented.Softwaredocumentationincludesinforma­
tionsuch
asthesoftwaretype,theversion,thetimeinstalled,andthelicenseagreement.
Mostoperatingsystemshaveautilitythatallowsthedocumentation
ofuseraccounts
andtheirprivileges.Themanagementmustmakesurethatthefileswiththisinformation
areupdatedandsecured.Someoperatingsystemsrecordaccessprivilegesintwodocu­
ments;oneshowsallfilesandaccesstypesforeachuser;theothershowsthelist
ofusers
thathaveaparticularaccess
toafile.
FaultManagement
Complexnetworkstodayaremadeup ofhundredsandsometimesthousands ofcompo­
nents.Properoperation
ofthenetworkdependsontheproperoperation ofeachcomponent
individuallyandinrelationtoeachother.
Faultmanagement istheareaofnetwork
managementthathandlesthisissue.
Aneffectivefaultmanagementsystemhastwosubsystems:reactivefaultmanage­
mentandproactivefaultmanagement.
ReactiveFaultManagement
Areactivefaultmanagementsystemisresponsiblefordetecting,isolating,correcting,
andrecordingfaults.
Ithandlesshort-termsolutionstofaults.
Thefirststeptakenbyareactivefaultmanagementsystemistodetecttheexact
location
ofthefault.Afaultisdefinedasanabnormalconditioninthesystem.Whena
faultoccurs,eitherthesystemstopsworkingproperlyorthesystemcreatesexcessive
errors. Agoodexample
ofafaultisadamagedcommunicationmedium.Thisfaultmay
interruptcommunicationorproduceexcessiveerrors.
Thenextsteptakenbyareactivefaultmanagementsystemistoisolatethefault.A
fault,
ifisolated,usuallyaffectsonlyafewusers.Afterisolation,theaffectedusersare
immediatelynotifiedandgiven
anestimatedtime ofcorrection.
Thethirdstepistocorrectthefault.Thismayinvolvereplacingorrepairingthe
faultycomponent(s).
Afterthefaultiscorrected,itmustbedocumented.Therecordshouldshowthe
exactlocation
ofthefault,thepossiblecause,theactionoractionstakentocorrectthe
fault,thecost,andtimeittookforeachstep.Documentationisextremelyimportantfor
severalreasons:
oTheproblemmayrecur.Documentationcanhelpthepresentorfutureadministrator
ortechniciansolveasimilarproblem.
oThefrequencyofthesamekind offailureis anindicationofamajorproblemin
thesystem.
Ifafaulthappensfrequentlyinonecomponent,itshould bereplaced
withasimilarone,orthewholesystemshouldbechangedtoavoidtheuse
ofthat
type
ofcomponent.
oThestatisticishelpfultoanotherpart ofnetworkmanagement,performance
management.

876 CHAPTER 28NETWORKMANAGEMENT: SNMP
ProactiveFaultManagement
Proactivefaultmanagementtriestopreventfaultsfromoccurring.Althoughthisisnot
alwayspossible,sometypes
offailurescanbepredictedandprevented.Forexample, if
amanufacturerspecifiesalifetimeforacomponentorapart ofacomponent,itisa
goodstrategytoreplaceitbeforethattime.Asanotherexample,
ifafaulthappens
frequentlyatoneparticularpoint
ofanetwork,it iswisetocarefullyreconfigurethe
networktopreventthefaultfromhappeningagain.
PerformanceManagement
Performancemanagement, whichiscloselyrelatedtofaultmanagement,triesto
monitorandcontrolthenetworktoensurethatitisrunningasefficiently
aspossible.
Performancemanagementtriestoquantifyperformancebyusingsomemeasurable
quantitysuchascapacity,traffic,throughput,orresponsetime.
Capacity
Onefactorthatmustbemonitoredbyaperformancemanagementsystemisthecapacity
ofthenetwork.Everynetworkhasalimitedcapacity,andtheperformancemanagement
systemmustensurethatit
isnotusedabovethiscapacity.Forexample, ifaLANis
designedfor100stationsatanaveragedatarate
of2Mbps,itwillnotoperateproperly if
200stationsareconnectedtothenetwork.Thedataratewilldecreaseandblocking
mayoccur.
Traffic
Trafficcanbemeasuredintwoways:internallyandexternally.Internaltrafficis
mea­
suredbythenumber ofpackets(orbytes)travelinginsidethenetwork.Externaltraffic
ismeasuredbytheexchange ofpackets(orbytes)outsidethenetwork.Duringpeak
hours,whenthesystemisheavilyused,blockingmayoccur
ifthereisexcessivetraffic.
Throughput
Wecanmeasurethethroughput ofanindividualdevice(such asarouter)orapart of
thenetwork.Performancemanagementmonitorsthethroughputtomakesurethatit is
notreducedtounacceptablelevels.
ResponseTime
Responsetimeisnormallymeasuredfromthetimeauserrequestsaservicetothetime
theserviceisgranted.Otherfactorssuchascapacityandtrafficcanaffecttheresponse
time.Performancemanagementmonitorstheaverageresponsetimeandthepeak-hour
responsetime.Anyincreaseinresponsetimeisaveryserious conditionasitis
anindi­
cationthatthenetworkisworkingaboveitscapacity.
SecurityManagement
Securitymanagement isresponsibleforcontrollingaccesstothenetworkbasedon
thepredefinedpolicy.
WediscusssecurityandinparticularnetworksecurityinChap­
ters
31and32.

SECTION28.2SIMPLENETWORKMANAGEMENT PROTOCOL(SNMP) 877
AccountingManagement
Accountingmanagementisthecontrol ofusers'access tonetworkresourcesthrough
charges.Underaccountingmanagement,individualusers,departments,divisions,or
evenprojectsarechargedfortheservicestheyreceivefromthenetwork.Chargingdoes
notnecessarilymeancashtransfer;itmaymeandebitingthedepartmentsordivisions
forbudgetingpurposes.Today,organizationsuseanaccountingmanagementsystem
forthefollowingreasons:
oItpreventsusersfrommonopolizinglimitednetworkresources.
oItpreventsusersfromusingthesysteminefficiently.
oNetworkmanagerscan doshort-andlong-termplanningbasedonthedemandfor
networkuse.
28.2SIMPLENETWORK MANAGEMENT
PROTOCOL(SNMP)
TheSimpleNetwork ManagementProtocol(SNMP)isaframeworkformanaging
devicesinaninternetusingtheTCPIIPprotocolsuite.Itprovidesaset
offundamental
operationsformonitoringandmaintaininganinternet.
Concept
SNMPusestheconcept ofmanagerandagent.Thatis,amanager,usuallyahost,
controlsandmonitorsaset
ofagents,usuallyrouters(seeFigure28.2).
Figure28.2
SNMPconcept
Agentvariables
Agent
Internet
1------.-'1;':':1
---,....,--
Manager
SNMPisanapplication-levelprotocolinwhichafewmanagerstationscontrola
set
ofagents.Theprotocolisdesignedattheapplicationlevelsothat itcanmonitor
devicesmadebydifferentmanufacturersandinstalledondifferentphysicalnetworks.
Inotherwords,SNMPfreesmanagementtasksfromboththephysicalcharacteristics
ofthemanageddevicesandtheunderlyingnetworkingtechnology.Itcanbeusedina
heterogeneousinternetmade
ofdifferentLANsand WANsconnectedbyroutersmade
bydifferentmanufacturers.

878 CHAPTER28NETWORKMANAGEMENT: SNMP
ManagersandAgents
Amanagementstation,calleda manager,isahostthatrunstheSNMPclientprogram.A
managedstation,called an
agent,isarouter(orahost)thatrunstheSNMPserverprogram.
Management
isachievedthroughsimpleinteractionbetweenamanagerandanagent.
Theagentkeepsperformanceinformationinadatabase.Themanagerhasaccess
tothevaluesinthedatabase.Forexample,aroutercanstoreinappropriatevariables
thenumber
ofpacketsreceivedandforwarded.Themanagercanfetchandcomparethe
values
ofthesetwovariablestosee iftherouteriscongested ornot.
The
managercanalsomaketherouter performcertainactions. Forexample,a
routerperiodicallychecksthevalue
ofarebootcountertoseewhenitshouldreboot
itself.Itrebootsitself,forexample,
ifthevalueofthecounteris O.Themanagercan
usethisfeaturetoreboottheagentremotelyatanytime.
Itsimplysendsapacketto
forcea 0valueinthecounter.
Agentscanalsocontributetothemanagementprocess.Theserverprogramrunning
ontheagentcanchecktheenvironment,and ifitnoticessomethingunusual,itcansend
awarningmessage,calleda
trap,tothemanager.
Inotherwords,managementwithSNMPisbasedonthreebasicideas:
1.Amanagerchecksanagent byrequestinginformationthatreflects thebehavior of
theagent.
2.Amanagerforcesanagenttoperformataskbyresettingvalues intheagentdatabase.
3.Anagentcontributestothemanagementprocessbywarningthemanager
ofan
unusualsituation.
ManagementComponents
Todomanagementtasks, SNMPusestwootherprotocols: StructureofManagement
Information(SMI)
andManagementInformationBase(MIB). Inotherwords,man­
agement
ontheInternetisdonethroughthecooperation ofthethreeprotocolsSNMP,
SMI,andMIB,asshowninFigure28.3.
Figure28.3 ComponentsofnetworkmanagementontheInternet
Management
I
SNMP
8MI
I
MIB
I
Letuselaborateontheinteractionsbetweentheseprotocols.
RoleofSNMP
SNMPhassomeveryspecificrolesinnetworkmanagement. Itdefinestheformat of
thepackettobesentfromamanagertoanagentandviceversa. Italsointerpretsthe

SECTION28.2SIMPLENETWORKMANAGEMENT PROTOCOL(SNMP) 879
resultandcreatesstatistics(oftenwiththehelp ofothermanagementsoftware).The
packetsexchangedcontaintheobject(variable)namesandtheirstatus(values).SNMP
isresponsibleforreadingandchangingthesevalues.
SNMPdefinestheformat ofpacketsexchangedbetweenamanagerand anagent.
Itreadsandchangesthestatus(values) ofobjects(variables) in8NMPpackets.
RoleofSMI
TouseSNMP,weneedrules. Weneedrulesfornamingobjects.Thisisparticularly
importantbecausetheobjectsinSNMPformahierarchicalstructure(anobjectmay
haveaparentobjectandsomechildrenobjects).Partofanamecanbeinheritedfrom
theparent.
Wealsoneedrulestodefinethetypeoftheobjects.Whattypes ofobjects
arehandledbySNMP?CanSNMPhandlesimpletypesorstructuredtypes?Howmany
simpletypesareavailable?Whatarethesizes
ofthesetypes?What istherangeofthese
types?Inaddition,howareeach
ofthesetypesencoded?
Weneedtheseuniversalrulesbecausewedonotknowthearchitecture ofthecom­
putersthatsend,receive,orstorethesevalues.Thesendermaybeapowerfulcomputer
inwhichanintegerisstored
as8-bytedata;thereceivermaybeasmallcomputerthat
storesaninteger
as4-bytedata.
SMIisaprotocolthatdefinestheserules.However,wemustunderstandthatSMI
onlydefinestherules;itdoesnotdefinehowmanyobjectsaremanagedinanentityor
whichobjectuseswhichtype.SMIisacollectionofgeneralrulestonameobjectsand
tolisttheirtypes.TheassociationofanobjectwiththetypeisnotdonebySMI.
8MIdefinesthegeneralrulesfornamingobjects,definingobjecttypes(including
range
andlength),andshowinghowtoencodeobjects andvalues.
8M1doesnotdefinethenumber
ofobjectsanentityshouldmanage ornametheobjects
tobemanaged
ordefinetheassociationbetweentheobjects andtheirvalues.
RoleofMIB
Wehopeitisclearthatweneedanotherprotocol.Foreachentitytobemanaged,this
protocolmustdefinethenumber
ofobjects,namethemaccordingtotherulesdefined
bySMI,andassociateatypetoeachnamedobject.ThisprotocolisMIB.MIBcreates
aset
ofobjectsdefinedforeachentitysimilartoadatabase(mostlymetadatainadata­
base,namesandtypeswithoutvalues).
:MIBcreatesacollection ofnamedobjects,theirtypes, andtheirrelationshipsto
eachotherin
anentitytobemanaged.
AnAnalogy
Beforediscussingeach oftheseprotocolsingreaterdetail,wegiveananalogy.The
threenetworkmanagementcomponentsaresimilartowhatweneedwhenwewritea
programinacomputerlanguagetosolveaproblem.

880 CHAPTER28NETWORKMANAGEMENT: SNMP
Beforewewriteaprogram,thesyntax ofthelanguage(such asCorJava)mustbe
predefined.Thelanguagealsodefinesthestructure
ofvariables(simple,structured,
pointer,andsoon)andhowthevariablesmustbenamed.Forexample,avariablename
mustbe
1toNcharactersinlengthandstartwithaletterfollowedbyalphanumeric
characters.Thelanguagealsodefinesthetype
ofdatatobeused(integer,float,char,
etc.).Inprogrammingtherulesaredefinedbythelanguage.Innetworkmanagement
therulesaredefinedbySMI.
Mostcomputerlanguagesrequirethatvariablesbedeclaredineachspecificpro­
gram.Thedeclarationnameseachvariableanddefinesthepredefinedtype.Forexample,
ifaprogramhastwovariables(anintegernamed counterandanarraynamed gradesof
typechar),theymustbedeclaredatthebeginning
oftheprogram:
int
counter;
chargrades[40];
Notethatthedeclarationsnamethevariables(counterandgrades)anddefinethe
type
ofeachvariable.Becausethetypesarepredefinedinthelanguage,theprogram
knowstherangeandsize
ofeachvariable.
MIBdoesthistaskinnetworkmanagement.
MIBnameseachobjectanddefines
~e
typeoftheobjects.BecausethetypeisdefinedbySMI,SNMPknowstherangeandsize.
Afterdeclarationinprogramming,theprogramneedstowritestatementstostore
valuesinthevariablesandchangethem
ifneeded.SNMPdoesthistaskinnetwork
management.SNMPstores,changes,andinterpretsthevalues
ofobjectsalready
declaredbyMIBaccordingtotherulesdefinedbySMI.
Wecancomparethe taskofnetwork managementto thetaskofwriting aprogram.
oBothtasksneedrules. InnetworkmanagementthisishandledbySMI.
oBothtasksneedvariabledeclarations. InnetworkmanagementthisishandledbyMIB.
oBothtaskshaveactionsperformedbystatements.Innetworkmanagementthisis
handledby
SNMP.
AnOverview
Beforediscussingeachcomponentindetail,weshowhoweachisinvolvedinasimple
scenario.This
isanoverviewthatwillbedevelopedlaterattheend ofthechapter.A
managerstation(SNMPclient)wantstosendamessagetoanagentstation(SNMP
server)tofindthenumber
ofUDPuserdatagramsreceivedbytheagent.Figure28.4
shows
anoverviewofstepsinvolved.
MIB
isresponsibleforfindingtheobjectthatholdsthenumber oftheUDPuser
datagramsreceived.SMI,withthehelp
ofanotherembeddedprotocol,isresponsiblefor
encodingthename
oftheobject.SNMPisresponsibleforcreatingamessage,calleda
GetRequestmessage,andencapsulatingtheencodedmessage.
Ofcourse,thingsare
morecomplicatedthanthissimpleoverview,butwefirstneedmoredetails
ofeach
protocol.

SECTION28.2SIMPLENETWORKMANAGEMENT PROTOCOL(SNMP) 881
Figure28.4 Managementoverview
NumberofUDPuserdatagrams?
--------------~
Theobjecthasanintegervalueand
iscalledudpInDatagramwithid
1.3.6.1.2.1.7.1.0
--------------~
Retrievethevalue ofanobject
withcode0609 .
--------------jSNMPI
Encapsulatetherequestina
GetRequestmessage
StructureofManagementInformation
TheStructureofManagementInformation,version2(SMIv2)isacomponentfornet­
workmanagement.Itsfunctionsare
1.Tonameobjects
2.Todefinethetype ofdatathatcanbestoredinanobject
3.Toshowhowtoencodedatafortransmissionoverthenetwork
SMIisaguidelineforSNMP.
Itemphasizesthreeattributestohandleanobject:name,
datatype,andencodingmethod(seeFigure28.5).
Figure28.5Objectattributes
Objectattributes
Type
Name
SMIrequiresthateachmanagedobject(such asarouter,avariableinarouter,avalue)
haveauniquename.
Tonameobjectsglobally,SMIusesan objectidentifier,whichis
ahierarchicalidentifierbasedonatreestructure(seeFigure28.6).

882 CHAPTER 28NETWORKMANAGEMENT: SNMP
Figure28.6 Objectidentifier
1.3.6.1(iso.org.dop.intemet)
1.3.6.1.2.1(iso.org.dod.internet.mgmt.mib-2)
Thetreestructurestartswithanunnamedroot.Eachobjectcanbedefinedbyusing
asequenceofintegersseparatedbydots.Thetreestructurecanalsodefinean objectby
usingasequenceoftextualnamesseparatedbydots.Theinteger-dotrepresentation
is
usedinSNMP.Thename-dotnotationisusedbypeople.Forexample,thefollowing
showsthesameobjectintwodifferentnotations:
iso.org.dod.internet.mgmt.mib-2
...1.3.6.1.2.1
TheobjectsthatareusedinSNMParelocatedunderthe mib-2object,sotheir
identifiersalwaysstartwith1.3.6.1.2.1.
AUobjectsmanagedbySNMP aregivenanobjectidentifier.
Theobjectidentifieralwaysstartswith1.3.6.1.2.1.
Type
Thesecondattributeofan objectisthetype ofdatastoredinit. Todefinethedatatype,
SMIusesfundamental
AbstractSyntaxNotation1(ASN.l) definitionsandadds
somenewdefinitions.Inotherwords,SMIisbothasubsetandasupersetofASN.1.
SMIhastwobroadcategoriesofdatatype:
simpleandstructured.Wefirstdefine
thesimpletypesandthenshowhowthestructuredtypescanbeconstructedfromthe
simpleones(seeFigure28.7).

SECTION28.2SIMPLENEIWORKMANAGEMENT PROTOCOL(SNMP) 883
Figure28.7 Datatype
SimpleTypeThesimple datatypesareatomicdatatypes.Someofthemaretaken
directlyfromASN.l;othersareaddedbySMI.Themostimportantonesaregivenin
Table28.1.ThefirstfivearefromASN.l;thenextsevenaredefinedbySMI.
Table28.1
Datatypes
Type Size Description
INTEGER 4bytesAnintegerwithavaluebetween _2
31
and2
31
-1
Integer32 4bytesSameasINTEGER
Unsigned32 4bytesUnsignedwithavaluebetween0and2
32
-
1
OCTETSTRING VariableBytestring
upto65,535byteslong
OBJECTIDENTIFIER Variable
Anobjectidentifier
IPAddress 4bytes
AnIPaddressmade offourintegers
Counter32 4bytes
Anintegerwhosevaluecanbeincremented
from0to2
32
;
whenitreachesitsmaximum
value,itwrapsbackto
O.
Counter64 8bytes64-bitcounter
Gauge32 4bytesSameasCounter32,butwhen
itreachesits
maximumvalue,
itdoesnotwrap; itremains
thereuntilitisreset
TimeTicks 4bytesAcountingvaluethatrecordstimein
l~s
BITS Astring
ofbits
Opaque VariableUninterpretedstring
StructuredTypeBycombiningsimpleandstructureddatatypes,wecanmakenew
structureddatatypes.SMIdefinestwo
structureddatatypes:sequenceandsequenceof
oSequence.A sequencedatatypeisacombination ofsimpledatatypes,notneces­
sarily
ofthesametype. Itisanalogoustotheconcept ofastructorarecordusedin
programminglanguagessuch
asC.
oSequenceof.A sequenceofdatatypeisacombination ofsimpledatatypesall of
thesametypeoracombination ofsequencedatatypesall ofthesametype.Itis
analogoustotheconcept
ofanarrayusedinprogramminglanguagessuch asC.

884 CHAPTER 28NETWORKMANAGEMENT: SNMP
Figure28.8showsaconceptualview ofdatatypes.
Figure28.8 Conceptualdatatypes
-
a.Simplevariable
b.Sequence
of
(simplevariables)
c.Sequence
d.Sequence
of
(sequences)
...
...
EncodingMethod
SMIusesanotherstandard, BasicEncodingRules(BER), toencodedatatobetrans­
mittedoverthenetwork.
BERspecifiesthateachpiece ofdatabeencodedintriplet
format:tag,length,andvalue,asillustratedinFigure28.9.
Figure28.9 Encodingformat
oTag.ThetagisaI-bytefieldthatdefinesthetype ofdata.Itiscomposedofthree
subfields:class
(2bits),fonnat(1bit),andnumber (5bits).Theclasssubfielddefines
thescope
ofthedata.Fourclassesaredefined:universal(00),applicationwide(01),
context-specific(10),andprivate(11).Theuniversaldatatypesarethosetakenfrom
ASN.l(INTEGER,OCTETSTRING,andObjectIdentifier).Theapplicationwide
datatypesarethoseaddedbySMI(IPAddress,Counter,Gauge,andTimeTicks).The
fivecontext-specificdatatypeshavemeaningsthatmaychangefromoneprotocolto
another.Theprivatedatatypesarevendor-specific.
Theformatsubfieldindicateswhetherthedataaresimple(0)orstructured
(1).
Thenumbersubfieldfurtherdividessimpleorstructureddataintosubgroups.For
example,intheuniversalclass,withsimpleformat,INTEGERhasavalue
of2,
OCTETSTRINGhasavalue of4,andsoon.Table28.2showsthedatatypeswe
useinthischapterandtheirtagsinbinaryandhexadecimalnumbers.

SECTION28.2SIMPLENETWORKMANAGEMENT PROTOCOL(SNMP) 885
Table28.2 Codesfordatatypes
DataType
ClassFormatNumber Tag(Binary)Tag(Hex)
INTEGER
00 0 00010 00000010 02
OCTETSTRING 00 0 00100 00000100 04
OBJECTIDENTIFIER 00 0 00110 00000110 06
NULL 00 0 00101 00000101 05
Sequence,sequence of 00 1 10000 00110000 30
IPAddress 01 0 00000 01000000 40
Counter 01 0 00001 01000001 41
Gauge 01 0 00010 01000010 42
TimeTicks 01 0 00011 01000011 43
Opaque 01 0 00100 01000100 44
oLength.Thelengthfieldis Iormorebytes. Ifitis1byte,themostsignificantbit
mustbe
O.Theother7bitsdefinethelength ofthedata.Ifitismorethan1byte,
themostsignificantbit
ofthefirstbytemustbe 1.Theother7bitsofthefirstbyte
definethenumber
ofbytesneededtodefinethelength.SeeFigure28.10fora
depiction
ofthelengthfield.
Figure28.10
Lengthformat
~
a.Thecolored partdefinesthelength(2).
~~~
b.Theshaded partdermesthelength ofthelength(2bytes);
thecoloredbytesdefinethelength(260bytes).
oValue.Thevaluefieldcodesthevalue ofthedataaccordingtotherulesdefined
inBER.
Toshowhowthesethree fields-tag,length,and value-candefineobjects,wegive
someexamples.
Example28.1
Figure28.11showshowtodefineINTEGER14.
Example28.2
Figure28.12showshowtodefinetheOCTETSTRING "HI."

886 CHAPTER 28NETWORKMANAGEMENT: SNMP
Figure28.11 Example28.1,INTEGER14
Value(14)
02
Tag
(integer)
04
,';
1.li.lOOO100
Length
(4bytes)
00
00000000
00
00000000
00
00000000
OE
00001110
Figure28.12 Example28.2,OCTETSTRING
"HI"
04 02 48 49
00000010~~'.01001000 01001001
Tag Length Value Value
(String)
(2bytes) (H) (1)
Example28.3
Figure28.13showshowtodefineObjectIdentifier1.3.6.1(iso.org.dod.internet).
Figure28.13 Example28.3,ObjectIdentifier1.3.6.1
06
04
~(~ ..~~~OOOQQIQ(J~·J
Tag Length
(ObjectId) (4bytes)
I-
01
00000001
Value
(1)
03 06 01
00000011 00000110 00000001
Value Value Value
(3)
(6) 0)
1.3.6.1(iso.org.dod.intemet)
'I
Example28.4
Figure28.14showshowtodefineIPAddress131.21.14.8.
Figure28.14 Example28.4,IPAddress131.21.14.8
04 83 15 OE 08
000oo100 10000011 00010101 00001110 00001000
Tag Length Value Value Value Value
(IPAddress) (4bytes) (131) (21) (14) (8)
I- 131.21.14.8
>I
ManagementInformationBase(MIB)
TheManagementInformationBase,version2(MIB2)isthesecondcomponentusedin
networkmanagement.EachagenthasitsownMIB2,whichisacollection
ofallthe
objectsthatthemanagercanmanage.TheobjectsinMIB2arecategorizedunder
10

SECTION28.2SIMPLENETWORKMANAGEMENT PROTOCOL(SNMP) 887
differentgroups:system,interface,addresstranslation,ip,icmp,tcp,udp,egp,trans­
mission,andsnmp.Thesegroupsareunderthemib-2object
intheobjectidentifiertree
(seeFigure28.15).Eachgrouphasdefinedvariablesand/ortables.
Figure28.15mib-2
1.3.6.1.2.1
Thefollowingisabriefdescription ofsomeoftheobjects:
DsysThis object (system)definesgeneralinformationaboutthenode(system),
such
asthename,location,andlifetime.
DifThisobject (inteiface)definesinformationaboutalltheinterfaces ofthenode
includinginterfacenumber,physicaladdress,andIPaddress.
DatThisobject(addresstranslation) definestheinformationabouttheARPtable.
DipThisobjectdefinesinformationrelatedto IP,suchastheroutingtableandthe
IPaddress.
DicmpThisobjectdefinesinformationrelated toICMP,suchasthenumber of
packetssentandreceivedandtotalerrorscreated.
DtcpThisobjectdefinesgeneralinformationrelatedtoTCP,suchastheconnection
table,time-outvalue,number
ofports,andnumber ofpacketssentandreceived.
DudpThis objectdefinesgeneralinformationrelatedtoUDP,suchasthenumber
ofportsandnumber ofpacketssentandreceived.
DsnmpThisobjectdefinesgeneralinformationrelatedtoSNMPitself.
AccessingMIBVariables
Toshowhowtoaccessdifferentvariables,weusetheudpgroupasanexample.There
arefoursimplevariablesinthe
udpgroupandonesequence of(tableof)records.
Figure28.16showsthevariablesandthetable.
Wewillshowhowtoaccesseachentity.
Simple
VariablesToaccessany ofthesimplevariables,weusethe idofthegroup
(1.3.6.1.2.1.7)followed
bytheidofthevariable.Thefollowingshowshowtoaccess
eachvariable.
udpInDatagrams
.udpNoPorts
udplnErrors
udpOutDatagrams
1.3,6.1.2.1.7.1
1.3.6.1.2.1.7.2
1.3.6.1.2.1.7.3
1.3.6.1.2.1.7.4

888 CHAPTER28NETWORKMANAGEMENT: SNMP
Figure28.16udpgroup
udpLocal
Address
udpLocal
Port
However,theseobjectidentifiersdefinethevariable,nottheinstance(contents). Toshow
theinstance
orthecontentsofeachvariable,wemustadd aninstancesuffix.Theinstance
suffixforasimplevariableissimplya
O.Inotherwords,toshowaninstance oftheabove
variables,weusethefollowing:
udpInDatagrams.O 1.3.6.1.2.1.7.1.0
udpNoPorts.O 1.3.6.1.2.1.7.2.0
udpInErrors.O 1.3.6.1.2.1.7.3.0
udpOutDa.tagrams.O 1.3.6.1.2.1.7.4.0
TablesToidentifyatable,wefirstusethetableid.Theudpgrouphasonlyonetable
(withid5)asillustratedinFigure28.17.
Sotoaccessthetable,weusethefollowing:
udpTable
...1.3.6.1.2.1.7.5
However,thetableisnot attheleaflevelinthetreestructure.Wecannotaccessthe
table;wedefinetheentry(sequence)inthetable(with
idof1),asfollows:
udpEntry...1.3.6.1.2.1.7.5.1
Thisentryisalsonota leafandwecannotaccessit.Weneedtodefineeachentity
(field)intheentry.
udpLocalAddress 1.3.6.1.2.1.7.5.1.1udpLocalPoo' 1.3.6.1.2.1.7.5.1.2
Thesetwovariablesare attheleafofthetree.Although wecanaccesstheirinstances,
weneedto define
whichinstance.Atanymoment,thetablecanhaveseveralvaluesfor

SECTION28.2SIMPLENETWORKMANAGEMENT PROTOCOL(SNMP) 889
Figure28.17udpvariablesandtables
udpInDatagrams
(1.3.6.1.2.1.7.1)
'---I
udpLocaIAddress
(1.3.6.1.2.1.7.5.1.1)
---_I
udpLocaIPort
(1.3.6.1.2.1.7.5.1.2)
udpEntry
(1.3.6.1.2.1.7.5.1)
udpNoPorts
(1.3.6.1.2.1.7.2)
_------I
udpLocaIAddress
(1.3.6.1.2.1.7.5.1.1)
~~I
udpLocaIPort
(1.3.6.1.2.1.7.5.1.2)
udpEntry
(1.3.6.1.2.1.7.5.1)
udpEnn-y
(1.3.6.1.2.1.7.5.1)
udplnErrors
(1.3.6.1.2.1.7.3)
~------I
udpOutDatagrams
(1.3.6.1.2.1.7.4)
_------I
udpLocalAddress
(1.3.6.1.2.1.7.5.1.1)
···
-------,
udpLocalPon
(1.3.6.1.2.1.7.5.1.2)
udpTable
(1.3.6.1.2.1.7.5)
eachlocaladdress/localportpair. Toaccessaspecificinstance(row) ofthetable,we
addtheindextotheaboveids.InMIB,theindexes
ofarraysarenotintegers(likemost
programminglanguages).Theindexesarebasedonthevalue
ofoneormorefieldsin
theentries.Inourexample,theudpTableisindexedbasedonboththelocaladdressand
thelocalportnumber.Forexample,Figure
28.18showsatablewithfourrowsandvalues
foreachfield.Theindex
ofeachrowisacombination oftwovalues.
Toaccesstheinstance ofthelocaladdressforthefirstrow,weusetheidentifier
augmentedwiththeinstanceindex:
udpLocalAddress.181.23.45.14.23
......1.3.6.1.2.7.5.1.1.181.23.45.14.23
Note thatnotalltablesareindexedinthesameway.Sometablesareindexedbyusing
thevalue
ofonefield,othersbyusingthevalue oftwofields,andsoon.
LexicographicOrdering
OneinterestingpointabouttheMIBvariablesisthattheobjectidentifiers(including
theinstanceidentifiers)followinlexicographicorder.Tablesareorderedaccordingto
column-rowrules,whichmeansoneshouldgocolumnbycolumn.Ineachcolumn,one
shouldgofromthetoptothebottom,asshowninFigure
28.19.

890 CHAPTER28NETWORKMANAGEMENT: SNMP
Figure28.18 IndexesforudpTable
181.23.45.14I
1.3.6.1.2.1.7.5.1.1.181.23.45.14.23
192.13.5.10
1.3.6.1.2.1.7.5.1.1.192.13.5.10.161
227.2.45.18
1.3.6.1.2.1.7.5.1.1.227.2.45.18.180
230.20.5.24I
1.3.6.1.2.1.7.5.1.1.230.20.5.24.212
Figure28.19 Lexicographicordering
23I
1.3.6.1.2.1.7.5.1.2.181.23.45.14.23
o
1.3.6.1.2.1.7.5.1.2.192.13.5.10.161
180I
1.3.6.1.2.1.7.5.1.2.227.2.45.18.180
212I
1.3.6.1.2.1.7.5.1.2.230.20.5.24.212
I ~
I
I
181.23.45.14I )
23I
I
1.3.6.1.2.1.7.5.1..181.23.45.14.23 1.3.6. 1.2!1.7.5.1..181.23.45.14.23
I
I
I
I
I I
I
I I
192.13.5.10
I
161
I
I
1.3.6.1.2.1.7.5.1..192.13.5.10.161
/1.3.6.1.2.1.7.5.1..192.13.5.10.161
I
I
I
I
I I
I
I I
227.2.45.18
I
180
I
I
I
1.3.6.1.2.1.7.5.1.1.3.6.1.2.1.7.5.1..227.2.45.18.1&0 .227.2.45.18.180
I
I
I
I
I
230.20.5.24I I
212
I
I
1.3.6.1.2.1.7.5.1.1.3.6.1.2.1.7.5.1..23tl.20.5.24.212 .230.20.5.24.212
I
I

SECTION28.2SIMPLENETWORKMANAGEMENT PROTOCOL(SNMP) 891
Thelexicographicorderingenablesamanagertoaccessaset ofvariablesoneafter
anotherbydefiningthefirstvariable,aswewillseeintheGetNextRequestcommandin
thenextsection.
SNMP
SNMPusesbothSMIandMIBinInternetnetworkmanagement. Itisanapplication
programthatallows
1.Amanagertoretrievethevalue ofanobjectdefined inanagent
2.Amanagertostoreavalue inanobjectdefinedinanagent
3.Anagenttosendanalarmmessageaboutanabnormalsituationtothemanager
PDUs
SNMPv3defineseighttypes ofpackets(orPDUs):GetRequest,GetNextRequest,Get­
BulkRequest,SetRequest,Response,Trap,InformRequest,andReport(seeFigure28.20).
Figure28.20SNMPPDUs
UDP
connections
Trap
SNMP
manager
Client
<r--~-....R_e-,""-spo-....n-,,se,,---,~_: ~~',,,---',_''-I',I
~
SNMP
agent
Server
-;~:~~~~epa~f~7 Toanothermanager
'---_......
GetRequestTheGetRequest PDUissentfromthemanager(client)totheagent
(server)toretrievethevalue
ofavariableoraset ofvariables.
GetNextRequestTheGetNextRequestPDUissentfromthemanagertotheagentto
retrievethevalue
ofavariable.Theretrievedvalue isthevalueoftheobjectfollowingthe
definedObjectidinthePDD.
Itismostlyusedtoretrievethevalues oftheentriesinatable.
Ifthemanagerdoesnotknowtheindexesoftheentries,itcannotretrievethevalues.How­
ever,itcanuseGetNextRequestanddefinetheObjectIdofthetable.Becausethefirstentry
hastheObjectIdimmediatelyaftertheObjectIdofthetable,thevalueofthefirstentryis
returned.ThemanagercanusethisObjectIdtogetthevalueofthenextone,andso
on.

892 CHAPTER 28NETWORKMANAGEMENT: SNMP
GetBulkRequestTheGetBulkRequestPODissentfromthemanagertotheagent
toretrievealargeamountofdata.Itcanbeusedinstead ofmultipleGetRequestand
GetNextRequestPODs.
SetRequestTheSetRequestPDDissentfromthemanagertotheagenttoset(store)
avalueinavariable.
ResponseTheResponsePDDissentfromanagenttoamanagerinresponseto
GetRequestorGetNextRequest.
Itcontainsthevalue(s) ofthevariable(s)requestedby
themanager.
TrapTheTrap(alsocalledSNMPv2TraptodistinguishitfromSNMPv1Trap)
PODissentfromtheagenttothemanagertoreportanevent.Forexample,iftheagent
isrebooted,itinfonnsthemanagerandreportsthetime
ofrebooting.
InformRequestTheInfonnRequestPODissentfromonemanagertoanotherremote
managertogetthevalue
ofsomevariablesfromagentsunderthecontrol oftheremote
manager.TheremotemanagerrespondswithaResponsePOD.
ReportTheReportPODisdesignedtoreportsometypes oferrorsbetweenmanagers.
Itisnotyetinuse.
Format
ThefonnatfortheeightSNMPPODsisshowninFigure28.21.TheGetBulkRequest
PODdiffersfromtheothersintwoareas,
asshowninthefigure.
Figure28.21
SNMPPDUformat
PDU
VarBindlist
:I
I'l~-~IValueI···IVaria.ble:11Value1
Differences:
1.Errorstatus anderrorindexvaluesarezerosforallrequest
messages
exceptGetBulkRequest.
2.Errorstatusfieldisreplaced
bynonrepeaterfield anderrorindex
fieldisreplacedbymax-repetitionsfield
inGetBulkRequest.
Thefieldsarelistedbelow:
oPDUtype.Thisfielddefinesthetype ofthePOD(seeTable28.4).
oRequestID.ThisfieldisasequencenumberusedbythemanagerinaRequestPOD
andrepeatedbytheagentinaresponse.
Itisusedtomatcharequest toaresponse.

SECTION28.2SIMPLENETWORKMANAGEMENT PROTOCOL(SNMP) 893
oErrorstatus.ThisisanintegerthatisusedonlyinResponsePDUstoshowthe
types
oferrorsreportedbytheagent.Itsvalueis0inRequestPDUs.Table 28.3
liststhetypes oferrorsthatcanoccur.
Table28.3
Typesoferrors
Status Name Meaning
0 noError No error
1 tooBig Responsetoobigto fitinonemessage
2 noSuchName Variabledoesnotexist
3 badValue Thevaluetobestoredisinvalid
4 readOnly Thevaluecannotbemodified
5 genErr Othererrors
oNonrepeaters.Thisfield
ISusedonlyinGetBulkRequestandreplacestheerror
statusfield,whichisemptyinRequestPDUs.
oErrorindex.Theerrorindexisanoffsetthattellsthemanagerwhichvariable
causedthe
errOr.
o
Max~repetition. ThisfieldisalsousedonlyinGetBulkRequestandreplacesthe
errorindexfield,whichisemptyinRequestPDUs.
oVarBindlist.Thisisaset ofvariableswiththecorrespondingvaluesthemanager
wantstoretrieveorset.ThevaluesarenullinGetRequestandGetNextRequest.In
aTrapPDU,itshowsthevariablesandvaluesrelatedtoaspecificPDU.
Messages
SNMPdoesnotsendonlyaPDU,itembedsthePDUinamessage.Amessagein
SNMPv3ismade
offourelements:version,header,securityparameters,anddata
(whichincludetheencodedPDU),asshowninFigure
28.22.
Becausethelength oftheseelementsisdifferentfrom messagetomessage,SNMP
usesBERtoencodeeachelement.RememberthatBERusesthetagandthelengthto
defineavalue.The
versiondefinesthecurrentversion(3).The headercontainsvaluesfor
messageidentification,maximummessagesize(themaximumsize
ofthereply),mes­
sageflag(oneoctet
ofdatatypeOCTETSTRINGwhereeachbitdefinessecuritytype,
suchasprivacyorauthentication,
Orotherinformation),and amessagesecuritymodel
(definingthesecurityprotocol).Themessage
securityparameter isusedtocreateames­
sagedigest(seeChapter
31).ThedatacontainthePDU. Ifthedataareencrypted,thereis
informationabouttheencryptingengine(themanagerprogramthatdidtheencryption)
andtheencryptingcontext(thetype
ofencryption)followedbytheencryptedPDU. Ifthe
dataarenotencrypted,thedataconsist
ofjustthePDU.
Todefinethetype ofPDU,SNMPusesatag.Theclass iscontext-sensitive(10),the
formatisstructured
(1),andthenumbersare 0,1,2,3,5,6,7,and8(seeTable28.4).
NotethatSNMPvldefinedA4forTrap,whichisobsoletetoday.

894 CHAPTER28NETWORKMANAGEMENT: SNMP
Figure28.22 SNMPmessage
Message
Version
Header
Securityparameter
Data
ContextengineID
Contextname
PDU
Table28.4 CodesforSNMPmessages
, WholeTagWholeTag
Data ClassFormatNumber (Binary) (Hex)
GetRequest 10 1 00000 10100000 AO
GetNextRequest10 1 00001 10100001 Al
Response 10 1 00010 10100010 A2
SetRequest 10 1 00011 10100011 A3
GetBulkRequest10 1 00101 10100101 AS
InformRequest 10 1 00110 10100110 A6
Trap(SNMPv2) 10 1 00111 10100111 A7
Report 10 1 01000 10101000 A8
Example28,5
Inthisexample,amanagerstation(SNMPclient)usestheGetRequestmessagetoretrievethe
number
ofUDPdatagramsthatarouterhasreceived.
ThereisonlyoneVarBindentity.Thecorresponding
MIDvariablerelatedtothisinforma­
tionisudpInDatagramswiththeobjectidentifier1.3.6.1.2.1.7.1.0.Themanagerwantstoretrieve
avalue(nottostoreavalue),sothevaluedefinesanullentity.Figure28.23showstheconceptual

SECTION28.2SIMPLENETWORKMANAGEMENT PROTOCOL(SNMP) 895
Figure28.23 Example28.5
3034
020103 INTEGER,version
300C
1--...-IHeader,sequence
oflength12,notshown
020140]Two
0202 04 00INTEGERs
040100J
0400 Three
04 00 OCTETSTRINGs
30
IF
AO10
02
04000106IlThr
020100 ee
02
0100 INTEGERs
Data,a
30
OF
GetRequest
sequence
PDUof
of31
30
on length29
bytes
VarBind
II0609010306010201070100I
v:Bind
list
0500 ar
Wholemessage
asequence
of
52bytes
viewofthepacketandthehierarchicalnature ofsequences.Wehaveusedwhiteandcoloredboxes
forthesequencesandagrayoneforthePDU.
TheVarBindlisthasonlyoneVarBind.Thevariableis
oftype06andlength09. Thevalueis
oftype05andlength00.ThewholeVarBindisasequence oflengthOD(13).TheVarBindlistis
alsoasequence
oflengthOF(15).TheGetRequestPDUis oflengthID(29).
NowwehavethreeOCTETSTRINGsrelatedtothesecurityparameter,securitymodel,and
flags.
Thenwehavetwointegersdefining maximumsize(1024)and messageID(64).The
headerisasequence oflength12,which weleftblankforsimplicity.Thereisoneinteger,version
(version3).
Thewholemessageisasequence of52bytes.
Figure28.24showstheactualmessagesentbythemanagerstation(client)totheagent(server).
UDPPorts
SNMPusestheservices ofUDPontwowell-knownports, 161and162.Thewell­
knownport
161isusedbytheserver(agent),andthewell-knownport162isusedby
theclient(manager).
Theagent(server)issuesapassiveopenonport161.
Itthenwaitsforaconnection
fromamanager(client).Amanager(client)issuesanactiveopen,usinganephemeral
port,Therequestmessagesare sentfromtheclienttotheserver,usingtheephemeral
portasthesourceportandthewell-knownport161asthedestinationport.The
responsemessagesaresentfromtheservertotheclient,usingthewell-knownport
161
asthesourceportandtheephemeralportasthedestinationport.
Themanager(client)issuesapassiveopenonport162.Itthenwaitsforaconnec­
tionfrom
anagent(server).Whenever ithasaTrapmessagetosend, anagent(server)
issuesanactiveopen,usinganephemeralport.Thisconnectionisonlyone-way,from
theservertotheclient(seeFigure28.25).

896 CHAPTER 28NETWORKMANAGEMENT: SNMP
Figure28.24 GetRequestmessage
&
Packet me=!
cu::uJ
~
Manager
..-
Agent
303402 01
0330 OC
02
CLl
014002 02
bO
oj
0400 04 01'"
'"
8 00040004
tl
0030IFAO
CLl
::;
100204000'
~
0106 1102
O:l
0 010002 01
0030 OF 30
0006 09 01
03
06 0102
0107 0100
0500
Figure28.25 Portnumbers forSNMP
Client
Passive
open
PassiveOII(0pen.
IServer
-_......
a.Passiveopenby bothclientandserver
Active
=
8000:...,0II(f-°..;:.p_en --+j._
Client IServer
--- '---
b.Exchangeofrequestandresponsemessages
'__C_li_en_t_~f-ool(E---------A-O-~t1-~~-e~='__se_rv_e_r_
c.Serversends trapmessage

SECTION28.4KEYTERMS 897
Theclient/servermechanisminSNMPisdifferentfromotherprotocols.Hereboth
theclientandtheserverusewell-knownports.Inaddition,boththeclientandthe
serverarerunninginfinitely.Thereasonisthatrequestmessagesareinitiatedbyaman­
ager(client),butTrapmessagesareinitiatedbyanagent(server).
Security
ThemaindifferencebetweenSNMPv3andSNMPv2istheenhancedsecurity.SNMPv3
providestwotypes
ofsecurity:generalandspecific.SNMPv3providesmessageauthenti­
cation,privacy,andmanagerauthorization.WediscussthesethreeaspectsinChapter31.
In
addition,SNMPv3allowsamanagertoremotelychangethesecurityconfiguration,which
meansthatthemanagerdoesnothavetobephysicallypresentatthemanagerstation.
28.3RECOMMENDED READING
Formoredetailsaboutsubjectsdiscussedinthischapter,werecommendthefollowing
booksandsites.Theitemsinbrackets[
...]refertothereferencelistattheend ofthetext.
Books
SNMPisdiscussedin[MS01],Chapter25 of[Ste94],Section22.3 of[Sta04],and
Chapter39
of[Com04].Networkmanagementisdiscussedin[Sub01].
Sites
Thefollowingsitesarerelatedtotopicsdiscussedinthischapter.
owww.ietf.org/rfc.htmlInformationaboutRFCs
RFCs
ThefollowingRFCsarerelatedtoSNMP,MIB,andSMI:
1065,1067,1098, 1155,1157,1212, 1213,1229,1231,1243, 1284,1351,1352,1354,1389,
1398,
1414,1441,1442,1443,1444,1445,1446,1447,1448,1449, 1450,1451,1452, 1461,
1472,
1474, 1537,1623,1643,1650,1657, 1665,1666,1696,1697, 1724,1742,1743,1748,
1749
28.4KEYTERMS
AbstractSyntaxNotation1 (ASN.l)
accountingmanagement
agent
BasicEncodingRules(BER)
configurationmanagement
faultmanagement
hardwaredocumentation
lexicographicordering
ManagementInformationBase(MIB)
manager
networkmanagement
objectidentifier
performancemanagement
securitymanagement

898 CHAPTER 28NE1WORKMANAGEMENT: SNMP
simpledatatype
SimpleNetworkManagementProtocol
(SNMP)
structureddatatype
Structure ofManagementInformation
(SMI)
trap
28.5SUMMARY
oThefiveareascomprisingnetworkmanagementareconfigurationmanagement,
faultmanagement,performancemanagement,accountingmanagement,andsecurity
management.
oConfigurationmanagementisconcernedwiththephysicalorlogicalchanges of
networkentities. Itincludesthereconfigurationanddocumentation ofhardware,
software,anduseraccounts.
oFaultmanagementisconcernedwiththeproperoperation ofeachnetworkcompo­
nent.Itcanbereactiveorproactive.
oPerformancemanagementisconcernedwiththemonitoringandcontrol ofthe
networktoensurethenetworkruns
asefficientlyaspossible.Itisquantifiedby
measuringthecapacity,traffic,throughput,andresponsetime.
oSecuritymanagementisconcernedwithcontrollingaccesstothenetwork.
oAccountingmanagementisconcernedwiththecontrolofuseraccess tonetwork
resourcesthroughcharges.
oSimpleNetworkManagementProtocol(SNMP)isaframeworkformanaging
devicesinaninternetusingtheTCP/IPprotocolsuite.
oAmanager,usuallyahost,controlsandmonitorsaset ofagents,usuallyrouters.
oThemanagerisahostthatrunstheSNMPclientprogram.
oTheagentisarouterorhostthatrunstheSNMPserverprogram.
oSNMPfreesmanagementtasksfromboththephysicalcharacteristics ofthemanaged
devicesandtheunderlyingnetworkingtechnology.
oSNMPusestheservices oftwootherprotocols:Structure ofManagementInfor­
mation(SMI)andManagementInformationBase(MIB).
oSMInamesobjects,definesthetype ofdatathatcanbestoredinanobject,and
encodesthedata.
oSMIobjectsarenamedaccordingtoahierarchicaltreestructure.
oSMIdatatypesaredefinedaccordingtoAbstractSyntaxNotation1(ASN.l).
oSMIusesBasicEncodingRules(BER)toencodedata.
oMIBisacollection ofgroupsofobjectsthatcanbemanagedbySNMP.
oMIBuseslexicographicorderingtomanageitsvariables.
oSNMPfunctionsinthreeways:
1.Amanagercanretrievethevalue ofanobjectdefinedinanagent.
2.Amanagercanstoreavalueinanobjectdefinedinanagent.
3.Anagentcansendanalarmmessage tothemanager.

SECTION28.6PRACTICESET 899
oSNMPdefineseighttypes ofpackets:GetRequest,GetNextRequest,SetRequest,
GetBulkRequest,Trap,InformRequest,Response,andReport.
oSNMPusestheservices ofUDPontwowell-knownports, 161and162.
oSNMPv3hasenhancedsecurityfeaturesoverpreviousversions.
28.6PRACTICESET
ReviewQuestions
I.Definenetworkmanagement.
2.Listfivefunctions ofnetworkmanagement..3.Defineconfigurationmanagementanditspurpose.
4.Listtwosubfunctions ofconfigurationmanagement.
S.Definefaultmanagementanditspurpose.
6.Listtwosubfunctions
offaultmanagement.
7.Defineperformancemanagementanditspurpose.
8.Listfourmeasurablequantities ofperformancemanagement.
9.Definesecuritymanagementanditspurpose.
10.Defineaccountmanagementanditspurpose.
Exercises
II.ShowtheencodingforINTEGER1456.
12.ShowtheencodingfortheOCTETSTRING"HelloWorld."
13.ShowtheencodingforanarbitraryOCTETSTRING oflength1000.
14.Showhowthefollowingrecord(sequence)isencoded.
INTEGER
2345
OCTETSTRING
"COMPUTER"
IPAddress
185.32.1.5
15.Showhowthefollowingrecord(sequence)isencoded.
TimeTick
12000
INTEGER
14564
ObjectId
1.3.6.1.2.1.7
16.Showhowthefollowingarray(sequenceof)isencoded.Eachelementisan
integer.
2345
1236
122
1236

900 CHAPTER28NETWORKMANAGEMENT: SNMP
17.Showhowthefollowingarray ofrecords(sequence ofsequence)isencoded.
INTEGER
2345
1123
3456
OCTETSTRING
"COMPUTER"
"DISK"
"MONITOR"
Counter
345
1430
2313
18.Decodethefollowing.
a.020401021432
b.3006020111020114
c.30090403414342020214 14
d.30OA40042351 6271020214 12

CHAPTER29
Multimedia
Recentadvancesintechnologyhavechanged ouruseofaudioandvideo. Inthepast,
welistenedtoanaudiobroadcastthrougharadioandwatchedavideoprogrambroad­
castthrougha
TV.Weusedthetelephonenetworktointeractivelycommunicatewith
anotherparty.
Buttimeshavechanged.PeoplewanttousetheInternet notonly fortext
and
imagecommunications,butalsoforaudioandvideoservices. Inthischapter,we
concentrateonapplicationsthat usetheInternetforaudioandvideoservices.
We
candivideaudio andvideoservicesintothreebroadcategories:streaming
storedaudio/video,streamingliveaudio/video,and interactiveaudio/video,asshown
inFigure29.1.Streamingmeansausercanlistento(orwatch)thefileafterthedown­
loadinghasstarted.
Figure29.1Internetaudio/video
Inthefirstcategory,streamingstoredaudio/video,thefilesarecompressedand
stored
onaserver.AclientdownloadsthefilesthroughtheInternet. Thisissometimes
referredtoason-demandaudio/video.Examplesofstoredaudiofilesaresongs,
symphonies,booksontape,andfamouslectures.Examples ofstoredvideofilesare
movies,
TVshows,andmusicvideoclips.
Streamingstoredaudio/videorefers
toon-demand
requestsforcompressedaudio/videofiles.
901

902 CHAPTER 29MULTIMEDIA
Inthesecondcategory,streamingliveaudio/video,auserlistenstobroadcast
audioandvideothroughtheInternet.Agoodexample
ofthistypeofapplicationisthe
Internetradio.SomeradiostationsbroadcasttheirprogramsonlyontheInternet;many
broadcastthembothontheInternetandonthe
air.InternetTVisnotpopularyet,but
manypeoplebelievethatTVstationswillbroadcasttheirprogramsontheInternetin
thefuture.
Streamingliveaudio/videoreferstothebroadcasting of
radioandTVprogramsthroughtheInternet.
Inthethirdcategory,interactiveaudio/video,peopleusetheInternettointeractively
communicatewithoneanother.Agoodexample
ofthisapplicationisInternettelephony
andInternetteleconferencing.
Interactiveaudio/videoreferstotheuse oftheInternet
forinteractiveaudio/videoapplications.
Wewilldiscussthesethreeapplicationsinthischapter,butfirstweneedtodiscuss
someotherissuesrelatedtoaudio/video:digitizingaudioandvideoandcompressing
audioandvideo.
29.1DIGITIZINGAUDIOANDVIDEO
BeforeaudioorvideosignalscanbesentontheInternet,theyneedtobedigitized. We
discussaudioandvideoseparately.
DigitizingAudio
Whensoundisfedintoamicrophone,anelectronicanalogsignalisgeneratedwhich
representsthesoundamplitudeasafunction
oftime.Thesignaliscalledan analog
audiosignal.
Ananalogsignal,suchasaudio,canbedigitizedtoproduceadigitalsig­
nal.AccordingtotheNyquisttheorem,
ifthehighestfrequency ofthesignalis f,we
needtosamplethesignal
21timespersecond.Thereareothermethodsfordigitizing
anaudiosignal,buttheprincipleisthesame.
Voiceissampledat8000samplespersecondwith8bitspersample.Thisresultsin
adigitalsignal
of64kbps.Musicissampledat44,100samplespersecondwith 16bits
persample.Thisresultsinadigitalsignal
of705.6kbpsformonauraland1.411Mbps
forstereo.
DigitizingVideo
Avideoconsists ofasequenceofframes.Iftheframesaredisplayedonthescreenfast
enough,wegetanimpression
ofmotion.Thereasonisthatoureyescannotdistinguish
therapidlyflashingframesasindividualones.Thereisnostandardnumber
offrames
persecond;inNorthAmerica25framespersecondiscommon.However,toavoida

SECTION29.2AUDIOANDVIDEOCOMPRESSION 903
conditionknown asflickering,aframeneedstoberefreshed.TheTVindustryrepaints
eachframetwice.Thismeans50framesneedtobesent,or
ifthereismemoryatthe
sendersite,
25frameswitheachframerepaintedfromthememory.
Eachframeisdividedintosmallgrids,calledpictureelementsorpixels.Forblack­
and-white
TV,each8-bitpixelrepresentsone of256differentgraylevels.Foracolor TV,
eachpixelis24bits,with8bitsforeachprimarycolor(red,green,andblue).
Wecancalculatethenumber ofbitsin1 sforaspecificresolution.Inthelowest
resolutionacolorframeismade
of1024x768pixels.Thismeansthatweneed
2
x25xI024x768x24=944Mbps
Thisdatarateneedsaveryhighdataratetechnologysuch asSONET.Tosendvideo
usinglower-ratetechnologies,weneedtocompressthevideo.
CompresswnisneededtosendvideoovertheInternet.
29.2AUDIOANDVIDEO COMPRESSION
TosendaudioorvideoovertheInternetrequirescompression.Inthissection,wediscuss
audiocompressionfirstandthenvideocompression.
AudioCompression
Audiocompressioncanbeusedforspeechormusic.Forspeech,weneedtocompress
a64-kHzdigitizedsignal;formusic,weneedtocompressa
1.41I-MHzsignal.Two
categories
oftechniquesareusedforaudiocompression:predictiveencodingand
perceptualencoding.
PredictiveEncoding
Inpredictiveencoding,the differencesbetweenthesamplesareencodedinstead of
encodingallthesampledvalues.Thistype ofcompressionisnormallyusedforspeech.
SeveralstandardshavebeendefinedsuchasGSM(13kbps),G.729(8kbps),and
G.723.3(6.4
or5.3kbps).Detaileddiscussions ofthesetechniquesarebeyondthe
scope
ofthisbook.
PerceptualEncoding:MP3
ThemostcommoncompressiontechniquethatisusedtocreateCD-qualityaudiois
basedonthe
perceptualencodingtechnique.Aswementionedbefore,thistype of
audioneedsatleast1.411Mbps;thiscannotbesentoverthe
Int~rnetwithoutcompres­
sion.
MP3(MPEGaudiolayer3),apart oftheMPEGstandard(discussedinthevideo
compressionsection),usesthistechnique.
Perceptualencodingisbasedonthescience
ofpsychoacoustics,whichisthestudy
ofhowpeopleperceivesound. Theideaisbasedonflawsinourauditorysystem:
Somesoundscanmaskothersounds.Maskingcanhappeninfrequencyandtime.In

904 CHAPTER 29MULTIMEDIA
frequency masking,aloudsoundinafrequencyrangecanpartiallyortotallymaska
softersoundinanotherfrequencyrange.Forexample,wecannothearwhatourdance
partnersaysinaroomwherealoudheavymetalbandisperforming.In
temporal
masking,aloudsoundcannumbourearsforashorttimeevenafterthesoundhas
stopped.
MP3usesthesetwophenomena,frequencyandtemporalmasking,tocompress
audiosignals.Thetechniqueanalyzesanddividesthespectrumintoseveralgroups.
Zerobitsareallocatedtothefrequencyrangesthataretotallymasked.Asmallnumber
ofbitsareallocatedtothefrequencyrangesthatarepartiallymasked.Alargernumber of
bitsareallocatedtothefrequencyrangesthatarenotmasked.
MP3producesthreedatarates:
96kbps,128kbps,and160kbps.Therateisbased
ontherange
ofthefrequenciesintheoriginalanalogaudio.
VideoCompression
Aswementionedbefore,videoiscomposed ofmultipleframes.Eachframeisone
image.
Wecancompressvideo byfirstcompressingimages. Twostandardsareprevalent
inthemarket.
JointPhotographicExpertsGroup(JPEG)isusedtocompressimages.
Moving
PictureExpertsGroup(MPEG)isusedtocompressvideo. Webrieflydiscuss
JPEGandthenMPEG.
ImageCompression: lPEG
Aswediscussedpreviously, ifthepictureisnotincolor(grayscale),eachpixelcanbe
representedbyan8-bitinteger(256levels).
Ifthepictureisincolor,eachpixelcan
berepresentedby24bits
(3x 8bits),witheach8bitsrepresentingred,blue, orgreen
(RBG).
Tosimplifythediscussion,weconcentrateonagrayscalepicture.
InJPEG,agrayscalepictureisdividedintoblocks
of8 x 8pixels(seeFigure29.2).
Figure29.2lPEGgrayscale
..
Thepurposeofdividingthepictureintoblocksistodecreasethenumber ofcalcula­
tionsbecause,
asyouwillseeshortly,thenumber ofmathematicaloperationsforeach
picture
isthesquareofthenumberofunits.
Thewholeidea
ofJPEGistochangethepictureintoalinear(vector)set ofnumbers
thatrevealstheredundancies.Theredundancies(lack
ofchanges)can
thenberemoved

SECTION29.2AUDIOANDVIDEOCOMPRESSION 905
byusingone ofthetextcompressionmethods.Asimplifiedscheme oftheprocessis
showninFigure29.3.
Figure29.3
lPEGprocess
Threephases ofJPEG
IT][]•••bI
GJQ;)···~
oD···(I
Blocked
image
Quantization
Data
compression
001111·..000001
Compressed
image
DiscreteCosine Transform(DCT)Inthisstep,eachblock of64pixelsgoesthrough
atransformationcalledthediscretecosine
transform(DCT).Thetransformation
changesthe64valuessothattherelativerelationshipsbetweenpixelsarekeptbutthe
redundanciesarerevealed.
Wedonotgivetheformulahere,butwedoshowtheresults
ofthetransformation forthreecases.
Case1Inthiscase,wehaveablock
ofuniformgray,andthevalue ofeachpixelis
20.Whenwedothetransformations,wegetanonzerovalueforthefirstelement
(upperleftcomer);therest
ofthepixelshaveavalue ofO.ThevalueofT(O,O)isthe
average(multipliedbyaconstant)
oftheP(x,y)valuesand iscalledthe devalue(direct
current,borrowedfromelectricalengineering).Therest
ofthevalues,called aevalues,
inT(m,n)representchangesinthepixelvalues.Butbecausetherearenochanges,the
restofthevaluesare
Os(seeFigure29.4).
Figure29.4
Case1:uniformgrayscale
20 2020 20202020 20 16000 0 00 00
20 2020 20 20 202020
o0 0 0 0 0 0 0
20 2020 20
20202020 o0 0 0 0 0 0 0
--+-
202020 2020 202020
---+
o0 0 0 0 0 0 0
202020
2020 20 2020 o0 0 0 0 0 0 0
20 20 2020 2020 20 20
o0 000 000
Picture
20 20 2020 20 2020 20 o0 0 0 0 0 00
20202020 20 202020 o000 0 0 0 0
P(X,y) T(m,n)
Case2Inthesecondcase,wehaveablockwithtwodifferentuniformgrayscalesec­
tions.Thereisasharpchange
inthevaluesofthepixels(from20to50).Whenwe do
thetransformations,wegeta dcvalueaswellasnonzeroacvalues.However,thereare
onlyafewnonzerovaluesclusteredaroundthedcvalue.Most
ofthevaluesare0(see
Figure29.5).
Case3Inthethirdcase,wehaveablockthatchangesgradually.Thatis,thereisno
sharpchangebetweenthevalues
ofneighboringpixels.Whenwe dothetransformations,
wegetadevalue,withmanynonzero
acvaluesalso(Figure29.6).

906 CHAPTER 29MULTIMEDIA
Figure29.5 Case2:twosections
20 2020205050 50 50 28021090390225022
20 20
2020505050 50 0 0 0 0 0 0 00iL
202020 2050505050 0 0 0 0 0 0 0 0
---+
202020 205050 50 50
---+
0 0 0 0 0 0 00
20
20202050 505050 0 0 00 0 0 0 0t, 20 20202050 5050 50 0 0 0 0 000 0
Picture
20 20202050 50 50 50 0 0 0 0 0 0 00
20 2020 2050 505050 0 0 0 0 0 0 00
P(x,y) T(m,n)
Figure29.6 Case3:gradientgrayscale
2030405060708090 40021460 2312132128
2030405060708090 0 0 00 0 0 0 0
2030405060 708090
0 00 0000 0
2030405060 708090 000
0
00 0 0
2030405060 708090 0000000 0
2030405060 708090 0 0 0 0 0 00 0
Picture
2030405060708090 0 0 00 0 0 0 0
2030405060 708090 0 0 00 0 0 0 0
P(x,y) T(m,n)
FromFigures29.4,29.5,and29.6,wecanstatethefollowing:
oThetransformationcreatestable Tfromtable P.
oThedcvalue istheaveragevalue(multipliedbyaconstant)ofthepixels.
oTheacvaluesarethechanges.
oLackofchangesinneighboringpixelscreates Os.
QuantizationMtertheTtableiscreated, thevaluesarequantizedtoreducethenum­
ber
ofbitsneededforencoding.Previouslyin quantization,wedroppedthefraction
fromeachvalueandkepttheintegerpart.Here,wedividethenumberbyaconstantand
thendropthefraction.Thisreducestherequirednumber
ofbitsevenmore.Inmost
implementations,aquantizingtable
(8x8)defineshowtoquantizeeachvalue.The
divisordependsontheposition
ofthevalueinthe Ttable.Thisisdonetooptimizethe
number
ofbitsandthenumber ofOsforeachparticularapplication.Notethattheonly
phaseintheprocessthat
isnotreversibleisthequantizingphase. Welosesomeinfor­
mationherethatisnotrecoverable.Asamatteroffact,theonlyreasonthat
lPEGis
called
lossycompression isbecauseofthisquantizationphase.
CompressionAfterquantization,thevaluesarereadfromthetable,andredundant
Osareremoved.However,toclusterthe Ostogether,thetableisreaddiagonallyina
zigzagfashionratherthanrowbyroworcolumnbycolumn.Thereasonisthatifthe
picturechangessmoothly,thebottomrightcornerofthe
Ttableisall Os.Figure29.7
showstheprocess.

SECTION29.2AUDIOANDVIDEOCOMPRESSION 907
Figure29.7Readingthetable
20151512171200000"·0
Result
VideoCompression: MPEG
TheMovingPictureExpertsGroupmethodisusedtocompressvideo.Inprinciple,a
motionpicture
isarapidflow ofasetofframes,whereeachframeisanimage.Inother
words,aframeisaspatialcombination
ofpixels,andavideoisatemporalcombination
offramesthataresentoneafteranother.Compressingvideo,then,meansspatiallycom­
pressingeachframeandtemporallycompressingaset
offrames.
SpatialCompressionThespatialcompression
ofeachframeisdonewithIPEG(or
amodification
ofit).Eachframeisapicturethatcanbeindependentlycompressed.
TemporalCompressionIn temporalcompression,redundantframes areremoved.
Whenwewatchtelevision,wereceive50framespersecond.However,most
ofthecon­
secutiveframesarealmostthesame.Forexample,whensomeoneistalking,most
ofthe
frameisthesame
asthepreviousoneexceptforthesegment oftheframearoundthelips,
whichchangesfromoneframetoanother.
Totemporallycompressdata,theMPEGmethodfirstdividesframesintothree
categories:I-frames,P-frames,andB-frames.
oI-frames.An intracodedframe(I-frame)isanindependentframethat isnot
relatedtoanyotherframe(nottotheframesentbeforeortotheframesentafter).
Theyarepresentatregularintervals(e.g.,everyninthframeisanI-frame).An
I-framemustappearperiodicallytohandlesomesuddenchangeintheframethat
thepreviousandfollowingframescannotshow.Also,whenavideoisbroadcast,a
viewermaytuneinatanytime.
IfthereisonlyoneI-frameatthebeginning ofthe
broadcast,the
viewerwhotunes inlatewill notreceiveacompletepicture.
I-framesareindependentofotherframesandcannotbeconstructedfromotherframes.
oP-frames.A predictedframe(P-frame)isrelatedtotheprecedingI-frameor
P-frame.
Inotherwords,eachP-framecontainsonlythechangesfromthepreceding

908 CHAPTER 29MULTIMEDIA
frame.Thechanges,however,cannotcoverabigsegment.Forexample,forafast­
movingobject,thenewchangesmaynotberecorded
inaP-frame.P-framescan be
constructedonlyfromprevious 1-orP-frames.P-frames carrymuchlessinforma­
tionthanotherframetypesandcarryevenfewerbitsaftercompression.
oB-frames.Abidirectionalframe(B.frame) isrelatedtotheprecedingand
followingI-frameorP-frame.Inotherwords,eachB-frameisrelativetothepast
andthefuture.NotethataB-frameisneverrelatedtoanotherB-frame.
Figure29.8showsasamplesequence
offrames.
Figure29.8 MPEGframes
Figure29.9showshow 1-,P-,andB-framesareconstructedfromaseries ofseven
frames.
Figure29.9 MPEGframeconstruction
.---11----1
151 1617
1 :1 :
1 I
I I 1 1 I I
L 01""_____.I
1.__01L _
MPEGhasgonethroughtwoversions.MPEG1wasdesignedforaCD-ROMwith
adatarate
of1.5Mbps.MPEG2wasdesignedforhigh-qualityDVDwithadatarate of
3to6Mbps.
29.3STREAMINGSTOREDAUDIONIDEO
Nowthatwehavediscusseddigitizingandcompressingaudio/video,weturnour
attentiontospecificapplications.Thefirstisstreamingstoredaudioandvideo.Down­
loadingthesetypes
offilesfromaWebservercan bedifferentfromdownloadingother

SECTION29.3STREAMINGSTOREDAUDIOIVIDEO 909
typesoffiles.Tounderstandtheconcept,letusdiscussfourapproaches,eachwitha
differentcomplexity.
FirstApproach:UsingaWebServer
Acompressedaudio/videofilecanbedownloadedasatextfile.Theclient(browser)
canusetheservices
ofHTTPandsendaGETmessagetodownloadthefile.TheWeb
servercansendthecompressedfiletothebrowser.Thebrowsercanthenuseahelp
application,normallycalleda
mediaplayer,toplaythefile.Figure29.10showsthis
approach.
Figure29.10UsingaWebserver
Clientmachine
a
Servermachine
i
-.GET:audio/videofile
-
Web
Browser
RESPONSE .....
server
-
4~
Audio/video
file
Media
player
Thisapproachisverysimpleanddoesnotinvolve streaming.However,ithasa
drawback.Anaudio/videofileisusuallylargeevenaftercompression.Anaudiofile
maycontaintens
ofmegabits,andavideofilemaycontainhundreds ofmegabits.In
thisapproach,thefileneedstodownloadcompletelybefore
itcanbeplayed.Using
contemporarydatarates,theuserneedssomesecondsortens
ofsecondsbeforethefile
canbeplayed.
SecondApproach:UsingaWebServerwithMetafile
Inanotherapproach,themediaplayerisdirectlyconnectedtotheWebserverfordown­
loadingtheaudio/videofile.TheWebserverstorestwofiles:theactualaudio/video
file
andametafilethatholdsinformationabouttheaudio/videofile.Figure29.11showsthe
stepsinthisapproach.
1.TheHTTPclientaccessestheWebserverbyusingtheGETmessage.
2.Theinformationaboutthemetafilecomes intheresponse.
3.Themetafileispassedtothemediaplayer.
4.ThemediaplayerusestheURLinthemetafiletoaccesstheaudio/videofile.
5.TheWebserverresponds.

910 CHAPTER 29MULTIMEDIA
Figure29.11 Usinga Webserverwithametafile
Clientmachine
&
Servermachine
i
l- GET:metafile
r-
Browser
RESPONSE-"l;I
., Web
Metafile
server
GET:audio/videofIle
'-
Media'"
player
RESPONSE .-
--
ThirdApproach:UsingaMediaServer
Theproblemwiththesecondapproach isthatthebrowserandthemediaplayerboth
usetheservicesofHTIP.
HTIPisdesignedtorunover TCP.Thisisappropriatefor
retrievingthemetafile,butnotforretrievingtheaudio/videofile.Thereasonisthat
TCPretransmitsalostordamagedsegment,whichiscountertothephilosophyof
streaming.
WeneedtodismissTCPanditserror
control~weneedtouse UDP.How­
ever,HTTP,whichaccessesthe Webserver,andtheWebserveritselfaredesignedfor
TCP;weneedanotherserver,a
mediaserver.Figure 29.12showstheconcept.
1.TheHTTPclientaccessesthe WebserverbyusingaGETmessage.
2.Theinformationaboutthemetafilecomesintheresponse.
Figure29.12
Usingamediaserver
Clientmachine
[J
~
Servermachine
i
l- GET:metafile
'U'
Web
Browser
RESPONSE ....
server
-
4'
Metafile
GET:audio/videofile
I-.
Media
~
Media
player
RESPONSE
-
server

SECTION29.3STREAMINGSTOREDAUDIOIVIDEO 911
3.Themetafileispassedtothemediaplayer.
4.ThemediaplayerusestheURLinthemetafiletoaccessthemediaservertodown­
loadthefile.Downloadingcantakeplacebyanyprotocolthatuses
UDP.
5.Themediaserverresponds.
FourthApproach:UsingaMediaServer andRTSP
TheReal-Time StreamingProtocol(RTSP)isacontrolprotocoldesignedtoaddmore
functionalitiestothestreamingprocess.UsingRTSP,wecancontroltheplaying
of
audio/video.RTSP isanout-of-bandcontrolprotocolthat issimilartothesecondcon­
nectionin
FTP.Figure29.13showsamediaserverand RTSP.
Figure29.13Usingamediaserver andRTSP
Clientmachine
a
GET:metafile
Browser
RESPONSE
Metafile
SETUP
RESPONSE
PLAY
Media
player
RESPONSE
Servermachine
i
Web
server
Media
server
1.TheHTTPclientaccessestheWebserverbyusingaGETmessage.
2.Theinformationaboutthemetafilecomesintheresponse.
3.Themetafileispassedtothemediaplayer.
4.ThemediaplayersendsaSETUPmessagetocreateaconnectionwiththemedia
server.
5.Themediaserverresponds.
6.ThemediaplayersendsaPLAYmessagetostartplaying(downloading).
7.Theaudio/videofileisdownloadedbyusinganotherprotocolthatrunsover UDP.

912 CHAPTER 29MULTIMEDIA
8.TheconnectionisbrokenbyusingtheTEARDOWN message.
9.Themediaserverresponds.
Themediaplayercansendothertypes
ofmessages.Forexample,aPAUSEmessage
temporarilystopsthedownloading;downloadingcanberesumedwithaPLAYmessage.
29.4STREAMINGLIVEAUDIONIDEO
Streamingliveaudio/videoissimilartothebroadcasting ofaudioandvideobyradio
and
TVstations.Instead ofbroadcastingtotheair,thestationsbroadcastthrough
theInternet.Thereareseveralsimilaritiesbetweenstreamingstoredaudio/videoand
streamingliveaudio/video. Theyarebothsensitivetodelay;neithercanacceptretrans­
mission.However,thereisadifference.Inthefirstapplication,thecommunicationis
unicastandon-demand.Inthesecond,thecommunicationismulticastandlive.Live
streamingisbettersuitedtothemulticastservicesofIPandtheuse
ofprotocolssuch as
UDPandRTP(discussedlater).However,presently,livestreamingisstillusingTCP
andmultipleunicastinginsteadofmulticasting.Thereisstillmuchprogresstobemade
inthisarea.
29.5REAL-TIMEINTERACTIVEAUDIONIDEO
Inreal-timeinteractiveaudio/video,peoplecommunicatewithoneanotherinrealtime.
TheInternetphoneorvoiceoverIPisanexample
ofthistypeofapplication.Video
conferencingisanotherexamplethatallowspeopletocommunicatevisuallyandorally.
Characteristics
Beforeaddressingtheprotocolsusedinthisclassofapplications,wediscusssome
characteristicsofreal-timeaudio/videocommunication.
TimeRelationship
Real-timedataonapacket-switchednetworkrequirethepreservation ofthetime
rela­
tionshipbetweenpackets ofasession.Forexample,let usassumethatareal-timevideo
servercreateslivevideoimagesandsendsthemonline.Thevideoisdigitizedand
packetized.Thereareonlythree packets,andeachpacketholds
lOsofvideoinforma­
tion.Thefirstpacketstartsat00:00:00,thesecondpacketstartsat00:00:
10,andthe
thirdpacketstartsat00:00:20.Alsoimaginethat
ittakes1 s(anexaggerationforsim­
plicity)foreachpackettoreachthedestination(equaldelay).Thereceivercanplay
backthefirstpacketat00:00:01,thesecondpacketat00:00:11,andthethirdpacketat
00:00:21.AlthoughthereisaI-stimedifferencebetweenwhattheserversendsand
whattheclientseesonthecomputerscreen,theactionishappening
inrealtime.The
timerelationshipbetweenthepacketsispreserved.TheI-sdelayisnotimportant.Fig­
ure29.14showstheidea.

SECTION29.5REAL-11MEINTERACTIVEAUDIOIVIDEO 913
Figure29.14 Timerelationship
Server
ClientIIliiIIIl
r-
c;::;:w]
Internet ~
-
00.00.01
00.00.00
Firstpacket
00.00.11
00.00.10
'"en
Secondpacket
0
0 ('f)
t"")
00.00.21
00.00.31
Arriveandplaytime Sendtime
Butwhathappens ifthepacketsarrivewithdifferentdelays?Forexample,saythe
firstpacketarrivesat00:00:01
(l-sdelay),thesecondarrivesat00:00: 15(5-sdelay),
andthethirdarrivesat00:00:27(7-sdelay).
Ifthereceiverstartsplayingthefirstpacket
at00:00:01,itwillfinishat00:00:11.However,thenextpackethasnotyetarrived;it
arrives4 slater.Thereisagapbetweenthefirstandsecondpacketsandbetweenthe
secondandthethirdasthevideoisviewedattheremotesite.Thisphenomenon
iscalled
jitter.Figure29.15showsthesituation.
Jitterisintroducedinreal-timedatabythedelaybetweenpackets.
Figure29.15 Jitter
--
Server
Internet
Client
r-
00.00.01~ -IOO.OO.OO
Firstpacket
00.00.30
00.00.20
Secondpacket
00.00.37
00.00.27
1:==========::::::====-,00.00.10
00.00.15
Arriveandplaytime Sendtime
Timestamp
Onesolutiontojitteristheuse ofatimestamp.Ifeachpackethasatimestampthat
showsthetimeitwasproducedrelativetothefirst(orprevious)packet,thenthereceiver

914 CHAPTER 29MULTIMEDIA
canaddthistime tothetimeatwhichitstartstheplayback.Inotherwords,thereceiver
knowswheneachpacketistobeplayed.Imaginethefirstpacketinthepreviousexample
hasatimestamp
of0,thesecondhasatimestampof10,andthethirdhasatimestamp of
20.Ifthereceiverstartsplayingback thefirstpacketat00:00:08,thesecondwillbe
playedat00:00:
18andthethirdat00:00:28.Therearenogapsbetweenthepackets.
Figure29.16showsthesituation.
Figure29.16
Timestamp
Server
Client
Internet
00.00.01l------------100.00.00
Firstpacket(0)
00.00.30
00.00.20
Flow
Secondpacket
(10)
00.00.37
00.00.27
C===============~I 00.00.10
00.00.15
00.00.28
00.00.38
00.00.18
00.00.08
Playtime Arrivetime Sendtime
Topreventjitter, wecantime-stampthepackets and
separatethearrivaltimefromtheplaybacktime.
PlaybackBuffer
Tobeabletoseparatethearrivaltimefromtheplaybacktime, weneedabuffertostore
thedatauntiltheyareplayedback.Thebufferisreferredto
asaplaybackbuffer.
Whenasessionbegins(thefirstbit
ofthefirstpacketarrives),thereceiverdelaysplaying
thedatauntilathresholdisreached.Inthepreviousexample,thefirstbit
ofthefirst
packetarrivesat00:00:01;thethresholdis7
s,andtheplaybacktimeis00:00:08.The
thresholdismeasuredintimeunits
ofdata.Thereplaydoesnotstartuntilthetimeunits
ofdataareequaltothethresholdvalue.
Dataarestoredinthebufferatapossiblyvariablerate,buttheyareextracted
andplayedbackatafixedrate.Notethattheamount
ofdatainthebuffershrinksor
expands,butaslongasthedelayislessthanthetimetoplaybackthethresholdamount
ofdata,thereisnojitter.Figure29.17showsthebufferatdifferenttimesforour
example.
Ordering
Inadditiontotimerelationshipinformationandtimestampsforreal-timetraffic,one
morefeature
isneeded.Weneedasequencenumberforeachpacket.Thetimestamp
alonecannotinformthereceiverifapacketislost.Forexample,supposethetimestamps

SECTION29.5REAL-TIMEINTERACTIVEAUDIOIVIDEO 915
Figure29.17Playback buffer
Attime00:00:08
Arrival" j"PlaYbaCk

7
.[
Attime00:00:18
Arrival" I"Playback

3
·1
Attime00:00:28
Arrival" I"PlaYbaCk
~
Aplaybackbufferisrequiredforreal-timetraffic.
are0,10,and20. Ifthesecondpacket islost,thereceiverreceivesjusttwopacketswith
timestamps0and20.Thereceiverassumesthatthepacketwithtimestamp20isthe
secondpacket,produced20safterthefirst.Thereceiverhasnoway
ofknowingthat
thesecondpackethasactuallybeenlost.Asequencenumbertoorderthepacketsis
neededtohandlethissituation.
Asequencenumberoneachpacket isrequiredforreal-timetraffic.
Multicasting
Multimediaplayaprimaryroleinaudioandvideoconferencing.Thetrafficcanbeheavy,
andthedataaredistributedbyusingmulticastingmethods.Conferencingrequirestwo­
waycommunicationbetweenreceiversandsenders.
Real-timetrafficneedsthesupport ofmulticasting.
Translation
Sometimesreal-timetrafficneedstranslation.Atranslatorisacomputerthatcanchange
theformat
ofahigh-bandwidthvideosignaltoalower-qualitynarrow-bandwidthsignal.
This
isneeded,forexample,forasourcecreatingahigh-qualityvideosignalat5Mbps
andsending
toarecipienthavingabandwidth oflessthan1Mbps. Toreceivethesignal,
atranslatorisneededtodecodethesignalandencodeitagainatalowerqualitythat
needslessbandwidth.

916 CHAPTER 29MULTIMEDIA
Translationmeanschangingtheencodingofapayloadtoalowerquality
tomatchthebandwidthofthereceivingnetwork.
Mixing
Ifthereismorethan onesourcethat cansenddataatthesametime(as inavideoor
audioconference),thetrafficismade ofmultiplestreams.Toconvergethetraffictoone
stream,datafromdifferentsources
canbemixed.A mixermathematicallyaddssignals
comingfromdifferentsourcestocreate onesinglesignal.
Mixingmeanscombiningseveralstreams
oftrafficintoonestream.
SupportfromTransportLayerProtocol
Theprocedures mentionedintheprevioussectionscanbeimplementedintheapplication
layer.However,theyaresocommoninreal-timeapplicationsthatimplementationinthe
transportlayerprotocolispreferable.Let'sseewhich
oftheexistingtransport layersis
suitableforthistype
oftraffic.
TCPisnotsuitableforinteractivetraffic.Ithasnoprovisionfortime-stamping,and
itdoesnotsupportmulticasting.However, itdoesprovideordering(sequencenumbers).
Onefeature
ofTCPthatmakesitparticularlyunsuitableforinteractivetrafficisitserror
controlmechanism.
Ininteractivetraffic, wecannotallowtheretransmission ofalostor
corruptedpacket. Ifapacketislost orcorruptedininteractivetraffic,itmustbeignored.
Retransmissionupsetsthewhole
ideaoftime-stampingandplayback.Todaythere isso
muchredundancyinaudioandvideosignals(evenwithcompression)that
wecansimply
ignorealostpacket.
Thelistenerorviewerattheremotesitemaynotevennoticeit.
TCP,with
allitssophistication,isnotsuitableforinteractivemultimedia
trafficbecause
wecannotallowretransmission ofpackets.
UDPismoresuitableforinteractivemultimediatraffic. UDPsupportsmulticasting
andhasnoretransmissionstrategy.However,
UDPhasnoprovisionfortime-stamping,
sequencing,
ormixing.A newtransportprotocol,Real-timeTransportProtocol(RTP),
providesthesemissingfeatures.
UDP
ismoresuitablethanTCPforinteractivetraffic.However, weneedtheservices
ofRTP,another transportlayerprotocol,tomake upforthedeficienciesof UDP.
29.6RTP
Real-timeTransportProtocol(RTP) istheprotocoldesignedtohandlereal-timetraffic
ontheInternet.RTPdoesnothaveadeliverymechanism(multicasting,portnumbers,
andsoon);itmustbeusedwithUDP. RTPstandsbetweenUDPandtheapplication

SECTION29.6RTP 917
program.Themaincontributions ofRTParetime-stamping,sequencing,andmixing
facilities.Figure29.18showstheposition
ofRTPintheprotocolsuite.
Figure29.18RTP
I
.Motion
IPEG
•••
I
MPEG2
video
IP
MPEGI
video
MPEG
audio
UDP
I
~-~--
~
"
UnderlyingLANorWAN
technology
N<lWmkl
layer
Physical
layer
Data
link
layer
Transport
layer
Application
GeMIH261I
layer
'---------'
RTPPacketFormat
Figure29.19showstheformat oftheRTPpacketheader.Theformat isverysimple
andgeneralenoughtocoverallreal-timeapplications.
Anapplicationthatneeds
moreinformationaddsittothebeginning
ofitspayload.Adescription ofeachfield
follows.
OVer.This2-bitfielddefinestheversionnumber.Thecurrentversionis 2.
Figure29.19RTPpacketheaderformat
veriplxl
;~~~IMI
Payloadtype
I
Sequencenumber
Timestamp
Synchronizationsourceidentifier
Contributoridentifier
·•

.
Contributoridentifier

918 CHAPTER 29MULTIMEDIA
oP.ThisI-bitfield, ifsetto1,indicatesthepresence ofpaddingattheend ofthe
packet.Inthiscase,thevalue
ofthelastbyteinthepaddingdefinesthelength of
thepadding.Paddingisthenorm ifapacketisencrypted.Thereisnopadding if
thevalueofthePfieldis O.
oX.ThisI-bitfield,ifsetto1,indicatesanextraextensionheaderbetweenthe
basicheaderandthedata.Thereisnoextraextensionheader
ifthevalueofthis
fieldis
O.
oContributorcount. This4-bitfieldindicatesthenumber ofcontributors.Notethat
wecanhaveamaximum
of15contributorsbecausea4-bitfieldonlyallowsanum­
berbetween0and15.
oM.ThisI-bitfieldisamarkerusedbytheapplicationtoindicate,forexample,the
end
ofitsdata.
oPayloadtype. This7-bitfieldindicatesthetype ofthepayload.Severalpayload
typeshavebeendefinedso
far.WelistsomecommonapplicationsinTable29.1.
Adiscussion
ofthetypesisbeyondthescope ofthisbook.
Table29.1 Payloadtypes
TypeApplicationTypeApplicationTypeApplication
a
PCMj.lAudio 7 LPCaudio 15G728audio
1 1016 8 PCMAaudio26MotionJPEG
2 G721audio
9 G722audio 31H.261
3 GSMaudio 10-11L16audio 32MPEGIvideo
5-6DV14audio 14 MPEGaudio 33MPEG2video
oSequencenumber. Thisfieldis16bitsinlength. ItisusedtonumbertheRTP
packets.Thesequencenumber
ofthefirstpacketischosenrandomly; itisincre­
mentedby1foreachsubsequentpacket.Thesequencenumber
isusedbythe
receivertodetectlostorout-of-orderpackets.
oTimestamp.Thisisa32-bitfieldthatindicatesthetimerelationshipbetween
packets.Thetimestampforthefirstpacketisarandomnumber.Foreachsucceeding
packet,thevalueisthesum
oftheprecedingtimestampplusthetimethefirstbyte
isproduced(sampled).Thevalue
oftheclocktickdependsontheapplication.For
example,audioapplicationsnormallygeneratechunks
of160bytes;theclocktick
forthisapplicationis160.Thetimestampforthisapplicationincreases160for
eachRTPpacket.
oSynchronizationsourceidentifier. Ifthereisonlyonesource,this32-bitfield
definesthesource.However,
ifthereareseveralsources,themixeristhesynchroni­
zationsourceandtheothersourcesarecontributors.Thevalue
ofthesourceidentifier
isarandomnumberchosenbythesource.Theprotocolprovidesastrategyincase
of
conflict(twosourcesstartwiththesamesequencenumber).
oContributoridentifier. Eachofthese32-bitidentifiers(amaximum of15)defines
asource.Whenthereismorethanonesourceinasession,themixeristhesynchro­
nizationsourceandtheremainingsourcesarethecontributors.

SECTION29.7RTCP 919
UDPPort
AlthoughRTPisitselfatransportlayerprotocol,theRTPpacketisnotencapsulated
directlyinanIPdatagram.Instead,RTPistreatedasanapplicationprogram
andis
encapsulatedina
UDPuserdatagram.However,unlikeotherapplicationprograms,no
well-knownportisassignedtoRTP.Theportcan
beselectedondemandwithonlyone
restriction:
Theportnumbermustbeanevennumber.Thenextnumber(an oddnumber)
isused
bythecompanionofRTP,Real-timeTransportControlProtocol(RTCP).
RTPusesatemporaryeven-numberedUDPport.
29.7RTCP
RTPallowsonlyonetype ofmessage,onethatcarriesdatafromthesourcetothedesti­
nation.Inmanycases,thereisaneedforothermessagesinasession.Thesemessages
controltheflowandquality
ofdataandallowtherecipienttosendfeedbacktothesource
orsources.Real-timeTransportControlProtocol(RTCP) isaprotocoldesignedfor
thispurpose.RTCPhasfivetypes
ofmessages,asshowninFigure29.20. Thenumber
nexttoeachboxdefinesthetype
ofthemessage.
Figure29.20 RTCPmessagetypes
---i
Senderreport
1
200
---i
Receiverreport
1
201
RTCP
I
Sourcedescriptionmessage
1
202
messagetypes
I ---i
Byemessage
1
203
Application-specificmessage
1
204
SenderReport
Thesenderreportissentperiodicallybytheactivesenders inaconferencetoreport
transmissionandreceptionstatisticsforallRTPpacketssentduringtheinterval.
The
senderreportincludesanabsolutetimestamp,whichisthenumberofseconds
elapsedsincemidnightonJanuary1,1970.Theabsolutetimestampallowsthe
receivertosynchronizedifferentRTPmessages. Itisparticularlyimportantwhen
bothaudioandvideoare transmitted(audioandvideotransmissions useseparate
relativetimestamps).

920 CHAPTER 29MULTIMEDIA
ReceiverReport
Thereceiverreportisforpassiveparticipants,thosethatdo notsendRTPpackets. The
reportinfonnsthesenderandotherreceiversaboutthequality ofservice.
SourceDescriptionMessage
Thesourceperiodicallysendsasourcedescriptionmessagetogiveadditionalinfonna­
tionaboutitself.Thisinfonnation
canbethename,e-mailaddress,telephonenumber,
andaddress
ofthe ownerorcontrollerofthesource.
ByeMessage
Asourcesendsa byemessagetoshut downastream.Itallowsthesourcetoannounce
that
itisleavingtheconference. Althoughothersourcescandetect theabsenceofa
source,thismessageisadirectannouncement.
Itisalsoveryusefultoamixer.
Application-SpecificMessage
Theapplication-specificmessageisapacketfor anapplicationthatwantstousenew
applications
(notdefinedinthestandard). Itallowsthedefinitionofanewmessage
type.
UDPPort
RTCP,likeRTP,does notuseawell-known UDPport.Itusesatemporaryport. The
UDPportchosenmustbethe numberimmediatelyfollowingthe UDPportselectedfor
RTP.
Itmustbeanodd-numberedport.
RTCPuses
anodd-numberedUDP portnumberthat
followsthe portnumberselectedfor
RTP..
29.8VOICEOVER IP
Letusconcentrateononereal-timeinteractiveaudio/videoapplication: voiceoverIP,
orInternettelephony. TheideaistousetheInternetasatelephonenetworkwithsome
additionalcapabilities.Instead
ofcommunicatingoveracircuit-switchednetwork,this
applicationallowscommunicationbetweentwopartiesoverthepacket-switchedInternet.1\voprotocolshavebeendesignedtohandlethistype ofcommunication:SIPandH.323.
Webrieflydiscussboth.
SIP
TheSessionInitiationProtocol(SIP) wasdesigned byIETEItisanapplicationlayer
protocolthatestablishes,manages,andterminatesamultimediasession(call).
Itcanbe
usedtocreatetwo-party,multiparty,ormulticastsessions.SIPisdesignedto beindepen­
dentoftheunderlyingtransportlayer;itcan runonUDP,TCP, orSCTP.

SECTION29.8VOICEOVERIP 921
Messages
SIPisatext-basedprotocol,asisHTTP. SIP,likeHTTP,usesmessages.Sixmessages
aredefined,asshowninFigure29.21.
Figure29.21SIPmessages
SIP
messages
I
I I I I I I
INVITE ACK BYE OPTIONS CANCEL
I
REGISTERI
Eachmessagehasaheaderandabody.Theheaderconsists ofseverallinesthat
describethestructure
ofthemessage,caller'scapability,mediatype,andsoon. We
giveabriefdescription ofeachmessage.Thenweshowtheirapplicationsinasimple
session.
ThecallerinitializesasessionwiththeINVITEmessage.Afterthecalleeanswers
thecall,thecallersendsanACKmessageforconfirmation.TheBYEmessagetermi­
natesasession.TheOPTIONSmessagequeriesamachineaboutitscapabilities.The
CANCELmessagecancelsanalreadystartedinitializationprocess.TheREGISTER
messagemakesaconnectionwhenthecalleeisnotavailable.
Addresses
Inaregulartelephonecommunication,atelephonenumberidentifiesthesender,and
anothertelephonenumberidentifiesthereceiver.SIPisveryflexible.In
SIP,ane-mail
address,anIPaddress,atelephonenumber,andothertypes
ofaddressescanbeusedto
identifythesenderandreceiver.However,theaddressneedstobeinSIPformat(also
called
scheme).Figure29.22showssomecommonformats.
Figure29.22SIPformats
sip:[email protected]
11__siP_:_bo_b_@_fu_da_.e_d_u__11 sip:bob@408~864-8900 ·1
IPv4address E-mailaddress Phone number
SimpleSession
AsimplesessionusingSIPconsists ofthreemodules:establishing,communicating, and
terminating.Figure29.23showsasimplesessionusing
SIP.

922 CHAPTER 29MULTIMEDIA
Figure29.23 SIPsimplesession
Caller Callee
g- g-
INVITE:address,options
Oil
Q
:.E
.~
OK:address
~
'" Iu.l
ACK
.
I
I>/)
.5
~
u
'13
Exchangingaudio
='
S
S
0
u
I>/)
.S
~f-· .~." J I
.
l:: BYE
·s 1 I
....
~
EstablishingaSession EstablishingasessioninSIPrequiresathree-wayhandshake.
ThecallersendsanINVITEmessage,usingUDP,
TCP,orSCTPtobeginthecommuni­
cation.
Ifthecalleeiswillingtostartthesession,shesendsareplymessage. Toconfirm
thatareplycodehasbeenreceived,thecallersendsanACKmessage.
CommunicatingAfterthesessionhasbeenestablished,thecallerandthecalleecan
communicatebyusingtwotemporaryports.
TerminatingtheSession Thesessioncan beterminatedwithaBYEmessagesentby
eitherparty.
TrackingtheCallee
Whathappens ifthecalleeisnotsittingatherterminal?Shemaybeawayfromhersystem
oratanotherterminal.ShemaynotevenhaveafixedIPaddress
ifDHCPisbeingused.
SIPhasamechanism(similartooneinDNS)thatfindstheIPaddress
oftheterminalat
whichthecalleeissitting.
Toperformthistracking,SIPusestheconcept ofregistration.
SIPdefinessomeserversasregistrars.Atanymomentauser
isregisteredwithatleastone
registrarserver; thisserverknowsthe IPaddressofthecallee.
Whenacallerneedstocommunicatewiththecallee,thecallercanusethee-mail
addressinstead
oftheIPaddressintheINVITEmessage.Themessagegoestoaproxy
server.Theproxyserversendsalookupmessage(notpart
ofSIP)tosomeregistrar
serverthathasregisteredthecallee.Whentheproxyserverreceivesareplymessage
fromtheregistrarserver,theproxyservertakesthecaller'sINVITEmessageandinserts
thenewlydiscoveredIPaddress
ofthecallee.Thismessageisthensenttothecallee.
Figure29.24showstheprocess.

Figure29.24 Trackingthecallee
SECTION29.8VOICEOVERIP923
Caller
Proxyserver
INVITE
OK
ACK
~
Registrar
Lookup~
Reply
INVITE
OK
ACK
Callee--
Exchangingaudio
BYE
H.323
H.323isastandarddesignedby lTVtoallowtelephonesonthepublictelephone
networktotalktocomputers(called
terminalsinH.323)connectedtotheInternet.
Figure29.25showsthegeneralarchitecture
ofH.323.
Figure29.25H.323architecture
Gateway
~
t------!w::::LWJ1----(
E:::::J
-
AgatewayconnectstheInternettothetelephonenetwork.Ingeneral,agatewayis
afive-layerdevicethatcantranslateamessagefromoneprotocolstack
toanother.The

924 CHAPTER 29MULTIMEDIA
gatewayheredoesexactlythesamething. Ittransformsatelephonenetworkmessage to
anInternetmessage.Thegatekeeperserveronthelocalareanetworkplaystherole of
theregistrarserver, aswediscussedinthe SIP.
Protocols
H.323usesanumber ofprotocolstoestablishandmaintainvoice(orvideo)communica­
tion.Figure29.26showstheseprotocols.
Figure29.26
H.323protocols
@"
~'>
Compression
code
RTCP
H.225
RTP
IP
H.323usesG.71orG.723.1forcompression. ItusesaprotocolnamedH.245
whichallowstheparties
tonegotiatethecompressionmethod.ProtocolQ.931 isused
.forestablishingandterminatingconnections.AnotherprotocolcalledH.225, orRAS
(Registration!Administration!Status),isusedforregistrationwiththegatekeeper.
Operatio1l
Letusshowtheoperation ofatelephonecommunicationusingH.323withasimple
example.Figure29.27showsthestepsusedbyaterminaltocommunicatewitha
telephone.
1.Theterminalsendsabroadcastmessagetothegatekeeper.Thegatekeeperresponds
withitsIPaddress.
2.Theterminalandgatekeepercommunicate,usingH.225 tonegotiatebandwidth.
3.Theterminal,gatekeeper,gateway,andtelephonecommunicatebyusingQ.931 to
setupaconnection.
4.Theterminal,gatekeeper,gateway,andtelephonecommunicatebyusingH.245to
negotiatethecompressionmethod.
5.Theterminal,gateway,andtelephoneexchangeaudiobyusing RTPunderthe
management
ofRTCP.
6.Theterminal,gatekeeper,gateway,andtelephonecommunicatebyusingQ.931 to
terminatethecommunication.

SECTION29.10KEYTERMS 925
Figure29.27 H.323example
Tenninal
RTPforaudioexchange
RTCPformanagement
Gateway
Telephone
29.9RECOMMENDED READING
Formoredetailsaboutsubjectsdiscussedinthischapter,werecommendthefollowing
booksandsites.Theitemsinbrackets[
...]refertothereferencelistattheend ofthetext.
Books
Multimediacommunicationisdiscussedin[HalOl]andinSection7.4 of[Tan03].Image
andvideocompressionarefullydiscussedin[Dro02].
Sites
owww.ietf.org/rfc.htmlInfonnationaboutRFCs
29.10KEYTERMS
bidirectionalframe(B-frame)
compression
discretecosinetransform(DCT)
frequencymasking
gatekeeper
gateway
H.323
interactiveaudio/video
intracodedframe(I-frame)
jitter

926 CHAPTER 29MULTIMEDIA
JointPhotographicExpertsGroup(JPEG)
mediaplayer
mediaserver
metafile
mixer
MovingPictureExpertsGroup(MPEG)
MP3
multicasting
on-demandaudio/video
perceptualencoding
pixel
playbackbuffer
predictedframe(P-frame)
predictiveencoding
quantization
Real-TimeStreamingProtocol(RTSP)
real-timetraffic
Real-timeTransportControlProtocol
(RTCP)
Real-timeTransportProtocol(RTP)
registrarserver
SessionInitiationProtocol(SIP)
spatialcompression
streamingliveaudio/video
streamingstoredaudio/video
temporalcompression
temporalmasking
timestamp
translation
voiceoverIP
29.11SUMMARY
oAudio/videofilescanbedownloadedforfutureuse(streamingstoredaudio/video)
orbroadcasttoclientsovertheInternet(streamingliveaudio/video).TheInternet
canalso
beusedforliveaudio/videointeraction.
oAudioandvideoneedto bedigitizedbeforebeingsentovertheInternet.
oAudiofilesarecompressedthroughpredictiveencodingorperceptualencoding.
oJointPhotographicExpertsGroup(JPEG)isamethodtocompresspicturesand
graphics.
oTheJPEGprocessinvolvesblocking,thediscretecosinetransform,quantization,
andlosslesscompression.
oMovingPicturesExpertsGroup(MPEG)isamethodtocompressvideo.
oMPEGinvolvesbothspatialcompressionandtemporalcompression.Theformer
issimilartoJPEG,andthelatterremovesredundantframes.
oWecanuseaWebserver,oraWebserverwithametafile, oramediaserver, ora
mediaserverandRTSPtodownloadastreamingaudio/videofile.
oReal-timedataonapacket-switchednetworkrequirethepreservation ofthetime
relationshipbetweenpackets
ofasession.
oGapsbetweenconsecutivepacketsatthereceivercauseaphenomenoncalledjitter.
oJittercanbecontrolledthroughtheuse oftimestampsandajudiciouschoice ofthe
playbacktime.
DAplaybackbufferholdsdatauntiltheycanbeplayedback.
DAreceiverdelaysplayingbackreal-timedataheldintheplaybackbufferuntila
thresholdlevelisreached.

SECTION29.12PRACTICESET 927
oSequencenumbers onreal-timedatapacketsprovideaform oferrorcontrol.
oReal-timedataaremulticasttoreceivers.
oReal-timetrafficsometimesrequiresatranslatortochangeahigh-bandwidthsignal
toalower-qualitynarrow-bandwidthsignal.
oAmixer combinessignalsfromdifferentsourcesinto onesignal.
oReal-timemultimediatrafficrequiresboth UDPandReal-timeTransportProtocol
(RTP).
oRTPhandlestime-stamping,sequencing,andmixing.
oReal-timeTransportControlProtocol(RTCP)providesflowcontrol,quality ofdata
control,andfeedbacktothesources.
oVoiceover IPisareal-timeinteractiveaudio/videoapplication.
oTheSessionInitiationProtocol(SIP)isanapplicationlayerprotocol thatestablishes,
manages,andterminatesmultimediasessions.
oH.323isanITUstandardthatallowsatelephoneconnectedtoapublictelephone
networktotalktoacomputerconnectedtotheInternet.
29.12PRACTICESET
ReviewQuestions
1.Howdoesstreamingliveaudio/videodifferfromstreamingstoredaudio/video?
2.Howdoesfrequencymaskingdifferfromtemporalmasking?
3.Whatisthefunction ofametafileinstreamingstoredaudio/video?
4.
Whatisthepurpose ofRTSPinstreamingstoredaudio/video?
5.Howdoesjitteraffectreal-timeaudio/video?
6.DiscusshowSIPisused inthetransmissionofmultimedia.
7.WhenwouldyouuseJPEG? WhenwouldyouuseMPEG?
8.InJPEG,whatisthefunction ofblocking?
9.Whyisthe DCTneededinJPEG?
10.Whatisspatialcompressioncomparedtotemporalcompression?
Exercises
11.InFigure29.17whatistheamount ofdataintheplaybackbufferateach ofthe
followingtimes?
a.00:00:17
b.00:00:20
c.00:00:25
d.00:00:30
12.Compareandcontrast
TCPwithRTP.Arebothdoingthesamething?
13.Canwesay
UDPplusRTPisthesameas TCP?
14.WhydoesRTPneedtheservice ofanotherprotocol,RTCP,but TCPdoesnot?

928 CHAPTER 29MULTIMEDIA
15.InFigure29.12,cantheWebserverandmediaserverrunondifferentmachines?
16.Wediscusstheuse ofSIPinthischapterforaudio. Isthereanydrawbacktoprevent
usingitforvideo?
17.DoyouthinkH.323isactuallythesameasSIP?Whatarethedifferences?Makea
comparisonbetweenthetwo.
18.Whataretheproblemsforfullimplementation ofvoiceoverIP?Doyouthinkwe
willstopusingthetelephonenetworkverysoon?
19.Can
rI.323alsobeusedforvideo?
ResearchActivities
20.Findtheformat ofanRTCPsenderreport.Payparticularattentiontothepacket
lengthandthepartsrepeatedforeachsource.Describeeachfield.
21.Findtheformat
ofanRTCPreceiverreport.Payparticularattentiontothepacket
lengthandthepartsrepeatedforeachsource.Describeeachfield.
22.Findtheformat
ofanRTCPsourcedescription.Payparticularattentiontothe
packetlengthandthepartsrepeatedforeachsource.Describeeachfield.
23.Findthemeaning
ofthesourcedescriptionitemsusedintheRTCPsourcedescription
packet.Specifically,findthemeaning
ofCNAME,NAME,EMAIL,PHONE,LOC,
TOOL,NOTE,andPRIY.
24.FindtheformatofanRTCPbyemessage.Payparticularattentiontothepacketlength
andthepartsrepeatedforeachsource.Describeeachfield.

Security
Objectives
Noonecandenytheimportance ofsecurityindatacommunicationsandnetworking.
Securityinnetworkingisbasedoncryptography,thescienceandart
oftransforming
messagestomakethemsecureandimmunetoattack.Cryptographycanprovideseveral
aspects
ofsecurityrelatedtotheinterchange ofmessagesthroughnetworks.Theseaspects
areconfidentiality,integrity,authentication,andnonrepudiation.
Cryptographycanprovideconfidentiality,integrity,authentication,
andnonrepudiationofmessages.
Cryptographycanalsobeusedtoauthenticatethesenderandreceiver ofthemessage
toeachother.Forexample,auserwhoneedsaccesstotheresources
ofasystemmust
firstbeauthorized.Wecallthisaspectentityauthentication.
Cryptographycanalsoprovideentityauthentication.
Inthispart ofthebook,wefirstintroducecryptographywithoutdelvingintothe
mathematicalfoundations
ofthissubject.Wethenbrieflyexplore securityaspectsas
appliedtoanetwork.Finally,wediscusssomecommonprotocolsthatimplementsecurity
aspectsattheupperthreelayers
oftheInternetmodel.
Part7ofthebookisdevotedtodifferentsecurityaspects.
Chapters
Thispartconsists ofthreechapters:Chapters30, 31,and32.

Chapter30
Chapter30 isabriefdiscussion ofabroadtopiccalledcryptography.Althoughcryptography,
whichisbasedonabstractalgebra,canitselfbeacompletecourse,
weintroduceithere
brieflyandavoidreferencestoabstractalgebraasmuchaspossible.Wegivejustenough
backgroundinformationasafoundationforthematerialinthenexttwochapters.
Chapter31
Chapter31isanintroduction,andmotivation,forthebroadtopic ofnetworksecurity.
Wediscussselectedissuesthatareoftenencounteredwhendealingwithcommunications
andnetworkingproblems.
Chapter32
Chapter32brieflydiscussestheapplications oftopicsdiscussedinChapters 30and31
totheInternetmodel.Weshowhownetworksecurityandcryptographycanbeused in
threeupperlayers oftheInternetmodel.

CHAPTER30
Cryptography
Networksecurityismostlyachievedthroughtheuse ofcryptography,asciencebased
onabstractalgebra.Inthischapter,webrieflydiscussthecryptographysuitableforthe
scope
ofthisbook.Wehavetriedtolimitourdiscussion ofabstract algebraasmuchas
wecould.Ourgoalistogiveenoughinformationaboutcryptographytomakenetwork
securityunderstandable.Thechapteropensthedoorforstudyingnetworksecurityin
Chapter
31andInternetsecurityinChapter32.
30.1INTRODUCTION
Letusintroducetheissuesinvolved incryptography.First,weneedtodefinesometerms;
thenwegivesometaxonomies.
Definitions
Wedefinesometermsherethatareused intherestofthechapter.
Cryptography
Cryptography,awordwithGreekorigins,means"secretwriting."However,weusethe
termtorefertothescienceand
artoftransformingmessagestomakethemsecureand
immunetoattacks.Figure30.1showsthecomponentsinvolvedincryptography.
Figure30.1 Cryptographycomponents
Receiver
Plaintext
Encryption1------------+-1Decryption
Ciphertext
931

932 CHAPTER 30CRYPTOGRAPHY
PlaintextandCiphertext
Theoriginalmessage,beforebeingtransformed,iscalled plaintext.Afterthemessage
istransformed,itiscalled
ciphertext.Anencryptionalgorithm transformstheplain­
textintociphertext;a
decryptionalgorithm transformstheciphertextbackinto
plain­
text.Thesenderusesanencryptionalgorithm,andthereceiverusesadecryption
algorithm.
Cipher
Werefertoencryptionanddecryptionalgorithmsas ciphers.Theterm cipherisalso
usedtorefertodifferentcategories
ofalgorithmsincryptography.Thisisnottosay
thateverysender-receiverpairneedstheirveryownuniquecipherforasecurecommu­
nication.
Onthecontrary,oneciphercanservemillions ofcommunicatingpairs.
Key
Akeyisanumber(oraset ofnumbers)thatthecipher,asanalgorithm,operateson. To
encryptamessage,weneedanencryptionalgorithm,anencryption key,andtheplaintext.
Thesecreatetheciphertext.
Todecryptamessage,weneedadecryptionalgorithm,a
decryptionkey,andtheciphertext.Theserevealtheoriginalplaintext.
Alice,Bob, andEve
Incryptography,itiscustomarytousethreecharacters inaninformationexchange
scenario;weuseAlice,Bob,andEve.Aliceisthepersonwhoneedstosendsecure
data.Bobistherecipient
ofthedata.Eveisthepersonwhosomehowdisturbsthecom­
municationbetweenAliceandBobbyinterceptingmessagestouncoverthedataorby
sendingherowndisguisedmessages.Thesethreenamesrepresentcomputersorpro­
cessesthatactuallysend
orreceivedata, orinterceptorchangedata.
TwoCategories
Wecandivideallthecryptographyalgorithms(ciphers)intotwogroups:symmetric­
key(alsocalled
secret-key)cryptographyalgorithmsandasymmetric(alsocalled
public-key)cryptographyalgorithms.Figure30.2showsthetaxonomy.
Figure30.2 Categoriesofcryptography
Secret-key Public-key

SECTION30.1INTRODUCTION 933
Symmetric·KeyCryptography
Insymmetric-keycryptography,thesamekeyisusedbybothparties.Thesenderuses
thiskeyandanencryptionalgorithmtoencryptdata;thereceiverusesthesamekeyand
thecorrespondingdecryptionalgorithmtodecryptthedata(seeFigure30.3).
Figure30.3 Symmetric-keycryptography
Sharedsecretkey
1--
-------------11---------------I
1 I
1 I
l t
I------------~ Decryption
L............__-' Ciphertext
Bob
r
--
Plaintext
Insymmetric·keycryptography,thesamekeyisusedbythesender
(forencryption)
andthereceiver(fordecryption).
Thekey
isshared.
Asymmetric-KeyCryptography
Inasymmetricorpublic-keycryptography,therearetwokeys:aprivatekeyandapublic
key.The
privatekey iskeptbythereceiver.The publickey isannouncedtothepublic.
InFigure30.4,imagineAlicewantstosendamessagetoBob.Aliceusesthepublickey
toencryptthemessage.WhenthemessageisreceivedbyBob,theprivatekeyisusedto
decryptthemessage.
Figure30.4 Asymmetric-keycryptography
Tothepublic
1A
I 1
_________________________1::.:.=_=_=_=_=::::jBob'spublickey
....-----tBob'sprivatekey
y
Encryption1-----~-----+1 Decryption
Ciphertext
Bob
r
Plaintext
Inpublic-keyencryption/decryption,thepublickeythatisusedforencryptionis
differentfromtheprivatekeythatisusedfordecryption.Thepublickey isavailableto
thepublic;'theprivatekeyisavailableonlytoanindividual.

934 CHAPTER30CRYPTOGRAPHY
ThreeTypes ofKeys
Thereadermayhavenoticedthatwearedealingwiththreetypes ofkeysincryptography:
thesecretkey,thepublickey,andtheprivatekey.Thefirst,thesecretkey,
istheshared
keyusedinsymmetric-keycryptography.The
secondandthethirdarethepublic
andprivatekeysusedinasymmetric-keycryptography.
Wewillusethreedifferenticons
forthesekeysthroughoutthebooktodistinguishonefromtheothers,asshownin
Figure30.5.
Figure30.5 Keysusedincryptography
I
Secretkey
Symmetric-keycryptography
PublickeyPrivatekey
Asynunetric-keycryptography
Comparison
Letuscomparesymmetric-keyandasymmetric-keycryptography.Encryptioncanbe
thought
ofaselectroniclocking;decryptionaselectronicunlocking.Thesenderputs
themessageinaboxandlockstheboxbyusingakey;thereceiverunlocksthebox
withakeyandtakesoutthemessage.Thedifferenceliesinthemechanism
ofthe locking
andunlockingandthetype
ofkeysused.
Insymmetric-keycryptography,the
samekeylocksandunlocksthebox. In
asymmetric-keycryptography,onekeylocksthebox,butanotherkeyisneededto
unlockit.Figure30.6showsthedifference.
Figure30.6 Comparisonbetweentwocategories ofcryptography
Alice
Ciphertext
a.Symmetric-key
cryptography
Alice
Ciphertext
b.Asymmetric-key
cryptography

SECTION30.2SYMMETRIC-KEY CRYPTOGRAPHY 935
30.2SYMMETRIC-KEY CRYPTOGRAPHY
Symmetric-keycryptographystartedthousands ofyearsagowhenpeopleneededto
exchangesecrets(forexanlple,inawar).
Westillmainlyusesymmetric-keycryptography
inournetworksecurity.However,today'sciphersaremuchmorecomplex.Letusfirst
discusstraditionalalgorithms,whichwerecharacter-oriented.Thenwediscussthemodem
ones,whicharebit-oriented.
TraditionalCiphers
Webrieflyintroducesometraditionalciphers,whicharecharacter-oriented.Although
these arenowobsolete,thegoalistoshowhowmodernciphersevolvedfromthem.We
candividetraditionalsymmetric-keyciphersintotwobroadcategories:substitution
ciphersandtranspositionciphers,
asshowninFigure30.7.
Figure30.7 Traditionalciphers
Transposition
ciphers
SubstitutionCipher
Asubstitutionciphersubstitutesonesymbolwithanother. Ifthesymbolsintheplain­
textarealphabeticcharacters,wereplaceonecharacterwithanother.Forexample,we
canreplacecharacterAwithD,andcharacterTwithZ.
Ifthesymbolsaredigits(0to
9),wecanreplace3with7,and2with
6.Substitution cipherscanbecategorizedas
eithermonoalphabeticorpolyalphabeticciphers.
Asubstitutioncipherreplacesonesymbolwithanother.
Inamonoalphabeticcipher, acharacter(orasymbol)intheplaintextisalways
changedtothesamecharacter(orsymbol)intheciphertextregardless
ofitspositionin
thetext.Forexample,
ifthealgorithmsaysthatcharacterAintheplaintextischanged
tocharacterD,everycharacterAischangedtocharacter
D.Inotherwords,therelation­
shipbetweencharactersintheplaintextandtheciphertext
isaone-to-onerelationship.
Inapolyalphabeticcipher, eachoccurrence ofacharactercanhaveadifferent
substitute.Therelationshipbetweenacharacterintheplaintexttoacharacter
inthe

936 CHAPTER30CRYPTOGRAPHY
ciphertextisaone-to-manyrelationship.Forexample,characterAcouldbechangedto
Dinthebeginning
ofthetext,butitcouldbechangedtoNatthemiddle. Itisobvious
that
iftherelationshipbetweenplaintextcharactersandciphertextcharactersisone-to­
many,thekeymusttelluswhich
ofthemanypossiblecharacterscanbechosenfor
encryption.
Toachievethisgoal,weneedtodividethetextintogroups ofcharacters
anduseaset
ofkeys.Forexample,wecandividethetext"THISISANEASYTASK"
intogroups
of3charactersandthenapplytheencryptionusingaset of3keys.Wethen
repeattheprocedureforthenext3characters.
Example30.1
Thefollowingshowsaplaintextanditscorrespondingciphertext.Istheciphermonoalphabetic?
Plaintext:HELLO
Ciphertext:
KHOOR
Solution
Thecipherisprobablymonoalphabeticbecausebothoccurrences ofL'sareencryptedasO's.
Example30.2
Thefollowingshowsaplaintextanditscorrespondingciphertext.Istheciphermonoalphabetic?
Plaintext:HELLO
Ciphertext:ABNZF
Solution
Thecipherisnotmonoalphabeticbecauseeachoccurrence ofLisencryptedbyadifferentchar­
acter.ThefirstLisencrypted
asN;the secondasZ.
ShiftCipherThesimplestmonoalphabeticcipherisprobablytheshiftcipher. We
assumethattheplaintextandciphertextconsist ofuppercaseletters (AtoZ)only.In
thiscipher,theencryptionalgorithmis"shift
keycharactersdown,"with keyequalto
somenumber.Thedecryptionalgorithmis"shift keycharactersup."Forexample, ifthe
key
is5,theencryptionalgorithmis"shift5charactersdown"(towardtheend ofthe
alphabet).Thedecryptionalgorithmis"shift5charactersup"(towardthebeginning
of
thealphabet).Ofcourse,ifwereachtheendorbeginning ofthealphabet,wewrap
around.
JuliusCaesarusedtheshiftcipher
tocommunicatewithhisofficers.Forthisreason,
theshiftcipherissometimesreferredto
astheCaesarcipher.Caesarusedakey of3
forhiscommunications.
TheshiftcipherissometimesreferredtoastheCaesarcipher.
Example30.3
Usetheshiftcipherwithkey =15toencryptthemessage"HELLO."

SECTION30.2SYMMETRIC-KEYCRYPTOGRAPHY 937
Solution
Weencryptonecharacteratatime.Eachcharacterisshifted 15charactersdown.LetterHis
encrypted
toW.LetterEisencryptedto T.ThefirstLisencryptedtoA.ThesecondLisalso
encrypted
toA.And0isencryptedtoD.TheciphertextisWTAAD.
Example30.4
Usetheshiftcipherwithkey =15todecryptthemessage"WTAAD."
Solution
Wedecryptonecharacteratatime.Eachcharacterisshifted 15charactersup.LetterWis
decryptedtoH.LetterTisdecryptedtoE.ThefirstAisdecryptedto
L.ThesecondAis
decryptedto
L.And,finally,Disdecryptedto O.TheplaintextisHELLO.
TranspositionCiphers
Inatranspositioncipher, thereisnosubstitution ofcharacters;instead,theirlocations
change.Acharacterinthefirstposition
oftheplaintextmayappearinthetenthposition
oftheciphertext.Acharacterintheeighthpositionmayappearinthefirstposition.In
otherwords,atranspositioncipherreordersthesymbolsinablock
ofsymbols.
Atranspositioncipherreorders(permutes)symbols inablockofsymbols.
KeyInatranspositioncipher,thekeyisamappingbetweentheposition ofthesymbols
intheplaintextandciphertext.Forexample,thefollowingshowsthekeyusingablock
offourcharacters:
Plaintext:
Ciphertext:2 4 1 3
1234
Inencryption,wemovethecharacteratposition2toposition 1,thecharacterat
position4
toposition2,andsoon.Indecryption,wedothereverse.Notethat,to be
moreeffective,thekeyshouldbelong,whichmeansencryptionanddecryption oflong
blocks
ofdata.Figure30.8showsencryptionanddecryptionfor ourfour-character
Figure30.8 Transpositioncipher
Plaintext
(block) Key. Plaintext
(block)
I
"11234
111
...
+
11(rK
I ReorderI IReorder
I
(downwarddirection) (upwarddirection)
Encryption Decryption
Ciphertext(block)

938 CHAPTER 30CRYPTOGRAPHY
blockusingtheabove key.Thefigureshowsthattheencryptionanddecryptionusethe
same
key.Theencryptionappliesitfromdownwardwhiledecryptionappliesitupward.
Example30.5
Encryptthemessage"HELLOMYDEAR,"usingtheabovekey.
Solution
Wefirstremovethespacesinthemessage. Wethendividethetextintoblocks offourcharacters.
WeaddaboguscharacterZattheend ofthethirdblock.TheresultisHELLOMYDEARZ. We
createathree-blockciphertextELHLMDOYAZER.
Example30.6
UsingExample30.5,decryptthemessage"ELHLMDOYAZER".
Solution
TheresultisHELLOMYDEARZ.Afterremovingtheboguscharacterandcombiningthechar­
acters,wegettheoriginalmessage"HELLOMYDEAR."
SimpleModernCiphers
Thetraditionalcipherswehavestudiedsofararecharacter-oriented.Withtheadvent of
thecomputer,ciphersneedtobebit-oriented.Thisissobecausetheinformationtobe
encryptedisnotjusttext;itcanalsoconsist
ofnumbers,graphics,audio,andvideodata.
Itisconvenienttoconvertthesetypes ofdataintoastream ofbits,encryptthestream,
andthensendtheencryptedstream.Inaddition,whentextistreatedatthebitlevel,each
characterisreplacedby8(or16)bits,whichmeansthenumber
ofsymbolsbecomes8
(or16).Minglingandmanglingbitsprovidesmoresecuritythanminglingandmangling
characters.Modemciphersuseadifferentstrategythanthetraditionalones.Amodern
symmetriccipherisacombination
ofsimpleciphers.Inotherwords,amoderncipher
usesseveralsimplecipherstoachieveitsgoal.
Wefirstdiscussthesesimpleciphers.
XORCipher
Moderncipherstodayarenormallymade ofasetofsimpleciphers,whicharesimple
predefinedfunctionsinmathematicsorcomputerscience.Thefirstonediscussedhere
iscalledtheXORcipherbecauseitusestheexclusive-oroperation
asdefinedincomputer
science.Figure30.9showsanXORcipher.
Figure30.9
XORcipher

SECTION30.2SYMMETRIC-KEYCRYPTOGRAPHY 939
AnXORoperationneedstwodatainputsplaintext,asthefirstandakey asthesec­
ond.Inotherwords,one
oftheinputsistheblocktobetheencrypted,theotherinputis
akey;theresultistheencryptedblock.NotethatinanXORcipher,thesize
ofthekey,
theplaintext,andtheciphertextareallthesame.XORciphershaveaveryinteresting
property:theencryptionanddecryptionarethesame.
RotationCipher
Anothercommoncipher istherotationcipher, inwhichtheinputbitsarerotatedto
theleftorright.Therotationciphercanbekeyedorkeyless.Inkeyedrotation,thevalue
of
thekeydefinesthenumber ofrotations;inkeylessrotationthenumber ofrotationsisfixed.
Figure30.10showsanexample
ofarotationcipher.Notethattherotationciphercanbe
consideredaspecialcase
ofthetranspositionalcipherusingbitsinstead ofcharacters.
Figure30.10 Rotationcipher
Input
Output
Therotationcipherhasaninterestingproperty. Ifthelengthoftheoriginalstream
is
N,afterNrotations,wegettheoriginalinputstream.Thismeansthatitisuselessto
applymorethan
N-1rotations.Inotherwords,thenumber ofrotationsmustbebetween
1and
N-1.
Thedecryptionalgorithmfortherotationcipherusesthesamekeyandtheopposite
rotationdirection.
Ifweusearightrotationintheencryption,weusealeftrotationin
decryptionandviceversa.
SubstitutionCipher:S-box
AnS-box(substitutionbox)parallelsthetraditionalsubstitutioncipherforcharacters.
TheinputtoanS-boxisastream
ofbitswithlength N;theresultisanotherstream of
bitswithlength M.AndNandMarenotnecessarilythesame.Figure30.11showsan
S-box.
TheS-boxisnormallykeylessandisusedasanintermediatestage
ofencryption
ordecryption.Thefunctionthatmatchestheinputtotheoutputmaybedefinedmathe­
maticallyorbyatable.
TranspositionCipher:P-box
AP-box(permutationbox)forbitsparallelsthetraditionaltranspositioncipherforchar­
acters.
Itperformsatranspositionatthebitlevel;ittransposesbits. Itcanbeimplemented

940 CHAPTER30CRYPTOGRAPHY
Figure30.11 S-box
S-box
Ninputbits
AfunctionthatmatchesNinputs
toMoutputs
Moutputbits
insoftwareorhardware,buthardwareisfaster.P-boxes,likeS-boxes,arenonnallykey­
less.
Wecanhavethreetypes ofpennutationsinP-boxes:thestraightpermutation,
expansionpermutation,
andcompressionpermutation asshowninFigure30.12.
Figure30.12
P-boxes:straight,expansion, andcompression
2 3 4 5
2
2
3
a.Straight
3
4 5
2 3 4 5
2 3
2
4
3
5
b.Expansion c.Compression
AstraightpermutationcipherorastraightP-boxhasthesamenumberofinputsas
outputs.Inotherwords,
ifthenumberofinputsis N,thenumberofoutputsisalso N.In
anexpansionpennutationcipher,thenumber
ofoutputportsisgreaterthanthenumber
ofinputports.Inacompressionpennutationcipher,thenumber ofoutputportsisless
thanthenumber
ofinputports.
ModernRoundCiphers
Theciphersoftodayarecalledroundciphersbecausetheyinvolvemultiplerounds,
whereeachroundisacomplexciphermadeup
ofthesimpleciphersthatwepreviously

SECTION30.2SYMMETRIC-KEYCRYPTOGRAPHY 941
described.Thekeyusedineachroundisasubsetorvariation ofthegeneralkeycalledthe
roundkey.
Ifthecipherhas Nrounds,akeygeneratorproduces Nkeys,
K
b
Kz,...,K
N
,
whereK
1
isusedinround 1,K
2
inround2,andsoon.
Inthissection,weintroducetwomodemsymmetric-keyciphers:DESandAES.
Theseciphersarereferredto
asblockciphers becausetheydividetheplaintextinto
blocksandusethesamekeytoencryptanddecrypttheblocks.DEShasbeenthede
factostandarduntilrecently.AESistheformalstandardnow.
DataEncryptionStandard(DES)
Oneexample ofacomplexblockcipheristhe DataEncryptionStandard(DES).DES
wasdesignedbyIBMandadoptedbytheU.S.governmentasthestandardencryption
methodfornonmilitaryandnonclassifieduse.Thealgorithmencryptsa64-bit plaintext
blockusinga
64-bitkey,asshowninFigure30.13.
Figure30.13 DES
64-bitplaintext
DES
I
Initialpermutation
I
r---------I---------~
I II
K
j
Round1 I~

I
I
I
II
K
2
Round2 p
Round
key
....
...-
• •
generator
• •

·
K
l6
I
L
Round16
I
~--------1t---------
I
Finalpermutation
I
,..
64-bitkey
64-bitciphertext
DEShastwotranspositionblocks(P-boxes)and 16complexroundciphers(theyare
repeated).Althoughthe16iterationroundciphersareconceptuallythesame,eachuses
adifferentkeyderivedfromtheoriginal
key.
Theinitialandfinalpermutationsarekeylessstraightpermutationsthatarethe
inverse
ofeachother.Thepermutationtakesa64-bitinputandpermutesthemaccording
topredefinedvalues.

942 CHAPTER30CRYPTOGRAPHY
Eachround ofDESisacomplexroundcipher,asshowninFigure30.14.Notethat
thestructure
oftheencryptionroundciphersisdifferentfromthat ofthedecryptionone.
Figure30.14
OneroundinDESciphers
K
j
(48bits)
a.Encryptionround b.Decryptionround
K;
(48bits)
DESFunctionTheheart ofDESistheDESfunction.TheDESfunctionappliesa
48-bitkeytotherightmost32bits
R
i
toproducea32-bitoutput.Thisfunctionismade
up
offouroperations:anXOR,anexpansionpermutation,agroup ofS-boxes,anda
straightpermutation,asshowninFigure30.15.
Figure30.15
DESfunction
R;
(32bits)
Function
S-boxes
XOR
~----...-K;(48bits)
32bits

SECTION30.2SYMMETRIC-KEYCRYPTOGRAPHY 943
TripleDES
CriticsofDEScontendthatthekeyistooshort. Tolengthenthekey, TripleDES or3DES
hasbeenproposedandimplemented.ThisusesthreeDESblocks,
asshowninFigure30.16.
Notethattheencryptingblockusesanencryption-decryption-encryptioncombination
of
DESs,whilethedecryptionblockusesadecryption-encryption-decryptioncombination.
Twodifferentversions of3DESareinuse:3DESwithtwokeysand3DESwiththreekeys.
Tomakethekeysize112bitsandatthesametimeprotectDESfromattackssuchasthe
man-in-the-middleattack,3DESwithtwokeyswasdesigned.
Inthisversion,thefirstand
thethirdkeysarethesame
(KeYl=KeY3)'Thishastheadvantageinthatatextencryptedby
asingleDESblockcanbedecryptedbythenew3DES.
WejustsetallkeysequaltoKeYl'
Manyalgorithmsusea3DEScipherwiththreekeys.Thisincreasesthesize
ofthekey
to
168bits.
Figure30.16 TripleDES
64-bitplaintext 64-bitplaintext
EncryptDES KeYl Decrypt DES KeYl
fil
tn
Q
DecryptDES KeY2
gs
EncryptDES KeY2.., ..,
15.. "S..
'I::
ESE-;
EncryptDES
KeY3
DecryptDES
KeY3
64-bitciphertext 64-bitciphertext
a.EncryptionTripleDES b.DecryptionTripleDES
AdvancedEncryptionStandard(AES)
TheAdvancedEncryptionStandard(AES)wasdesignedbecause DES'skeywastoo
small.AlthoughTripleDES
ODES)increasedthekeysize,theprocesswastooslow.
TheNationalInstituteofStandardsandTechnology(NIST) chosethe Rijndael
algorithm,namedafteritstwoBelgianinventors,VincentRijmenandJoanDaemen,
asthebasis
ofAES.AESisaverycomplexroundcipher.AESisdesignedwiththree
keysizes:128,192,or256bits.Table30.1showstherelationshipbetweenthedatablock,
number
ofrounds,andkeysize.
Table30.1 AESconfiguration
Size
ofDataBlock Number ofRounds KeySize
10 128bits
128bits
12 192bits
14 256bits

944 CHAPTER30CRYPTOGRAPHY
AEShasthreedifferentconfigurationswithrespect
tothenumberofroundsandkeysize.
Inthistext,wediscussjustthelO-round,12S-bitkeyconfiguration.Thestructureand
operation
oftheotherconfigurationsaresimilar.Thedifferenceliesinthekeygeneration.
ThegeneralstructureisshowninFigure30.17.Thereisaninitial
XORoperation
followedby10
roundciphers.Thelastroundisslightlydifferentfromthepreceding
rounds;itismissingoneoperation.
Althoughthe10iterationblocksarealmostidentical,eachusesadifferentkey
derivedfromtheoriginalkey.
Figure30.17AES
12S-bitplaintext
AES
+""
K
o
/
r--------------------,
iI
I~
K
1
Ronnd1
II
I

I
iI
I Round
II
K
2
key
Round2
Ii
generator
I
I
I
I
I
I
·
I
I
·
I
· ·I
·
I
·I
I
I
I
I
IiI
Round10 Il
K
IO
(slightlydifferent)
II
I
'------------
---______ 1
,r
12S-bitkey
l2S-bitciphertext
StructureofEachRoundEachround ofAES,exceptforthelast,isacipherwithfour
operationsthatareinvertible.Thelastroundhasonlythreeoperations.Figure30.18is
aflowchartthatshowstheoperationsineachround.Each
ofthefouroperationsusedin
eachroundusesacomplexcipher;thistopicisbeyondthescope
ofthisbook.
OtherCiphers
Duringthelasttwodecades,afewothersymmetricblockciphershavebeendesignedand
used.Most
oftheseciphershavesimilarcharacteristicstothetwocipherswediscussedin
thischapter(DESandAES).Thedifferenceisusuallyinthesize
oftheblockorkey,the
number
ofrounds,andthefunctionsused.Theprinciplesarethesame.Inordernotto
burdentheuserwiththedetails
oftheseciphers,wegiveabriefdescription ofeach.

SECTION30.2SYMMETRIC-KEYCRYPTOGRAPHY 945
Figure30.18 Structureofeachround
Roundi
SubByte
128-bitdata
Bytesubstitution
ShiftRow
Bytepermutation
MixCo1umn
~~~~IKi
1__ _ _ _ _ _ _ _ _ _ _ _ _ J
128-bitdata
IDEATheInternationalDataEncryptionAlgorithm(IDEA)wasdevelopedbyXuejia
LaiandJamesMassey.Theblocksizeis64andthekeysizeis128.
Itcanbeimple­
mentedinbothhardwareandsoftware.
BlowfishBlowfishwasdevelopedbyBruceSchneier.Theblocksizeis64andthe
keysizebetween32and448.
CAST-128CAST-128wasdevelopedbyCarlisleAdamsandStaffordTavares.
Itisa
Feistelcipherwith
16roundsandablocksizeof64bits;thekeysizeis128bits.
ReSRCSwasdesignedbyRonRivest. Itisafamilyofcipherswithdifferentblock
sizes,keysizes,andnumbers
ofrounds.
ModeofOperation
Amodeofoperationisatechniquethatemploysthemodernblockcipherssuch asDES
andAESthatwediscussedearlier(seeFigure30.19).
Figure30.19
Modesofoperationforblockciphers

946 CHAPTER30CRYPTOGRAPHY
ElectronicCodeBook
Theelectroniccodebook(ECB)mode isapurelyblockciphertechnique.Theplain­
textisdividedintoblocks
ofNbits.Theciphertextismade ofblocksofNbits.The
value
ofNdependsonthetype ofcipherused.Figure30.20showsthemethod.
Figure30.20
ECBmode
K
Pi:Plaintextblock i
C
i
:
Ciphertextblock i
Nbits
K
Wementionfourcharacteristics ofthismode:
1.Becausethekeyandtheencryption/decryptionalgorithmarethesame,equalblocks
intheplaintextbecomeequalblocksintheciphertext.Forexample,
ifplaintext
blocks
1,5,and9arethesame,ciphertextblocksI,5,and9arealsothesame.
Thiscanbeasecurityproblem;theadversarycanguessthattheplaintextblocks
arethesame
ifthecorrespondingciphertextblocksarethesame.
2.Ifwereordertheplaintextblock,theciphertextisalsoreordered.
3.Blocksareindependent ofeachother.Eachblockisencryptedordecryptedinde­
pendently.Aprobleminencryptionordecryption
ofablockdoesnotaffectother
blocks.
4.Anerrorinoneblockisnotpropagatedtootherblocks.
Ifoneormorebitsarecor­
ruptedduringtransmission,itonlyaffectsthebitsinthecorrespondingplaintext
afterdecryption.Otherplaintextblocksarenotaffected.Thisisarealadvantageif
thechannelisnotnoise-free.
CipherBlockChaining
Thecipherblockchaining(CBC)modetriestoalleviatesomeoftheproblemsinECB
byincludingthepreviouscipherblockinthepreparationofthecurrentblock.
Ifthecur­
rentblockis
i,thepreviousciphertextblockC
i
-1
isincludedintheencryption ofblocki.
Inotherwords,whenablock iscompletelyenciphered,theblock issent,butacopyofit
iskeptinaregister(aplacewheredatacanbeheld)tobeusedintheencryptionofthe
nextblock.Thereadermaywonderabouttheinitialblock.Thereis
nociphertextblock
beforethefirstblock.Inthiscase,aphonyblockcalledtheinitiationvector(IV)is
used.Boththesenderandreceiveragreeuponaspecificpredetermined
IV.Inother
words,theIVisusedinsteadofthenonexistent
CO,Figure30.21showstheCBCmode.
Thereadermaywonderaboutthedecryption.Doestheconfigurationshowninthe
figureguaranteethecorrectdecryption?
Itcanbeproventhatitdoes,butweleavethe
prooftoatextbookinnetworksecurity.

SECTION30.2SYMMETRIC-KEYCRYPTOGRAPHY 947
Figure30.21CBCmode
K
Initiated
,..--------''------.--.--"withIV
F,:Plaintextblocki
CiCiphertextblock i
IV:Initializationvector
Nbits
Initiated
with
IV
,------''------"
K
Thefollowingaresomecharacteristics ofCBC.
1.Eventhoughthekeyandtheencryption/decryptionalgorithmarethesame,equal
blocksintheplaintextdonot
becomeequalblocksintheciphertext. Forexample,
ifplaintextblocks 1,5,and9arethesame,ciphertextblocksI,5,and9will notbe
thesame.Anadversarywill notbeabletoguess fromtheciphertextthattwoblocks
arethesame.
2.Blocksaredependent oneachother.Eachblockisencryptedordecryptedbasedon
apreviousblock.A
probleminencryptionordecryptionofablockaffectsother
blocks.
3.Theerrorinone blockispropagatedtotheotherblocks. Ifoneormorebitsare
corruptedduringthetransmission,
itaffectsthebits inthenext blocksoftheplain­
textafterdecryption.
CipherFeedback
Thecipherfeedback(CFB)modewascreatedforthosesituationsinwhich weneed
tosendorreceiverbitsofdata,whererisanumberdifferentfromtheunderlying
blocksizeoftheencryptioncipherused. Thevalueofrcanbe1,4,8,orany numberof
bits.Sinceallblockciphers workonablockofdataatatime,theproblemis howto
encrypt
justrbits.Thesolutionisto letthecipherencrypta blockofbitsand useonly
thefirst
rbitsasanew key(streamkey)toencryptthe rbitsofuserdata.Figure30.22
showstheconfiguration.
Thefollowingaresomecharacteristics oftheCFBmode:
1.Ifwechangethe IVfromoneencryptiontoanotherusingthe sameplaintext,the
ciphertextisdifferent.
2.TheciphertextC
i
dependson bothPiandtheprecedingciphertextblock.
3.Errorsinone
ormorebitsoftheciphertextblockaffectthenextciphertextblocks.
OutputFeedback
Theoutputfeedback(OFB)modeisverysimilartotheCFB modewithonedifference.
Eachbitintheciphertextisindependent ofthepreviousbitorbits.Thisavoids error

948 CHAPTER 30CRYPTOGRAPHY
Figure30.22 CFBmode
N-bit
shiftregister
initiallyIV
rbits
Pi--~
rbits
- - - C
i
_1
p/Plaintextblocki
C
i
:
Ciphertextblock i
IV:Initializationvector
rbits
Actualkey
N-bit
shiftregister
initially
IV
rbits
---C
i
-1
propagation.Ifanerroroccursintransmission,itdoesnotaffectthefuturebits.Note
that,asinCFB,boththesenderandthereceiverusetheencryptionalgorithm.Note
alsothatinOFB,blockcipherssuchasDESorAEScanonlybeusedtocreatethekey
stream.Thefeedbackforcreatingthenextbitstreamcomesfromthepreviousbits
of
thekeystreaminstead oftheciphertext.Theciphertextdoesnottakepartincreating
thekeystream.Figure30.23showstheOFBmode.
Figure30.23 OFBmode
N-bit
shiftregister
initially
IV
Actualkey
rbits
Pi:Plaintextblock i
C
j
:Ciphertextblock i
IV:Initializationvector
K
N-bit
shiftregister
initiallyIV
Actualkey
rbits
rbits +rbits
Pi+}----------------+JPi
C
i
Thefollowingaresome ofthecharacteristicsoftheOFBmode.
1.IfwechangetheIVfromoneencryptiontoanotherusingthesameplaintext,the
ciphertextwillbedifferent.
2.TheciphertextC
idependsontheplaintext Pi'
3.Errorsinoneormorebits oftheciphertextdonotaffectfutureciphertextblocks.

SECTION30.3ASYMMETRIC-KEYCRYPTOGRAPHY 949
30.3ASYMMETRIC-KEY CRYPTOGRAPHY
Intheprevioussections,wediscussedsymmetric-keycryptography.Inthissectionwe
introduceasymmetric-key(publickeycryptography).As
wementionedbefore,anasymmetric-key(orpublic-key)cipherusestwokeys:oneprivateandonepublic. We
discusstwoalgorithms:RSAandDiffie-Hellman.
RSA
ThemostcommonpublickeyalgorithmisRSA,namedforitsinventorsRivest,Shamir,
andAdleman(RSA).Itusestwonumbers,eandd,asthepublicandprivatekeys,as
showninFigure30.24.
Figure30.24RSA
Topublici!i
, , I
I , I
,__L L __
J _
I
.~:
;;5,e
::>,
0-<,
,
Y
j
C=pemodn
Encryption
Ciphertext
Calculatinge,d,
mldn
p=Cemodn
Decryption
Bob
--
Plaintext
Thetwokeys, eandd,haveaspecialrelationshiptoeachother,adiscussion ofthis
relationshipisbeyondthescope
ofthisbook. Wejustshowhowtocalculatethekeys
withoutproof.
SelectingKeys
Bobusethefollowing stepstoselecttheprivateandpublickeys:
1.Bobchoosestwoverylargeprimenumbers pandq.Rememberthataprimenum­
berisonethatcanbedividedevenlyonlyby1anditself.
2.Bobmultipliestheabovetwoprimestofind n,themodulusforencryptionand
decryption.Inotherwords,
n:::pXq.
3.Bobcalculatesanothernumber
<1>:::(p-1)X(q-1).
4.Bobchoosesarandominteger e.Hethencalculates dsothatdxe:::1mod<1>.
5.Bobannounces eandntothepublic;hekeeps<1>anddsecret.
InRSA,eandnareannouncedtothepublic; dand<I>arekeptsecret.

950 CHAPTER30CRYPTOGRAPHY
Encryption
AnyonewhoneedstosendamessagetoBobcanuse nande.Forexample,ifAlice
needstosendamessagetoBob,shecanchangethemessage,usuallyashortone,toan
integer.Thisistheplaintext.Shethencalculatestheciphertext,usingeand
n.C=pt!(modn)
Alicesends C,theciphertext,toBob.
Decryption
Bobkeeps<panddprivate.Whenhereceivestheciphertext,heuseshisprivatekey dto
decryptthemessage:
P=Cd(modn)
Restriction
ForRSAtowork,thevalue ofPmustbelessthanthevalue ofn.IfPisalargenumber,
theplaintextneedstobedividedintoblockstomake
Plessthann.
Example30.7
Bobchooses7and 11aspandqandcalculates
n= 7 .11=77.Thevalue of<p=(7-1)(11- 1)
or60.Nowhechoosestwokeys, eandd.Ifhechoosesetobe13,then dis37.Nowimagine
Alicesendstheplaintext5toBob.Sheusesthepublickey
13toencrypt5.
Plaintext:
5
C=5
13
;::::26mod77
Ciphertext:26
Bobreceivestheciphertext26andusestheprivatekey37todeciphertheciphertext:
Ciphertext:26
P=26
37
=5mod77
Plaintext:5 Intendedm~agesentbY'Alice
Theplaintext5sentbyAliceisreceivedasplaintext5byBob.
Example30.8
Jennifercreatesapair ofkeysforherself.Shechooses p=397and q=401.Shecalculates n=
159,197and<p=396.400 =158,400.Shethenchooses e=343and d=12,007.ShowhowTed
cansendamessagetoJennifer
ifheknowseandn.
Solution
SupposeTedwantstosendthemessage "NO"toJennifer.Hechangeseachcharactertoanumber
(from00to25)witheachcharactercodedastwodigits.Hethenconcatenatesthetwocoded
charactersandgetsafour-digitnumber.Theplaintextis1314.Tedthenuses
eandntoencrypt
themessage.Theciphertextis1314
343
=33,677mod159,197.Jenniferreceivesthemessage

SECTION30.3ASYMMETRIC-KEYCRYPTOGRAPHY 951
33,677andusesthedecryptionkeydtodecipheritas33,677
12
,007=1314mod159,197.Jennifer
thendecodes1314asthemessage"NO".Figure30.25showstheprocess.
Figure30.25 Example30.8
Jennifer
r
id=12,007
P''''391q'"401
n;::;·159,197
e",)43d"'·12,007
I-------i~ P=33.677
12
,007mod159,1971------'
je=343
C=1314:>43.mod159,197
Example30.9
Letusgivearealisticexample.Wechoosea512-bitpandq.Wecalculatenand<1>.Wethen
chooseeandtestforrelativeprimenesswith<I>(n).Wecalculated.Finally,weshowtheresultsof
encryptionanddecryption.WehavewrittenaprogramwritteninJavatodoso;thistypeofcalcula­
tioncannotbedonebyacalculator.
Werandomlychoseanintegerof512bits.Theintegerpisa159-digitnumber.
p=96130345313583504574191581280615427909309845594996215822583150879647940
45505647063849125716018034750312098666606492420191808780667421096063354
219926661209
Theintegerqisa160-digitnumber.
q=12060191957231446918276794204450896001555925054637033936061798321731482
14848376465921538945320917522527322683010712069560460251388714552496900
0359660045617
Wecalculaten.Ithas309digits.
n=11593504I73967614968892509864615887523771457375454144775485526137614788
54083263508172768788159683251684688493006254857641112501624145523391829
27162507656772727460097082714127730434960500556347274566628060099924037
10299142447229221577279853172703383938133469268413732762200096667667183
1831088373420823444370953
Wecalculate<1>.Ithas309digits:
<1>=115935041739676149688925098646158875237714~7375454144775485526137614788
54083263~0817276878&159683251684688493OO6254857641112501624145523391829
27162507656751054233608492916752034482627988117554787657013923444405716
98958172819609822636107546721186461217135910735864061400888517026537727
1264467341066243857664128

952 CHAPTER 30CRYPTOGRAPHY
Wechoosee=35,535.Wethenfind d.
e=35335
d=58oo8302860037763936093661289677917594669062089650962180422866111380593852
82235873170628691003002171085904433840217072986908760061153062025249598844
48047568240966247081485817130463240644077704833134010850947385295645071936
77406119732655742423721761767462077637164207600337085333288532144708859551
36670294831
Alicewantstosendthemessage"THISISATEST"whichcanbechanged toanumeric
valuebyusingthe
00-26encodingscheme (26isthespacecharacter).
P=1907081826081826002619041819
TheciphertextcalculatedbyAliceisC =p
e
,
whichis
c
'=475309123646226827206365550610545J80942371796070491716523239243aS44j~',
60613199328566617843418359114151197411252005682979794571736036101278:21'
8847892741566090480023507190715277185914975188465888632101148354103361
6578984679683867637337657774656250792805211481418440481418443081277305",
9004692874248559166462108656
Bobcanrecovertheplaintextfromtheciphertextbyusing P=Cd,whichis
P=:1907081826081826002619041819
TherecoveredplaintextisTHISISATESTafterdecoding.
Applications
AlthoughRSAcanbeusedtoencryptanddecryptactualmessages, itisveryslow ifthe
messageislong.RSA,therefore,isusefulforshortmessagessuchasasmallmessage
digest(seeChapter31)orasymmetrickeytobeusedforasymmetric-keycryptosystem.
Inparticular,wewillseethatRSAisused
indigitalsignaturesandothercryptosystems
thatoftenneedtoencryptasmallmessagewithouthavingaccesstoasymmetrickey.
RSAisalsousedforauthenticationas
wewillseelater.
Diffie-Hellman
RSAisapublic-keycryptosystemthatisoftenusedtoencryptanddecryptsymmetric
keys.Diffie-Hellman,ontheotherhand,wasoriginallydesignedforkeyexchange.Inthe
Diffie-Hellmancryptosystem,twopartiescreateasymmetric sessionkey toexchange
datawithouthavingtorememberorstorethekeyforfutureuse.Theydonothavetomeet
toagreeonthekey;
itcanbedonethroughtheInternet. Letusseehowtheprotocolworks
whenAliceandBobneedasymmetrickeytocommunicate.Beforeestablishingasym­
metric
key,thetwopartiesneedtochoosetwonumbers pandg.Thefirstnumber, p,isa

SECTION30.3ASYMMETRIC-KEY CRYPTOGRAPHY 953
largeprimenumberontheorder of300decimaldigits(1024bits).Thesecondnumberis
arandomnumber.Thesetwonumbersneednotbeconfidential.Theycanbesentthrough
theInternet;theycanbepublic.
Procedure
Figure30.26showstheprocedure.Thestepsareasfollows:
Figure30.26 Diffie-Hellmanmethod
0,-....,._...
Thevaluesof
pandgarepublic.
Sharedsecretkey
~-.;.,._....
-------------------0-------------------
K=gXYmodp
oStep1:Alicechoosesalargerandomnumber xandcalculatesR1=Ifmodp.
oStep2:Bobchoosesanotherlargerandomnumber yandcalculatesR2
=gYmodp.
oStep3:Alicesends R1toBob.NotethatAlicedoesnotsendthevalue ofx;she
sendsonly
R1-
oStep4:Bobsends R
2
toAlice.Again,notethatBobdoesnotsendthevalue ofy,
hesendsonly R
2
.
oStep5:Alicecalculates K=
(R
2lmodp.
oStep6:Bobalsocalculates K=(R
1?modp.
Thesymmetrickeyforthesessionis K.
(.fmodp)Ymodp=(gYmodp)Xmodp=.fYmodp
Bobhascalculated K=(R1?modp=(Ifmodp?modp=lfYmodp.Alicehas
calculated
K=(R
2
)Xmodp=(gYmodp)Xmod=
lfYmodp.Bothhavereachedthesame
valuewithoutBobknowingthevalue
ofxandwithoutAliceknowingthevalue ofy.
Thesymmetric(shared)key intheDiffie-HellmanprotocolisK=!tYmodp.

954 CHAPTER 30CRYPTOGRAPHY
Example30.10
Letusgiveatrivialexample tomaketheprocedureclear.Ourexampleusessmallnum­
bers,butnotethatinarealsituation,thenumbersareverylarge.Assumeg
=7andp=23.
Thestepsareasfollows:
1.Alicechooses x=3andcalculates R
1
=7
3
mod23=21.
2.Bobchoosesy =6andcalculates R
2
=7
6
mod23=4.
3.Alicesendsthenumber 21toBob.
4.Bobsendsthenumber4toAlice.
5.Alicecalculatesthesymmetrickey K=4
3
mod23=18.
6.Bobcalculatesthesymmetrickey K=21
6
mod23 =18.
Thevalue
ofKisthesameforbothAliceandBob;
EfYmodp=7
18
mod23 =18.
IdeaofDiffie-Hellman
TheDiffie-Hellmanconcept,showninFigure30.27,issimplebutelegant.Wecanthink
ofthesecretkeybetweenAliceandBobasmadeofthreeparts: g,x,andy.Thefirstpart
ispublic.Everyoneknowsone-third
ofthekey;gisapublicvalue.Theothertwoparts
mustbeaddedbyAliceandBob.Eachaddsonepart.Aliceadds
xasthesecondpartfor
Bob;BobaddsyasthesecondpartforAlice.WhenAlicereceivesthetwo-thirdscom­
pletedkeyfromBob,sheaddsthelastpart,her
x,tocompletethekey.WhenBobreceives
thetwo-thirdscompletedkeyfromAlice,headdsthelastpart,his
y,tocompletethe key.
NotethatalthoughthekeyinAlice'shandconsists of
g-y-xandthekeyinBob'shandis
g-x-y,thesetwokeysarethesamebecauseEfY=gYx.
Figure30.27Diffie-Hellmanidea
Alice
_....
bd
Alicefillsupanother!
one-thirdofthe
secretkeyusing
herrandomnumber
fB
One-thirdofthekeyispublic.
Thetwokeysarethesame
becauseitdoesnotmatter
if
xisfilledfirst ory.
Bobfillsupanother
one-third
of
the
secretkeyusing
hisrandomnumber

SECTION30.3ASYMMETRIC-KEY CRYPTOGRAPHY 955
Notealsothatalthoughthetwokeysarethesame,Alicecannotfindthevalue yusedby
Bobbecausethe calculationisdone
inmodulop;Alicereceives gYmodpfromBob,not gY.
Man-in-the-MiddleAttack
Diffie-Hellmanisaverysophisticatedsymmetric-keycreationalgorithm. Ifxandyare
verylargenumbers,itisextremelydifficultforEvetofindthekey,knowingonly
pand
g.Anintruderneedstodeterminexand
yifR
1andR
2areintercepted.Butfindingx
from
R1andyfromR
2aretwodifficulttasks.Evenasophisticatedcomputerwould
needperhapsyearstofindthekeybytryingdifferentnumbers.Inaddition,Aliceand
Bobwillchangethekeythenexttimetheyneedtocommunicate.
However,theprotocoldoeshaveaweakness.Evedoesnothavetofindthevalue
of
xandytoattacktheprotocol.ShecanfoolAliceandBobbycreatingtwokeys:one
betweenherselfandAliceandanotherbetweenherselfandBob.Figure30.28shows
thesituation.
Figure30.28Man-in-the-middleattack
pandgarepublic.
Alice
Eve
R
z
=gZmodp
K]
:=;(R1)tmodp
Kz""(R;Fmodp
Bob
".
R
3
=gYmodp
Alice-Evekey Eve-Bobkey
-----------1----------------------1----------
K
1
=gXZmodp K
z
=gZYmodp
Thefollowingcanhappen:
1.Alicechooses x,calculatesR
1=gXmodp,andsends R1toBob.
2.Eve,theintruder,intercepts Rl'Shechoosesz,calculatesR
2=Efmodp,andsends
R
2
tobothAliceandBob.

956 CHAPTER30CRYPTOGRAPHY
3.Bobchooses y,calculatesR
3=gYmodp,andsendsR
3toAlice;R
3
isintercepted
byEveandneverreachesAlice.
4.AliceandEvecalculate K
I=
Et
z
modp,whichbecomesasharedkeybetweenAlice
andEve.Alice,however,thinksthatitisakeysharedbetweenBobandherself.
5.EveandBobcalculate K
2
=gZYmodp,whichbecomesasharedkeybetweenEve
andBob.Bob,however,thinksthatit
isakeysharedbetweenAliceandhimself.
Inotherwords,twokeys,instead
ofone,arecreated:onebetweenAliceandEveand
onebetweenEveandBob.WhenAlicesendsdatatoBobencryptedwith
K
1
(sharedby
AliceandEve),itcanbedecipheredandreadbyEve.EvecansendthemessagetoBob
encryptedby
K
2
(sharedkeybetweenEveandBob); orshecanevenchangethemes­
sageorsendatotallynewmessage.Bobisfooledintobelievingthatthemessagehas
comefromAlice.AsimilarscenariocanhappentoAliceintheotherdirection.
Thissituationiscalledaman-in-the-middle
attackbecauseEvecomesinbetween
andintercepts
R
I
,
sentbyAlicetoBob,and R
3
,
sentbyBobtoAlice. Itisalsoknown
asa
bucketbrigadeattackbecauseitresemblesashortline ofvolunteerspassinga
bucket
ofwaterfrompersontoperson.
Authentication
Theman-in-the-middleattackcanbeavoided ifBobandAlicefirstauthenticateeach
other.Inotherwords,theexchangekeyprocesscanbecombinedwithanauthentication
schemetopreventaman-in-the-middleattack.
WediscussauthenticationinChapter31.
30.4RECOMMENDED READING
Formoredetailsaboutsubjectsdiscussedinthischapter,werecommendthefollowing
books.Theitemsinbrackets[
...]refertothereferencelistattheend ofthetext.
Books
Cryptographycanbefoundinmanybooksdedicatedtothesubjectsuchas[Bar02],
[GartH],[Sti02],[Mao04],[MOV97],and[Sch96].
30.5KEYTERMS
AdvancedEncryptionStandard(AES)
blockcipher
bucketbrigadeattack
Caesarcipher
cipherblockchaining(CBC)mode
cipherfeedback(CFB)mode
ciphertext
compressionpermutation
cryptography
DataEncryptionStandard(DES)
decryption
decryptionalgorithm
DESfunction
Diffie-Hellmancryptosystem
electroniccodebook(ECB)mode
encryption

encryptionalgorithm
expansionpermutation
initiationvector(IV)
key
man-in-the-middleattack
mode
ofoperation
monoalphabeticcipher
NationalInstitute
ofStandardsand
Technology(NIST)
outputfeedback(OFB)mode
P-box
plaintext
polyalphabeticcipher
privatekey
publickey
SECTION30.6SUMMARY 957
Rijndaelalgorithm
Rivest,Shamir,
Adleman(RSA)
rotationcipher
round
roundcipher
S-box
secretkey
sessionkey
shiftcipher
simplecipher
straightpermutation
substitutioncipher
transpositioncipher
Triple
DES
XORcipher
30.6SUMMARY
oCryptographyisthescience andartoftransformingmessagestomake themsecure
andimmunetoattacks.
oTheplaintextistheoriginalmessagebeforetransformation;theciphertextisthe
messageaftertransformation.
oAnencryptionalgorithmtransformsplaintexttociphertext;adecryptionalgorithm
transformsciphertexttoplaintext.
oAcombinationofanencryptionalgorithm andadecryptionalgorithmiscalleda
cipher.
oThekeyisanumber orasetofnumbersonwhichthecipheroperates.
oWecandivideallciphersintotwobroadcategories:symmetric-keyciphers and
asymmetric-keyciphers.
oInasymmetric-keycipher,thesamekeyisusedbyboththesenderandreceiver. The
keyiscalledthesecretkey.
oInanasymmetric-keycipher,apair ofkeysisused. Thesenderusesthepublickey;
thereceiverusestheprivatekey.
oAsubstitutioncipherreplacesonecharacterwithanothercharacter.
oSubstitutionciphers canbecategorizedintotwo broadcategories:monoalphabetic
andpolyalphabetic.
oTheshiftcipher isthesimplestmonoalphabeticcipher. Itusesmodulararithmetic
withamodulus
of26.TheCaesarcipherisashiftcipherthathasakey of3.
oThetranspositioncipherreorderstheplaintextcharacterstocreateaciphertext.
oAnXORcipheristhe simplestcipherwhichisself-invertible.
oArotationcipher isaninvertiblecipher.

958 CHAPTER30CRYPTOGRAPHY
oAnS-boxisakeylesssubstitutioncipherwith Ninputsand Moutputsthatusesa
formulatodefinetherelationshipbetweentheinputstreamandtheoutputstream.
oAP-boxisakeylesstranspositioncipherwith Ninputsand Moutputsthatusesa
tabletodefinetherelationshipbetweentheinputstreamandtheoutputstream.A
P-box
isinvertibleonly ifthenumbersofinputsandoutputsarethesame.AP-boxcan
useastraightpermutation,acompressionpeilliutation,oranexpansionpermutation.
oAmoderncipherisusuallyaroundcipher;eachroundisacomplexciphermade of
acombinationofdifferentsimpleciphers.
oDESisasymmetric-keymethodadoptedbytheU.S.government.DEShas aninitial
andfinalpermutationblockand
16rounds.
oTheheartofDESistheDESfunction.TheDESfunctionhasfourcomponents:an
expansionpermutation,
anXORoperation,S-boxes,andastraightpermutation.
oDESusesakeygeneratortogeneratesixteen48-bitroundkeys.
oTripleDESwasdesignedtoincreasethesize oftheDESkey(effectively56bits)
forbettersecurity.
oAESisaroundcipherbased ontheRijndaelalgorithmthatusesa128-bitblock of
data.AEShasthreedifferentconfigurations: 10roundswithakeysize of128bits,
12roundswithakeysize of192bits,and14roundswithakeysize of256bits.
oModeofoperationreferstotechniquesthatdeploythecipherssuchasDESorAES.
Fourcommonmodes
ofoperationareECB,CBC,CBF,andOFB.ECBandCBC
areblockciphers;CBFandOFBarestreamciphers.
oOnecommonlyusedpublic-keycryptographymethodistheRSAalgorithm,
inventedbyRivest,Shamir,andAdleman.
oRSAchoosesntobetheproduct oftwoprimespandq.
oTheDiffie-Hellmanmethodprovidesaone-timesessionkeyfortwoparties.
oTheman-in-the-middleattackcanendangerthesecurity oftheDiffie-Hellman
method
iftwopartiesarenotauthenticatedtoeachother.
30.7PRACTICESET
ReviewQuestions
1.Insymmetric-keycryptography,howmanykeysareneeded ifAliceandBobwant
tocommunicatewitheachother?
2.Insymmetric-keycryptography,canAliceusethesamekeytocommunicatewith
bothBobandJohn?Explainyouranswer.
3.Insymmetric-keycryptography, ifeverypersoninagroup of10peopleneedsto
communicatewitheveryotherpersoninanothergroupof10people,howmany
secretkeysareneeded?
4.Insymmetric-keycryptography, ifeverypersoninagroupof10peopleneedstocom­
municatewitheveryotherpersoninthegroup,howmanysecretkeysareneeded?
5.RepeatQuestion1forasymmetric-keycryptography.

SECTION30.7PRACTICESET 959
6.RepeatQuestion2forasymmetric-keycryptography.
7.RepeatQuestion3forasymmetric-keycryptography.
8.RepeatQuestion4forasymmetric-keycryptography.
Exercises
9.Insymmetric-keycryptography,howdoyouthinktwopersonscanestablishasecret
keybetweenthemselves?
10.Inasymmetric-keycryptography,howdoyouthinktwopersonscanestablishtwo
pairs
ofkeysbetweenthemselves?
11.Encryptthemessage"THIS ISANEXERCISE"usingashiftcipherwithakey of20.
Ignorethespacebetweenwords.Decryptthemessagetogettheoriginalplaintext.
12.Canweusemonoalphabeticsubstitution ifoursymbolsarejust0 andI?Isita
goodidea?
13.Canweusepolyalphabeticsubstitution ifoursymbolsarejust0 and I?Isitagood
idea?
14.Encrypt"INTERNET"usingatranspositioncipherwiththefollowingkey:
35214
1 2
345
15.Rotate11100Ithreebitstotheright.
16.Rotate100111threebitstotheleft.
17.A6-by-2S-boxaddsthebitsattheodd-numberedpositions (1,3,5,...)togetthe
rightbit
oftheoutputandaddsthebitsattheeven-numberedpositions (2,4,6,...)
togettheleftbit
oftheoutput.Iftheinputis1100I 0,whatistheoutput? Ifthe
inputis
10110I,whatistheoutput?AssumetherightmostbitisbitI.
18.Whatareallthepossiblenumbercombinations ofinputsina6-by-2S-box?What
isthepossiblenumber
ofoutputs?
19.Theleftmostbit ofa4-by-3S-boxrotatestheother3bits. Iftheleftmostbitis0,
the3otherbitsarerotatedtotheright1bit.
IftheleftmostbitisI,the3otherbits
arerotatedtotheleftIbit.
Iftheinputis 10II,whatistheoutput?Iftheinputis
0110,whatistheoutput?
20.AP-boxusesthefollowingtableforencryption.Showtheboxandconnecttheinput
totheoutput.
4
2,
1
3
2
1.
IstheP-boxstraight,compression,orexpansion?
21.InRSA,giventwoprimenumbers
p=19andq=23,findnand
<p.Choosee=5 and
trytofind
d,suchthat eanddmeetthecriteria.
22.
Tounderstandthesecurity oftheRSAalgorithm,find difyouknowthat e=17and
n=187.ThisexerciseproveshoweasyisforEvetobreakthesecret ifnissmall.

960 CHAPTER30CRYPTOGRAPHY
23.FortheRSAalgorithmwithalarge n,explainwhyBobcancalculate dfromn,but
Evecannot.
24.Using
e=13,d=37,andn=77intheRSAalgorithm,encryptthemessage"FINE"
usingthevalues
of00to25forlettersAtoZ.Forsimplicity,dotheencryptionand
decryptioncharacterbycharacter.
25.Why
can'tBobchoose1asthepublickey einRSA?
26.Whatisthedangerinchoosing2asthepublickeyeinRSA?
27.EveusesRSA
tosendamessagetoBob,usingBob'spublickey.Later,atacock­
tailparty,EveseesBobandaskshim
ifthemessagehasarrivedandBobconfirms
it.Afterafewdrinks,EveasksBob,"Whatwastheciphertext?"Bobgivesthe
value
oftheciphertexttoEve.Canthisendangerthesecurity ofBob'sprivatekey?
Explainyouranswer.
28.What
isthevalueofthesymmetrickey intheDiffie-Hellmanprotocol ifg=7,p=23,
x=2,andy=5?
29.IntheDiffie-Hellmanprotocol,whathappens
ifxandyhavethesamevalue?That
is,AliceandBobhaveaccidentallychosenthesamenumber.Arethevalues
ofR1
andR
2thesame?Arethevalues ofthesessionkeyscalculatedbyAliceandBob
thesame?Useanexampletoproveyourclaims.
ResearchActivities
30.Anotherasymmetric-keyalgorithmiscalledEIGamal.Dosomeresearchandfind
outsomeinformationaboutthisalgorithm.WhatisthedifferencebetweenRSA
andEIGamal?
31.Anotherasymmetric-keyalgorithmisbasedonellipticcurves.
Ifyouarefamiliar
withellipticcurves,dosomeresearchandfindthealgorithmsbasedonelliptic
curves.
32.
TomakeDiffie-Helmanalgorithmmorerobust,oneusescookies.Do someresearch
andfindoutabouttheuse
ofcookiesintheDiffie-Helmanalgorithm.

CHAPTER31
NetworkSecurity
InChapter30,weintroducedthescienceofcryptography.Cryptographyhasseveral
applicationsinnetworksecurity.
Inthischapter,wefirstintroducethesecurityservices
wetypicallyexpectinanetwork.
Wethenshowhowtheseservicescanbeprovided
usingcryptography.Attheend
ofthechapter,wealsotouchontheissueofdistributing
symmetricandasymmetrickeys.Thechapterprovidesthebackgroundnecessaryfor
Chapter32,wherewediscusssecurityintheInternet.
31.1SECURITYSERVICES
Networksecuritycanprovideone ofthefiveservicesasshowninFigure31.1.Four of
theseservicesarerelated tothemessageexchangedusingthenetwork:messageconfi­
dentiality,integrity,authentication,andnonrepudiation.Thefifthserviceprovides
entityauthenticationoridentification.
Figure31.1 Securityservicesrelated tothemessageorentity
Message
Security
services
Entity
Confidentiality
Integrity
Authentication
Nonrepudiatton
Authentication
961

962 CHAPTER 31NETWORKSECURiTY
MessageConfidentiality
Messageconfidentiality orprivacymeansthatthesenderandthereceiverexpectcon­
fidentiality.Thetransmittedmessagemustmakesensetoonlytheintendedreceiver.
To
allothers,themessagemustbegarbage.Whenacustomercommunicateswithher
bank,sheexpectsthatthecommunication
istotallyconfidential.
MessageIntegrity
Messageintegritymeansthatthedatamustarriveatthereceiverexactlyastheywere
sent.Theremustbenochangesduringthetransmission,neitheraccidentallynormali­
ciously.
AsmoreandmoremonetaryexchangesoccurovertheInternet,integrity iscrucial.
Forexample,
itwouldbedisastrous ifarequestfortransferring$100changedtoa
requestfor$10,000or$100,000.Theintegrity
ofthemessagemustbepreservedina
securecommunication.
MessageAuthentication
Messageauthenticationisaservicebeyondmessageintegrity.Inmessageauthentication
thereceiverneedstobesure
ofthesender'sidentityandthatanimposterhasnotsentthe
message.
MessageNonrepudiation
Messagenonrepudiationmeansthatasendermustnotbeabletodenysendingamessage
thatheorshe,infact,didsend.Theburden
ofprooffalls onthereceiver.Forexample,
whenacustomersendsamessagetotransfermoneyfromoneaccounttoanother,the
bankmusthaveproofthatthecustomeractuallyrequestedthistransaction.
EntityAuthentication
Inentityauthentication(oruseridentification)theentityoruserisverifiedpriorto
accesstothesystemresources(files,forexample).Forexample,astudentwhoneedsto
accessheruniversityresourcesneedstobeauthenticatedduringtheloggingprocess.
Thisistoprotecttheinterests
oftheuniversityandthestudent.
31.2MESSAGECONFIDENTIALITY
Theconceptofhowtoachievemessageconfidentialityorprivacyhasnotchangedfor
thousands
ofyears.The messagemustbeencryptedatthesendersiteanddecrypted
atthereceiversite.Thatis,themessagemustberenderedunintelligibletounauthorized
parties.Agoodprivacytechniqueguaranteestosomeextentthatapotentialintruder
(eavesdropper)cannotunderstandthecontents
ofthemessage.Aswediscussedin
Chapter30,thiscanbedoneusingeithersymmetric-keycryptographyorasymmetric­
keycryptography.
Wereviewboth.

SECTION31.2MESSAGECONFIDENTIALITY 963
Confidentiality withSymmetric-KeyCryptography
Althoughmodernsymmetric-keyalgorithmsaremorecomplexthantheonesused
throughthelonghistory
ofthesecretwriting,theprincipleisthesame. Toprovideconfi­
dentialitywithsymmetric-keycryptography,asenderandareceiverneedtosharea
secret
key.Inthepastwhendataexchangewasbetweentwospecificpersons(forexam­
ple,twofriendsorarulerandherarmychief),itwaspossibletopersonally exchangethe
secretkeys.Today'scommunicationdoesnotoftenprovidethisopportunity.Aperson
residingintheUnitedStatescannotmeetandexchangeasecretkeywithapersonliving
inChina.Furthermore,thecommunicationisbetweenmillions
ofpeople,notjusta few.
Tobeabletousesymmetric-keycryptography,weneedtofindasolutiontothe
keysharing.Thiscanbedoneusingasessionkey.Asessionkeyisonethatisusedonly
fortheduration
ofonesession.Thesessionkeyitselfisexchangedusingasymmetric­
keycryptographyaswewillseelater.Figure31.2showstheuse
ofasessionsymmetric
keyforsendingconfidentialmessagesfromAlicetoBobandviceversa.Notethatthe
nature
ofthesymmetrickeyallowsthecommunicationtobecarriedoninbothdirec­
tionsalthoughitisnotrecommendedtoday.Usingtwodifferentkeysismoresecure,
because
ifonekeyiscompromised,thecommunicationisstillconfidentialintheother
direction.
Figure31.2Messageconfidentialityusingsymmetrickeysintwodirections
Alice
GI Sharedkeys n
mr-----------------------------lI
Bob
Plaintext,----------, Ciphertext ,...-------,Plaintext
1-------------1
Dataflow
a.AsharedsecretkeycanbeusedinAlice-Bobcommunication
Alice
Plaintext Ciphertext.....-----,Plaintext
I-----lDecry;pnonI---------'-------f
.. L.........."""::"::"--o....J
Dataflow
b.AdifferentsharedsecretkeyisrecommendedinBob-Alicecommunication
Bob
Thereasonsymmetric-keycryptographyisstillthedominantmethodforconfiden­
tiality
ofthemessageisitsefficiency.Foralongmessage,symmetric-keycryptography
ismuchmoreefficientthanasymmetric-keycryptography.
ConfidentialitywithAsymmetric-Key Cryptography
Theproblemwementionedaboutkeyexchangeinsymmetric-keycryptographyfor
privacyculminatedinthecreation
ofasymmetric-keycryptography.Here,there isno
keysharing;thereisapublicannouncement.Bobcreatestwokeys:oneprivateandone

964 CHAPTER31NETWORKSECURITY
public.Hekeepstheprivatekeyfordecryption;hepubliclyannouncesthepublickeyto
theworld.Thepublickeyisusedonlyforencryption;theprivatekeyisusedonlyfor
decryption.Thepublickeylocksthemessage;theprivatekeyunlocksit.
Foratwo-waycommunicationbetweenAliceandBob,twopairs
ofkeysare
needed.WhenAlicesendsamessagetoBob,sheusesBob'spair;whenBobsendsa
messagetoAlice,heusesAlice'spairasshowninFigure31.3.
Figure31.3 Messageconfidentialityusingasymmetrickeys
Alice
r-,
----------------~~
f f~
r ~ B~
PlaintextI. I Ciphertext r------,Plaintext
Encryption----2-------1
• '-----_----J
Dataflow
a.Bob'skeys
areusedinAlice-Bobcommunication
~r-----------------
~ t t
~ ~ r
it
Dataflow
b.Alice'skeys areusedinBob·Alicecommunication
Bob
Confidentialitywithasymmetric-keycryptosystemhasitsownproblems.First,the
method
isbasedonlongmathematicalcalculationsusinglongkeys.Thismeansthat
thissystemisveryinefficientforlongmessages;itshouldbeappliedonlytoshortmes­
sages.Second,thesender
ofthemessagestill needstobecertainaboutthepublickey
ofthereceiver.Forexample,inAlice-Bobcommunication,Aliceneedstobesurethat
Bob'spublickeyisgenuine;Evemayhaveannouncedherpublickeyinthenameof
Bob.Asystem
oftrustisneeded,as wewillseelaterinthechapter.
31.3MESSAGEINTEGRITY
Encryptionanddecryptionprovidesecrecy,orconfidentiality,butnot integrity.How­
ever,onoccasionwemaynotevenneedsecrecy,butinsteadmusthaveintegrity.For
example,Alicemaywriteawilltodistributeherestateuponherdeath.Thewilldoes
notneedtobeencrypted.Afterherdeath,anyonecanexaminethewill.Theintegrityof
thewill, however,needstobepreserved.Alicedoesnotwantthecontents
ofthewillto

SECTION31.3MESSAGEINTEGRITY 965
bechanged.Asanotherexample,supposeAlicesendsamessageinstructing herbanker,
Bob,topay
Eveforconsultingwork. Themessagedoesnotneedto behiddenfromEve
becauseshealreadyknowssheisto
bepaid.However,themessagedoesneedto besafe
fromanytampering,especially
byEve.
DocumentandFingerprint
Onewaytopreservetheintegrity ofadocumentisthroughthe useofafingerprint.If
Aliceneedsto besurethatthecontents ofherdocumentwillnot beillegallychanged,
shecan
putherfingerprintatthebottom ofthedocument.Evecannotmodifythecontents
ofthisdocument orcreateafalsedocumentbecause shecannotforgeAlice'sfinger­
print.Toensurethatthedocument
hasnotbeenchanged,Alice'sfingerprint onthedoc­
umentcanbecomparedtoAlice'sfingerprintonfile.Iftheyarenotthesame,the
documentisnotfromAlice.
Topreservetheintegrityofa
document,
boththedocument andthefingerprintareneeded.
MessageandMessage Digest
Theelectronicequivalent ofthedocument andfingerprintpairisthe messageandmes­
sagedigestpail:Topreservetheintegrity ofamessage,themessageispassedthrough
analgorithmcalleda hashfunction.Thehashfunctioncreatesacompressedimage of
themessagethatcanbeusedasafingerprint.Figure31.4showsthemessage,hash
function,andthe messagedigest.
Figure31.4 Messageandmessagedigest
Message
(Document)
Hash
function
Difference
Thetwopairsdocument/fingerprintandmessage/messagedigestaresimilar,withsome
differences.
Thedocumentandfingerprintarephysicallylinkedtogether;also,neither
needsto
bekeptsecret.Themessageandmessagedigestcan beunlinked(orsent)sep­
aratelyand,mostimportantly,themessagedigestneedsto
bekeptsecret.Themessage
digest
iseitherkeptsecret inasafeplace orencryptedifweneedtosenditthrougha
communicationschannel.
Themessagedigestneedstobekeptsecret.

966 CHAPTER31NETWORKSECURITY
CreatingandCheckingtheDigest
Themessagedigestiscreatedatthesendersiteandissentwiththemessagetothe
receiver.
Tochecktheintegrity ofamessage,ordocument,thereceivercreatesthehash
functionagainandcomparesthenewmessagedigestwiththeonereceived.
Ifbothare
thesame,thereceiverissurethattheoriginalmessagehasnotbeenchanged.
Ofcourse,
weareassumingthatthedigesthasbeensentsecretly.Figure31.5showstheidea.
Figure31.5 Checkingintegrity
Alice
&
HashFunctionCriteria
Message
and
digest
Bob&
Tobeeligibleforahash,afunctionneedstomeetthreecriteria:one-wayness,resis­
tancetoweakcollision,andresistancetostrongcollisionasshowninFigure31.6.
Figure31.6 Criteriaofahashfunction
Hashfunction
criteria
I
I I I
Onc-wayncss
Weakcollision I
Stron~collision
resistance resistance
One-wayness
Ahashfunctionmusthave one-wayness;amessagedigestiscreatedbyaone-way
hashingfunction.
Wemustnotbeabletorecreatethemessagefromthedigest.Some­
timesitisdifficulttomakeahashfunction100percentone-way;thecriteriastatethatit
mustbeextremelydifficultorimpossibletocreatethemessage
ifthemessagedigestis
given.Thisissimilartothedocument/fingerprintcase.Noonecanmakeadocument
fromafingerprint.

SECTION31.3MESSAGEINTEGRITY 967
Example31.1
Canweuseaconventionallosslesscompressionmethodasahashingfunction?
Solution
Wecannot.Alosslesscompressionmethodcreatesacompressedmessagethatisreversible. You
canuncompressthecompressedmessagetogettheoriginalone.
Example31.2
Canweuseachecksummethodasahashingfunction?
Solution
Wecan.Achecksumfunctionisnotreversible;itmeetsthefirstcriterion.However,itdoesnot
meettheothercriteria.
WeakCollisionResistance
Thesecondcriterion, weakcollisionresistance,ensuresthatamessagecannoteasily
beforged.
IfAlicecreatesamessageandadigestandsendsbothtoBob,thiscriterion
ensuresthatEvecannoteasilycreateanothermessagethathashesexactlytothesame
digest.
Inotherwords,givenaspecificmessageanditsdigest,itisimpossible(or at
leastverydifficult)tocreateanothermessagewiththesamedigest.
Whentwomessagescreatethesamedigest,
wesaythereisacollision. Inaweek
collision,givenamessagedigest,itisveryunlikelythatsomeonecancreateamessage
withexactlythesamedigest.Ahashfunctionmusthaveweakcollisionresistance.
StrongCollisionResistance
Thethirdcriterion, strongcollisionresistance,ensuresthatwecannotfindtwomessages
thathashtothesamedigest.ThiscriterionisneededtoensurethatAlice,thesender
ofthe
message,cannotcauseproblemsbyforgingamessage.
IfAlicecancreatetwomessages
thathashtothesamedigest,shecandenysendingthefirsttoBobandclaimthatshesent
onlythesecond.
Thistype
ofcollisioniscalledstrongbecausetheprobability ofcollisionishigher
thaninthepreviouscase.Anadversarycancreatetwomessagesthathashtothesame
digest.
Forexample,ifthenumber ofbitsinthemessagedigestissmall, itislikely
Alicecancreatetwodifferentmessageswiththesamemessagedigest.Shecansendthe
firsttoBobandkeepthesecondforherself.Alicecanlatersaythatthesecondwas
theoriginalagreed-upondocumentandnotthefirst.
Supposetwodifferentwillscanbecreatedthathashtothesamedigest.Whenthe
timecomesfortheexecution
ofthewill,thesecondwillispresentedtotheheirs.Since
thedigestmatchesbothwills,thesubstitutionissuccessful.
HashAlgorithms:SHA-l
Whilemanyhashalgorithmshavebeendesigned,themostcommonis SHA-l.SHA-1
(SecureHashAlgorithm1)isarevisedversion ofSHAdesignedbytheNational
Institute
ofStandardsandTechnology(NIST). ItwaspublishedasaFederalInformation
ProcessingStandard(PIPS).

968 CHAPTER 31NETWORKSECURITY
Averyinterestingpointaboutthisalgorithmandothersisthattheyallfollowthe
sameconcept.Eachcreatesadigest
oflengthNfromamultiple-blockmessage.Each
block
is512bitsinlength, asshowninFigure31.7.
Figure31.7Messagedigestcreation
512bits
Message,multiple
5l2-bitblocks
•••
...
...
Messagedigest
·1
AbufferofNbitsisinitializedtoapredeterminedvalue.Thealgorithmmangles
thisinitialbufferwiththefirst512bits
ofthemessagetocreatethefirstintermediate
messagedigest
ofNbits.Thisdigest isthenmangledwiththesecond512-bitblockto
createthesecondintermediatedigest.The
(n-l)thdigestismangledwiththe nthblock
tocreatethe
nthdigest.Ifablockisnot512bits,padding (Os)isaddedtomakeitso.
Whenthelastblockisprocessed,theresultingdigestisthemessagedigestforthe
entiremessage.
SHA-lhasamessagedigest of160bits(5words,each of32bits).
SHA-lhashalgorithmscreate anN-bitmessage
digest
outofamessageof512-bitblocks.
SHA-lhasamessagedigest of160bits(5wordsof32bits).
WordExpansion
Beforeprocessing,theblockneedstobeexpanded.Ablockismade of512bitsor 16
32-bitwords,butweneed80wordsintheprocessingphase.Sothe16-wordblockneeds
tobeexpandedto80words,
wordOtoword79.
ProcessingEachBlock
Figure31.8showsthegeneraloutlinefortheprocessing
ofoneblock.Thereare80steps
inblockprocessing.Ineachstep,onewordfromtheexpandedblockandone32-bit
constantaremangledtogetherandthenoperatedontocreateanewdigest.
Atthe
beginning
ofprocessing,thevaluesofdigestwords(A,B,C,D,andE)aresavedinto
fivetemporaryvariables.Attheend
oftheprocessing(afterstep79),thesevaluesare

SECTION31.4MESSAGEAUTHENTICATION 969
Figure31.8ProcessingofoneblockinSHA-1
Resultsofthepreviousblock
ortheinitialdigest
IAIBICIDtEI

,Wl}"
Step0
j.;...K
o
ttttt
IAIBjCtDIEI
·•
·
-t-t-t-t-t
.~
Wi9Step79
~K
79
ttttt
IAIBICIDIEI
Final
adding
"
"",~
""
rtJIlliI'-
+l:t:Jl:!::JltJl:!:J
'f'f'f'f'f
IAIBIC/DIE
Valuesforthenextblock
orthefinaldigest
addedtothevaluescreatedfromstep79.Thedetail ofeachstep iscomplexandbeyond
thescope
ofthisbook.Theonlythingweneedtoknow isthateachstepmanglesa
word
ofdataandaconstanttocreatearesultthatisfedtothenextstep.
31.4MESSAGEAUTHENTICATION
Ahashfunction guaranteestheintegrity ofamessage.Itguaranteesthatthemessagehas
notbeenchanged.Ahashfunction,however,doesnotauthenticatethesender
ofthemes­
sage.WhenAlicesendsamessagetoBob,Bobneedstoknow
ifthemessageiscoming
fromAliceorEve.
Toprovidemessageauthentication,Aliceneedstoprovideproofthat
itisAlicesendingthemessageandnotanimposter.Ahashfunctionpersecannot
providesuchaproof.Thedigestcreatedbyahashfunctionisnormallycalleda
modifi­
cationdetectioncode
(MDC).Thecodecandetectanymodificationinthemessage.
MAC
Toprovidemessageauthentication,weneedtochangeamodificationdetectioncodeto
a
messageauthenticationcode(MAC).AnMDCusesakeylesshash
function~ a
MACusesakeyedhashfunction.Akeyedhashfunctionincludesthesymmetrickey

970 CHAPTER 31NETWORKSECURITY
betweenthesenderandreceiverwhencreatingthedigest.Figure31.9showshowAlice
usesakeyedhashfunctiontoauthenticatehermessageandhowBobcanverifythe
authenticity
ofthemessage.
Figure31.9MAC,created byAliceandcheckedbyBob
Alice Bob
Message
and
MAC
Alice,usingthesymmetrickeybetweenherselfandBob (K
AB
)andakeyedhash
function,generatesaMAC.ShethenconcatenatestheMACwiththeoriginalmessage
andsendsthetwotoBob.BobreceivesthemessageandtheMAC.Heseparatesthe
messagefromtheMAC.Heappliesthesamekeyedhashfunctiontothemessageusing
thesymmetrickey
K
AB
togetafreshMAC.HethencomparestheMACsentbyAlice
withthenewlygeneratedMAC.
IfthetwoMACsareidentical,themessagehasnotbeen
modifiedandthesender
ofthemessageisdefinitelyAlice.
HMAC
Thereareseveralimplementations ofMACinusetoday.However,inrecent'years,
someMACshavebeendesignedthatarebasedonkeylesshashfunctionssuchas
SHA-l.Thisideaisa hashedMAC,calledHMAC,thatcanuseanystandardkeyless
hashfunctionsuchas
SHA-l.HMACcreatesanestedMACbyapplyingakeyless
hashfunctiontotheconcatenation
ofthemessageand asymmetrickey.Figure31.10
showsthegeneralidea.
Acopy
ofthesymmetrickeyisprependedtothemessage.Thecombinationis
hashedusingakeylesshashfunction,suchasSHA-1.Theresult
ofthisprocessisan
intermediateHMACwhichisagainprependedwiththekey(thesamekey),andthe
resultisagainhashedusingthesamealgorithm.ThefinalresultisanHMAC.
ThereceiverreceivesthisfinalHMACandthemessage.Thereceivercreatesits
ownHMACfromthereceivedmessageandcomparesthetwoHMACstovalidatethe
integrity
ofthemessageandauthenticatethedataorigin.Notethatthedetails ofan
HMACcanbemorecomplicatedthanwhatwehaveshownhere.

SECTION31.5DIGITALSIGNATURE 971
Figure31.10HMAC
Message
HMAC
31.5DIGITALSIGNATURE
AlthoughaMACcanprovidemessageintegrityandmessageauthentication, ithasa
drawback.
Itneedsasymmetrickeythatmustbeestablishedbetweenthesenderand
thereceiver.Adigitalsignature,ontheotherhand,canuseapair
ofasymmetrickeys(a
publiconeandaprivateone).
Weareallfamiliarwiththeconcept
ofasignature.Wesignadocumenttoshow
thatitoriginatedfromusorwasapprovedbyus.Thesignatureisprooftotherecipient
thatthedocumentcomesfromthecorrectentity.Whenacustomersignsacheckto
himself,thebankneedstobesurethatthecheckisissuedbythatcustomerandnobody
else.Inotherwords,asignatureonadocument,whenverified,isasign
ofauthentica­
tion;thedocumentisauthentic.Considerapaintingsignedbyanartist.Thesignature
ontheart,
ifauthentic,meansthatthepaintingisprobablyauthentic.
WhenAlicesendsamessagetoBob,Bobneedstochecktheauthenticity
ofthe
sender;heneedstobesurethatthemessagecomesfromAliceandnotEve.Bobcanask
Alicetosignthemessageelectronically.Inotherwords,anelectronicsignaturecan
provetheauthenticity
ofAliceasthesender ofthemessage.Werefertothistype ofsig­
natureasadigitalsignature.
Comparison
Beforewecontinueanyfurther,letusdiscussthedifferencesbetweentwotypes ofsig­
natures:conventionalanddigital.
Inclusion
Aconventionalsignatureisincludedinthedocument;itispart
ofthedocument.When
wewriteacheck,thesignatureisonthecheck;
itisnotaseparatedocument.Onthe
otherhand,whenwesignadocumentdigitally,wesendthesignatureasaseparatedoc­
ument.Thesendersendstwodocuments:themessageandthesignature.Therecipient
receivesbothdocumentsandverifiesthatthesignaturebelongstothesupposedsender.
Ifthisisproved,themessageiskept;otherwise,itisrejected.

972 CHAPTER 31NETWORKSECURITY
VerificationMethod
Theseconddifferencebetweenthetwotypesofdocumentsisthemethod ofverifying
thesignature.Inconventionalsignature,whentherecipientreceivesadocument,she
comparesthesignatureonthedocumentwiththesignatureonfile.
Iftheyarethesame,
thedocument
isauthentic.Therecipientneedstohaveacopyofthissignatureonfile
forcomparison.Indigitalsignature,therecipientreceivesthemessageandthesigna­
ture.Acopy
ofthesignatureisnotstoredanywhere.Therecipientneedstoapplya
verificationtechniquetothecombination
ofthemessageandthesignaturetoverifythe
authenticity.
Relationship
Inconventionalsignature,thereisnormallyaone-to-manyrelationshipbetweenasig­
natureanddocuments.Aperson,forexample,hasasignaturethatisusedtosignmany
checks,manydocuments,etc.Indigitalsignature,thereisaone-to-onerelationship
betweenasignatureand amessage.Eachmessagehasitsownsignature.Thesignature
ofonemessagecannotbeusedinanothermessage. IfBobreceivestwomessages,one
afteranother,fromAlice,hecannotusethesignature
ofthefirstmessagetoverifythe
second.Eachmessageneedsanewsignature.
Duplicity
Anotherdifferencebetweenthetwotypes ofsignaturesisaqualitycalledduplicity.In
conventionalsignature,acopy
ofthesigneddocumentcanbedistinguishedfromthe
originaloneonfile.Indigitalsignature,thereisnosuchdistinctionunlessthereisa
factor
oftime(suchasatimestamp)onthedocument.Forexample,supposeAlice
sendsadocumentinstructingBobtopayEve.
IfEveinterceptsthedocumentandthe
signature,shecanresenditlatertogetmoneyagainfromBob.
NeedforKeys
Inconventionalsignatureasignatureislikeaprivate"key"belonging tothesignerof
thedocument.Thesignerusesittosignadocument;nooneelsehasthissignature.The
copy
ofthesignatureisonfilelikeapublickey;anyonecanuseittoverifyadocument,
tocompareittotheoriginalsignature.
Indigitalsignature,thesignerusesherprivatekey,appliedtoasigningalgorithm,
tosignthedocument.Theverifier,ontheotherhand,usesthepublickey
ofthesigner,
appliedtotheverifyingalgorithm,toverifythedocument.
Canweuseasecret(symmetric)keytobothsignandverifyasignature?Theanswer
is
noforseveralreasons.First,asecretkeyisknownonlybetweentwoentities(Alice
andBob,forexample).So
ifAliceneedstosignanotherdocumentandsendittoTed,
sheneedstouseanothersecretkey.Second,aswewillsee,creatingasecretkeyfora
sessioninvolvesauthentication,whichnormallyusesdigitalsignature.
Wehaveavicious
cycle.Third,BobcouldusethesecretkeybetweenhimselfandAlice,signadocument,
sendittoTed,andpretendthatitcamefromAlice.
Adigitalsignatureneedsapublic-keysystem.

SECTION31.5DIGITALSIGNATURE 973
Process
Digitalsignaturecanbeachievedintwoways:signingthedocument orsigningadigest
ofthedocument.
Signingthe Document
Probably,theeasier,butlessefficientwayistosignthedocumentitself.Signingadoc­
umentisencryptingitwiththeprivatekey
ofthesender;verifyingthedocumentis
decryptingitwiththepublickey
ofthesender.Figure31.11showshowsigningand
verifyingaredone.
Figure31.11Signingthemessageitselfindigitalsignature~ t t
keys
Alice
i j
Bob
-~ -~
Plaintext Signeddocument Plaintext
Encryption Decryption
.-
Signing Dataflow Verifying
Weshouldmakeadistinctionbetweenprivateandpublickeys asusedindigital
signatureandpublicandprivatekeysasusedforconfidentiality.Inthelatter,theprivate
andpublickeys
ofthereceiverareusedintheprocess.Thesenderusesthepublickey
ofthereceivertoencrypt;thereceiveruseshisownprivatekeytodecrypt.Indigital
signature,theprivateandpublickeys
ofthesenderareused.Thesenderusesherpri­
vatekey;thereceiverusesthepublickey
ofthesender.
Inacryptosystem,weusetheprivate andpublickeys ofthereceiver;
indigitalsignature,
weusetheprivate andpublickeyofthesender.
SigningtheDigest
Wementionedthatthepublickeyisveryinefficientinacryptosystem ifwearedealing
withlongmessages.Inadigitalsignaturesystem,ourmessagesarenormallylong,but
wehavetousepublickeys.Thesolutionisnottosignthemessageitself;instead,we
signadigest
ofthemessage.Aswelearned,acarefullyselectedmessagedigesthasa
one-to-onerelationshipwiththemessage.Thesendercansignthemessagedigest,and
thereceivercanverifythemessagedigest.Theeffectisthesame.Figure31.12shows
signingadigestinadigitalsignaturesystem.
Adigest
ismadeout ofthemessageatAlice'ssite.Thedigestthengoesthrough
thesigningprocessusingAlice'sprivate
key.Alicethensendsthemessageandthesig­
naturetoBob.
Aswewillseelaterinthechapter,therearevariationsintheprocessthat
aredependentonthesystem.Forexample,theremightbeadditionalcalculationsbefore
thedigestismadeorothersecretkeysmightbeused.Insomesystems,thesignatureis
aset
ofvalues.

974 CHAPTER31NETWORKSECURITY
Figure31.12 Signingthedigestinadigitalsignature
Sign
Alice
Message
and
signature
Verify
Bob&
AtBob'ssite,usingthesamepublichashfunction,adigestisfirstcreatedoutof
thereceivedmessage.Calculationsaredoneonthesignatureandthedigest.Theverifying
processalsoappliescriteriaontheresultofthecalculationtodetenninetheauthenticity
ofthesignature.Ifauthentic,themessageisaccepted;otherwise, itisrejected.
Services
Adigitalsignaturecanprovidethreeout ofthefiveserviceswementionedforasecurity
system:messageintegrity,messageauthentication,andnonrepudiation.Notethatadig­
italsignatureschemedoesnotprovideconfidentialcommunication.
Ifconfidentialityis
required,themessageandthesignaturemustbeencryptedusingeitherasecret-keyor
public-keycryptosystem.
MessageIntegrity
Theintegrityofthemessageispreservedeven ifwesignthewholemessagebecause
wecannotgetthesamesignature
ifthemessageischanged.Thesignatureschemestoday
useahashfunctioninthesigningandverifyingalgorithmsthatpreservetheintegrity
of
themessage.
Adigitalsignaturetodayprovidesmessageintegrity.
MessageAuthentication
Asecuresignaturescheme,likeasecureconventionalsignature(onethatcannotbe
easilycopied),canprovidemessageauthentication.Bobcanverifythatthemessageis
sentbyAlicebecauseAlice'spublickeyisusedinverification.Alice'spublickeycannot
createthesamesignatureasEve'sprivate
key.
Digitalsignatureprovidesmessageauthentication.

SECTION31.5DIGITALSIGNATURE 975
MessageNonrepudiation
IfAlicesignsamessageandthendeniesit,canBoblaterprovethatAliceactually
signedit?Forexample,
ifAlicesendsamessagetoabank(Bob)andaskstotransfer
$10,000fromheraccounttoTed'saccount,canAlicelaterdenythatshesentthis
message?Withtheschemewehavepresentedsofar,Bobmighthaveaproblem.
BobmustkeepthesignatureonfileandlateruseAlice'spublickeytocreatethe
originalmessagetoprovethemessageinthefileandthenew
lycreatedmessageare
thesame.ThisisnotfeasiblebecauseAlicemayhavechangedherprivate/public
keyduringthistime;shemayalsoclaimthatthefilecontainingthesignatureisnot
authentic.
Onesolutionisatrustedthirdparty.Peoplecancreateatrustedpartyamongthem­
selves.InChapter32,wewillseethatatrustedpartycansolvemanyotherproblems
concerningsecurityservicesandkeyexchange.Figure31.13showshowatrustedparty
canpreventAlicefromdenyingthatshesentthemessage.
Figure31.13
Usingatrustedcenter fornonrepudiation
Alice,Bob,
M,SA
M:Message
SA:SignaturefromAlice
ST:Signaturefromtrustedcenter
Trustedcenter
Alice,Bob,
M,ST
Alicecreatesasignaturefromhermessage (SA)andsendsthemessage,her
iden­
tity,Bob'sidentity,andthesignaturetothecenter.Thecenter,aftercheckingthat
Alice'spublickeyisvalid,verifiesthroughAlice'spublickeythatthemessagecomes
fromAlice.Thecenterthensavesacopy
ofthemessagewiththesenderidentity,recip­
ientidentity,andatimestampinitsarchive.Thecenterusesitsprivatekeytocreate
anothersignature
(ST)fromthemessage.Thecenterthensendsthemessage,thenew
signature,Alice'sidentity,andBob'sidentitytoBob.Bobverifiesthemessageusing
thepublickeyofthetrustedcenter.
IfinthefutureAlicedeniesthatshehassentthemessage,thecentercanshowa
copy
ofthesavedmessage. IfBob'smessageisaduplicate ofthemessagesavedatthe
center,Alicewilllosethedispute.
Tomakeeverythingconfidential,alevelofencryption!
decryptioncanbeaddedtotheschemeasdiscussedinthenextsection.
Nonrepudiationcanbeprovidedusingatrustedparty.

976 CHAPTER 31NETWORKSECURITY
SignatureSchemes
Severalsignatureschemeshaveevolvedduringthelastfewdecades.Some ofthem
havebeenimplemented.Such
asRSAandDSS(DigitalSignatureStandard)schemes.
Thelatterwillprobablybecomethestandard.However,thedetails
oftheseschemesare
beyondthescope
ofthisbook.
31.6ENTITYAUTHENTICATION
Entityauthenticationisatechniquedesignedtoletonepartyprovetheidentity of
anotherparty.An entitycanbeaperson,aprocess,aclient,oraserver.Theentity
whoseidentityneedstobeprovediscalledthe
claimant;thepartythattriestoprove
theidentity
oftheclaimantiscalledthe verifier.WhenBobtriestoprovetheidentity of
Alice,Aliceistheclaimant,andBobistheverifier.
Therearetwodifferencesbetweenmessageauthenticationand
entityauthentication.
First,messageauthenticationmaynothappeninrealtime;entityauthenticationdoes.
Intheformer,AlicesendsamessagetoBob.WhenBobauthenticatesthemessage,Alice
mayormaynotbepresentinthecommunicationprocess. Ontheotherhand,when
Alicerequestsentityauthentication,thereisnorealmessagecommunicationinvolved
untilAliceisauthenticatedbyBob.Aliceneedstobeonlineandtakespartintheprocess.
Onlyaftersheisauthenticatedcanmessages
becommunicatedbetweenAliceandBob.
Messageauthenticationisrequiredwhenane-mailissentfromAlicetoBob.Entity
authenticationisrequiredwhenAlicegetscashfromanautomatictellermachine.Second,
messageauthenticationsimplyauthenticatesonemessage;theprocessneedstobe
repeatedforeachnewmessage.Entityauthenticationauthenticatestheclaimantforthe
entireduration
ofasession.
Inentityauthentication,theclaimantmustidentifyherselftotheverifier.Thiscanbe
donewithone
ofthreekinds ofwitnesses:somethingknown,somethingpossessed, or
somethinginherent.
oSomethingknown. Thisisasecretknownonlybytheclaimantthatcanbechecked
bytheverifier.Examplesareapassword,aPINnumber,asecret
key,andaprivatekey.
oSomethingpossessed. Thisissomethingthatcanprovetheclaimant'sidentity.
Examplesareapassport,adriver'slicense,anidentificationcard,acreditcard, and
asmartcard.
oSomethinginherent. Thisisaninherentcharacteristic oftheclaimant.Examples
areconventionalsignature,fingerprints,voice,facialcharacteristics,retinalpattern,
andhandwriting.
Passwords
Thesimplestandtheoldestmethod ofentityauthenticationisthe password,something
thattheclaimant
possesses.Apasswordisusedwhenauserneedstoaccessasystemto
usethesystem'sresources(log-in).Eachuserhasauseridentificationthatispublicand
apasswordthatisprivate.
Wecandividethisauthenticationschemeintotwoseparate
groups:the
fixedpassword andtheone-timepassword.

SECTION31.6ENTITYAUTHENTICATION 977
FixedPassword
Inthisgroup,thepasswordisfixed;thesamepasswordisusedoverandoverforevery
access.Thisapproachissubjecttoseveralattacks.
oEavesdropping.EvecanwatchAlicewhenshetypesherpassword.Mostsystems,
asasecuritymeasure,donotshowthecharactersausertypes.Eavesdroppingcan
takeamoresophisticatedform.Evecanlistentothelineandtheninterceptthe
message,therebycapturingthepasswordforherownuse.
oStealingaPassword. Thesecondtype ofattackoccurswhenEvetriestophysically
stealAlice'spassword.Thiscanbeprevented
ifAlicedoesnotwritedown the
password;instead,shejustcommitsittomemory.Therefore,apasswordshouldbe
verysimpleorelserelatedtosomethingfamiliartoAlice,whichmakesthepassword
vulnerabletoothertypes
ofattacks.
oAccessingafile.Evecanhackintothesystemandgetaccesstothefilewherethe
passwordsarestored.Eve
canreadthefileandfind Alice'spasswordoreven
changeit.
Topreventthistype ofattack,thefilecanberead/writeprotected.How­
ever,mostsystemsneedthistype
offiletobereadablebythepublic.
oGuessing.Evecanlogintothesystemand trytoguessAlice'spasswordbytrying
differentcombinations
ofcharacters.Thepassword isparticularlyvulnerable ifthe
userisallowedtochooseashortpassword(afewcharacters).
Itisalsovulnerable
ifAlicehaschosensomethingunimaginative,suchasherbirthday,herchild'sname,
orthename
ofherfavoriteactor. Topreventguessing,alongrandompasswordis
recommended,somethingthatisnotveryobvious.However,theuse
ofsucharandom
passwordmayalsocreateaproblem;Alicemightstorethepasswordsomewhere
soasnottoforgetit.Thismakesthepasswordsubjecttostealing.
Amore secureapproachistostorethehash
ofthepasswordinthepasswordfile
(instead
oftheplaintextpassword).Anyusercanreadthecontents ofthefile,but,
becausethehashfunctionisaone-wayfunction,itisalmostimpossibletoguessthe
value
ofthepassword.ThehashfunctionpreventsEvefromgainingaccesstothesystem
eventhoughshehasthepasswordfile.However,thereisapossibility
ofanothertype of
attackcalledthe dictionaryattack. Inthisattack,Eveisinterestedinfindingonepass­
word,regardless
oftheuserID.Forexample, ifthepasswordis6digits,Evecancreate
alist
of6-digitnumbers(000000to999999),andthenapplythehashfunctiontoevery
number;theresultisalist
of1millionhashes.Shecanthengetthepasswordfileand
searchthesecond-columnentriestofindamatch.Thiscouldbeprogrammedandrun
offlineonEve'sprivatecomputer.Afteramatchisfound,Evecangoonlineandusethe
passwordtoaccessthesystem.
Wewillseehowtomakethisattackmoredifficult inthe
thirdapproach.
Anotherapproach
iscalledsaltingthepassword.Whenthepasswordstring iscreated,
arandomstring,calledthesalt,isconcatenatedtothepassword.Thesaltedpasswordis
thenhashed.The
rD,salt,andthehasharethenstored inthefile.Now,whenauserasks
foraccess,thesystemextractsthesalt,concatenatesitwiththereceivedpassword,
makesahashout
oftheresult,andcomparesitwiththehashstoredinthefile. Ifthere
\~amatc\.,a.cce.~~ \~%,tal e.d:,C)fue.N1\I2,e., \~de.me.d.Salt\w~, mak.e.12,the.d\ct\c)l\aI'jattack
moredifficult.Iftheoriginalpassword is6digitsand thesaltis4digits,thenhashingis

978 CHAPTER 31NETWORKSECURITY
doneoveralO-digitvalue.ThismeansthatEvenowneedstomakealist of10million
itemsandcreateahashforeach
ofthem.Thelist ofhasheshas10millionentriesand
thecomparisontakesmuchlonger.Saltingisveryeffective
ifthesaltisaverylongran­
domnumber.TheUNIXoperatingsystemusesavariation
ofthismethod.
Inanotherapproach,twoidentificationtechniquesarecombined.Agoodexample
ofthistypeofauthenticationistheuse ofanATMcardwithaPIN(personalidentifica­
tionnumber).Thecardbelongstothecategory"somethingpossessed"andthePIN
belongstothecategory"somethingknown."ThePINisactuallyapasswordthat
enhancesthesecurity
ofthecard.Ifthecardisstolen,itcannotbeusedunlessthePIN
isknown.ThePIN,however,istraditionallyveryshortsoit
iseasilyrememberedby
theowner.Thismakesitvulnerabletotheguessingtype
ofattack.
One-TimePassword
Inthistype ofscheme,apasswordisusedonlyonce.Itiscalledthe one-timepassword.
Aone-timepasswordmakeseavesdroppingandstealinguseless.However,thisapproach
isverycomplex,andweleaveitsdiscussiontosomespecializedbooks.
Challenge-Response
Inpasswordauthentication,theclaimantprovesheridentitybydemonstratingthatshe
knowsasecret,thepassword.However,sincetheclaimantrevealsthissecret,thesecret
issusceptibletointerceptionbytheadversary.In
challenge-responseauthentication,
theclaimantprovesthatshe knowsasecretwithoutrevealingit.Inotherwords,the
claimantdoesnotrevealthesecrettotheverifier;theverifiereitherhasitorfindsit.
Inchallenge-responseauthentication,
theclaimantproves
thatsheknowsasecretwithoutrevealing it.
Thechallengeisatime-varyingvaluesuchasarandomnumberoratimestamp
whichissentbytheverifier.Theclaimantappliesafunctiontothechallengeandsends
theresult,calleda
response,totheverifier.Theresponseshowsthattheclaimantknows
thesecret.
Thechallengeisatime-varyingvaluesentbytheverifier;
theresponse
istheresultofafunctionapplied onthechanenge.
UsingaSymmetric-KeyCipher
Inthefirstcategory,thechallenge-responseauthenticationisachievedusingsymmetric­
keyencryption.Thesecrethereisthesharedsecretkey,knownbyboththeclaimant
andtheverifier.Thefunctionistheencryptingalgorithmapplied
onthechallenge.
Figure31.14showsoneapproach.Thefirstmessageisnotpart
ofchallenge-response,
itonlyinformstheverifierthattheclaimantwantstobechallenged.Thesecondmes­
sageisthechallenge.AndR
B
isthenoncerandomlychosenbytheverifiertochallenge
theclaimant.Theclaimantencryptsthe
nonceusingthesharedsecretkeyknownonly
totheclaimantandtheverifierandsendstheresulttotheverifier.Theverifierdecrypts

SECTION31.6ENTITYAUTHENTICATION 979
Figure31.14 Challenge/responseauthenticationusinganonce
Bob
(server)
Alice
(user)
...-----------iAlicel------------'l~
I+----------iRB1-----------'
themessage.Ifthenonceobtainedfromdecryptionisthesame astheonesent bythe
verifier,Aliceisgrantedaccess.
Notethatinthisprocess,theclaimantandtheverifierneedtokeepthesymmetric
keyusedintheprocesssecret.Theverifiermustalsokeepthevalueofthenoncefor
claimantidentificationuntiltheresponseisreturned.
Thereadermayhavenoticedthatuseofanoncepreventsareplayofthethirdmes­
sagebyEve.Evecannotreplaythethirdmessageandpretendthatitisanewrequest
forauthenticationbyAlicebecauseonceBobreceivestheresponse,thevalueofR
B
is
notvalidanymore.Thenexttimeanewvalueisused.
Inthesecondapproach,thetime-varyingvalueisatimestamp,whichobviously
changeswithtime.
Inthisapproachthechallengemessageisthecurrenttimesentfrom
theverifiertotheclaimant.However,thissupposesthattheclientandtheserverclocks
aresynchronized;theclaimantknowsthecurrenttime.Thismeansthatthereisnoneed
forthechallengemessage.Thefirstandthirdmessagescanbecombined.Theresultis
thatauthenticationcanbedoneusingonemessage,theresponsetoanimplicitchallenge,
thecurrenttime.Figure31.15showstheapproach.
Figure31.15 Challenge-responseauthenticationusingatimestamp
Alice
(user)
Bob
(server)
---
Alice,T
UsingKeyed-HashFunctions
Insteadofusingencryptionanddecryptionforentityauthentication,wecanusea
keyed-hashfunction(MAC).Therearetwoadvantagestothisscheme.First,the

980 CHAPTER31NETWORKSECURITY
encryption/decryptionalgorithmisnotexportabletosomecountries.Second,inusinga
keyed-hashfunction,
wecanpreservetheintegrity ofchallengeandresponsemessages
andatthesametimeuseasecret,the
key.
Letusseehowwecanuseakeyed-hashfunctiontocreateachallengeresponsewith
atimestamp.Figure31.16showsthescheme.
Figure31.16Challenge-responseauthenticationusingakeyed-hashfunction
Alice
(user)
Alice,TI
n+T
Hash
Bob
(server)
Notethatinthiscase,thetimestampissentboth asplaintextandastextscrambled
bythekeyed-hashfunction.WhenBobreceivesthemessage,hetakestheplaintext
T,
appliesthekeyed-hashfunction,andthencompareshiscalculationwithwhathe
receivedtodeterminetheauthenticity
ofAlice.
UsinganAsymmetric-KeyCipher
Insteadofasymmetric-keycipher,wecanuse
anasymmetric-keycipherforentity
authentication.Herethesecretmustbetheprivatekeyoftheclaimant.Theclaimant
mustshowthatsheownstheprivatekeyrelatedtothepublickeythatisavailableto
everyone.Thismeansthattheverifiermustencryptthechallengeusingthepublickey
oftheclaimant;theclaimantthendecryptsthemessageusingherprivatekey.The
responsetothechallengeisthedecryptedchallenge.
Weshowtwoapproaches:onefor
unidirectionalauthenticationandoneforbidirectionalauthentication.Inoneapproach,
BobencryptsthechallengeusingAlice'spublic
key.Alicedecryptsthemessagewith
herprivatekeyandsendsthenoncetoBob.Figure31.17showsthisapproach.
Figure31.17Authentication,asymmetric-key
Alice
(user)
Alice
Bob
(server)
-

SECTION31.7KEYMANAGEMENT 981
UsingDigitalSignature
Wecanusedigitalsignatureforentityauthentication.Inthismethod,welettheclaim­
antuseherprivatekeyforsigninginstead
ofusingitfordecryption.Inoneapproach
showninFigure31.18,Bobusesaplaintextchallenge.Alicesignstheresponse.
Figure31.18Authentication,usingdigitalsignature
Alice
(user)
Alice
Bob
31.7KEYMANAGEMENT
Bob
(server)
Wehaveusedsymmetric-keyandasymmetric-keycryptographyin ourdiscussion
throughoutthechapter.However,weneverdiscussedhowsecretkeysinsymmetric-key
cryptographyandhowpublickeysinasymmetric-keycryptographyaredistributedand
maintained.Inthissection,wetouchonthesetwoissues.
Wefirstdiscussthedistribu­
tion
ofsymmetrickeys;wethendiscussthedistribution ofasymmetrickeys.
Symmetric-Key Distribution
Wehavelearnedthatsymmetric-keycryptographyismoreefficientthanasymmetric­
keycryptographywhenweneedtoencryptanddecryptlargemessages.Symmetric­
keycryptography,however,needsasharedsecretkeybetweentwoparties.
IfAliceneedstoexchangeconfidentialmessageswith
Npeople,sheneeds Ndifferent
keys.What
ifNpeopleneedtocommunicatewithoneanother?Atotal ofN(N- 1)/2keys
isneeded.Eachpersonneedstohave
N-1keystocommunicatewitheach oftheother
people,butbecausethekeysareshared,weneedonly
N(N-1)12.Thismeansthat if
1millionpeopleneedtocommunicatewithoneanother,eachpersonhasalmost0.5mil­
liondifferentkeys;intotal,almost1billionkeysareneeded.Thisisnormallyreferredto
as
theN
2
problembecausethenumber ofrequiredkeysfor Nentitiesiscloseto N
2
.
Thenumber ofkeysisnottheonlyproblem;thedistribution ofkeysisanother. If
AliceandBobwanttocommunicate,theyneedtosomehowexchangeasecretkey; if
Alicewantstocommunicatewith1millionpeople,howcansheexchange1million
keyswith1millionpeople?UsingtheInternetisdefinitelynotasecuremethod.

982 CHAPTER31NETWORKSECURITY
Itisobviousthatweneedanefficientway ofmaintaininganddistributingsecret
keys.
KeyDistributionCenter:KDC
Apracticalsolutionistheuse
ofatrustedparty,referredtoasa keydistributioncen­
ter(KDC).Toreducethenumber ofkeys,eachpersonestablishesasharedsecretkey
withtheKDCasshowninFigure31.19.
Figure31.19 KDC
Alice~. KAlice K ~ Bob
~~~ Bb~~~
&
K~'~~""';- "'~"'K~~~~~&
Ann George
Ann------------c;:::;:::u:J------------George
E:9
• "- ......KBetsy
: Krd",KDC .....
Ie, .....
, ...
, ..
Ted&,/ ..........& Betsy
AsecretkeyisestablishedbetweenKDCandeachmember.Alicehasasecretkey
withKDC,whichwerefertoasK
Alice
;
BobhasasecretkeywithKDC,whichwerefer
toasK
Bob
;
andsoon.Nowthequestionis,HowcanAlicesendaconfidential message
toBob?Theprocessisasfollows:
1.AlicesendsarequesttoKDC,statingthatsheneedsasession(temporary)secret
keybetweenherselfandBob.
2.KDCinformsBob ofAlice'srequest.
3.IfBobagrees,asessionkeyiscreatedbetweenthetwo.
ThesecretkeybetweenAliceandBobthat
isestablishedwiththeKDC isusedto
authenticateAliceandBobtotheKDCandtopreventEvefromimpersonatingeither
ofthem.WediscusshowasessionkeyisestablishedbetweenAliceandBoblaterinthe
chapter.
SessionKeys
AKDCcreatesasecretkeyforeachmember.Thissecretkeycanbeusedonlybetween
thememberandtheKDC,notbetweentwomembers.
IfAliceneedstocommunicate
secretlywithBob,sheneedsasecretkeybetweenherselfandBob.AKDCcancreatea
session(temporary)keybetweenAliceandBobusingtheirkeyswiththecenter.The
keys
ofAliceandBobareusedtoauthenticateAliceandBobtothe centerandtoeach
otherbeforethesessionkeyisestablished.Aftercommunicationisterminated,theses­
sionkeyisnolongervalid.
Asessionsymmetrickeybetweentwopartiesisusedonlyonce.

SECTION31.7KEYMANAGEMENT 983
Severaldifferentapproacheshavebeenproposedtocreatethesessionkeyusing
ideaswepreviouslydiscussedforentityauthentication.
Letusdiscussoneapproach,thesimplestone,asshown
inFigure31.20.Although
thissystemhassomeflaws,itshowstheidea.Moresophisticatedapproaches
canbe
foundinsecuritybooks.
Figure31.20Creatingasessionkey betweenAliceandBobusingKDC
KDC
­
u:;:L::UJ
~
--
••-----1Alice,BobI---~~I
Bob
_....
DStep1 AlicesendsaplaintextmessagetotheKDCtoobtainasymmetricsession
keybetween
Bobandherself.Themessagecontainsherregisteredidentity(the
word
Aliceinthefigure)andtheidentity ofBob(theword Bobinthefigure).This
messageisnotencrypted,itispublic.KDCdoesnotcare.
DStep2KDCreceivesthemessageandcreateswhatiscalleda ticket.Theticketis
encryptedusingBob'skey(K
B
).Theticketcontainstheidentities ofAliceandBob
andthesessionkey(K
AB
).Theticketwithacopy ofthesessionkeyissenttoAlice.
Alicereceivesthemessage,decryptsit,andextractsthesessionkey.Shecannot
decryptBob'sticket;theticketisforBob,notforAlice.Notethatwehaveadouble
encryptioninthismessage;theticketisencryptedandtheentiremessageisalso
encrypted.
Inthesecondmessage,AliceisactuallyauthenticatedtotheKDC,
becauseonlyAlicecanopenthewholemessageusinghersecretkeywithKDC.
DStep3AlicesendsthetickettoBob.BobopenstheticketandknowsthatAliceneeds
tosendmessagesto
himusingK
ABasthesessionkey.Notethatinthismessage,
BobisauthenticatedtotheKDCbecauseonlyBobcanopentheticket.SinceBob
is
authenticatedtotheKDC,heisalsoauthenticatedtoAlicewhotruststheKDC. In
thesameway,AliceisalsoauthenticatedtoBob,becauseBobtruststheKDCand
theKDChassentthetickettoBobwhichincludestheidentity
ofAlice.
Kerberos
KerberosisanauthenticationprotocolandatthesametimeaKDCthathasbecome
verypopular.SeveralsystemsincludingWindows2000useKerberos.Itisnamedafter
thethree-headeddoginGreekmythologythatguardstheGates
ofHades.Originally
designedatM.LT.,ithasgonethroughseveralversions.Wediscussonlyversion4,the
mostpopular.

Bob(Server)
984 CHAPTER 31NETWORKSECURITY
ServersThreeserversareinvolvedintheKerberosprotocol:anauthenticationserver
(AS),aticket-grantingserver(TGS),andareal(data)serverthatprovidesservicesto
others.Inourexamplesandfigures
Bobistherealserverand Aliceistheuserrequest­
ingservice.Figure31.21showstherelationshipbetweenthesethreeservers.
Figure31.21Kerberosservers
1.Requestticketfor TGS
2.Alice-TGSsessionkey
andticketforTGS
Iil
Alire~: ~AS,:;:;,
~II(-~'8
3.RequestticketforBob
4.Alice-Bobsession key
__an_d_tl_'c_ke_t_fo_r_Bo_b•~
5.Requestaccess~
6.Grantaccess
oAuthenticationServer(AS).ASistheKDCinKerberosprotocol.Eachuserreg­
isterswith
ASandisgrantedauseridentityandapassword. AShasadatabase
withtheseidentitiesandthecorrespondingpasswords.
ASverifiestheuser,issues
asessionkeytobeusedbetweenAliceandTGS,andsendsaticketforTGS.
oTicket-GrantingServer(TGS).TGSissuesaticketfortherealserver(Bob). It
alsoprovidesthesessionkey(K
AB
)
betweenAliceandBob.Kerberoshassepa­
ratedtheuserverificationfromticketissuing.Inthisway,althoughAliceverifies
herIDjustoncewithAS,shecancontactTGSmultipletimestoobtainticketsfor
differentrealservers.
oRealServer.Therealserver(Bob)providesservicesfortheuser(Alice).Kerberos
isdesignedforaclient/serverprogramsuch
asFTP,inwhichauserusestheclient
processtoaccesstheserverprocess.Kerberosisnotusedforperson-to-person
authentication.
OperationAclientprocess(Alice)canaccessaprocessrunningontherealserver
(Bob)insixstepsasshowninFigure31.22.
oStep1.AlicesendsherrequesttoASinplaintext,usingherregisteredidentity.
oStep2. ASsendsamessageencryptedwithAlice'ssymmetrickey
KA-Themes­
sagecontainstwoitems:asessionkeyK
s
thatisusedbyAlicetocontactTGSanda
ticketforTGSthatisencryptedwiththeTGSsymmetrickeyK
TG
.Alicedoesnot
knowK
A
,
butwhenthemessagearrives,shetypeshersymmetricpassword.The
passwordandtheappropriatealgorithmtogethercreateK
Aifthepasswordiscorrect.
Thepasswordisthenimmediatelydestroyed;itisnotsenttothenetwork,anditdoes

SECTION31.7KEYMANAGEMENT 985
Figure31.22 Kerberosexample
Server(Bob)
AS
TGS
=
i
-
Alice
i
u::::u::u
E:=l
~iii.!!!!!!
1--1""
..'"
I
~B ~KB I
1I;IIf-----------l:2]c'0lice,K
AB
I-------·~I
1+---------1f&ful---------·~~I:
notstayintheterminal. ItisonlyusedforamomenttocreateKA-Theprocessnow
usesK
A
todecryptthemessagesent.BothK s
andtheticketareextracted.
oStep3.AlicenowsendsthreeitemstoTGS.Thefirstistheticketreceivedfrom
AS.Thesecondisthenameoftherealserver(Bob),thethird
isatimestampwhich
isencryptedbyK
s.
ThetimestamppreventsareplaybyEve.
oStep4. Now,TGSsendstwotickets,eachcontainingthesessionkeybetween
AliceandBobK
AB
.
TheticketforAlice isencryptedwithKs;theticketforBob is
encryptedwithBob'skeyK
B
.
NotethatEvecannotextractK
AB
becauseshedoes
notknowK
s
orK
B
.
Shecannotreplaystep3becauseshecannotreplacethetimestamp
withanewone(shedoesnotknowK
S
)'Evenifsheisveryquickandsendsthe
step3messagebeforethetimestamphasexpired,shestillreceivesthesametwo
ticketsthatshecannotdecipher.
oStep5.AlicesendsBob'sticketwiththetimestampencryptedbyK
AB
.
oStep6.Bobconfirmsthereceiptbyadding1tothetimestamp.Themessageis
encryptedwithK
AB
andsenttoAlice.
UsingDifferentServersNotethat
ifAliceneedstoreceiveservicesfromdifferent
servers,sheneedrepeatonlysteps3
to6.ThefirsttwostepshaveverifiedAlice'siden­
tityandneednotberepeated.AlicecanaskTGStoissueticketsformultipleserversby
repeatingsteps3to
6.

986 CHAPTER 31NETWORKSECURITY
RealmsKerberosallowstheglobaldistribution ofASsandTGSs,witheachsystem
calledarealm.Ausermaygetaticketforalocalserveroraremoteserver.Inthesec­
ondcase,forexample,AlicemayaskherlocalTGStoissueaticketthat isacceptedby
aremoteTGS.ThelocalTGScanissuethisticket
iftheremoteTGSisregisteredwith
thelocalone.ThenAlicecanusetheremoteTGStoaccesstheremoterealserver.
Public-KeyDistribution
Inasymmetric-keycryptography,peopledonotneedtoknowasymmetricshared key.
IfAlicewantstosendamessagetoBob,sheonlyneedstoknowBob'spublickey,
whichisopentothepublicandavailabletoeveryone.
IfBobneedstosendamessage
toAlice,heonlyneedstoknowAlice'spublickey,whichisalsoknowntoeveryone.In
public-keycryptography,everyoneshieldsaprivatekeyandadvertisesapublickey.
Inpublic-keycryptography,everyone hasaccesstoeveryone'spublickey;
publickeys
areavailabletothepublic.
Publickeys,likesecretkeys,needtobedistributedtobeuseful.Letusbrieflydis­
cussthewaypublickeyscanbedistributed.
PublicAnnouncement
Thenaiveapproachistoannouncepublickeyspublicly.Bobcanputhispublickeyon
hiswebsiteorannounceitinalocalornationalnewspaper.WhenAliceneedstosenda
confidentialmessage
toBob,shecanobtainBob'spublickeyfromhissiteorfromthe
newspaper,orshecanevensendamessagetoaskforit.Figure31.23showsthesituation.
Figure31.23 Announcingapublickey
I
I
\ I I
" I "'.....',:,'.".'
" \ I I .".'
......\ I '
------'-.....j:'------
Publickey
Bob
Thisapproach,however,isnotsecure;itissubjecttoforgery.Forexample,Eve
couldmakesuchapublicannouncement.BeforeBobcanreact,damagecouldbedone.
EvecanfoolAliceintosendingheramessagethatisintendedforBob.Evecouldalso
signadocumentwithacorrespondingforgedprivatekeyandmakeeveryonebelieveit
wassignedbyBob.Theapproachisalsovulnerable
ifAlicedirectlyrequestsBob's
public
key.EvecaninterceptBob'sresponseandsubstituteherownforgedpublickey
forBob'spublic
key.

SECTION31.7KEYMANAGEMENT 987
TrustedCenter
Amoresecureapproachistohaveatrustedcenterretainadirectory ofpublickeys.The
directory,liketheoneusedinatelephonesystem,isdynamicallyupdated.Eachuser
canselectaprivate/publickey,keeptheprivatekey,anddeliverthepublickeyforinser­
tionintothedirectory.Thecenterrequiresthateachuserregisterinthecenterand
provehisorheridentity.Thedirectorycanbepubliclyadvertisedbythetrustedcenter.
Thecentercanalsorespondtoanyinquiryaboutapublickey.Figure31.24showsthe
concept.
Figure31.24 Trustedcenter
,
,
,
\
... \
"', \
......,
".....\.
Directory
· ·
· ·
AliceK
A
· ···· ·
BobK
B
· · · ·· ·
Trustedcenter
ControlledTrustedCenter
Ahigherlevel ofsecuritycanbeachieved ifthereareaddedcontrolsonthedistribution
ofthepublickey.Thepublic-keyannouncementscanincludeatimestampandbe
signedbyanauthoritytopreventinterceptionandmodification
oftheresponse.IfAlice
needstoknowBob'spublickey,shecansendarequesttothecenterincludingBob's
nameandatimestamp.ThecenterrespondswithBob'spublickey,theoriginalrequest,
andthetimestampsignedwiththeprivatekey
ofthecenter.Aliceusesthepublickey of
thecenter,knownby all,todecryptthemessageandextractBob'spublic key.Figure31.25
showsonescenario.
CertificationAuthority
Thepreviousapproachcancreateaheavyloadonthecenter ifthenumber ofrequests
islarge.Thealternativeistocreatepublic-keycertificates.Bobwantstwothings:he
wantspeopletoknowhispublickey,andhewantsnoonetoacceptapublickeyforged
ashis.Bobcangotoa
certificationauthority (CA)-afederalorstateorganization
thatbindsapublickeyto
anentityandissuesacertificate.TheCAhasawell-known
publickeyitselfthatcannotbeforged.The
CAchecksBob's identification(usinga

988 CHAPTER 31NETWORKSECURITY
Figure31.25 Controlledtrustedcenter
Directory
······
AliceKA
······
BobKg
·:··
Alice
r'
--
Trustedcentercw:::w:::J
E:::3
-
NeedBob'skey,Time
KCenter
NeedBob'skey,Time,K
B
pictureIDalongwithotherproof).ItthenasksforBob'spublickeyandwritesitonthe
certificate.
Topreventthecertificateitselffrombeingforged,theCAsignsthecertificate
withitsprivatekey.NowBobcanuploadthesignedcertificate.Anyonewhowants
Bob'spublickeydownloadsthesignedcertificateandusesthepublickey
ofthecenter
toextractBob'spublickey.Figure31.26showstheconcept.
Figure31.26 Certificationauthority
Directory
__
A"p~IX jL.....-K......B_I-_
=-=
cw:::w:::JTrusted
E3center
-
Issue
· ··:
·
AliceK
A
······,~BobKg
· · ·:
·
Bob
..
-",'II
.. II
,,' I I
" I
I I
I I
I I
I
AnnouncetopUblic
I
\ I
, I
\ I
, I
"....',I
" \ I
....,, I
..
--------~--- -

SECTION31.7KEYMANAGEMENT 989
X.509Althoughtheuse ofaCAhassolvedtheproblem ofpublic-keyfraud,ithas
createdasideeffect.Eachcertificatemayhaveadifferentformat.
IfAlice
wa.!1tstouse
aprogramtoautomaticallydownloaddifferentcertificatesanddigestsbelongingtodif­
ferentpeople,theprogrammaynotbeabletodoso.Onecertificatemayhavethepublic
keyinoneformatandanother
inanotherformat.Thepublickeymaybeonthefirstline
inonecertificateandonthethirdlineinanother.Anythingthatneedstobeuseduniver­
sallymusthaveauniversalformat.
Toremovethissideeffect,lTDhasdesignedaprotocolcalledX.509,whichhasbeen
acceptedbytheInternetwithsomechanges.X.509isawaytodescribethecertificateina
structuredway.
Itusesawell-knownprotocolcalledASN.1(AbstractSyntax Notation 1)
thatdefinesfieldsfamiliartoCprogrammers.Thefollowingliststhefieldsinacertificate.
DVersionThisfielddefinestheversion ofX.509ofthecertificate.Theversion
numberstartedat0;thecurrentversionis2(thethirdversion).
oSerialnumberThisfielddefinesanumberassignedtoeachcertificate.Thevalue
isuniqueforeachcertificateissued.
oSignatureThisfield,forwhichthenameisinappropriate,identifiesthealgorithm
usedtosignthecertificate.Anyparameterthatisneededforthesignatureisalso
definedinthisfield.
oIssuerThisfieldidentifiesthecertificationauthoritythatissuedthecertificate.The
nameisnormallyahierarchy
ofstringsthatdefinesacountry,state,organization,
department,andsoon.
oPeriodofvalidity Thisfielddefinestheearliestandthelatesttimesthecertificate
isvalid.
oSubjectThisfielddefinestheentitytowhichthepublickeybelongs. Itisalsoa
hierarchy
ofstrings.Part ofthefielddefineswhatiscalledthe commonname,
whichistheactualname ofthebeholderofthekey.
oSubject'spublickey Thisfielddefinesthesubject'spublickey,theheart ofthe
certificate.Thefieldalsodefinesthecorrespondingalgorithm(RSA,forexample)
anditsparameters.
oIssueruniqueidentifier Thisoptionalfieldallowstwoissuerstohavethesame
issuerfieldvalue,iftheissueruniqueidentifiers aredifferent.
DSubjectuniqueidentifier Thisoptionalfieldallowstwodifferentsubjectstohave
thesame
subjectfieldvalue,ifthesubjectuniqueidentifiers aredifferent.
oExtensionThisfieldallowsissuerstoaddmoreprivateinformationtothecertificate.
oEncryptedThisfieldcontainsthealgorithmidentifier,asecurehash oftheother
fields,andadigitalsignature
ofthathash.
Public-KeyInfrastructures(PKI)
Whenwewanttousepublickeysuniversally,wehaveaproblemsimilartosecret-key
distribution.WefoundthatwecannothaveonlyoneKDCtoanswerthequeries.
We
needmanyservers.Inaddition,wefoundthatthebestsolutionistoputtheserversina
hierarchicalrelationshipwithoneanother.Likewise,asolutiontopublic-keyqueriesis
ahierarchicalstructurecalleda
public-keyinfrastructure(PKI). Figure31.27shows
anexample
ofthishierarchy.

990 CHAPTER 31NETWORKSECURITY
Figure31.27 PKIhierarchy
Level-l
CAl
Atthefirstlevel,wecanhavearoot CAthatcancertifytheperformance ofCAsin
thesecondlevel;theselevel-lCAsmayoperateinalargegeographicorlogicalarea.
Thelevel-2CAsmayoperateinsmallergeographicareas.
Inthishierarchy,everybodytruststheroot.Butpeople
mayormaynottrustinter­
mediateCAs.
IfAliceneedstogetBob'scertificate,shemayfindaCAsomewhereto
issuethecertificate.ButAlicemaynottrustthatCA.InahierarchyAlicecanaskthe
next-higherCAtocertifytheoriginalCA.Theinquirymaygoallthewaytotheroot.
31.8RECOMMENDED READING
Formoredetailsaboutthesubjectsdiscussed inthischapter,werecommendthefollowing
booksandsites.Theitemsinbrackets[
...]refertothereferencelistattheend ofthetext.
Books
Severalbooksarededicatedtonetworksecurity,suchas[PHS02],[Bis03],and[SalO3].
31.9KEYTERMS
authenticationserver(AS)
certificationauthority(CA)
challenge-responseauthentication
claimant
dictionaryattack
digitalsignature
eavesdropping
entityauthentication
fingerprint
fixedpassword
hashfunction
hashedmessageauthenticationcode
(HMAC)
identification
integrity
Kerberos
keydistributioncenter(KDC)
messageauthentication
messageauthenticationcode(MAC)
messageconfidentialityorprivacy
messagedigest
messageintegrity

messagenonrepudiation
modificationdetectioncode
(MDC)
nonce
nonrepudiation
one-timepassword
one-wayness
password
privacy
public-keyinfrastructure
(PKI)
salting
SECTION31.10 SUMMARY 991
sessionkey
SHA-I
signaturescheme
signingalgorithm
strongcollision
ticket
ticket-grantingserver
(TGS)
verifier
verifyingalgorithm
weakcollision
X.509
31.10SUMMARY
DCryptographycanprovidefiveservices.Four ofthesearerelatedtothemessage
exchangebetweenAliceandBob.Thefifthisrelatedtotheentitytryingtoaccessa
systemforusingitsresources.
DMessageconfidentialitymeansthatthesenderandthereceiverexpectprivacy.
DMessageintegritymeansthatthedatamustarriveatthereceiverexactlyassent.
DMessageauthenticationmeansthatthereceiverisensuredthatthemessageiscoming
fromtheintendedsender,notanimposter.
DNonrepudiationmeansthatasender mustnotbeabletodenysendingamessage
thathesent.
DEntityauthenticationmeanstoprovetheidentity oftheentitythattriestoaccess
thesystem'sresources.
DAmessagedigestcan beusedtopreservetheintegrity ofadocumentoramessage.
Ahashfunctioncreatesamessagedigestout
ofamessage.
DAhashfunctionmustmeetthreecriteria:one-wayness,resistancetoweakcollision,
andresistancetostrongcollision.
DAkeylessmessagedigestisusedasamodificationdetectioncode(MDC). Itguar­
anteestheintegrity
ofthemessage.Toauthenticatethedataorigin,oneneedsa
messageauthenticationcode(MAC).
DMACsarekeyedhashfunctionsthatcreateacompresseddigestfromthemessage
addedwiththekey.Themethodhasthesamebasisasencryptionalgorithms.
DAdigitalsignatureschemecanprovidethesameservicesprovidedbyaconven­
tionalsignature.Aconventionalsignatureisincluded
inthe document;adigital
signatureisaseparateentity.
DDigitalsignature providesmessageintegrity,authentication,andnonrepudiation.
Digitalsignaturecannotprovideconfidentialityforthemessage.
Ifconfidentiality
isneeded,acryptosystemmust
beappliedoverthescheme.

992 CHAPTER 31NETWORKSECURiTY
oAdigitalsignatureneedsanasymmetric-keysystem.
oInentityauthentication,aclaimantprovesheridentitytotheverifierbyusingone
ofthethreekinds ofwitnesses:somethingknown,somethingpossessed,orsome­
thinginherent.
oInpassword-basedauthentication,theclaimantusesastring ofcharactersassome­
thingsheknows.
oPassword-basedauthenticationcanbedividedintotwobroadcategories:fixedand
one-time.
oInChallenge-responseauthentication,theclaimantprovesthatsheknowsasecret
withoutactuallysending
it.
oChallenge-responseauthenticationcanbedividedintofourcategories:symmetric­
keyciphers,keyed-hashfunctions,asymmetric-keyciphers,anddigitalsignature.
DAkeydistributioncenter(KDC)isatrustedthirdpartythatassignsasymmetric
keytotwoparties.
oKDCcreatesasecretkeyonlybetweenamemberandthecenter.Thesecretkey
betweenmembersneedstobecreatedasasessionkeywhentwomemberscon­
tactKDC.
DKerberosisapopularsessionkeycreatorprotocolthatrequiresanauthentication
serverandaticket-grantingserver.
DAcertificationauthority(CA)isafederal orstateorganizationthatbindsapublic
keytoanentityandissuesacertificate.
DApublic-keyinfrastructure(PKI)isahierarchicalsystemtoanswerqueriesabout
keycertification.
31.11PRACTICESET
ReviewQuestions
1.Whatisanonce?
2.Whatisthe N
2
problem?
3.NameaprotocolthatusesaKDCforuserauthentication.
4.Whatisthepurpose oftheKerberosauthenticationserver?
5.Whatisthepurpose
oftheKerberosticket-grantingserver?
6.Whatisthepurpose ofX,S09?
7.Whatisacertificationauthority?
8.Whataresomeadvantagesanddisadvantages ofusinglongpasswords?
9.Wediscussedfixedandone-timepasswords astwoextremes.Whataboutfrequently
changedpasswords?Howdoyouthinkthisschemecanbeimplemented?Whatare
theadvantagesanddisadvantages?
10.Howcanasystempreventaguessingattackonapassword?Howcanabank
preventPINguessing
ifsomeonehasfound orstolenabankcardandtriedto
useit?

SECTION31.11PRACTICESET 993
Exercises
11.Amessageismade of10numbersbetween00and99.Ahashalgorithmcreatesa
digestout
ofthismessagebyaddingallnumbersmodulo100.Theresultingdigest
isanumberbetween00and99.Doesthisalgorithmmeetthefirstcriterion ofa
hashalgorithm?Doesitmeetthesecond criterion?Doesitmeetthethirdcriterion?
12.Amessageismade of100characters.Ahashalgorithmcreatesadigestout ofthis
messagebychoosingcharacters
1,11,21,...,and91.Theresultingdigesthas
10characters.Doesthisalgorithmmeetthefirstcriterion
ofahashalgorithm?
Doesitmeetthesecondcriterion?Does
itmeetthethirdcriterion?
13.Ahashalgorithmcreatesadigest ofNbits.Howmanydifferentdigestscanbe
createdfromthisalgorithm?
14.Ataparty,which ismoreprobable,apersonwithabirthdayonaparticulardayor
two(ormore)personshavingthesamebirthday?
15.HowisthesolutiontoExercise 14relatedtothesecondandthirdcriteriaofahashing
function?
16.Whichoneismorefeasible,afixed-sizedigestoravariable-sizedigest?Explain
youranswer.
17.Amessageis20,000characters. Weareusingadigest ofthismessageusing SHA-l.
Aftercreatingthedigest,wedecidedtochangethelast10characters.Canwesay
howmanybitsinthedigestwillbechanged?
18.Aretheprocesses ofcreatingaMACand ofsigningahashthesame?Whatarethe
differences?
19.Whenapersonusesamoneymachinetogetcash,isthisamessageauthentication,
anentityauthentication,orboth?
20.ChangeFigure31.14toprovidetwo-wayauthentication(AliceforBobandBob
forAlice).
21.ChangeFigure31.16toprovidetwo-wayauthentication(AliceforBobandBob
forAlice).
22.ChangeFigure31.17toprovidetwo-wayauthentication(AliceforBobandBob
forAlice).
23.ChangeFigure31.18toprovidetwo-wayauthentication(AliceforBobandBob
forAlice).
24.Inauniversity,astudentneedstoencryptherpassword(withauniquesymmetric
key)beforesendingitwhenshelogsin.Doesencryptionprotecttheuniversityor
thestudent?Explainyouranswer.
25.InExercise24,doesithelp
ifthestudentappendsatimestamptothepasswordbefore
encryption?Explainyouranswer.
26.InExercise24,doesithelp
ifastudenthasalist ofpasswordsandusesadifferent
oneeachtime?
27.InFigure31.20,whathappens
ifKDCisdown?
28.InFigure31.21,whathappens
iftheAS isdown?Whathappens iftheTGSisdown?
Whathappens
ifthemainserverisdown?
29.InFigure31.26,whathappens
ifthetrustedcenter isdown?

994 CHAPTER 31NETWORKSECURITY
30.Addasymmetric-keyencryption/decryptionlayertoFigure31.11 toprovideprivacy.
31.Addanasymmetric-keyencryption/decryptionlayertoFigure31.11
toprovideprivacy.
ResearchActivities
32.ThereisahashingalgorithmcalledMD5.Findthedifferencebetweenthisalgorithm
and
SHA-l.
33.ThereisahashingalgorithmcalledRIPEMD-160.Findthedifferencebetween
thisalgorithmand
SHA-l.
34.Compare
MD5.SHA-1,andRIPEMD-160.
35.FindsomeinfonnationaboutRSAdigitalsignature.
36.FindsomeinformationaboutDSSdigitalsignature.

CHAPTER32
SecurityintheInternet:IPSec,
SSUTLS,PGp,VPN,andFirewalls
Inthischapter,wewant toshowhowcertainsecurityaspects,particularlyprivacyand
messageauthentication,canbeappliedtothenetwork,transport,andapplicationlayers
of
theInternetmodel.WebrieflyshowhowtheIPSecprotocolcanaddauthenticationand
confidentialitytotheIPprotocol,howSSL(orTLS)candothesamefortheTCPprotocol,
andhowPGPcandoitfortheSMTPprotocol(e-mail).
Inalltheseprotocols,therearesomecommonissuesthat
weneedtoconsider.First,
weneedtocreateaMAC.ThenweneedtoenCl)'ptthemessageand,probably,the
MAC.Thismeans,thatwithsomeminorvariations,thethreeprotocolsdiscussedinthis
chaptertakeapacketfromtheappropriatelayerandcreateanewpacketwhichisauthen­
ticatedandencrypted.Figure32.1showsthisgeneralidea.
Figure32.1 Commonstructure ofthreesecurityprotocols
Headerofsecurity
protocol
Payload
(fromIP,TCP,orSMTP)
)
Dataflow
Notethattheheaderorthetrailer ofthesecurityprotocol mayormaynotbeincluded
intheencryptionprocess.Notealsothatsomeprotocols mayneedmoreinformationin
thesecuredpacket;thefigureshowsonlythegeneralidea.
Onecommonissueinalltheseprotocols
issecurityparameters. Even thesimplified
structureinFigure32.1suggeststhatAliceandBobneedtoknowseveralpieces
ofinfor­
mation,securityparameters,beforetheycansendsecureddatatoeachother.Inparticular,
theyneedtoknowwhichalgorithmstouseforauthenticationandencryption/decryption.
995

996 CHAPTER 32SECURITYINTHEINTERNET:IPSec,SSl./TLS,PGP, VPN,ANDFIREWALLS
Evenifthesealgorithmscanbepredeterminedforeveryoneintheworld,whichtheyare
notaswewillsee,BobandAlicestillneedatleasttwokeys:onefortheMACandone
forencryption/decryption.Inotherwords,thecomplexity
oftheseprotocolsliesnotin
thewaythe MACdataarecalculatedorthewayencryptionisperformed;itliesinthefact
thatbeforecalculatingthe MACandperformingencryption,weneedtocreateaset
of
securityparametersbetweenAliceandBob.
Atfirstglance,itlooksas
iftheuseofanyoftheseprotocolsmustinvolveaninfi­
nitenumber
ofsteps.Tosendsecureddata,weneedaset ofsecurityparameters.The
secureexchange
ofsecurityparametersneedsasecondset ofsecurityparameters.The
secureexchangeofthesecondset
ofsecurityparametersneedsathirdset ofsecurity
parameters.Andsoonadinfinitum.
Tolimitthesteps,wecanusepublic-keycryptography ifeachpersonhasaprivate
andpublickeypair.Thenumber
ofstepscanbereducedtooneortwo.Intheone-step
version,wecanusesessionkeystocreatetheMACandencryptbothdataandMAC.
Thesessionkeysandthelist
ofalgorithmscanbesentwiththepacketbutencryptedby
usingpublic-keyciphers.Inthetwo-stepversion,wefirstestablishthesecuritypara­
metersbyusingpublic-keyciphers.
Wethenusethesecurityparameterstosecurely
sendactualdata.One
ofthethreeprotocols, PGP,usesthefirstapproach;theothertwo
protocols,IPSecandSSLITLS,usethesecond.
Wealsodiscussacommonprotocol,thevirtualprivatenetwork(VPN),thatuses
theIPSec.Attheend
ofthechapter,wediscussthefirewall,amechanismforpreventing
theattackonthenetwork
oftheorganization.
32.1IPSecurity(IPSec)
IPSecurity(IPSec)isacollection ofprotocolsdesignedbytheInternetEngineering
TaskForce(IETF)toprovidesecurityforapacketatthenetworklevel.IPSechelpsto
createauthenticatedandconfidentialpacketsfortheIPlayerasshowninFigure32.2.
Figure32.2TCPIIPprotocolsuiteandIPSec
Applications
UDP,TCP,orSCTP
TwoModes
IP
Underlyingphysicalnetworks
I
I
IPSecisdesigned
toprovidesecurity
at
thenetworklayer.
IPSecoperatesinone oftwodifferentmodes:thetransportmodeorthetunnelmode as
showninFigure32.3.

SECTION32.1IPSecurity(IPSec)997
Figure32.3 Transportmodeandtunnelmodes ofIPSecprotocol
Transportlayer
Transport,layer
payload
Networklayer
IPSec
a.Transportmode
Networklayer
IPSec
b.Tunnelmode
TransportMode
Inthetransportmode,IPSecprotectswhatisdeliveredfromthetransportlayertothe
networklayer.
Inotherwords,thetransportmodeprotectsthenetworklayerpayload,
thepayloadto
beencapsulatedinthenetworklayer.
Notethatthetransport
modedoesnotprotectthe IPheader.Inotherwords,the
transportmodedoes
notprotectthewholeIPpacket;itprotectsonlythepacketfrom
thetransportlayer(the
IPlayerpayload). Inthismode,theIPSecheaderandtrailerare
addedtotheinformationcorningfromthetransportlayer.
TheIPheaderisaddedlater.
IPSec
inthetransportmodedoesnotprotectthe IPheader;
itonlyprotectstheinformationcomingfromthetransportlayer.
Thetransportmodeisnormallyused whenweneedhost-to-host(end-to-end)pro­
tection
ofdata.ThesendinghostusesIPSectoauthenticateand/orencryptthepayload
deliveredfromthetransportlayer.
ThereceivinghostusesIPSectochecktheauthenti­
cationandlordecrypttheIPpacketanddeliver
ittothetransportlayer.Figure32.4
showsthisconcept.
Figure32.4 Transportmodeinaction
!
~. Transportlayer fI Transportlayer
JI:;!IPSeclayer )!=i::jl:::::::::::=±=!lIPSeclayer
!II! INetworklayer I1il!ll!C::::.=:::::::::::::::llNetworklayer
~-----illlac::::::=:=::::::::::::rt>>----&
HostA HostB

998 CHAPTER 32SECURITYINTHEINTERNET:IPSec,SSUTLS,PGP, VPN,ANDFIREWALLS
TunnelMode
Inthetunnelmode, IPSecprotectstheentireIPpacket. Ittakesan IPpacket,including
theheader,appliesIPSecsecuritymethodstotheentirepacket,andthenaddsanewIP
headerasshowninFigure32.5.
ThenewIPheader,aswewillseeshortly,hasdifferentinformationthantheoriginal
IFheader.Thetunnelmodeisnormallyusedbetweentworouters,betweenahostanda
router,orbetweenarouterandahostasshowninFigure32.5.
Figure32.5 Tunnelmodeinaction
HostA
r
--
!I:

Networklayer
IPSeclayer
Networklayer
Tunnel
~
~
HostB
r
--
Inotherwords,weusethetunnelmodewheneitherthesender orthereceiverisnot
ahost.
Theentireoriginalpacketisprotectedfromintrusionbetweenthesenderandthe
receiver.
It'sasifthewholepacketgoesthroughanimaginarytunnel.
IPSecintunnelmodeprotectstheoriginal IPheader.
TwoSecurityProtocols
IPSecdefinestwo protocols-theAuthenticationHeader(AH)Protocol andtheEncap­
sulatingSecurityPayload(ESP)
Protocol-toprovideauthenticationand/orencryption
forpacketsattheIPlevel.
AuthenticationHeader(AH)
TheAuthenticationHeader(AH)Protocol isdesignedtoauthenticatethesourcehost
andtoensuretheintegrity
ofthepayloadcarriedinthe IPpacket.Theprotocolusesa
hashfunctionandasymmetrickeytocreateamessagedigest;thedigestisinsertedin
theauthenticationheader.
TheAHisthenplacedintheappropriatelocationbased onthe
mode(transportortunnel).Figure32.6showsthefieldsandtheposition
oftheauthen­
ticationheaderinthetransportmode.
Whenan
IPdatagramcarriesanauthenticationheader,theoriginalvalueinthepro­
tocolfield
oftheIPheaderisreplacedbythevalue 51.Afieldinsidetheauthentication
header(thenextheaderfield)holdstheoriginalvalue
oftheprotocolfield(thetype of
payloadbeingcarried bytheIPdatagram).Theadditionofanauthenticationheader
followsthesesteps:
1.Anauthenticationheader isaddedtothepayloadwiththeauthenticationdatafield
settozero.

SECTION32.1IPSecurity(IPSec)999
Figure32.6AuthenticationHeader(AH)Protocolintransportmode
I,
Datausedincalculation ofauthenticationdata
(exceptthosefieldsinIPheaderchangingduringtransmission)
Transportlayerpayload
Securityparameterindex
Sequencenumber
Authenticationdata(digest)
(variablelength)
,I
2.Paddingmaybeaddedtomakethetotallengthevenforaparticularhashing
algorithm.
3.Hashingisbasedonthetotalpacket.However,onlythosefields oftheIPheaderthat
donotchangeduringtransmissionareincludedinthecalculation ofthemessage
digest(authenticationdata).
4.Theauthenticationdataareinsertedintheauthenticationheader.
S.TheIPheaderisaddedafterthevalue oftheprotocolfieldischanged to51.
Abriefdescription
ofeachfieldfollows:
oNextheader. The8-bitnext-headerfielddefinesthetype ofpayloadcarriedbythe
IPdatagram(suchasTCP,UDP,ICMP,orOSPF).Ithasthesamefunctionasthe
protocolfieldintheIPheaderbeforeencapsulation.Inotherwords,theprocess
copiesthevalue
oftheprotocolfieldintheIPdatagramtothisfield.Thevalue of
theprotocolfieldinthenewIPdatagramisnowsetto 51toshowthatthepacket
carriesanauthenticationheader.
oPayloadlength. Thename ofthis8-bitfieldismisleading.Itdoesnotdefinethe
length
ofthepayload;itdefinesthelength oftheauthenticationheaderin4-byte
multiples,butitdoesnotincludethefirst8bytes.
oSecurityparameterindex.The32-bitsecurityparameterindex(SPI)fieldplays
therole
ofavirtual-circuitidentifierandisthesameforallpacketssentduringa
connectioncalledasecurityassociation(discussedlater).
oSequencenumber. A32-bitsequencenumberprovidesorderinginformationfor
asequence
ofdatagrams.Thesequencenumberspreventaplayback.Notethatthe
sequencenumberisnotrepeatedeven
ifapacketisretransmitted.Asequencenum­
berdoesnotwraparoundafteritreaches2
32
;
anewconnectionmustbeestablished.
oAuthenticationdata. Finally,theauthenticationdatafieldistheresult ofapplying
ahashfunctiontotheentireIPdatagramexceptforthefieldsthatarechangedduring
transit(e.g.,time-to-live),

1000 CHAPTER 32SECURITYINTHEINTERNET:IPSec,SSUFLS,PCP,VPN, ANDFIREWALLS
TheAHProtocolprovidessourceauthentication anddataintegrity,butnotprivacy.
EncapsulatingSecurityPayload(ESP)
TheAHProtocoldoesnotprovideprivacy,onlysourceauthenticationanddataintegrity.
IPSeclaterdefinedanalternativeprotocolthatprovidessourceauthentication,integrity,
andprivacycalled
EncapsulatingSecurityPayload(ESP). ESPaddsaheaderand
trailer.NotethatESP'sauthenticationdataareaddedattheend
ofthepacketwhich
makesitscalculationeasier.Figure32.7showsthelocation
oftheESPheaderand
trailer.
Figure32.7 EncapsulationSecurityPayload(ESP)Protocolintransportmode
I'
Securityparameterindex
Sequencenumber
Authenticated
Encrypted
.Padding
Sbits
Nextheader
WhenanIPdatagramcarriesanESPheaderandtrailer,thevalue oftheprotocol
fieldintheIPheaderis50.AfieldinsidetheESPtrailer(thenext-headerfield)holdsthe
originalvalue
oftheprotocolfield(thetype ofpayloadbeingcarriedbytheIPdatagram,
suchasTCPorUDP).TheESPprocedurefollowsthesesteps:
1.AnESPtrailerisaddedtothepayload.
2.Thepayloadandthetrailerareencrypted.
3.TheESPheaderisadded.
4.TheESPheader,payload,andESPtrailerareusedtocreatetheauthenticationdata.
5.Theauthenticationdataareaddedtotheend oftheESPtrailer.
6.TheIPheaderisaddedaftertheprotocolvalueischangedto50.
Thefieldsfortheheaderandtrailerareasfollows:
oSecurityparameterindex.The32-bitsecurityparameterindexfieldissimilarto
thatdefinedfortheAHProtocol.
oSequencenumber. The32-bitsequencenumberfieldissimilartothatdefinedfor
theAHProtocol.
oPadding.Thisvariable-lengthfield(0to255bytes) ofOsservesaspadding.
oPadlength.The8-bitpadlengthfielddefinesthenumber ofpaddingbytes.The
value
isbetween0and255;themaximumvalueisrare.
oNextheader. The8-bitnext-headerfield issimilartothatdefinedin theAHProtocol.
Itservesthesamepurpose astheprotocolfieldintheIPheaderbeforeencapsulation.

SECTION32.1IPSecurity(iPSec)1001
oAuthenticationdata.Finally,theauthenticationdatafieldistheresultofapplying
anauthenticationschemetopartsofthedatagram.Notethedifferencebetweenthe
authenticationdatainAHand
ESP.InAH,part oftheIPheaderisincludedinthe
calculationoftheauthenticationdata;in
ESP,itisnot.
ESPprovidessourceauthentication, dataintegrity,andprivacy.
IPv4andIPv6
IPSecsupportsbothIPv4andIPv6.InIPv6,however,AHandESParepart ofthe
extensionheader.
AHVersusESP
TheESPProtocolwasdesignedaftertheAHProtocolwasalreadyinuse.ESPdoes
whateverAHdoeswithadditionalfunctionality(privacy).Thequestionis,Whydowe
needAH?Theansweris,
Wedon't.However,theimplementation ofAHisalready
includedinsomecommercialproducts,whichmeansthatAHwillremainpartofthe
Internetuntiltheproductsarephasedout.
ServicesProvided byIPSec
The twoprotocols,AHand ESP,canprovideseveralsecurityservicesforpacketsatthe
networklayer.Table32.1showsthelistofservicesavailableforeachprotocol.
Table32.1
IPSecservices
Services
AH ESP
Accesscontrol Yes Yes
Messageauthentication(messageintegrity) Yes Yes
Entityauthentication(datasourceauthentication) Yes Yes
Confidentiality No Yes
Replayattackprotection Yes Yes
AccessControlIPSecprovidesaccesscontrolindirectlybyusingaSecurityAssoci­
ationDatabase(SADB)
aswewillseeinthenextsection.Whenapacketarrivesata
destination,andthere
isnosecurityassociationalreadyestablishedforthispacket,the
packetisdiscarded.
MessageAuthenticationTheintegrity
ofthemessageispreservedinbothAHand
ESPbyusingauthenticationdata.Adigest
ofdataiscreatedandsentbythesenderto
becheckedbythereceiver.
EntityAuthenticationThesecurityassociationandthekeyed-hasheddigest
ofthe
datasentbythesenderauthenticatethesender
ofthedatainbothAHandESP.
ConfidentialityTheencryption
ofthemessageinESPprovidesconfidentiality.AH,
however,doesnotprovideconfidentiality.Ifconfidentialityisneeded,oneshoulduse
ESPinstead
ofAH.

1002 CHAPTER 32SECURITYINTHEINTERNET:IPSec,SSUTLS,PGP,VPN,ANDFIREWALLS
ReplayAttackProtectionInbothprotocols,thereplay attackispreventedbyusing
sequencenumbersandaslidingreceiverwindow.EachIPSecheadercontainsaunique
sequencenumberwhenthesecurityassociationisestablished.Thenumberstartsfrom
oandincreasesuntilthevaluereaches2
32
-
1(thesize ofthesequencenumberfieldis
32bits).Whenthesequencenumberreachesthemaximum,
itisresettozeroand,atthe
sametime,theoldsecurityassociation(seethenextsection)isdeletedandanewoneis
established.
Topreventprocessingofduplicatepackets,IPSecmandatestheuse ofa
fixed-sizewindowatthereceiver.Thesize
ofthewindowisdeterminedbythereceiver
withadefaultvalue
of64.
SecurityAssociation
Aswementionedintheintroductiontothechapter,each ofthreeprotocolswediscuss
inthischapter(IPSec,SSLffLS,andPGP)needsaset
ofsecurityparametersbeforeit
canbeoperative.InIPSec,theestablishment
ofthesecurityparametersisdoneviaa
mechanismcalledsecurityassociation(SA).
IP,aswehaveseen,isaconnectionlessprotocol:Eachdatagram isindependentof
theothers.Forthistype
ofcommunication,thesecurityparameterscanbeestablished
inone
ofthreeways.
1.Securityparametersrelated toeachdatagramcanbeincludedineachdatagram.
ThedesignerofIPSecdidnotchoosethisoptionprobablybecauseofoverhead.
Addingsecurityparameters
toeachdatagramcreatesalargeoverhead,particularly
ifthedatagram
isfragmentedseveraltimesduringitsjourney.
2.Asetofsecurityparameterscanbeestablishedforeachdatagram.Thismeansthat
beforeeachdatagramistransmitted,aset
ofpacketsneeds tobeexchangedbetween
thesenderandreceivertoestablishsecurityparameters.Thisisprobablylesseffi­
cientthanthefirstchoice,anditisnotusedinIPSec.
3.IPSecusesthethirdchoice.Asetofsecurityparameterscanbeestablishedbetween
asenderandaparticularreceiverthefirsttimethesenderhasadatagramtosendto
thatparticularreceiver.Thesetcanbesavedforfuturetransmission
ofIPpacketsto
thesamereceiver.
Securityassociationisaveryimportantaspect
ofIPSec.Usingsecurityassociation,
IPSecchangesaconnectionlessprotocol,
IP,toaconnection-orientedprotocol. We
canthinkofanassociationasaconnection. WecansaythatwhenAliceandBob
agreeuponaset
ofsecurityparametersbetweenthem,theyhaveestablishedalogical
connectionbetweenthemselves(whichiscalledassociation).However,theymaynot
usethisconnectionallthetime.Afterestablishingtheconnection,Alicecansenda
datagramtoBobtoday,anotherdatagramafewdayslater,andsoon.Thelogical
connectionisthereandreadyforsendingasecuredatagram.
Ofcourse,they can
breaktheconnection,ortheycanestablishanewoneafterawhile(which isamore
secureway
ofcommunication).
ASimpleExample
Asecurityassociationisaverycomplexset ofpiecesofinformation.However,wecan
showthesimplestcaseinwhichAlicewants
tohaveanassociationwithBobforusein

SECTION32.11PSecurity(IPSec)1003
atwo-waycommunication.Alicecanhaveanoutboundassociation(fordatagrams to
Bob)andaninboundassociation(fordatagramsfromBob).Bobcanhavethesame.In
thiscase,thesecurityassociationsarereducedtotwosmalltablesforbothAliceand
BobasshowninFigure32.8.
Figure32.8 Simpleinboundandoutboundsecurityassociations
To
ProtocolAuthentication
OutboundSA
ESP SHA-I, x DES,y
OutboundSA
ToProtocolAuthenticationEncryption
BobESP SHA-l,x DES,y AliceAH MD5,z
AuthenticationEncryption
Authenticate
andencrypt
Verify
Alice
--
IPSecpacket
IPSecpacket
Bob
If
""':·
Verify
anddecrypt
Authenticate
ThefigureshowsthatwhenAliceneedstosendadatagramtoBob,sheusesthe
ESPProtocol
ofIPSec.AuthenticationisdonebyusingSHA-lwithkey x.Theencryption
isdonebyusingDESwithkey y.WhenBobneedstosendadatagramtoAlice,heuses
the
ARProtocolofIPSec.AuthenticationisdonebyusingMD5withkey z.Notethat
theinboundassociationforBob
isthesameastheoutboundassociationforAlice,and
viceversa.
SecurityAssociationDatabase(SADB)
Asecurityassociationcanbeverycomplex.This isparticularlytrue ifAlicewants to
sendmessagestomanypeopleandBobneedstoreceivemessagesfrommanypeople.
Inaddition,eachsiteneedstohavebothinboundandoutboundSAs
toallowbidirectional
communication.Inotherwords,weneedaset
ofSAsthatcanbecollectedintoadatabase.
Thisdatabase
iscalledthe securityassociationdatabase (SADB).Thedatabasecan
bethought
ofasatwo-dimensionaltablewitheachrowdefiningasingleSA.Normally,
therearetwoSADBs,oneinboundandoneoutbound.
SecurityParameterIndex
Todistinguishoneassociationfromtheother,eachassociationisidentifiedbyaparameter
calledthe
securityparameterindex(SPI).Thisparameter,inconjunctionwiththe
destinationaddress(outbound)orsourceaddress(inbound)andprotocol(ARorESP),
uniquelydefinesanassociation.

1004 CHAPTER 32SECURITYINTHEINTERNET:IPSec,SSUTLS,PGP,VPN, ANDF/REWALLS
InternetKeyExchange(IKE)
Nowwecometothelastpart ofthepuzzle-howSADBsarecreated.The InternetKey
Exchange(IKE)
isaprotocoldesignedtocreatebothinboundandoutboundsecurity
associationsinSADBs.
IKEcreatesSAsforIPSec.
IKEisacomplexprotocolbasedonthreeother protocols-Oakley,SKEME,and
ISAKMP-asshowninFigure32.9.
Figure32.9IKEcomponents
InternetSecurityAssociation
andKeyManagementProtocol
(ISAKMP)
Oakley
SKEME
I
'-
InternetKeyExchange(IKE)
TheOakleyProtocolwasdevelopedbyHilarieOrman.Itisakeycreationprotocol
basedontheDiffie-Hellmankey-exchangemethod,butwithsomeimprovements.Oakley
isafree-formattedprotocolinthesensethat
itdoesnotdefinetheformat ofthemessage
tobeexchanged.
SKEME,designedbyHugoKrawcyzk,isanotherprotocolforkeyexchange.It
usespublic-keyencryptionforentityauthenticationinakey-exchangeprotocol.
TheInternetSecurityAssociation andKeyManagementProtocol(ISAKMP) is
aprotocoldesignedbytheNationalSecurityAgency(NSA)thatactuallyimplementsthe
exchangesdefinedinIKE.
Itdefinesseveralpackets,protocols,andparametersthatallow
theIKEexchangestotakeplaceinstandardized,formattedmessagestocreateSAs.
One
mayaskhowISAKMPiscarriedfromthesendertothereceiver.Thisprotocol
isdesignedsoastobeapplicablewithanyunderlyingprotocol.
Forexample,the
packetcanbeusedasthepayloadinthenetworklayer
ortransportlayer.Whenweuse
IPSec,
itisnaturalthatthispacketbeconsideredasapayloadfortheIPprotocoland
carried
inthedatagram.Nowthenextquestionis,Howarethedatagramsthatcarry
ISAKMPsecurelyexchanged?Theansweristhatthereisnoneed.Thereisnothingin
theISAKMPpacketsthatneedsto
besecured.
VirtualPrivateNetwork
Virtualprivatenetwork(VPN) isatechnologythatisgainingpopularityamonglarge
organizationsthatusetheglobalInternetforbothintra-andinterorganizationcommu­
nication,butrequireprivacy
intheirinternalcommunications.Wediscuss VPNhere
because
itusestheIPSecProtocoltoapplysecuritytothe IPdatagrams.

SECT/ON32.//PSecurity(/PSec)1005
PrivateNetworks
Aprivatenetworkisdesignedforuseinside anorganization.Itallowsaccesstoshared
resourcesand,atthesametime,providesprivacy.Before
wediscusssomeaspects of
thesenetworks,letusdefinetwocommonlyused,relatedterms: intranetandextranet.
IntranetAnintranetisaprivatenetwork(LAN)thatusestheInternetmodel.How­
ever,accesstothenetworkislimitedtotheusersinsidetheorganization.
Thenetwork
usesapplicationprogramsdefinedfortheglobalInternet,suchasHTTP,andmayhave
Webservers,printservers,fileservers,andsoon.
ExtranetAnextranetisthesameasanintranetwith onemajordifference:Some
resourcesmaybeaccessedbyspecificgroups ofusersoutsidetheorganizationunder
thecontrolofthenetworkadministrator.Forexample,anorganizationmayallow
authorizedcustomersaccesstoproductspecifications,availability,andonlineordering.
Auniversity
oracollegecanallowdistancelearningstudentsaccesstothecomputer
labafterpasswordshavebeenchecked.
AddressingAprivatenetworkthatusestheInternetmodelmustuse IPaddresses.
Threechoicesareavailable:
1.Thenetworkcanapplyforaset ofaddressesfromtheInternetauthoritiesandusethem
withoutbeingconnectedtotheInternet.Thisstrategyhasanadvantage.
Ifinthefuture
theorganizationdecidesto
beconnectedtotheInternet,itcandosowithrelativeease.
However,thereisalsoadisadvantage:Theaddressspaceiswastedinthemeantime.
2.Thenetworkcanuseanyset ofaddresseswithoutregisteringwiththeInternet
authorities.Becausethenetworkisisolated,theaddressesdonothaveto
beunique.
However,thisstrategyhasaseriousdrawback:Usersmightmistakenlyconfusethe
addressesaspart
oftheglobalInternet.
3.Toovercometheproblemsassociatedwiththefirstandsecondstrategies,theInternet
authoritieshavereservedthreesets
ofaddresses,showninTable32.2.
Table32.2Addressesforprivatenetworks
Prefix Range Total
10/8 10.0.0.0to10.255.255.255 2
24
172.16/12172.16.0.0 to172.31.255.255 2
20
192.168/16192.168.0.0 to192.168.255.2552
16
Anyorganizationcanuseanaddress outofthissetwithoutpermissionfromtheInternet
authorities.Everybodyknowsthatthesereservedaddressesareforprivatenetworks.
Theyareuniqueinsidetheorganization,buttheyarenotuniqueglobally.
Norouterwill
forwardapacketthathas
oneoftheseaddressesasthedestinationaddress.
AchievingPrivacy
Toachieveprivacy,organizations canuseoneofthreestrategies:privatenetworks,
hybridnetworks,andvirtualprivatenetworks.

1006 CHAPTER 32SECURITYINTHEINTERNET:IPSec,SSUTLS,PGP,VPN, ANDFIREWALLS
PrivateNetworksAnorganizationthatneedsprivacywhenroutinginformationinside
theorganizationcanusea
privatenetworkasdiscussedpreviously.Asmallorganiza­
tionwithonesinglesitecanuseanisolatedLAN.Peopleinsidetheorganizationcan
senddatatooneanotherthattotallyremaininsidetheorganization,securefromoutsiders.
Alargerorganizationwithseveralsites
cancreateaprivateinternet.TheLANsat
differentsitescanbeconnectedtoeachotherbyusingroutersandleasedlines.Inother
words,aninternetcanbemadeout
ofprivateLANsandprivateWANs.Figure32.10
showssuchasituationforanorganizationwithtwosites.TheLANsareconnectedto
eachotherbyroutersandoneleasedline.
Figure32.10Privatenetwork
~A ~B
I
I
I
I
I
I
I
I
______________
.J
Leasedline
I
I
I
I
I
I
I
• I
• I
• I
R2 :
I
I
I
I
I
______________
-.J
Inthissituation,theorganizationhascreatedaprivateinternetthatistotallyisolated
fromtheglobalInternet.Forend-to-endcommunicationbetweenstationsatdifferent
sites,theorganizationcanusetheInternetmodel.However,thereisnoneedforthe
organizationtoapplyforIPaddresseswiththeInternetauthorities.Itcanuseprivate
IPaddresses.Theorganizationcanuseany IPclassandassignnetworkandhost
addressesinternally.Becausetheinternetisprivate,duplication
ofaddressesbyanother
organizationintheglobalInternetisnotaproblem.
HybridNetworksToday,mostorganizationsneedtohaveprivacyinintraorganization
dataexchange,but,atthesametime,theyneedtobeconnectedtotheglobalInternet
for
dataexchangewithotherorganizations.Onesolutionistheuse ofahybrid
network.Ahybridnetworkallowsanorganizationtohaveitsownprivateinternetand,
atthesametime,accesstotheglobalInternet.Intraorganizationdataareroutedthrough
theprivateinternet;interorganizationdataareroutedthroughtheglobalInternet.Fig­
ure32.11showsanexample
ofthissituation.
Anorganizationwithtwositesusesrouters RlandR2toconnectthetwositespri­
vatelythroughaleasedline;itusesroutersR3andR4toconnectthetwositestothe
rest
oftheworld.TheorganizationusesglobalIPaddressesforbothtypes ofcommuni­
cation.However,packetsdestinedforinternalrecipientsareroutedonlythroughrouters
RlandR2.Routers R3andR4routethepacketsdestinedforoutsiders.
VirtualPrivateNetworksBothprivateandhybridnetworkshaveamajordrawback:
cost.Privatewide-areanetworks(WANs)areexpensive.
Toconnectseveralsites,an
organizationneedsseveralleasedlines,whichmeansahighmonthlyfee.Onesolution

SECTION32.1IPSecurity(IPSe c) 1007
Figure32.11Hybridnetwork
Internet
Leasedline
R2
istousetheglobalInternetforbothprivateandpubliccommunications.Atechnology
calledvirtualprivatenetworkallowsorganizationstousetheglobalInternetforboth
purposes.
VPNcreatesanetworkthatisprivatebutvirtual.
Itisprivatebecauseitguarantees
privacyinsidetheorganization.
ItisvirtualbecauseitdoesnotuserealprivateWANs;
thenetworkisphysicallypublicbutvirtuallyprivate.
Figure32.12showstheidea
ofavirtual privatenetwork.Routers RlandR2use
VPNtechnologytoguaranteeprivacyfortheorganization.
Figure32.12Virtualprivatenetwork
R2
SiteA SiteB
I
----~----------
VPNTechnology
VPNtechnologyusesIPSecinthetunnelmodetoprovideauthentication,integrity,and
privacy.
TunnelingToguaranteeprivacyandothersecuritymeasuresforanorganization,
VPNcanusetheIPSecinthetunnelmode.Inthismode,each IPdatagramdestinedfor
privateuseintheorganizationisencapsulatedinanotherdatagram.
TouseIPSecin
tunneling,theVPNsneedtousetwosets
ofaddressing,asshowninFigure32.13.

1008 CHAPTER32SECURITYINTHEINTERNET:IPSec,SSUTLS,PGP,VPN, ANDFIREWALLS
Figure32.13AddressinginaVPN
r------------------,
SiteA
R2
SiteB
~------------------1
1
1
I
I
I
I
I
I
I
I
I
I
I
I
I
Station200:
I
I
--------
---------~
Internet
FromRltoR2
1 1
I
I
I
I
I
I
I
_____
..J
Station100
1 ------
From100to200 From100to200
Thepublicnetwork(Internet)isresponsibleforcarryingthepacketfrom RltoR2.
Outsiders
cannotdecipherthecontents ofthepacketorthesourceanddestination
addresses.DecipheringtakesplaceatR2,whichfindsthedestinationaddress
ofthe
packetanddeliversit.
32.2SSL/TLS
Atransportlayersecurityprovides
end-to-endsecurityservicesforapplicationsthatuse
areliabletransportlayerprotocolsuchasTCP.Theideaistoprovidesecurityservices
fortransactionsontheInternet.Forexample,whenacustomershopsonline,thefollow­
ingsecurityservicesaredesired:
1.Thecustomerneedstobesurethattheserverbelongstotheactualvendor,notan
imposter.Thecustomerdoesnotwanttogiveanimposterhercreditcardnumber
(entityauthentication).Likewise,thevendorneedstoauthenticatethecustomer.
2.Thecustomerandthevendorneedtobesurethatthecontents ofthemessageare
notmodifiedduringtransition(messageintegrity).
3.Thecustomerandthevendorneedtobesurethatanimposterdoesnotintercept
sensitiveinformationsuchasacreditcardnumber(confidentiality).
Twoprotocolsaredominanttodayforprovidingsecurityatthetransportlayer:theSecure
SocketsLayer(SSL)ProtocolandtheTransportLayerSecurity(TLS)Protocol.The
latter
isactuallyanIETFversionoftheformer.FirstwediscussSSL,thenwebriefly
mentionthemaindifferencesbetweenSSLandTLS.Figure32.14showstheposition
ofSSLandTLSintheInternetmodel.
SSLServices
SecureSocket Layer(SSL)isdesignedtoprovidesecurityandcompressionservices
todatageneratedfromtheapplicationlayer.Typically,SSLcanreceivedatafromany
applicationlayerprotocol,butusuallytheprotocolisHTTP.Thedatareceivedfromthe

SECTION32.2SSUTLS 1009
Figure32.14 LocationofSSLandTLSintheInternetmodel
I
Applications
~---_----I
I
TCP
IP
Underlyingphysicalnetworks
I
I
SSLrrLSisdesigned
toprovidesecurity
atthetransportlayer.
applicationarecompressed(optional),signed,andencrypted.Thedataarethenpassed
toareliabletransportlayerprotocolsuchasTCP.NetscapedevelopedSSLin1994.
Versions2and3werereleased
in1995.Inthischapter,wediscussSSLv3.SSLprovides
severalservices
ondatareceivedfromtheapplicationlayer.
Fragmentation
First,SSLdividesthedataintoblocks of2
14
bytesorless.
Compression
Eachfragment ofdataiscompressedbyusingone ofthelosslesscompressionmethods
negotiatedbetweentheclientandserver.Thisservice
isoptional.
MessageIntegrity
Topreservetheintegrity ofdata,SSLusesakeyed-hashfunctiontocreateaMAC.
Confidentiality
Toprovideconfidentiality,theoriginaldataandtheMACareencryptedusingsymmetric­
keycryptography.
Framing
Aheaderisaddedtotheencryptedpayload.The
,payloadisthenpassedtoareliable
transportlayerprotocol.
SecurityParameters
WhenwediscussedIPSecintheprevioussection,wementionedthateach ofthetwo
partiesinvolvedindataexchangeneedstohaveaset
ofparametersforeachassociation
(SA).SSLhasasimilargoal,butadifferentapproach.TherearenoSAs,butthereare
ciphersuitesandcryptographicsecretsthattogethermakethesecurityparameters.
CipherSuite
Thecombinationofkeyexchange,hash,andencryptionalgorithmsdefinesaciphersuite
foreachSSLsession.Eachsuitestartswiththeterm
SSL,followedbythekey-exchange

1010 CHAPTER 32SECURITYINTHEINTERNET:IPSec, SSUILS,PGP,VPN, ANDFIREWALLS
algorithm.Theword WITHseparatesthekeyexchangealgorithmfromtheencryption
andhashalgorithms.Forexample,
SSL_DBE_RSA_WITH_DES_CBC~SHA
definesDHE_RSA(ephemeralDiffie-HellmanwithRSAdigitalsignature) asthekey
exchangewithDES_CBC
astheencryptionalgorithmandSHA asthehashalgorithm.
NotethatDHisfixedDiffie-Hellman,DHEisephemeralDiffie-Hellman,andDH-anonis
anonymousDiffie-Hellman.Table32.3showsthesuitesusedintheUnitedStates.
We
havenotincludedthosethatareusedforexport.Notethatnotallcombinations ofkey­
exchangealgorithms(toestablishkeysformessageauthenticationandencryption),
encryptionalgorithms,andauthenticationalgorithmsareincludedintheciphersuitelist.
Wehavenotdefinedordiscussedseveralalgorithmsyoucanfindinthetable,butwewish
todescribethewholepicturesothatthereadercanhaveanidea
ofhowgeneralthesuite is.
Table32.3SSLciphersuitelist
KeyExchange Encryption Hash
CipherSuite Algorithm Algorithm Algorithm
SSL_NULL_WITH_NULL_NULL NULL NULL NULL
SSL_RSA_
WITH_NULL_MD5 RSA NULL MD5
SSL_RSA_WITH_NULL_SHA RSA NULL SHA
SSL_RSA_WITH_RC4_128_MD5 RSA
RCU28 MD5
SSL_RSA_WITH_RC4_128_SHA RSA
RC4
-
128 SHA
SSL_RSA_WITH_IDEA_CBC_SHA RSA IDEA_CSC SHA
SSL_RSA_WITH_DES_CBC_SHA RSA
DES_eSC SHA
SSL_RSA_WITH_3DES_EDE_CBC_SHA RSA 3DES_EDE_CBC SHA
SSL_DH3ll0ll_WITH_RC4_128_MD5 DH_anon
RC4_128 MD5
SSL_DH_anon_WITH_DES_CRC_SHA DH_anon DES_CBC SHA
SSL_DH_anon_WITH_3DES_EDE_CBC_SHA DH_anon 3DES_EDE_CBC SHA
SSL_DHE_RSA_WITH_DES_CBC_SHA DHE_RSA DES_CBC SHA
SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA DHE_RSA
3DES_EDLCBC SHA
SSL_DHE_DSS_WITH_DES_CBCSHA DHE_DSS DES_CBC SHA
SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA DHE_DSS 3DBS_EDE_CSC SHA
SSL_DH_RSA_WITH_DES_CRC_SHA DH_RSA DES_CBC SHA
SSL_DH_RSA_WITH_3DES_EDE_CBC_SHA DH_RSA 30BS_EDE_CSC SHA
SSL_DH_DSS_
WITH_DES_CBC_SHA DH_DSS DES_CEC SHA
SSL_DH_DSS_WITH_3DES_EDE_CBC_SHA DH_DSS
.'\DES_EDEJ'SC SHA
SSL_FORTEZZA_DMS_WITH_NULL_SHA FORTEZZA_DMS NULL SHA
SSL_FORTEZZA_DMS_WITH_FORTEZZA_CRC_SHA FORTEZZA_DMS FORTEZZA_CBC SHA
SSL]ORTEZZA_DMS_WITH_RC4_128_SHA FORTEZZA_DMS RC-U28 SHA
CryptographicSecrets
Thesecondpart ofsecurityparametersisoftenreferredtoascryptographicsecrets. To
achievemessageintegrityandconfidentiality,SSLneedssixcryptographicsecrets,four
keys,andtwoIVs.

SECTION32.2SSl./TLS1011
Theclientandtheserverhavesixdifferentcryptographysecrets.
Theprocessofcreatingthesesecrets isshowninFigure32.15.Theclientneeds
onekeyformessageauthentication,onekeyforencryption,andoneIVforblock
encryption.Theserverneedsthesame.SSLrequiresthatthekeysforonedirectionbe
differentfromthosefortheotherdirection.
Ifthereisanattackinonedirection,the
otherdirection
isnotaffected.Theseparametersaregeneratedbyusinganegotiation
protocol,
aswewillseeshortly.
Figure
32.15Creationofcryptographicsecrets inSSL
Client
I--Clientauthenticationkey
II--Serverauthenticationkey
III--Clientencryptionkey
IV--Serverencryptionkey
V--Clientinitiationvector
VI
--Serverinitiationvector
Acomplexalgorithm
using
SHA-IandMD5
Server
Some constants
Someconstants
IIIIV
1.Theclientandserverexchangetworandomnumbers;oneiscreatedbytheclient
andtheotherbytheserver.
2.Theclientandserverexchangeone premastersecretbyusingoneofthekey­
exchangealgorithmswediscussedpreviously.
3.A48-bytemastersecretiscreatedfromthepremastersecretbyapplyingtwohash
functions(SHA-landMD5).
4.Themastersecretisused tocreatevariable-lengthsecretsbyapplyingthesameset
ofhashfunctionsandprependingwithdifferentconstants.
SessionsandConnections
ThenatureofIPandTCPprotocolsisdifferent.IPisaconnectionlessprotocol;TCP is
aconnection-orientedprotocol.AnassociationinIPSectransformstheconnectionless
IPtoaconnection-orientedsecuredprotocol.TCPisalreadyconnection-oriented.

1012 CHAPTER32SECURITYINTHEINTERNET:IPSec, SSurLS,PGP,VPN,ANDFIREWALLS
However,thedesigners ofSSLdecidedthattheyneededtwo-levels ofconnectivity:
session
andconnection.Asessionbetweentwosystemsisanassociationthatcanlastfor
alongtime;aconnectioncanbeestablishedandbrokenseveraltimesduringasession.
Some
ofthesecurityparametersarecreatedduringthesessionestablishmentand
areineffectuntilthesessionisterminated(forexample,ciphersuiteandmasterkey).
Some
ofthesecurityparametersmustberecreated(oroccasionallyresumed)foreach
connection(forexample,sixsecrets).
FourProtocols
Wehavediscussedtheidea ofSSLwithoutshowinghowSSLaccomplishesitstasks.
SSLdefinesfourprotocolsintwolayers,asshowninFigure32.16.TheRecordProtocol
isthecarrier.Itcarriesmessagesfromthreeotherprotocolsaswellasthedatacoming
fromtheapplicationlayer.MessagesfromtheRecordProtocolarepayloadstothe
transportlayer,normallyTCP.TheHandshakeProtocolprovidessecurityparameters
for
theRecordProtocol.Itestablishesa ciphersetandprovideskeys andsecurity
parameters.
Italsoauthenticatestheservertotheclientandtheclienttotheserver, if
needed.TheChangeCipherSpecProtocolisusedforsignalingthereadiness ofcryp­
tographicsecrets.TheAlertProtocolisusedtoreportabnormalconditions.Wewill
brieflydiscusstheseprotocols
inthissection.
Figure32.16
FourSSLprotocols
SSL
,---------------------------------------------------1
L--:d:::-------~~:g:~~::I~Y-~-----~;~------1-----J
Protocol Protocol Protocol
I RecordProtocol I
, f 1
: Transportlayer :
I J
HandshakeProtocol
The HandshakeProtocolusesmessagestonegotiatetheciphersuite,toauthenticatethe
servertotheclientandtheclienttotheserver(ifneeded),andtoexchange information
forbuildingthecryptographicsecrets.Thehandshakingisdoneinfourphases,asshown
inFigure32.17.
ChangeCipherSpecProtocol
Wehaveseenthatthenegotiation oftheciphersuiteandthegeneration ofcrypto­
graphicsecretsareformedgraduallyduringtheHandshakeProtocol.Thequestionnow
is,Whencanthetwopartiesusetheseparametersecrets?SSLmandatesthattheparties

SECTION32.2SSUFLS 1013
Figure32.17 HandshakeProtocol
Client
r
--
PhaseI EstablishingSecurityCapabilities
Serverauthenticationandkeyexchange
Server
-
PhaseII
PhaseIII
,,',PhaseIV
notusetheseparametersorsecretsuntiltheyhavesentorreceivedaspecialmessage,
theChangeCipherSpecmessage,whichisexchangedduringtheHandshakeProtocoland
definedintheChangeCipherSpecProtocol.Beforetheexchangeof
anyChangeCipherSpec
messages,onlythependingcolumnshavevalues.
AlertProtocol
SSLusestheAlertProtocolforreportingerrorsandabnormalconditions. Ithasonlyone
messagetype,thealertmessage,thatdescribestheproblemanditslevel(warningorfatal).
RecordProtocol
TheRecordProtocolcarriesmessagesfromtheupperlayer(HandshakeProtocol,
ChangeCipherSpecProtocol,AlertProtocol,orapplicationlayer).Themessageisfrag­
mentedandoptionally compressed;aMACisaddedtothecompressedmessageby
usingthenegotiatedhashalgorithm.ThecompressedfragmentandtheMACare
encryptedbyusingthenegotiatedencryptionalgorithm.Finally,theSSLheaderis
addedtotheencryptedmessage.Figure32.18showsthisprocessatthesender.The
processatthereceiverisreversed.
TransportLayerSecurity
TransportLayerSecurity(TLS) istheIETFstandardversion ofSSL.Thetwoare
verysimilar,withslightdifferences.
Wehighlightthedifferencesbelow:
oVersion.TheSSLv3.0discussedinthissectioniscompatiblewithTLSv1.0.
oCipherSuite. TLSciphersuitedoesnotsupportFortezza.
oCryptographySecret. Thereareseveraldifferencesinthegenerationofcrypto­
graphicsecrets.TLSusesa
pseudorandomfunction(PRF) tocreatethemaster
keyandthekeymaterials.

1014 CHAPTER 32SECURITYINTHEINTERNET:IPSec,SSUTLS,PGP,VPN, ANDFIREWALLS
Figure32.18Processingdone bytheRecordProtocol
SSLHeader
Authenticationkey
Constant
COmpIeS&ed
l,;Fi-agroent ~d
'JCompressionr'
I
Payloadfromupper-layerprotocol
---~i""";"""';--"""
: I
'JEncryptionG--Encryptionkey
, "
r'..Encryptedfragment'.')
~'..SSLpayload ..~
a.Process b. Packet
Compressedfragment
oAlertProtocol.TLSdeletessomealertmessagesandaddssomenewones.
oHandshakeProtocol.Thedetails ofsomemessageshavebeenchanged inTLS.
oRecordProtocol.Instead ofusingMAC,TLSusestheHMAC asdefinedin
Chapter31.
32.3PGP
Oneoftheprotocolstoprovidesecurityattheapplicationlayeris PrettyGoodPrivacy
(PGP).PGPisdesignedtocreateauthenticatedandconfidentiale-mails.Figure32.19
showstheposition
ofPGPintheTCP/IPprotocolsuite.
Figure32.19PositionofPGPintheTCPlIPprotocolsuite
I
UDP,TCP.orSCTP
_____-01
I
Applications(e-mail)
I
I
PGPisdesigned
toprovidesecurity
at
theapplicationlayer.
I IP .....
Underlyingphysicalnetworks

SECTION32.3PGP 1015
Sendingane-mailisaone-timeactivity.Thenature ofthisactivityisdifferent
fromthosewehaveseenintheprevioustwosections.InIPSecorSSL,weassumethat
thetwopartiescreateasessionbetweenthemselvesandexchangedata
inbothdirec­
tions.Ine-mail,there
isnosession.AliceandBobcannotcreateasession.Alicesends
amessagetoBob;sometimelater,Bobreadsthemessageand
mayormaynotsenda
reply.
Wediscussthesecurity ofaunidirectionalmessagebecausewhatAlicesendsto
Bobistotallyindependent
ofwhatBobsendstoAlice.
SecurityParameters
Ife-mailisaone-timeactivity,howcanthesenderandreceiveragreeonthesecurity
parameterstousefore-mailsecurity?
Ifthereisnosessionandnohandshakingto
negotiatethealgorithmsforencryptionandauthentication,howcanthereceiverknow
whichalgorithmthesenderhaschosenforeachpurpose?Howcanthereceiverknow
thevalues
ofthekeysusedforencryptionandauthentication?
PhilZimmerman,thedesignerandcreator
ofPGP,hasfoundaveryelegantsolution
totheabovequestions.Thesecurityparametersneedtobesentwiththemessage.
InPGP,thesenderofthemessageneedstoinclude theidentifiersofthe
algorithmsused inthemessageaswellasthevalues ofthekeys.
Services
PGPcanprovideseveralservicesbasedontherequirements oftheuser.Ane-mailcan
useoneormore
oftheseservices.
Plaintext
Thesimplestcaseistosendthee-mailmessageinplaintext(noservice).Alice,the
sender,composesamessageandsends
ittoBob,thereceiver.Themessageisstoredin
Bob'smailboxuntil
itisretrievedbyhim.
MessageAuthentication
Probablythenextimprovement istoletAlicesignthemessage.Alicecreatesadigest
ofthemessageandsignsitwithherprivate key.WhenBobreceivesthemessage,he
verifiesthemessagebyusingAlice'spublickey.Twokeysareneededforthisscenario.
Aliceneedstoknowherprivatekey;BobneedstoknowAlice'spublic
key.
Compression
Afurtherimprovementistocompressthemessageanddigesttomakethepacketmore
compact.Thisimprovementhasnosecuritybenefit,butiteasesthetraffic.
Confidentialitywith
One·TimeSessionKey
Aswediscussedbefore,confidentialityin ane-mailsystemcanbeachievedbyusing
conventionalencryptionwithaone-timesessionkey.Alicecancreateasessionkey,use
thesessionkey
toencryptthemessageandthedigest,andsendthekeyitselfwiththe
message.However,toprotectthesessionkey,AliceencryptsitwithBob'spublickey.

1016 CHAPTER32SECURITYINTHEINTERNET:IPSec,SSUFLS,PGP,VPN, ANDFIREWALLS
CodeConversion
AnotherserviceprovidedbyPGPiscodeconversion.Moste-mailsystemsallowthe
messagetoconsist
ofonlyASCIIcharacters. Totranslateothercharactersnotinthe
ASCIIset,PGPusesRadix64conversion.Eachcharactertobesent(afterencryption)
isconvertedtoRadix64code.
Segmentation
PGPallowssegmentation
ofthemessageafterithasbeenconvertedtoRadix64to
makeeach
transmittedunittheuniformsizeallowedbytheunderlyinge-mailprotocoL
AScenario
Letusdescribeascenariothatcombinessome oftheseservices,authenticationand
confidentiality.Thewholeidea
ofPGPisbasedontheassumptionthatagroup ofpeople
whoneedtoexchange
e-mailmessagestrustoneanother.Everyoneinthegroupsome­
howknows(withadegree oftrust)thepublickey ofanyotherpersoninthegroup.
Basedonthissingleassumption,Figure32.20showsasimplescenarioinwhich
an
authenticatedandencryptedmessage issentfromAlicetoBob.
Figure32.20 Ascenarioinwhichane-mailmessageisauthenticated andencrypted
Alice'sBob's
privatepublic
j
Alice
r-
--
Bob'sAlice's
privatepublic
j
Bob
PGPmessage
PGP
header
PAl
+
PAl:Public-keyalgorithm1(forencryptingsessionkey)
PA2:PubliC-keyalgorithm(forencryptingthedigest)
.SA:Symmetric-keyalgorithmidentification(forencryptingmessageanddigest)
HA:Hashalgorithmidentification(forcreatingdigest)
SenderSite
ThefollowingshowsthestepsusedinthisscenarioatAlice'ssite:
1.Alicecreatesasessionkey(forsymmetricencryption/decryption)andconcatenates
itwiththeidentity
ofthealgorithmwhichwillusethis key.Theresultisencrypted

SECTION32.3PGP 1017
withBob'spublickey.Aliceaddstheidentification ofthepublic-keyalgorithm
usedabove
totheencryptedresult.Thispart ofthemessagecontainsthreepieces
ofinformation:thesessionkey,thesymmetricencryption/decryptionalgorithmto
beusedlater,andtheasymmetricencryption/decryptionalgorithmthatwasused
forthispart.
2.
a.Aliceauthenticatesthemessage(e-mail)byusingapublic-keysignaturealgo­
rithmandencryptsitwithherprivatekey.Theresultiscalledthesignature.
Aliceappendstheidentification
ofthepublickey(usedforencryption)aswell
astheidentificationofthehashalgorithm(usedforauthentication)tothesigna­
ture.Thispart
ofthemessagecontainsthesignatureandtwoextrapieces of
information:theencryptionalgorithmandthehashalgorithm.
b.Aliceconcatenatesthethreepieces ofinformationcreatedabovewiththemessage
(e-mail)andencryptsthewholething,usingthesessionkeycreatedinstep
1.
3.Alicecombinestheresults ofsteps1 and 2andsendsthemtoBob(afteraddingtue
appropriatePGPheader).
ReceiverSite
ThefollowingshowsthestepsusedinthisscenarioatBob'ssideafterhehasreceived
thePGPpacket:
1.Bobuseshisprivatekeytodecryptthecombination ofthesessionkeyand
symmetric-keyalgorithmidentification.
2.Bobusesthesessionkeyandthealgorithmobtainedinstep1 todecrypttherest of
thePGPmessage.Bobnowhasthecontent ofthemessage,theidentification ofthe
publicalgorithmusedforcreatingandencryptingthesignature,andtheidentifica­
tion
ofthehashalgorithmusedtocreatethehashout ofthemessage.
3.BobusesAlice'spublickeyandthealgorithmdefinedby PA2todecryptthedigest.
4.Bob usesthehashalgorithmdefinedbyHAtocreateahashout
ofmessagehe
obtainedinstep
2.
5.Bobcomparesthehashcreatedinstep4andthehashhedecryptedinstep 3.Ifthe
twoareidentical,heacceptsthemessage;otherwise,hediscardsthemessage.
PGPAlgorithms
Table32.4showssome ofthealgorithmsusedinPOP.Thelistisnotcomplete;new
algorithmsarecontinuouslyadded.
Table32.4
Algorithm ID Description
Publickey 1 RSA(encryption orsigning)
2 RSA(forencryptiononly)
3 RSA(forsigningonly)
17 DSS(forsigning)

1018 CHAPTER 32SECURITYINTHEINTERNET:IPSec,SSLfTLS,PGP,VPN, ANDFIREWALLS
Table32.4 (continued)
Algorithm
ID Description
Hashalgorithm 1 MD5
2 SHA-l
3 RIPE-MD
Encryption 0
Noencryption
1 IDEA
2 TripleDES
9 AES
KeyRings
Inthepreviousscenarios,weassumedthatAliceneededtosendamessagetoonlyBob.
Thatisnotalwaysthecase.Alicemayneedtosendmessagestomanypeople.Inthis
case,Aliceneedsakey
ringofpublickeys,withakeybelongingtoeachpersonwith
whomAliceneedstocorrespond(send
orreceivemessages).Inaddition,thePGP
designersspecifiedaring
ofprivate/publickeys.OnereasonisthatAlicemaywishto
changeherpair
ofkeysfromtimetotime.Another reasonisthatAlicemayneedto
correspondwithdifferentgroups
ofpeople(friends,colleagues,andsoon).Alicemay
wishtouseadifferentkeypairforeachgroup.Therefore,eachuserneedstohave
twosetsofrings:aringofprivate/publickeysandaring
ofpublickeysofotherpeople.
Figure32.21showsacommunity
offourpeople,eachhavingaringofpairsofprivate/
publickeysand,atthesametime,aring
offourpublickeysbelongingtotheotherfour
peopleinthecommunity.Thefigureshowssevenpublickeysforeachpublicring.Each
personintheringcankeepmorethanonepublickeyforeachotherperson.
Figure32.21Rings
Alice'srings Bob'srings
A
*~
John'srings

SECTION32.3PGP 1019
Alice,forexample,hasseveralpairs ofprivate/publickeysbelongingtoherand
publickeysbelongingtootherpeople.Notethateveryonecanhavemorethanonepublic
key.Twocasesmayarise.
1.Aliceneedstosendamessagetoone ofthepersonsinthecommunity.
a.Sheusesherprivatekeytosignthedigest.
b.Sheusesthereceiver'spublickeytoencryptanewlycreatedsessionkey.
c.Sheencryptsthemessageandsignsthedigestwiththesessionkeycreated.
2.Alicereceivesamessagefromone ofthepersonsinthecommunity.
a.Sheusesherprivatekeytodecryptthesessionkey.
b.Sheusesthesessionkeytodecryptthemessageanddigest.
c.Sheusesherpublickeytoverifythe digest.
PGPCertificates
Totrusttheowner ofthepublickey,eachuserinthePGPgroupneedstohave,implicitly
orexplicitly,acopyofthecertificateofthepublic-keyowner.Althoughthecertificate
cancomefromacertificateauthority(CA),thisrestrictionisnotrequiredinPGP.PGP
hasitsowncertificatesystem.
ProtocolsthatuseX509certificatesdependonthehierarchicalstructure
ofthe
trust.Thereisapredefinedchain
oftrustfromtheroottoanycertificate.Everyuser
fullytruststheauthority
oftheCAattherootlevel(prerequisite).Therootissuescertif­
icatesfortheCAsatthesecondlevel,asecond-levelCAissuesacertificateforthe
thirdlevel,andsoon.Everypartythatneedstobetrustedpresentsacertificatefrom
someCAinthetree.
IfAlicedoesnottrustthecertificateissuerforBob,shecanappeal
toahigher-levelauthorityuptotheroot(whichmustbetrustedforthesystemtowork).
Inotherwords,thereisonesinglepathfromafullytrustedCAtoacertificate.
InPGP,thereisnoneedforCAs;anyoneintheringcansignacertificateforany­
oneelseinthering.BobcansignacertificateforTed,John,Anne,andsoon.Thereis
nohierarchy
oftrustinPGP;thereisnotree.Asaresult ofthelackofhierarchical
structure,TedmayhaveonecertificatefromBobandanothercertificatefromLiz.
If
Alicewantstofollowtheline ofcertificatesforTed,ithastwopaths:onestartsfrom
BobandtheotherstartsfromLiz.AninterestingpointisthatAlicemayfullytrust Bob,
butonlypartiallytrustLiz.Therecanbemultiplepaths intheline
oftrustfromafully
orpartiallytrustedauthoritytoacertificate.InPGP,theissuer
ofacertificateisusually
calledan
introducer.
InPGP,therecanbemultiplepathsfromruny or
partiallytrustedauthoritiestoanysubject.
TrustsandLegitimacy
Theentireoperation ofPGPisbasedonintroducertrust,thecertificatetrust,andthe
legitimacy
ofthepublickeys.
IntroducerTrustLevelsWiththelackofacentralauthority,itisobviousthatthering
cannotbeverylarge
ifeveryuserinthePGPring ofusershastofullytrusteveryoneelse.

1020 CHAPTER 32SECURITYINTHEINTERNET:IPSec,SSUFLS,PGP,VPN, ANDFIREWALLS
(Eveninreallifewecannotfullytrusteveryonethatweknow.) Tosolvethisproblem,
PGPallowsdifferentlevels
oftrust.Thenumber oflevelsismostlyimplementation­
dependent,butforsimplicity,let
usassignthreelevelsoftrust toanyintroducer:none,
partial,
andfull.Theintroducertrustlevelspecifiesthetrustlevelsissuedbytheintro­
ducerforotherpeopleinthering.Forexample,AlicemayfullytrustBob,partiallytrust
Anne,andnottrustJohnat
alLThereisnomechanisminPGP todeterminehow tomake
adecisionaboutthetrustworthiness
oftheintroducer;itisup totheusertomakethis
decision.
Certificate
TrustLevels WhenAlicereceivesacertificatefromanintroducer,she
storesthecertificateunderthename
ofthesubject(certifiedentity).Sheassigns alevel
oftrusttothiscertificate.Thecertificate trustlevelisnormallythesame astheintro­
ducertrustlevelthatissuedthecertificate.AssumeAlicefullytrustsBob,partially
trustsAnneandJanette,andhasnotrustin John.Thefollowingscenarioscanhappen.
1.Bobissuestwocertificates,oneforLinda(withpublickeyK 1)andoneforLesley
(withpublickeyK2).AlicestoresthepublickeyandcertificateforLindaunder
Linda'snameandassignsa
fullleveloftrusttothiscertificate.Alicealsostoresthe
certificateandpublickeyforLesleyunderLesley'snameandassignsafulllevel
of
trusttothiscertificate.
2.AnneissuesacertificateforJohn(withpublickeyK3).Alicestoresthiscertificate
andpublickeyunderJohn'sname,butassignsa
partiallevelforthiscertificate.
3.Janetteissuestwocertificates,oneforJohn(withpublickeyK3)andoneforLee
(withpublickeyK4).AlicestoresJohn'scertificateunderhisnameandLee'scer­
tificateunderhisname,eachwitha
partialleveloftrust.NotethatJohnnowhas
twocertificates,onefromAnneandonefromJanette,eachwitha
partiallevel
oftrust.
4.JohnissuesacertificateforLiz.Alicecandiscardorkeepthiscertificatewitha
signaturetrust
ofnone.
KeyLegitimacyThepurpose ofusingintroducerandcertificatetrustsis todeter­
minethelegitimacyofapublic
key.Aliceneedstoknowhowlegitimatearethepublic
keys
ofBob,John,Liz,Anne,andsoon.PGPdefinesaveryclearprocedurefordeter­
miningkeylegitimacy.Thelevel
ofthekeylegitimacyforauseristheweightedtrust
l~velofthatuser.Forexample,supposeweassignthefollowingweightstocertificate
trustlevels:
1.Aweightof0toanontrustedcertificate
2.Aweightof
~toacertificatewithpartialtrust
3.Aweightof1toacertificatewithfulltrust
Thentofullytrust
anentity,Aliceneedsonefullytrustedcertificate ortwopartially
trustedcertificatesforthatentity.Forexample,AlicecanuseJohn'spublickeyinthe
previousscenariobecausebothAnneandJanettehaveissuedacertificateforJohn,
eachwithacertificatetrustlevel
of!.Notethatthelegitimacy ofapublickeybelonging
2
toanentitydoesnothaveanythingto dowiththetrustlevel ofthatperson.Although
BobcanuseJohn'spublickeytosendamessage
tohim,Alicecannotacceptanycertif­
icateissuedbyJohnbecause,forAlice,Johnhasatrustlevel
ofnone.

SECTION32.4FIREWALLS 1021
StartingtheRing
Youmighthaverealizedaproblemwiththeabovediscussion.What ifnobodysendsa
certificateforafullyorpartiallytrustedentity?Forexample,howcanthelegitimacy
ofBob'spublickeybedetermined ifnoonehassentacertificateforBob?InPGP,the
keylegitimacyofatrustedorpartiallytrustedentitycanbealsodeterminedbyother
methods.
1.AlicecanphysicallyobtainBob'spublic key.Forexample,AliceandBobcanmeet
personallyandexchangeapublickeywrittenonapiece
ofpaperortoadisk.
2.IfBob'svoiceisrecognizabletoAlice,Alicecancallhimandobtainhispublickey
onthephone.
3.AbettersolutionproposedbyPGPisforBobtosendhispublickeytoAliceby
e-mail.BothAliceandBobmakea16-byteMD5(or20-byte
SHA-l)digest
fromthe
key.Thedigestisnormallydisplayed aseightgroupsoffourdigits(or
10groups
offourdigits)inhexadecimalandiscalleda fingerprint.Alicecanthen
callBobandverifythefingerprintonthephone.Ifthekeyisalteredorchanged
duringthee-mailtransmission,thetwofingerprints
donotmatch.Tomakeiteven
moreconvenient,PGPhascreatedalistofwords,eachrepresentingafour-digit
combination.WhenAlicecallsBob,
Bobcanpronouncetheeightwords(or
10words)forAlice.ThewordsarecarefullychosenbyPGPtoavoidthosesimilar
inpronunciation;forexample,
ifswordisinthelist,wordisnot.
4.InPGP,nothingpreventsAlicefromgettingBob'spublickeyfromaCAina
sepa­
rateprocedure.Shecantheninsertthepublickeyinthepublic-keyring.
WebofTrust
PGPcaneventuallymakea
weboftrustbetweenagroup ofpeople.Ifeachentity
introducesmoreentities
tootherentities,thepublic-keyringforeachentitygetslarger
andlargerandentitiesintheringcansendsecuree-mailtooneanother.
KeyRevocation
Itmaybecomenecessaryforanentitytorevokehisorherpublickeyfromthering.
Thismayhappen
iftheownerofthekeyfeelsthatthekeyiscompromised(stolen,for
example)orjusttoooldtobesafe.
Torevokea key,theownercansendarevocation
certificatesignedbyherself.Therevocationcertificatemustbesignedbytheoldkey
anddisseminatedtoallthepeopleintheringwhousethatpublic
key.
32.4FIREWALLS
AllprevioussecuritymeasurescannotpreventEvefromsendingaharmfulmessagetoa
system.
Tocontrolaccesstoasystem,weneedfirewalls.A firewallisadevice(usuallya
routeroracomputer)installedbetweentheinternalnetworkofanorganizationandthe
restoftheInternet.
Itisdesignedtoforwardsomepacketsandfilter(notforward)others.
Figure32.22showsafirewall.

1022 CHAPTER32SECURITYINTHEINTERNET:IPSec,SSUTLS,PGP,VPN, ANDFIREWALLS
Figure32.22Firewall
Firewall
Forexample,afirewallmayfilterallincomingpacketsdestinedforaspecifichost
oraspecificserversuch
asHTTP.Afirewallcanbeusedtodenyaccesstoaspecific
hostoraspecificserviceintheorganization.
Afirewall
isusuallyclassified asapacket-filterfirewalloraproxy-basedfirewall.
Packet-FilterFirewall
Afirewallcanbeusedasapacketfilter.Itcanforwardorblockpacketsbasedonthe
informationinthenetworklayerandtransportlayerheaders:sourceanddestination
IPaddresses,sourceanddestinationportaddresses,andtype
ofprotocol(TCPorUDP).
Apacket-filterfirewallisarouterthatusesafilteringtabletodecidewhichpackets
mustbediscarded(notforwarded).Figure32.23shows
anexampleofafilteringtable
forthiskind
ofafirewall.
Figure32.23Packet-filterfirewall
Packet-filter
firewall
Toandfrom
globalInternet
-----I
Interface
Source SourceDestination Destination
IP porl
IP port
131.34.0.0
* * *
* * *
23
* *
194.78.20.8*
2 *
80 * *
AccordingtoFigure32.23,thefollowingpacketsarefiltered:
).Incomingpacketsfromnetwork131.34.0.0areblocked(securityprecaution).Note
thatthe
*(asterisk)means"any."
2.IncomingpacketsdestinedforanyinternalTELNETserver(port23)areblocked.
3.Incomingpacketsdestinedforinternalhost194.78.20.8areblocked.Theorganiza­
tionwantsthishostforinternaluseonly.
4.Outgoingpacketsdestinedforan HTfPserver(port80)areblocked.Theorgani­
zationdoesnotwantemployeestobrowsetheInternet.

SECTION32.4FlREWALLS 1023
Apackef.filterfirewallfilters atthenetworkortransportlayer.
ProxyFirewall
Thepacket-filterfirewallisbasedontheinformationavailableinthenetworklayerand
transportlayerheaders(IPandTCPIUDP).However,sometimesweneedtofiltera
messagebasedontheinformationavailableinthemessageitself(attheapplication
layer).Asanexample,assumethatanorganizationwants
toimplementthefollowing
policiesregardingitsWebpages:OnlythoseInternetuserswhohavepreviouslyestab­
lishedbusinessrelationswiththecompanycanhaveaccess;accesstootherusersmust
beblocked.Inthiscase,apacket-filterfirewall
isnotfeasiblebecauseitcannotdistin­
guishbetweendifferentpacketsarrivingatTCPport80(HTTP).Testingmustbedone
attheapplicationlevel(usingURLs).
Onesolutionistoinstallaproxycomputer(sometimescalledanapplicationgate­
way),whichstandsbetweenthecustomer(userclient)computerandthecorporation
computershowninFigure32.24.
Figure32.24Proxyfirewall
Errors
HTIPproxy
GlobalInternet
All
HTIP
packets
HTIPserver
Accepted
packets
Whentheuserclientprocesssendsamessage,the proxyfirewallrunsaserver
processtoreceivetherequest.Theserveropensthepacketattheapplicationleveland
findsout
iftherequestislegitimate. Ifitis,theserveracts asaclientprocessandsends
themessagetotherealserverinthecorporation.
Ifitisnot,themessageisdroppedand
anerrormessageissent
totheexternaluser.Inthisway,therequests oftheexternal
usersarefilteredbasedonthecontentsattheapplicationlayer
..Figure32.24showsa
proxyfirewallimplementation.
Aproxyfirewallfilters attheapplicationlayer.

1024 CHAPTER32SECURITYINTHEINTERNET:IPSec,SSUTLS,PGP,VPN, ANDFIREWALLS
32.5RECOMMENDED READING
Formoredetailsaboutsubjectsdiscussedinthischapter,werecommendthefollowing
books.Thebrackets,[
...],refertothereferencelistattheend ofthetext.
Books
IPSecisdiscussedinChapter7 of[Rhe03],Section 18.1of[PHS03],andChapters 17
and18of[KPS02].Afulldiscussion ofIPSeccanbefoundin[DH03].SSLITLSisdis­
cussedinChapter8of[Rhe03],andChapter
19of[KPS02].AfulldiscusionofSSLand
TLScanbefoundin[ResOl]and
[ThoOO].PGPisdiscussedinChapter9 of[Rhe03],and
Chapter22
of[KPS02].FirewallsarediscussedinChapter 10of[Rhe03]andChapter 23
of[KPS02].Firewallsarefullydiscussedin[CBR03].Virtualprivatenetworksarefully
discussedin
[YSO1]and[SWE99].
32.6KEYTERMS
AlertProtocol
AuthenticationHeader(AH)
Protocol
certificatetrust
ChangeCipherSpecProtocol
ciphersuite
connection
EncapsulatingSecurityPayload
(ESP)
extranet
fingerprint
firewall
HandshakeProtocol
hybridnetwork
InternetKeyExchange(IKE)
InternetSecurityAssociationandKey
ManagementProtocol(lSAKMP)
intranet
introducer
introducertrust
IPSecurity(IPSec)
keylegitimacy
keymaterial
keyring
mastersecret
Oakley
packet-filterfirewall
premastersecret
PrettyGoodPrivacy(PGP)
privatenetwork
proxyfirewall
pseudorandomfunction(PRF)
RecordProtocol
replayattack
SecureSocketLayer(SSL)
securityassociation(SA)
securityassociationdatabase
(SADB)
securityparameterindex(SPI)
session
SKEME
TransportLayerSecurity
(TLS)
transportmode
tunnelmode
tunneling
virtualprivatenetwork(VPN)
web
oftrust

SECTION32.7SUMMARY 1025
32.7SUMMARY
oIPSecurity(IPSec)isacollection ofprotocolsdesignedbytheIETF(Internet
EngineeringTaskForce)toprovidesecurityforapacketatthenetworklevel.
oIPSecoperatesinthetransportmodeorthetunnelmode.
oInthetransportmode,IPSecprotectsinformationdeliveredfromthetransport
layer
tothenetworklayer.IPSec inthetransportmodedoesnotprotecttheIPheader.
Thetransportmodeisnormallyusedwhenweneedhost-to-host(end-to-end)pro­
tection
ofdata.
oInthetunnelmode,IPSecprotectsthewholeIPpacket,includingtheoriginalIP
header.
oIPSecdefinestwoprotocols-AuthenticationHeader(AH)ProtocolandEncapsu­
latingSecurityPayload(ESP)
Protocol-toprovideauthenticationorencryption
orbothforpacketsatthe
IPlevel.
oIPSecrequiresalogicalrelationshipbetweentwohostscalledasecurityassociation
(SA).IPSecusesaset
ofSAscalledthesecurityassociationdatabaseorSADB.
oTheInternetKeyExchange(IKE)istheprotocoldesigned tocreatesecurityasso­
ciations,bothinboundandoutbound.IKEcreatesSAsforIPSec.
[lIKEisacomplexprotocolbasedonthreeotherprotocols:Oakley,SKEME,and
ISAKMP.
oAprivatenetworkisusedinsideanorganization.
oAnintranetisaprivatenetworkthatusestheInternetmodel.Anextranetisan
intranetthatallowsauthorizedaccessfromoutsideusers.
oTheInternetauthoritieshavereservedaddressesforprivatenetworks.
[]Avirtualprivatenetwork(VPN)providesprivacyforLANsthatmustcommunicate
throughtheglobalInternet.
oAtransportlayersecurityprotocolprovidesend-to-endsecurityservicesforappli­
cationsthatusetheservices
ofareliabletransportlayerprotocolsuchas TCP.
oTwoprotocolsaredominanttodayforprovidingsecurityatthetransportlayer:
SecureSocketsLayer(SSL)andTransportLayerSecurity(TLS).Thesecondis
actuallyanIETFversion
ofthefirst.
oSSLisdesignedtoprovidesecurityandcompressionservices todatagenerated
fromtheapplicationlayer.Typically,SSLcanreceiveapplicationdatafromany
applicationlayerprotocol,buttheprotocolisnormallyHTTP.
ClSSLprovidesservicessuchasfragmentation,compression,messageintegrity,con­
fidentiality,andframingondatareceivedfromtheapplicationlayer.
oThecombinationofkeyexchange,hash,andencryptionalgorithmsdefinesacipher
suiteforeachSSLsession.Thename
ofeachsuiteisdescriptive ofthecombination.UIne-mail,thecryptographicalgorithmsandsecretsaresentwiththemessage.
DOnesecurityprotocolforthee-mailsystemisPrettyGoodPrivacy(PGP).PGP
wasinventedbyPhilZimmermantoprovideprivacy,integrity,andauthentication
ine-mail.

1026 CHAPTER 32SECURITYINTHEINTERNET:IPSec,SSUFLS,PGP, VPN,ANDFIREWALLS
oToexchangee-mailmessages,auserneedsaring ofpublickeys;onepublickeyis
neededforeache-mailcorrespondent.
oPOPhasalsospecifiedaring ofprivate/publickeypairstoallowausertochange
herpairofkeysfromtimetotime. POPalsoallowseachusertohavedifferentuser
IDs(e-mailaddresses)fordifferentgroups
ofpeople.
oPOPcertificationisdifferentfromX509.InX509,thereisasinglepathfromthe
fullytrustedauthoritytoanycertificate.InPOP,therecan
bemultiplepathsfrom
fully
orpartiallytrustedauthorities.
opapusestheidea ofcertificatetrustlevels.
oWhenauserreceivesacertificatefromanintroducer, itstoresthecertificateunder
thename
ofthesubject(certifiedentity). Itassignsalevel oftrusttothiscertificate.
32.8PRACTICESET
ReviewQuestions
1.WhydoesIPSecneedasecurityassociation?
2.HowdoesIPSeccreateaset ofsecurityparameters?
3.WhatarethetwoprotocolsdefinedbyIPSec?
4.Whatdoes AHaddtothe IPpacket?
5.Whatdoes ESPaddtothe IPpacket?
6.Areboth
AHandESPneededfor IPsecurity?Why orwhynot?
7.Whatarethetwoprotocolsdiscussedinthischapterthatprovidesecurityatthe
transportlayer?
8.WhatisIKE?
9.
Whatisthedifferencebetweenasession andaconnectioninSSL?
10.Howdoes
SSLcreateaset ofsecurityparameters?
11.Whatisthename
oftheprotocol,discussedinthischapter,thatprovidessecurity
fore-mail?
12.Howdoes
PGPcreateaset ofsecurityparameters?
13.
Whatisthepurpose oftheHandshakeProtocolinSSL?
14.Whatisthepurpose oftheRecordProtocolinSSL?
15.Whatis thepurposeofafirewall?
16.Whatarethetwotypes offirewalls?
17.Whatisa VPNandwhyis itneeded?
18.Howdo
LANsonafullyprivateinternetcommunicate?
Exercises
19.Showthevalues oftheAHfieldsinFigure32.6.Assumethereare128bits of
authenticationdata.
20.Showthevalues
oftheESPheaderandtrailerfieldsinFigure32.7.

SECTION32.8PRACTICESET 1027
21.RedrawFigure32.6 ifAHisusedintunnelmode.
22.RedrawFigure32.7
ifESPisusedintunnelmode.
23.Drawafiguretoshowtheposition
ofAHinIPv6.
24.Drawafiguretoshowtheposition
ofESPinIPv6.
25.DoestheIPSecProtocolneedtheservices
ofaKDC?Explainyouranswer.
26.DoestheIPSecProtocolneedtheservices ofaCA?Explainyouranswer.
27.DoestheSSLProtocolneedtheservices ofaKDC?Explainyouranswer.
28.DoestheSSLProtocolneedtheservices
ofaCA?Explainyouranswer.
29.DoesthePGPProtocolneedtheservices ofaKDC?Explainyouranswer.
30.Doesthe
papProtocolneedtheservices ofaCA?Explainyouranswer.
31.ArethereanyciphersuitesinIPSec?Explainyouranswer.
32.ArethereanyciphersuitesinPGP?Explainyouranswer.

APPENDIXA
Unicode
Computersusenumbers.Theystorecharactersbyassigninganumberforeachone.The
originalcodingsystemwascalledASCII(AmericanStandardCodeforInformation
Interchange)andhad128numbers(0to127)eachstored
asa7-bitnumber.ASCIIcould
satisfactorilyhandlelowercaseanduppercaseletters,digits,punctuationcharacters,and
somecontrolcharacters.AnattemptwasmadetoextendtheASCIIcharactersetto8bits.
Thenewcode,whichwascalledExtendedASCII,wasneverinternationallystandardized.
ToovercomethedifficultiesinherentinASCIIandExtendedASCII,theUnicode
Consortium
(agroupofmultilingualsoftwaremanufacturers)createdauniversal
encodingsystemtoprovideacomprehensivecharactersetcalledUnicode.
Unicodewasoriginallya2-bytecharacterset.Unicodeversion3,however,isa
4-bytecodeandisfullycompatiblewithASCIIandExtendedASCII.TheASCIIset,
which
isnowcalledBasicLatin,isUnicode withtheupper 25bitssettozero.Extended
ASCII,whichisnowcalledLatin-I,isUnicodewiththe24upperbitssettozero.Fig­
ure
A.Ishowshowthedifferentsystemsarecompatible.
FigureA.lUnicodecompatibility
"
Extended
ASCIII
1-.-1• D_e_fin_in_g_p_lan_e_s__-+I'I 1•ASCII:
1__8_b_its_---..JII__8_b_its_---..J1~=,*f.,..",~c;...,....*M""""'~~=~i'..".,~""""'~l ~;Ji~~j~]j*ii£:~'-l
I, Unicode .j
A.IUNICODE
TheprevalentcodetodayisUnicode.Eachcharacter orsymbolinthiscodeisdefined
bya32-bitnumber.Thecodecandefineup
to2
32
(4,294,967,296)characters orsym­
bols.Thenotationuseshexadecimaldigitsinthefollowingformat:
1029

1030 APPENDIXAUNICODE
EachXisahexadecimaldigit.Therefore,thenumberinggoesfromU-OOOOOOOOto
U-FFFFFFFF.
Planes
Unicodedividestheavailablespacecodesintoplanes.Themostsignificant16bits
definetheplane,whichmeanswecanhave65,535planes.Eachplanecandefineupto
65,536characterorsymbols.FigureA.2showsthestructure
ofUnicodespacesand
planes.
FigureA.2Unicodeplanes
o ~ M {'tj
oa a a
a a a a
a a a a
Reserved
§i§g:;~=
88888
Reserved
Plane0000:BasicMultilingualPlane(BMP)
Plane0001:SupplementaryMultilingualPlane(SMP)
Plane0002:SupplementaryIdeographicPlane(SIP)
Plane OOOE:SupplementarySpecialPlane(SSP)
Plane
OOOF:PrivateUsePlane(PUP)
Plane0010:PrivateUsePlane(PUP)
BasicMultilingual Plane(BMP)
Plane0000,thebasicmultilingualplane(BMP),isdesignedtobecompatiblewiththe
previous16-bitUnicode.Themostsignificant
16bitsinthisplaneareallzeros.Thecodes
arenormallyshown
asU+XXXXwiththeunderstandingthatXXXXdefinesonlythe
leastsignificant16bits.Thisplanemostlydefinescharactersetsindifferentlanguages
withtheexception
ofsomecodesusedforcontrolorotherspecialcharacters.Table A.I
showsthemainclassification ofcodesinplane0000.
Table
A.IUnicodeBMP
Range Description
,
A-Zone(Alphabetical CharactersandSymbols)
U+OOOOtoU+OOFF BasicLatinandLatin-l
U+OIOOtoU+OIFF Latinextended
U+0200toU+02FF IPAextension,andspacemodifierletters
U+0300toU+03FF Combiningdiacriticalmarks,Greek
U+0400toU+04FF Cyrillic
U+0500toU+05FF Armenian,Hebrew
U+0600toU+06FF Arabic

TableA.I UnicodeBMP(continued)
APPENDIXAUNICODE 1031
Range Description
U+0700toU+08FF Reserved
U+0900toU+09FF Devanagari,Bengali
U+OAOOtoU+OAFF Gumukhi,Gujarati
U+OBOOtoU+OBFF Oriya,Tamil
U+OCOOtoU+OCFF Telugu,Kannda
U+ODOOtoU+ODFF Malayalam
U+OEOOtoU+OEFF Thai,Lao
U+OFOOtoU+OFFF Reserved
U+1000to U+lOFF Georgian
U+1100to
U+llFF HangulJamo
U+1200toU+1DFF Reserved
U+IEOOtoU+1EFF Latinextendedadditional
U+1FOOtoU+1FFF Greekextended
U+2000toU+20FF Punctuation,sub/superscripts,currency,marks
U+21
00toU+21FF Letterlikesymbols,numberforms,arrows
U+2200toU+22FF Mathematicaloperations
U+2300toU+23FF Miscellaneoustechnicalsymbols
U+2400
toU+24FF Controlpictures,OCR,andenclosedalphanumeric
U+2500
toU+25FF Boxdrawing,blockdrawing,andgeometricshapes
U+2600
toU+26FF Miscellaneoussymbols
U+2700
toU+27FF DingbatsandBraillepatterns
U+2800
toU+2FFF Reserved
U+3000toU+30FF CJKsymbolsandpunctuation,hiragana,katakana
U+3100toU+31FF Bopornfo,hanguljambo,cjkmiscellaneous
U+3200
toU+32FF Enclosed CJKlettersandmonths
U+3300
toU+33FF CJKcompatibility
U+3400toU+4DFF Hangul
I-Zone(IdeographicCharacters)
U+4EOOtoU+9FFF CJKunifiedideographic
O-Zone(Open)
U+AOOOtoU+DFFF Reserved
R·Zone(RestrictedUse)
U+EOOOtoU+F8FF Privateuse
U+F900
toU+FAFF CJKcompatibilityideographs
U+FBOOtoU+FBFF Arabicpresentationform-A

1032 APPENDIXAUNICODE
TableA.IUnicodeBMP(continued)
Range Description
I
I
U+FCOOtoU+FDFF Arabicpresentationform-B
U+FEOOtoU+FEFF Halfmarks,smallforms
U
+FFOOtoU+FFFF Half-widthandfull-widthforms I
I
SupplementaryMultilingualPlane(SMP)
Plane0001,thesupplementarymultilingualplane(SMP),isdesignedtoprovidemore
codesforthosemultilingualcharactersthatarenotincludedintheBMP.
SupplementaryIdeographicPlane(SIP)
Plane0002,thesupplementaryideographicplane(SIP),isdesignedtoprovidecodesfor
ideographicsymbols,symbolsthatprimarilydenote
anidea(ormeaning)incontrasttoa
sound(orpronunciation).
SupplementarySpecialPlane(SSP)
PlaneOOOE,thesupplementaryspecialplane(SSP),isusedforspecialcharacters.
PrivateUsePlanes(PUPs)
PlanesOOOFand0010,privateuseplanes(PUPs),areforprivateuse.
A.2ASCII
TheAmericanStandardCodeforInformationInterchange(ASCII)isa7-bitcodethat
wasdesignedtoprovidecodefor128symbols,mostlyinAmericanEnglish.Today,
ASCII,orBasicLatin,ispartofUnicode.
Itoccupiesthefirst128codesinUnicode
(00000000
to0000007F).TableA.2containsthedecimal,hexadecimal,andgraphic
codes(symbols)with
anEnglishinterpretation,ifappropriate.Thecodesinhexadecimal
justdefinethetwoleastsignificantdigitsinUnicode.Tofindtheactualcode,weprepend
000000inhexadecimaltothecode.Thedecimalcodeisjusttoshowtheintegervalue
ofeachsymbolwhenconverted.
TableA.2
ASCIICodes
Decimal Hex Symbol Interpretation
0 00 null Nullvalue
1 01 SOH Startofheading
2 02 STX Startoftext
3 03 ETX Endoftext
4 04 EaT Endoftransmission

TableA.2ASCIICodes(continued)
APPENDIXAUN/CODE 1033
Decimal Hex Symbol Interpretation
5 05 ENQ Enquiry
6 06 ACK Acknowledgment
7 07
BEL Ringbell
8 08 BS Backspace
9 09
HT Horizontaltab
10 OA LF Linefeed
11 OB VT Verticaltab
12
OC FF Fonnfeed
13 OD CR Carriagereturn
14
OE SO Shiftout
15 OF SI Shiftin
16
10 DLE Datalinkescape
17 11 DC1 Devicecontrol1
18 12 DC2 Devicecontrol2
19 13 DC3 Devicecontrol3
20 14 DC4 Devicecontrol4
21 15 NAK Negativeacknowledgment
22 16
SYN Synchronousidle
23 17 ETB End
oftransmissionblock
24 18
CAN Cancel
25 19
EM Endofmedium
26 1A SUB Substitute
27
lB ESC Escape
28 1C FS Fileseparator
29
10 GS Groupseparator
30
IE RS Recordseparator
31 IF US Unitseparator
32 20 SP Space
33
21 !
34 22
n
Doublequote
35 23 #
36 24
$
37 25 %
38 26 &
39 27
,
Apostrophe

1034 APPENDIXAUNICODE
TableA.2ASCIICodes(continued)
Decimal Hex Symbol Interpretation
I
40 28 (
41 29 )
42 2A
*
43 2B +
44 2C , Comma
45 2D - Minus
46 2E
47 2F /
48 30 0
49 31 1
50 32 2
51 33 3
52 34 4
53 35 5
54 36 6
55 37 7
56 38 8
57 39 9
58 3A Colon
59 3B , Semicolon
60 3C <
61 3D =
62 3E >
63 3F ?
64 40 @
65 41 A
66 42 B
67 43 C
68 44 D
69 45 E
70 46 F
71 47 G
72 48 H
73 49 I
74 4A J

TableA.2ASCIICodes(continued)
APPENDIXAUNICODE 1035
Decimal Hex Symbol Interpretation
75 4B K
76 4C L
77 4D M
78 4E N
79 4F 0
80 50 P
81 51 Q
_.
.f------...'--_.-_..
-"
82 52 R
83 53 S
84 54 T
85 55 U
86 56 V
87 57 W
88 58 X
89 59 y
90 5A Z
91 5B [ Openbracket
92 5C \ Backs1ash
93 5D ] Closebracket
94 5E
A
Caret
95 5F
-
Underscore
96 60
,
Graveaccent
97 61 a
98 62 b
99 63 c
100 64 d
101 65 e
102 66 f
103 67 g
104 68 h
105 69 i
106 6A J
107 6B k
108 6C 1
109 6D m

1036 APPENDIXAUNICODE
TableA.2 ASCIICodes(continued)
Decimal Hex Symbol Interpretation
110 6E n
111 6F 0
112 70 p
113 71 q
114 72 r
115 73 s
116 74 t
117 75 u
118 76 v
119 77 w
120 78 x
121 79 y
122 7A z
123 7B { Openbrace
124 7C I Bar
125 7D } Closebrace
126 7E
- Tilde
127 7F DEL Delete
SOllIePropertiesofASCII
ASCIIhas someinterestingpropertiesthatwebrieflymentionhere.
I.Thefirstcode(0) isthenullcharacter,whichmeansthelack ofanycharacter.
2.Thefirst32codes,0to31,arecontrolcharacters.
3.Thespacecharacter,whichisaprintablecharacter,isatposition32.
4.Theuppercaselettersstartfrom
65(A).Thelowercaselettersstartfrom97.When
compared,uppercaselettersarenumericallysmallerthanlowercaseletters.This
meansthatinasortedlistbasedonASCIIvalues,theuppercaselettersappear
beforethelowercaseletters.
5.Theuppercaseandlowercaselettersdifferbyonlyonebitinthe7-bitcode.Forexam­
ple,characterAis1000001(Ox4l)andcharactera
is110000I(Ox61).Thedifference
isinbit
6,whichis0inuppercaselettersand1inlowercaseletters. Ifweknowthe
codeforonecase,wecaneasilyfindthecodefortheotherbyaddingorsubtracting
32indecimal
(Ox20inhexadecimal),orwecanjustflipthesixthbit.
6.Theuppercaselettersarenotimmediatelyfollowedbylowercaseletters.Thereare
somepunctuationcharactersinbetween.
7.Digits(0to9)startfrom48 (Ox3).Thismeansthat ifyouwanttochangeanumeric
charactertoitsfacevalueasaninteger,youneedtosubtract48.

APPENDIXB
NumberingSystems
Weusedifferentnumberingsystems:base 10(decimal),base2(binary),base8(octal),
base16(hexadecimal),base256,and
soon.Allthenumberingsystemsexaminedhere
arepositional,meaningthattheposition
ofasymbolinrelationtoothersymbolsdeter­
minesitsvalue.Eachsymbolinanumberhasaposition.Thepositiontraditionally
startsfrom0andgoesto
n-1,wherenisthenumberofsymbols.Forexample,inFig­
ureB.1,thedecimalnumber14,782has
fivesymbolsinpositions0to 4.
FigureB.lPositionsandsymbolsinanumber
Decimalnumber: 14.782
2
34
___4__7_--,--_8_-,--_2_1Symbols
(J Positions
Aswewillsee,thedifferencebetweendifferentnumberingsystemsisbasedonthe
weightassignedtoeachposition.
B.lBASE10: DECIMAL
Thebase-10ordecimalsystemistheonemostfamiliartousineverydaylife.Allour
termsforindicatingcountablequantitiesarebasedonit,and,infact,whenwespeak
of
othernumberingsystems, wetendtorefertotheirquantitiesbytheirdecimalequiva­
lents.Theterm
decimalisderivedfromtheLatinstem deci,meaning10.Thedecimal
systemuses
10symbolstorepresentquantitativevalues: 0,1,2,3,4,5,6,7,8,and9.
Decimalnumbersuse10symbols:0, 1,2,3,4,5,6,7,8,and9.
1037

1038 APPENDIXBNUMBERINGSYSTEMS
Weights
Inthedecimalsystem,eachweightequals10raisedtothepower ofitsposition.The
weight
ofthesymbolatposition0is 100(1);theweightofthesymbolatposition1is
10
1
(10);andsoon.
B.2BASE 2:BINARY
Thebinarynumbersystemprovidesthebasisforallcomputeroperations.Computers
workbyturningelectriccurrentonandoff.Thebinarysystemusestwosymbols,0and
1,soitcorrespondsnaturallytoatwo-statedevice,suchasaswitch,with0torepresent
the
offstateand1torepresentthe onstate.Theword binaryderivesfromtheLatin
stem
bi,meaning2.
Binarynumbersusetwosymbols: 0and1.
Weights
Inthebinarysystem,eachweightequals2raisedtothepower ofitsposition.The
weightofthesymbolatposition0 is20(1);theweightofthesymbolatposition1 is2
1
(2);
andsoon.
Conversion
Nowletusseehowwecanconvertbinarytodecimalanddecimaltobinary.FigureB.2
showthetwoprocesses.
FigureB.2 Binary-to-decimaland
decimal~to-binary conversion
11001110IBinarynumber
6432
168 4 2 1 Weights
64
008420Weightedresults
~
~Decimalnumber
a.
Binarytodecimal
...
l-- Q_uo_ti_en_ts Decimal
I( number
~11100111 0 ~
Binarynumber
b.Decimal
tobinary
Toconvertabinarynumbertodecimal,weusetheweights. Wemultiplyeachsymbol
byitsweightandaddalltheweightedresults.FigureB.2showshowwecanchange
binary1001110toitsdecimalequivalent78.
Asimpledivisiontrickgivesusaconvenientway
toconvertadecimalnumberto
itsbinaryequivalent,asshowninFigureB.2.Toconvertanumberfromdecimalto
binary,dividethenumberby2andwritedowntheremainder
(lor0).Thatremainder
istheleastsignificantbinarydigit.Now,dividethequotient
ofthatdivisionby2and

APPENDIXBNUMBERINGSYSTEMS 1039
writedownthenewremainderinthesecondposition.Repeatthisprocessuntilthequo­
tientbecomeszero.
B.3BASE16: HEXADECIMAL
Anothersystemusedinthistext isbase16.Theterm hexadecimalisderivedfromthe
Greekterm
hexadec,meaning16.Thehexadecimalnumbersystemisconvenientfor
identifyingalargebinarynumberinashorterform.Thehexadecimalsystemuses
16symbols:0, 1,...,9,A,B,C,D,E,and F.Thehexadecimalsystemusesthesame
first
10symbolsasthedecimalsystem,butinstead ofusing10,11,12,13, 14,and
15,itusesA,B, C,D,E,and
F.Thispreventsanyconfusionbetweentwoadjacent
symbols.
Hexadecimalnumbersuse16symbols:0,1,2,3,4,5,6, 7,8,9,A,B, C,D,E,andF.
Weights
Inthehexadecimalsystem,eachweightequals16raisedtothepower ofitsposition.
Theweight
ofthesymbolatposition0is16°(1);theweight ofthesymbolatposition1 is
16
1
(16);and soon.
Conversion
Nowlet usseehowwecanconverthexadecimaltodecimalanddecimaltohexadecimal.
FigureB.3showthetwoprocesses.
FigureB.3Hexadecimal-to-decimalanddecimal-to-hexadecimalconversion
Quotients
I
3
4,096
A
256
7
16
Decimal
.......f---------number
Hexadecimalnumber
a.Hexadecimaltodecimal b.Decimaltohexadecimal
Toconvertahexadecimalnumbertodecimal,weusetheweights.Wemultiply
eachsymbolbyitsweightandaddalltheweightedresults.FigureB.3showshow
hexadecimal
Ox3A73istransformedtoitsdecimalequivalent14,963.
Weusethesametrickweusedforchangingdecimaltobinarytotransforma
decimal
tohexadecimal.Theonly differenceisthatwedividethenumberby 16instead
of2.Thefigurealsoshowshow14,963indecimalisconverted tohexadecimalOx3A73.

1040 APPENDIXBNUMBERINGSYSTEMS
AComparison
TableB.lshowshowsystemsrepresentthedecimalnumbers0through 15.Asyoucan
see,decimal
13isequivalenttobinary1101,whichisequivalenttohexadecimal D.
TableB.IComparisonofthreesystems
Decimal Binary Hexadecimal
0 0 0
1 1 1
2 10 2
3
11 3
4 100 4
5
101 5
6 110 6
7 111 7
Decimal Binary Hexadecimal
8 1000 8
9 1001 9
10 1010
A
11 1011 B
12 1100 C
13 1101 D
14 1110 E
15 1111 F
B.4BASE256: IPADDRESSES
OnenumberingsystemthatisusedintheInternetisbase256.IPv4addresses usethis
basetorepresentanaddressindotteddecimalnotation.WhenwedefineanIPv4
address
as131.32.7.8,weareusingabase-256number.Inthisbase,wecouldhave
used256uniquesymbols,butrememberingthatmanysymbolsandtheirvaluesisbur­
densome.ThedesignersoftheIPv4addressdecidedtousedecimalnumbers0to255
assymbolsandtodistinguishbetweenthesymbols,adot
isused.Thedotisusedto
separatethesymbols;itmarkstheboundarybetweenthepositions.Forexample,the
IPv4address131.32.7.8ismadeofthefoursymbols
8,7,32,and 131atpositions0,1,2,
and
3,respectively.
IPv4addressesusethebase-256 numberingsystem.
Thesymbolsin1Pv4aredecimalnumbersbetween0 and255;
theseparatorisadot.
Weights
Inbase256,eachweightequals256raisedtothepower ofitsposition.Theweightof
thesymbolatposition0is256
0
(1);theweightofthesymbolatposition1is256
1
(256);andsoon.
Conversion
Nowletusseehow wecanconverthexadecimal todecimalanddecimal tohexadecimal.
FigureB.4showthetwoprocesses.

APPENDIXBNUMBERINGSYSTEMS 1041
FigureB.4IPv4addresstodecimaltransformation
12,215,708,6861Decimalnumber
__1_3_2 1_7 8 14_1IPv4address
256
3
256
2
256
1
256
0
Weights
2,214,592,5121,114,1122,048 14Results
..QuotientsDecimal
~---- number
a.IPaddresstodecimal b.Decimalto IPaddress
ToconvertanIPv4addresstodecimal,weusetheweights. Wemultiplyeachsymbol
byitsweightandaddalltheweightedresults.ThefigureshowshowtheIPv4address
131.32.7.8
istransformedtoitsdecimalequivalent.
Weusethesametrickweusedforchangingdecimal tobinarytotransformadecimal
to
anIPv4address.Theonlydifferenceisthatwedividethenumberby256instead of2.
However,weneedtorememberthattheIPv4addresshasfourpositions.Thismeans
thatwhenwearedealingwith
anIPv4address,wemuststopafterwehavefoundfour
values.Figure
BAshowsanexampleforanIPv4address.
B.5OTHERCONVERSIONS
Thereareothertransformationssuchasbase2tobase 16orbase16tobase256. Itis
easytousebase10astheintermediatesystem.Inotherwords,tochangeanumber
frombinarytohexadecimalwefirstchangethebinarytodecimalandthenchangethe
decimaltohexadecimal.
Wediscusssomeeasymethodsforcommontransformations.
BinaryandHexadecimal
Thereisasimplewaytoconvertbinarytohexadecimalandviceversaasshownin
FigureB.5.
FigureB.5Transformationfrombinary tohexadecimal
I
10]100011110IBinary
~~~
2 8 E Hexadecimal
a.Binarytohexadecimal
Hexadecimal
Binary
'----'---'----------'
b.Hexadecimaltobinary
Tochangeanumberfrombinary tohexadecimal,wegroupthebinarydigitsfrom
therightbyfours.Thenweconverteach4-bitgrouptoitshexadecimalequivalent,

1042 APPENDIXBNUMBERINGSYSTEMS
usingTableB.1.Inthefigure,weconvertbinary1010001110 tohexadecimalOx28E.
Tochangeahexadecimalnumbertobinary,weconverteachhexadecimaldigittoits
equivalentbinarynumber,usingTableB.1,andconcatenatetheresults.InFigureB.5
weconverthexadecimalOx28Etobinary.
Base256 andBinary
Toconvertabase256numbertobinary, wefirstneedtoconvertthenumberineach
positiontoan8-bitbinarygroupandthenconcatenatethegroups.
Toconvertfrom
binary
tobase256,weneedtodividethebinarynumberintogroups of8bits,convert
eachgrouptodecimal,andtheninsertseparators(dots)betweenthedecimalnumbers.

APPENDIXC
MathematicalReview
Inthisappendix,wereviewsomemathematicalconceptsthatmayhelpyoutobetter
understandthetopicscoveredinthebook.Perhapsthemostimportantconcept
indata
communications
issignalsandtheirrepresentation. Westartwithabriefreview oftrig­
onometricfunctions,asdiscussedinatypicalprecalculusbook.
Wethenbrieflydiscuss
Fourieranalysis,whichprovidesatoolforthetransformationbetweenthetimeandfre­
quencydomains.
Wefinallygiveabrieftreatment ofexponentialandlogarithmicfunctions.
C.lTRIGONOMETRIC FUNCTIONS
Letusbrieflydiscusssomecharacteristics ofthetrigonometricfunctionsasusedinthe
book.
SineWave
Wecanmathematicallydescribeasinewaveas
set)
==Asin(21tft)::::Asin(2;t)
wheresistheinstantaneousamplitude, Aisthepeakamplitude, fisthefrequency,and
Tistheperiod(phasewillbediscussedlater).Figure C.lshowsasinewave.
FigureC.I Asinewave
Time
T
Notethatthevalue of21tfiscalledtheradianfrequencyandwritten as0)(omega),
whichmeansthatasinefunctioncanwritten
asset)=Asin
(rot).
1043

1044 APPENDIX CMATHEMATICAL REVIEW
ExampleC.l
Findthepeakvalue,frequency,andperiod ofthefollowingsinewaves.
a.set)=5sin(10m)
b.set)=sin(lOt)
Solution
a.Peakamplitude: A=5
Frequency:101t=2rtf,sof=5
Period:T=IIJ=1/5s
b.Peakamplitude:A=1
Frequency:10 =2rtf,sof=1O/(2rt)=1.60
Period:
T=IIJ=1/1.60=0.628s
ExampleC.2
Showthemathematicalrepresentation ofasinewavewitha peakamplitudeof2andafrequency
of1000Hz.
Solution
Themathematicalrepresentationis set)
=2sin(20001tt).
HorizontalShifting(Phase)
Allthesinefunctionswediscussed sofarhaveanamplitude ofvalue0attheorigin.
What
ifweshiftthesignaltotheleft ortotheright?FigureC.2showstwosimplesine
waves,oneshiftedtotherightandonetotheleft.
FigureC.2 Twohorizontallyshiftedsinewaves
I
s(t)=Asin(COt-<Il)
A---
Time
<Il
00 T
Is(t)=Asin(cot+<Il) CO=21tfI
...
Time
<Il
<0 T
Whenasignalisshifted totheleftorright,itsfirstzerocrossingwillbeatapoint
intimeotherthantheorigin.
Toshowthis,weneedtoaddorsubtractanotherconstant
to
oot,asshowninthefigure.

APPENDIXCMATHEMATICAL REVIEW 1045
Shiftingasinewavetotheleft orrightisapositiveornegativeshift,respectively.
VerticalShifting
Whenasinewaveisshiftedvertically,aconstantis addedtotheinstantaneousampli­
tude
ofthesignal.Forexample,ifweshiftasine wave2unitsofamplitudeupward,the
signal
becomesset)=2+sin(rot);ifweshiftit2unitsofamplitudedownward, wehave
set)=-2+sin(rot).FigureC.3shows theidea.
FigureC.3Verticalshifting ofsinewaves
I
s(t)=2+Asin(rot)00=2rrfI
Time
Is(t)=-2+Asin(rot)00=2rtfI
CosineWave
Ifweshiftasinewave T/2totheleft, wegetwhatiscalledacosinewave(cos).
Asin(rot+1tI2)=Acos(rot)
FigureC.4showsacosinewave.
FigureC.4Acosinewave
s(t~tIs(t)=Asin(rot+T/4)=Acos(rot)00=2rtfI
-w=
~---f/\
r~V\7
4 T
----

Time

1046 APPENDIXCMATHEMATICAL REVIEW
OtherTrigonometricFunctions
Therearemanytrigonometricfunctions;two ofthemorecommonaretan(cot)and
cot(illt).Theyaredefinedastan((Ot)=sine(Ot)/cos(cot)andcot(cot)=cos(ffit)/sin((Ot).
Notethattanandcotaretheinverse ofeachother.
TrigonometricIdentities
Thereareseveralidentitiesbetweentrigonometricfunctionsthatwesometimesneedto
know.Table
C.lgivestheseidentitiesforreference.Otheridentitiescanbeeasily
derivedfromthese.
Table
C.lSometrigonometricidentities
Name Formula
Pythagorean sin
2
x+cos
2
x=1
Even/odd sin
(-x)=-sin(x)cos(-x)=cos(x)
Sum sin (x+y)=sin(x)cos(y)+cos(x)sin(y)
cos(x+y)=cos(x)cos(y)- sin(x)sin(y)
Difference sin
(x-y)=sin(x)cos(y)-cos(x)sin(y)
cos(x-y)=cos(x)cos(Y)+sin(x)sin(y)
Producttosum sin (x)sin(y)=1/2[cos(x-y)-cos(x+y)]
cos(x)cos(y)
=1/2[cos(x-y)+cos(x+y)]
sin(x)cos(y)=1/2[sin(x+y)+sin(x-y)]
cos(x)sin(y)=1/2[sin(x+y)-sin(x-y)]
C.2FOURIERANALYSIS
Fourieranalysis isatoolthatchangesatime-domainsignaltoafrequency-domainsignal
andviceversa.
FourierSeries
Fourierprovedthatacompositeperiodicsignalwithperiod T(frequencyf)canbe
decomposedintoaseries
ofsineandcosinefunctionsinwhicheachfunctionisan
integralharmonic
ofthefundamentalfrequency fofthecompositesignal.Theresultis
calledthe
Fourierseries.Inotherwords,wecanwriteacompositesignal asshownin
FigureC.S.Usingtheseries,wecandecomposeanyperiodicsignalintoitsharmonics.
Notethat
Aoistheaveragevalue ofthesignaloveraperiod, Anisthecoefficientofthe
nthcosinecomponent,and
B
n
isthecoefficientofthenthsinecomponent.
ExampleC.3
Letusshowthecomponents ofasquarewavesignalasseeninFigureC.6.Thefigurealsoshows
thetimedomainandthefrequencydomain.According
tothefigure,suchasquarewavesignalhas
only
Ancoefficients.Notealsothatthevalue ofAo=0becausetheaveragevalue ofthesignalis0;
itisoscillatingaboveandbelowthetimeaxis.Thefrequencydomain
ofthesignalisdiscrete;

APPENDIXCMATHEMATICAL REVIEW 1047
FigureC.SFourierseriesandcoefficients oftenns
Fourierseries
~ ~
s(t)=A
o
+LAllsin(21tnft)+LB"cos(21tnft)
n=l n=l
Coefficients
Fourierseries
Timedomain:periodic Frequencydomain:discrete
onlyoddharmonicsarepresentandtheamplitudesarealternativelypositiveandnegative.Avery
importantpointisthattheamplitude
oftheharmonicsapproacheszeroas wemovetowardinfin­
ity.Somethingwhichisnotshowninthefigureisthephase.However,weknowthatallcompo­
nentsarecosinewaves,whichmeansthateachhasaphase
of90°.
FigureC.6FindingtheFourierseries ofaperiodicsquarefunction
Timedomain
Time
o
A
----;I---+---+--+---t--t---+---..-
-A
T
Ao=O
set)=~cos(21tft)-j~cos(21t3ft)+1~cos(21t5ft)-j~cos(2rr:7ft)+•••
4A
1t
f
4A
31t
4A
51t
Frequency
Frequencydomain

1048 APPENDIXCMATHEMATICAL REVIEW
ExampleC.4
Nowletusshowthecomponents ofasawtoothsignalasseeninFigureC.7.Thistime,wehave
only
Encomponents(sinewaves).Thefrequencyspectrum,however,isdenser;wehaveallhar­
monics
if,2j,3j,...).Apointwhichisnotclearfromthediagramisthephase.Allcomponents
aresinewaves,whichmeanseachcomponenthasaphase
of
00.
FigureC.7FindingtheFourierseries forasawtoothsignal
Timedomain
I
A •••
----,.'----I----:ll..r----i------::;.,,;-:---1----+-
~ TI~
set)=2,¢sin(2rcft)-~sin(2rc2ft)+~sin(21t3ft)-~sin(21t4!t)+•••
2A
1t
f
21
I
2A
-2rc
2A
3rc
I4f
3fI
2A
-4rc
2A
5
1
1t6f
5f'2A
-61t
Frequency
Frequencydomain
FourierTransform
WhiletheFourierseriesgivesthediscretefrequencydomain ofaperiodicsignal,the
Fouriertransformgivesthecontinuousfrequencydomain ofanonperiodicsignal.
Figure
C.Sshowshowwecancreateacontinuousfrequencydomainfromanonperiodic
time-domainfunctionandviceversa.
FigureC.S Fouriertransform andinverseFouriertransform
S(f)=
f~t)e-j2"ft dt set)=L~f)ej21tft dt
Fouriertransform InverseFouriertransform

APPENDIXCMATHEMATICAL REVIEW 1049
Fouriertransform
Timedomain:nonperiodic Frequencydomain:continuous
ExampleC.s
FigureC.9showsthetimeandfrequencydomains ofonesinglesquarepulse.Thetimedomainis
between
-t/2andtl2;thefrequencydomainisacontinuousfunctionthatstretchesfromnegative
infinitytopositiveinfinity.Unlikethepreviousexamples,thefrequencydomainiscontinuous;all
frequenciesarethere,not
justtheintegralones.
FigureC.9 FindingtheFouriertransform ofasquarepulse
Timedomain
-'t/201;/2
sin(1t'tj)
Sif)=A't1tTj
Frequencydomain
At
Frequency
Time-LimitedandBand-LimitedSignals
TwoveryinterestingconceptsrelatedtotheFouriertransformarethetime-limited
andband-limitedsignals.Atime-limitedsignalisasignalforwhichtheamplitude
of
set)isnonzeroonlyduringaperiod oftime;theamplitudeiszeroeverywhereelse.
Aband-limitedsignal,ontheotherhand,isthesignalforwhichtheamplitude
ofSif)
isnonzeroonlyforarange offrequencies;theamplitudeiszeroeverywhereelse.A
band-limitedsignalplaysaveryimportantroleinthesamplingtheoremandNyquist
frequencybecausethecorrespondingtimedomaincanberepresented
asaseriesof
samples.
Time-limitedsignal: s(t)=0forI tI
~T
Band-limitedsignal: Sif)=0forIfI~B

1050 APPENDIXCMATHEMATICAL REVIEW
C.3EXPONENTANDLOGARITHM
Insolvingnetworkingproblems,weoftenneedtoknowhowtohandleexponentialand
logarithmicfunctions.Thissectionbrieflyreviewsthesetwoconcepts.
ExponentialFunction
Theexponentialfunctionwith baseaisdefinedas
y=cr
Ifxisaninteger(integralvalue),wecaneasilycalculatethevalue ofybymultiplying
thevalue
ofabyitselfxtimes.
ExampleC.6
Calculatethevalue ofthefollowingexponentialfunctions.
a.y=3
2
b.Y=5.2
6
Solution
a.y=3x3=9
b.y=5.2x5.2x5.2x5.2x5.2x5.2=19,770.609664
Ifxisnotinteger,weneedtouseacalculator.
ExampleC.7
Calculatethevalue ofthefollowingexponentialfunctions.
a.y=3
2
.
2
b.y=5.2
6
.3
Solution
a.y=11.212(approximately)
b.y=32,424.60(approximately)
NaturalBase
Oneverycommonbaseusedinscienceandmathematicsisthe naturalbase e,which
hasthevalue2.71828183
....Mostcalculatorsshowthisfunctionas
£1,whichcanbe
calculatedeasilybyenteringonlythevalue
oftheexponent.
ExampleC.s
Calculatethevalue ofthefollowingexponentialfunctions.
_ 4
a.y-e
b.y=e
6
.3
Solution
a.y=54.56(approximately)
b.y=544.57(approximately)

APPENDIXCMATHEMATICAL REVIEW 1051
PropertiesoftheExponentialFunction
Exponentialfunctionshaveseveralproperties;someareuseful tousinthistext:
First:
Second:
Third: y
=aO=1
y=a
1
=a
_y=a-
x
=.!.
aX
ExampleC.9
Thethirdpropertyisusefultousbecausewecancalculatethevalue ofanexponentialfunction
withanegativevalue.Wefirstcalculatethepositivevalueandwetheninverttheresult.
a.y
=e-
4
b.y=e-6·3
Solution
a.y=1/54.56=0.0183
b.y=1/544.57=0.00183
LogarithmicFunction
Alogarithmicfunctionistheinverse ofanexponentialfunction,asshownbelow.Just
asintheexponentialfunction, aiscalledthebase ofthelogarithmicfunction:
y=£c.-..x=lo~y
Inotherwords, ifxisgiven,wecancalculate ybyusingtheexponentialfunction~
ifyisgiven,wecancalculate xbyusingthelogarithmicfunction.
Exponentialandlogarithmicfunctions aretheinverseofeachother.
ExampleC.10
Calculatethevalue ofthefollowinglogarithmicfunction,s.
a.x=log39
b.x=log216
Solution
Wehavenotyetshownhowtocalculatethelogfunctionindifferentbases,butwecansolvethis
problemintuitively.
a.Because3
2
:=9,wecansaythatlog39 =2,usingthefactthatthetwofunctionsarethe
inverse
ofeachother.
b.Because2
4
=16,wecansaythat log2l6=4byusingthepreviousfact.
TwoCommonBases
Thetwocommonbasesforlogarithmicfunctions,thosethatcanbehandledbyacalcu­
lator,arebase
eandbase10.Thelogarithminbase eisnormallyshownas In(natural
logarithm);thelogarithminbase10
isnormallyshownaslog(omittingthebase).

1052 APPENDIXCMATHEMATICAL REVIEW
ExampleCll
Calculatethevalue ofthefollowinglogarithmicfunctions.
a.x=log233
b.x=In45
Solution
Forthesetwobases wecanuseacalculator.
a.x=log233=2.367
b.x=In45=3.81
BaseTransformation
Weoftenneedtofindthevalue ofalogarithmicfunctioninabaseotherthan eor10.If
theavailablecalculatorcannotgivetheresultinourdesiredbase,wecanuseavery
fundamentalproperty
ofthelogarithm,basetransformation,asshown:
10g
b
Y
IO&1Y=-­
10g
b
a
Notethattheright-handsideistwologfunctionswithbase b,whichisdifferent
fromthebaseaattheleft-handside.Thismeansthatwecanchooseabasethatis
available
inourcalculator(base b)andfindthelog ofabasethat isnotavailable
(base
a).
ExampleC12
Calculatethevalue ofthefollowinglogarithmicfunctions.
a.x=log3810
b.x=log5600
Solution
Thesetwobases,3and5,arenotavailableonacalculator,butwecanusebase10whichisavailable.
loglO810
2.908
a.x=log3810= =--=6.095
log103 0.477
log10
6002.778
b.x=log5600= =--=3.975
log105 0.699
PropertiesofLogarithmicFunctions
Likeanexponentialfunction,alogarithmicfunctionhassomepropertiesthatareuseful
in:simplifyingthecalculation ofalogfunction.
First:
Second:
Third:
10&11=0
10&1a=1
10&1!=-10&1x
x
Fourth:
Fifth:
Sixth:
10&1(xxY)=10&1x+lo~y
10&1:!:=l0&zx-10&1y
y
lo&zx
Y
=Yx10&1x

APPENDIXCMATHEMATICAL REVIEW 1053
ExampleC13
Calculatethevalue ofthefollowinglogarithmicfunctions.
a.x=log31
b.x=log33
c.x=loglO(l/10)
d.loga(xxy)ifweknowthatloga x=2andloga y=3
e.logz(1024)withoutusingacalculator
Solution
Weusetheproperty oflogfunctionstosolvetheproblems.
a.x=log31 =0
b.x=log33=1
c.x=loglO(1110)=loglOlO-l=-loglO10 =-1
d.loga(xxy)=log
a
x+logaY=2+3=5
e.10gz
(1024)=logz(2
10
)
=10logz2 =10x 1=10

APPENDIXD
8B/6TCode
Thisappendixisatabulation of8B/6Tcodepairs.The8-bitdataareshowninhexadecimal
format.
The6Tcodeisshownas +(positivesignal),-(negativesignal),and0(lack of
signal)notation.
TableD.l8B/6Tcode
Data Code Data Code Data Code Data Code
00 -+00-+ 20 -++-00 40-00+0+ 60 0++0-0
01 0-+-+0 21 +00+-- 410-00++ 61 +0+-00
02 0-+0-+ 22 -+0-++ 420-0+0+ 62 +0+0-0
03 0-++0- 23 +-0-++ 430-0++0 63 +0+00-
04 -+0+0- 24 +-0+00 44-00++0 64 0++00-
05 +0--+0 25 -+0+00 4500-0++ 65 ++0-00
06 +0-0-+ 26 +00-00 4600-+0+ 66 ++00-0
07 +0-+0- 27 -+++-- 4700-++0 67 ++000-
08 -+00+- 28 0++-0- 4800+000 68 0++-+-
09 0-++-0 29 +0+0-- 49++-000 69 +0++--
OA 0-+0+- 2A +0+-0- 4A+-+000 6A +0+-+-
OB 0-+-0+ 2B +0+--0 4B-++000 6B +0+--+
OC -+0-0+ 2C 0++--0 4C0+-000 6C 0++--+
OD +0-+-0 2D ++00-- 4D+0-000 6D ++0+--
OE +0-0+- 2E ++0-0- 4E0-+000 6E ++0-+-
OF +0--0+ 2F ++0--0 4F-0+000 6F ++0--+
10 0--+0+ 30 +-00-+ 50+--+0+ 70 000++-
11 -0-0++ 31 0+--+0 51-+-0++ 71 000+-+
12 -0-+0+ 32 0+-0-+ 52-+-+0+ 72 000-++
13 -0-++0 33 0+-+0- 53-+-++0 73 000+00
1055

1056 APPENDIXD8B/6TCODE
TableD.I 8B/6Tcode(continued)
Data Code Data Code Data Code Data Code
14
0--++0 34 +-0+0- 54+--++0 74 000+0-
15 --00++ 35 -0+-+0 55--+0++ 75 000+-0
16 --0+0+ 36 -0+0-+ 56--++0+ 76 000-0+
17 --0++0 37 -0++0- 57--+++0 77 000-+0
18 -+0-+0 38 +-00+- 58--0+++ 78 +++--0
19 +-0-+0 39 0+-+-0 59-0-+++ 79 +++-0-
lA -++-+0 3A 0+-0+- 5A0--+++ 7A +++0--
IB +00-+0 3B 0+--0+ 5B0--0++ 7B 0++0--
lC +00+-0 3C+-0-0+ 5C+--0++ 7C -00-++
ID -+++-0 30 -0++-0 50-000++ 7D -00+00
IE +-0+-0 3E -0+0+- 5E0+++-- 7E +---++
IF -+0+-0 3F -0+-0+ 5F0++-00 7F +--+00
80 -00+-+ AO -++0-0 CO-+0+-+ EO -++0-+
81 0-0-++ Al +-+-00 Cl0-+-++El +-++0
82 0-0+-+ A2 +-+0-0 C20-++-+E2 +-+0-+
83 0-0++- A3 +-+00- C30-+++- E3 +-++0-
84 -00++- A4 -++00- C4-+0++- E4 -+++0-
85 00--++ A5 ++--00 C5+0--++ E5 ++--+0
8600-+-+ A6 ++-0-0 C6+0-+-+ E6 ++-0-+
87 00-++- A7 ++-00- C7+0-++- E7 ++-+0-
88 -000+0 A8-++-+- C8-+00+0 E8 -++0+-
89 0-0+00 A9+-++-- C90-++00 E9 +-++-0
8A 0-00+0 AA +-+-+- CA0-+0+0EA +-+0+-
8B 0-000+ AB +-+--+ CB0-+00+ EB +-+-0+
8C -0000+ AC -++--+ CC-+000+ EC -++-0+
80 00-+00 AD ++-+-- CD+0-+00ED ++-+-0
8E 00-0+0 AE ++--+- CE+0-0+0EE ++-0+-
8F 00-00+ AF ++---+ CF+0-00+EF ++--0+
90+--+-+ BO+000-0 DO+-0+-+ FO+000-+
91-+--++ Bl0+0-00 010+--++Fl0+0-+0
92-+-+-+ B20+00-0 020+-+-+F20+00-+
93-+-++- B30+000- D30+-++- F30+0+0-
94+--++- B4+0000- D4+-0++- F4+00+0-

TableD.I8B/6Tcode(continued)
APPENDIX
D8B/6TCODE 1057
Data Code Data Code Data Code Data Code
95--+-++ B500+-00 05-0+-++ F500+-+0
96
--++-+ B600+0-0 06-0++-+ F600+0-+
97--+++- B700+00- 07-0+++- F700++0-
98+--0+0 B8+00-+- 08+-00+0 F8+000+-
99-+-+00 B90+0+-- 090+-+00 F90+0+-0
9A-+-0+0 BA0+0-+- OA0+-0+0 FA0+00+-
9B-+-00+ BB0+0--+ OB0+-00+FB0+0-0+
9C+--00+ BC+00--+ OC+-000+FC+00-0+
90--++00 BO00++-- 00-0++00 FD00++-0
9E--+0+0 BE00+-+- OE-0+0+0 FE00+0+-
9F--+00+ BF00+--+ OF-0+00+ FF00+-0+

APPENDIXE
TelephoneHistory
InChapter9,wediscussedtelephonenetworks.Inthisappendix,webrieflyreviewthe
history
oftelephonenetworks.ThehistoryintheUnitedStatescan bedividedintothree
eras:priorto1984,between1984and1996,andafter1996.
Before1984
Before1984,almostalllocalandlong-distanceserviceswereprovidedbytheAT&TBell
System.In1970,theU.S.government,believingthattheBellSystemwasmonopolizing
thetelephoneserviceindustry,suedthecompany.Theverdictwasinfavor
ofthegovern­
mentandresultedinadocumentcalledtheModifiedFinalJudgment(MFJ).Beginningon
January
1,1984,AT&TwasbrokenintoAT&TLongLines, 23BellOperatingCompa­
nies(BOCs),andothers.The
23BOCsweregroupedtomakeseveralRegionalBell
OperatingCompanies(RBOSs).Thislandmarkevent,theAT&Tdivestiture
of1984,was
beneficialtocustomers
oftelephoneservices.Telephonerateswerelowered.
Between1984and1996
Thedivestituredividedthecountryintomorethan200LATAs;somecompanieswere
allowedtoprovideservicesinsideaLATA(LECs),andotherswereallowedtoprovide
servicesbetweenLATAs(IXCs).Competition,particularlybetweenlong-distancecar­
riers,increasedasnewcompanieswereformed.However,noLECcouldprovidelong­
distanceservices,andnoIXCscouldprovidelocalservices.
After1996
Anothermajorchangeintelecommunicationsoccurredin1996.TheTelecommunica­
tions
Actof1996combinedthedifferentservicesprovidedbydifferentcompanies
undertheumbrella
oftelecommunicationservices;thisincludedlocalservices,long­
distancevoiceanddataservices,videoservices,andsoon.Inaddition,theactallowed
anycompanytoprovideany
ofthese servicesatthelocalandlong-distancelevels.In
otherwords,acommoncarriercompanyprovidesservicesbothinsidetheLATAand
betweentheLATAs.However,topreventtherecabling
ofresidents,thecarriersthatwere
givenintra-LATAservices(ILECs)continuedtoprovidethemainservices;thenew
competitors(CLECs)providedotherservices.
1059

APPENDIXF
ContactAddresses
Thefollowingisalist ofcontactaddressesforvariousorganizationsmentionedin
thetext.
oATMForum
PresidioofSanFrancisco
P.O.Box29920(mail)
572BRugerStreet(surface)
SanFrancisco,CA94129-0920
Telephone:415561-6275
E-mail:[email protected]
www.atmforum.com
oFederalCommunicationsCommission (FCC)
44512thStreet S.W.
Washington,DC20554
Telephone:1-888-225-5322
E-mail:[email protected]
www.fcc.gov
oInstituteofElectricalandElectronicsEngineers(IEEE)
OperationsCenter
445HoesLane
Piscataway,NJ08854-1331
Telephone:732981-0060
www.ieee.org
1061

1062 APPENDIXFCONTACTADDRESSES
oInternationalOrganizationforStandardization(ISO)
1,ruedeVarembe
CaissePosta1e56
CH-1211Geneve20
Switzerland
Telephone:
41227490111
E-mail:[email protected]
www.iso.org
oInternationalTelecommunicationUnion(ITU)
PlacedesNations
CH-1211Geneva20
Switzerland
Telephone:41227305852
E-mail:[email protected]
www.itu.intlhome
oInternetArchitectureBoard(lAB)
E-mail:[email protected]
www.iab.org
oInternetCorporationforAssignedNames andNumbers(ICANN)
4676Admiralty Way,Suite330
MarinadelRey,CA90292-6601
Telephone:310823-9358
E-mail:[email protected]
www.icann.org
oInternetEngineeringSteeringGroup(IESG)
E-mail:[email protected]
www.ietf.org/iesg.html
oInternetEngineeringTaskForce(IETF)
E-mail:[email protected]
www.ietf.org
oInternetResearchTaskForce(IRTF)
E-mail:[email protected]
www.irtf.org
oInternetSociety(ISO C)
1775WeihleAvenue,Suite102
Reston,
VA20190-5108
Telephone:703.326-9880
E-mail:[email protected]
www.isoc.org

APPENDIXG
RFCs
InTableG.1,welistalphabeticallybyprotocoltheRFCsthataredirectlyrelatedto
the
materialinthistext.Formoreinformationgotothefollowingsite:http://
www.rfc-editor.org.
TableG.tRFCsforeachprotocol
Protocol
RFC
ARPandRARP 826,903,925,1027,1293,1329,1433,1868,1931,2390
BGP 1092,1105,1163,1265,1266,1267,1364,1392,1403,1565,
1654,1655,1665,1771,1772,1745,1774,2283
BOOTPandDHCP 951,1048,1084,1395,1497, 1531, 1532, 1533,1534,1541,
1542,2131,2132
CIDR 1322,1478,1479,1517,1817
DHCP SeeBOOTPandDHCP
DNS
799,811,819,830,881,882,883,897,920,921,1034,1035,
1386,1480,1535,1536,1537,1591,1637,1664,1706,1712,
1713,1982,2065,2137,2317,2535,2671
FTP 114,133,141,163,171,172,238,242,250,256,264,269,281,
291,354,385,412,414,418,430,438,448,463,468,478,486,
505,506,542,553,624,630,640,691,765,913,959,1635,
1785,2228,2577
HTML 1866
HTTP 2068,2109
ICMP 777,792,1016,1018,1256,1788,2521
IGMP 966,988,1054,1112,1301,1458,1469,1768,2236,2357,2365,
2502,2588
IMAP SeeSMTP,MIME,POP,IMAP
IP
760,781,791,815,1025, 1063,1071,1141, 1190, 1191,
1624,2113
1063

1064 APPENDIXGRFCs
TableG.!RFCsforeachprotocol(continued)
Protocol
RFC
IPv6 1365,1550,1678,1680,1682,1683,1686,1688,1726,1752,
1826,1883,1884,1886,1887,1955,2080,2373,2452,2463,
2465,2466,2472,2492,2545,2590
MIB SeeSNMP,MIB,SMI
MIME SeeSMTP,MIME,POP,IMAP
MulticastRouting 1584,1585,2117,2362
NAT 1361,2663,2694
OSPF 1131,1245,1246,1247,1370,1583,1584, 1585,1586,1587,
2178,2328,2329,2370
POP SeeSMTP,MIME,POP,IMAP
RARP SeeARPandRARP
RIP 1131,1245,1246,1247,1370,1583,1584,1585, 1586,1587,
1722,1723,2082,2453
SCTP 2960,3257,3284,3285,3286,3309,3436,3554,3708,3758
SMI SeeSNMP,MIB,SMI
SMTP,MIME,POP, 196,221,224,278,524,539,753,772,780,806,821,934,974,
IMAP 1047, 1081, 1082, 1225,1460,1496,1426, 1427,1652,1653,
1711,1725,1734,1740,1741,1767,1869,1870,2045,2046,
2047,2048,2177,2180,2192,2193,2221,2342,2359,2449,
2683,2503
SNMP,MIB,SMI 1065,1067,1098, 1155,1157,1212,1213,1229,1231,1243,
1284,1351,1352,1354,1389, 1398,1414,1441,1442,1443,
1444, 1445,1446,1447,1448,1449,1450,1451,1452, 1461,
1472,1474,1537,1623,1643, 1650, 1657, 1665,1666, 1696,
1697,1724,1742, 1743,1748,1749
TCP 675,700,721,761,793,879,896,1078,1106,1110,1144,1145,
1146,1263,1323,1337,1379,1644,1693,1901,1905,2001,
2018,2488,2580
TELNET 137,340,393,426,435,452,466,495,513,529,562,595,596,
599,669,679,701,702,703,728,764,782,818,854,855,1184,
1205,2355
TFfP 1350,1782,1783,1784
UDP 768
VPN 2547,2637,2685
WWW 1614,1630,1737,1738

APPENDIXH
UDPandTCPPorts
TableH.Iliststhecommonwell-knownportsorderedbyportnumber.
Table
H.IPortsby portnumber
PortNumber
UDPffCP Protocol
7 TCP ECHO
13 UDPrrCp DAYTIME
19 UDPITCP CHARACTERGENERATOR
20 TCP FTP-DATA
21 TCP FTP-CONTROL
23 TCP TELNET
25 TCP SMTP
37
UDPrrCp TIME
67 UDP BOOTP-SERVER
68 UDP BOOTP-CLIENT
69 UDP TFTP
70 TCP GOPHER
79 TCP FINGER
80 TCP HTTP
109 TCP POP-2
110 TCP POP-3
111 UOPITCP RPC
161 UOP SNMP
162 UOP SNMP-TRAP
179 TCP BGP
520 UOP
RIP
1065

1066 APPENDIXHUDP ANDTCPPORTS
TableH.2liststheports,orderedalphabeticallybyprotocol.
TableH.2 Portnumbers byprotocol
Protocol UDPITCP PortNumber
BGP TCP 179
BOOTP-SERVER UDP 67
BOOTP-CLIENT UDP 68
CHARACTERGENERATOR UDP/TCP 19
DAYTIME UDP/TCP 13
ECHO TCP 7
FINGER TCP 79
FTP-CONTROL TCP 21
FTP-DATA TCP 20
GOPHER TCP 70
HTTP TCP 80
POP-2 TCP 109
POP-3 TCP 110
RIP UDP 520
RPC UDP/TCP 111
SMTP TCP 25
SNMP UDP 161
SNMP-TRAP UDP 162
TELNET TCP 23
TFTP UDP 69
TIME UDP/TCP 37

Acronyms
AAL applicationadaptationlayer BER BasicEncodingRules
ABM asynchronousbalancedmode BOP BorderGatewayProtocol
ACK acknowledgment BNC Bayone-Neill-Concelman
ACL asynchronousconnectionlesslink BOOTP BootstrapProtocol
AOSL asymmetricdigitalsubscriberline BSS basicserviceset
AES AdvancedEncryptionStandard BUS broadcast/unknownserver
AH AuthenticationHeader CA CertificationAuthority
AM amplitudemodulation CATV communityantennaTV
AMI alternatemarkinversion CBC cipherblockchainingmode
AMPS AdvancedMobilePhoneSystem CBR constantbitrate
ANSI AmericanNationalStandardsInstitute CBT Core-BasedTree
AP accesspoint CCITT ConsultativeCommitteefor
ARP AddressResolutionProtocol
InternationalTelegraphyand
ARPA AdvancedResearchProjectsAgency
Telephony
ARPANET AdvancedResearchProjectsAgency
CCK complementarycodekeying
Network
COMA codedivisionmultipleaccess
ARQ automaticrepeatrequest
CFB cipherfeedbackmode
AS authenticationserver
COl CommonGatewayInterface
AS autonomoussystem
CHAP ChallengeHandshakeAuthentication
ASCII AmericanStandardCodefor
Protocol
InformationInterchange
CrOR ClasslessInterDomainRouting
ASK amplitudeshiftkeying CrR committedinformationrate
ASN.l AbstractSyntaxNotation1 CLEC competitivelocalexchangecarrier
ATM AsynchronousTransferMode CMTS cablemodemtransmissionsystem
AUr attachmentunitinterface CRC cyclicredundancycheck
B8ZS bipolarwith8-zerosubstitution CS convergencesublayer
Be committedburstsize CSM cipherstreammode
Be excessburstsize CSMA carriersensemultipleaccess
BECN backwardexplicitcongestion CSMAICA carriersensemUltipleaccesswith
notification collisionavoidance
1067

1068 ACRONYMS
CSMA/CD carriersensemultipleaccesswith FSK frequencyshiftkeying
collisiondetection
FTP FileTransferProtocol
D-AMPS digitalAMPS
GPS GlobalPositioningSystem
DARPA DefenseAdvancedResearchProjects
GSM GlobalSystemforMobile
Agency
Communication
dB decibel
HDLC High-levelData LinkControl
DC directcurrent
HDSL highbitratedigitalsubscriberline
DCF distributedcoordinationfunction
HFC hybrid-fiber-coaxialnetwork
OCT discretecosinetransform
HMAC hashed-messageauthenticationcode
DONS
DynamicDomainNameSystem
HR-DSSS HighRateDirectSequenceSpread
DDS digitaldataservice Spectrum
DE discardeligibility HTML HyperTextMarkupLanguage
DEMUX demultiplexer HTTP HyperTextTransferProtocol
DES dataencryptionstandard Hz hertz
DHCPDynamicHostConfigurationProtocol lAB InternetArchitectureBoard
DIFS distributedinterframespace lANA InternetAssignedNumbersAuthority
DLCI datalinkconnectionidentifier ICANN InternetCorporationforAssigned
DMT discretemultitonetechnique
NamesandNumbers
DNS DomainNameSystem
ICMP InternetControlMessageProtocol
DOCSIS DataOverCableSystemInterface
ICMPv6 InternetControlMessageProtocol,
Specifications
version6
DS digitalsignal
IEEE InstituteofElectricalandElectronics
Engineers
OS DifferentiatedServices
IESG InternetEngineeringSteeringGroup
DSL digitalsubscriberline
IETF InternetEngineeringTaskForce
DSLAM digitalsubscriberlineaccess
IFS interframespace
multiplexer
DSSS directsequencespreadspectrum
IGMP InternetGroupManagementProtocol
DVMRP DistanceVectorMulticastRouting
IKE InternetKeyExchange
Protocol
ILEC incumbentlocalexchangecarrier
DWDM densewave-divisionmultiplexing
IMAP4 InternetMailAccessProtocol,version4
EIA ElectronicsIndustriesAssociation
INTERNIC InternetNetworkInformationCenter
ESP EncapsulatingSecurityPayload
IntServ IntegratedServices
ESS ExtendedServiceSet
IP InternetProtocol
FCC FederalCommunicationsCommission
IPCP InternetworkProtocolControlProtocol
FDM frequency-divisionmultiplexing
IPng InternetProtocolnextgeneration
FDMA frequencydivisionmultipleaccess
IPSec IPSecurity
IPv4 InternetProtocolversion4
FDMA frequency-divisionmultipleaccess
IPv6 InternetProtocol,version6
FECN forwardexplicitcongestionnotification
IRTF InternetResearchTaskForce
FHSS frequencyhoppingspreadspectrum
IS-95 InterimStandard95
FIFO first-in,first-out
ISAKMP InternetSecurityAssociationandKey
FM frequencymodulation
ManagementProtocol
FQDN fullyqualifieddomainname
ISO InternationalOrganization of
FRAD FrameRelayassembler/disassembler Standardization

ACRONYMS 1069
ISOC InternetSociety MTU maximumtransferunit
ISP Internetserviceprovider MUX multiplexer
ISUP ISDNuserport NAP networkaccesspoint
ITM-2000 InternetMobileCommunication NAT networkaddresstranslation
ITU-T InternationalTelecommunications NAV networkallocationvector
Union-Telecommunication
NCP NetworkControlProtocol
StandardizationSector
NIC networkinterfacecard
IXC interexchangecarrier
NNI network-to-networkinterface
IPEG JointPhotographicExpertsGroup
NRM nonnalresponsemode
KOC keydistributioncenter
NRZ nonreturntozero
L2CAP LogicalLinkControlandAdaptation
NRZ-I nonreturntozero,invert
Protocol
NRZ-L nonreturntozero,level
LAN localareanetwork
NVT NetworkVirtualTenninal
LANE LANemulation
OC opticalcarrier
LANE localareanetworkemulation
OFB outputfeedback
LATA localaccessandtransportarea
OFOM orthogonalfrequencydivision
LCP LinkControlProtocol
multiplexing
LEC LANemulationclient
OSI OpenSystemsInterconnection
LEC localexchangecarrier
OSPF openshortestpathfirst
LEO lowearthorbit
PAM pulseamplitudemodulation
LES LANemulationserver
PAP PasswordAuthenticationProtocol
LLC logicallinkcontrol
PCF pointcoordinationfunction
LMI localmanagementinfonnation
PCM pulsecodemodulation
LSA linkstateadvertisement
PCS personalcommunicationsystem
LSP linkstatepacket
PGP PrettyGoodPrivacy
MA multipleaccess
PHB perhopbehavior
MAA messageaccessagent
PIM ProtocolIndependentMulticast
MAC mediumaccesscontrolsublayer
PIM-OM ProtocolIndependentMulticast,
MAC messageauthenticationcode DenseMode
MAN metropolitanareanetwork PIM-SM ProtocolIndependentMulticast,
MBONE multicastbackbone SparseMode
MOC modificationdetectionmode PKI publickeyinfrastructure
MEO mediumEarthorbit PM phasemodulation
MIB ManagementInfonnationBase PN pseudorandomnoise
MIl mediumindependentinterface POP pointofpresence
MIME MultipurposeInternetMailExtension POP3 PostOfficeProtocol,version3
MLT-3 multilinetransmission,3-level POTS plainoldtelephonesystem
MOSPF MulticastOpenShortestPathFirst PPP Point-to-PointProtocol
MPEG motionpictureexpertsgroup PQON partiallyqualifieddomainname
MSC mobileswitchingcenter PSK phaseshiftkeying
MTA mailtransferagent PVC permanentvirtualcircuit
MTA messagetransferagent QAM quadratureamplitudemodulation
MTSO mobiletelephoneswitchingoffice QoS qualityofservice

1070 ACRONYMS
RADSL rateadaptiveasymmetricaldigital STM synchronoustransportmodule
subscriberline
STP shieldedtwisted-pair
RARP ReverseAddressResolutionProtocol STP signaltransportport
RFC RequestforComment STS synchronoustransportsignal
RIP RoutingInformationProtocol SVC switchedvirtualcircuit
ROM read-onlymemory
TCAP transactioncapabilitiesapplicationport
RPB reversepathbroadcasting TCP TransmissionControlProtocol
RPF reversepathforwarding TCP/IP TransmissionControlProtocol!
RPM reversepathmulticasting InternetworkingProtocol
RSA Rivest,Shamir,Adleman TDD-TDMA timedivisionduplexingTDMA
RSVP ResourceReservationProtocol TDM time-divisionmultiplexing
RTCP Real-timeTransportControlProtocol TDMA timedivisionmultipleaccess
RTP Real-timeTransportProtocol TELNET TerminalNetwork
RTSP Real-TimeStreamingProtocol TFTP TrivialFileTransferProtocol
RTT round-triptime TGS ticket-grantingserver
RZ returntozero TLS TransportLayerSecurity
SA SecurityAssociation TOS typeofservice
SADB securityassociationdatabase TSI time-slotinterchange
SAR segmentationandreassembly TTL timetolive
SCCP signalingconnectioncontrolpoint TUP telephoneuser port
seo synchronousconnectionoriented UA useragent
SCP servercontrolpoint UBR unspecifiedbitrate
SCTP StreamControlTransmissionProtocol UDP UserDatagramProtocol
SDH SynchronousDigitalHierarchy UNI usernetworkinterface
SDSL symmetricdigitalsubscriberline UNI user-to-networkinterface
SEAL simpleandefficientadaptationlayer URL UniformResourceLocator
SHA-l SecureHashAlgorithm1 UTP unshieldedtwisted-pair
SIFS shortinterframespace VBR variablebitrate
SIP SessionInitiationProtocol ve virtualcircuit
SMI StructureofManagementInformation VDSL veryhighbitratedigitalsubscriber
SMTP SimpleMailTransferProtocol
line
SNMP SimpleNetworkManagementProtocol VLAN virtuallocalareanetwork
SNR signal-to-noiseratio VOFR VoiceOverFrameRelay
SONET SynchronousOpticalNetwork VPN virtualprivatenetwork
SP signalpoint VT virtualtributary
SPE synchronouspayloadenvelope WAN wideareanetwork
SPI securityparameterindex WATS wideareatelephoneservice
SS7 SignalingSystemSeven WDM wave-divisionmultiplexing
SSL SecureSocketLayer WWW WorldWideWeb

1000Base-CXThetwo-wireSTPimplementation ofGigabitEthernet.
1000Base-LXThetwo-wirefiberimplementation ofGigabitEthernetusinglong-wavelaser.
1000Base-SXThetwo-wirefiberimplementation ofGigabitEthernetusingshort-wavelaser.
1000Base-T Thefour-wireUTPimplementation ofGigabitEthernet.
100Base-FXThetwo-wirefiberimplementation ofFastEthernet.
100Base-T4 Thefour-wireUTPimplementationofFastEthernet.
IOOBase-TXThetwo-wireUTPimplementation ofFastEthernet.
IOBase2ThethincoaxialcableimplementationofStandardEthernet.
IOBase5Thethickcoaxialcableimplementation ofStandardEthernet.
10Base-FThefiberimplementation ofStandardEthernet.
10Base-TThetwisted-pairimplementation ofStandardEthernet.
10GBase-ETheextendedimplementationofTen-GigabitEthernet.
10GBase-LThefiberimplementationofTen-GigabitEthernetusinglong-wavelaser.
10GBase-SThefiberimplementationofTen-GigabitEthernetusingshort-wavelaser.
I-persistentstrategy ACSMApersistencestrategyinwhichastationsendsaframeimme­
diately
ifthelineisidle.
2BIQencodingAlineencodingtechniqueinwhicheachpulserepresents2bits.
4B/5Bencoding Ablockcodingtechniqueinwhich4bitsareencodedintoa5-bitcode.
8B/10Bencoding Ablockcodingtechniqueinwhich8bitsareencodedintoalO-bitcode.
8B6Tencoding Athree-levellineencodingschemethatencodesablockof8bitsintoasig­
nal
of6ternarypulses.
4-dimensional,5-levelpulseamplitudemodulation(4D-PAM5) Anencoding
schemeusedby1
OOOBase-T.
56Kmodem Amodemtechnologyusingtwodifferentdatarates:oneforuploadingandone
fordownloadingfromtheInternet.
1071

1072 GLOSSARY
A
AbstractSyntaxNotation 1(ASN.l)Astandardforrepresentingsimpleandstructured
data.
accesspoint(AP)AcentralbasestationinaBSS.
acknowledgment(ACK) Aresponsesentbythereceivertoindicatethesuccessfulreceipt
ofdata.
activedocument IntheWorldWideWeb,adocumentexecutedatthelocalsiteusingJava.
adaptivedeltamodulation Adeltamodulationtechniqueinwhichthevalue ofdelta
changesaccordingtotheamplitude
oftheanalogsignal.
add/dropmultiplexerASONETdevicethatremovesandinsertssignalsinapathwithout
demultiplexingandre-multiplexing.
additiveincrease Withslowstart,acongestionavoidancestrategyinwhichthewindowsize
isincreasedby
justonesegmentinstead ofexponentially.
addressaggregation Amechanisminwhichtheblocks ofaddressesforseveralorganizations
areaggregatedintoonelargerblock.
AddressResolutionProtocol(ARP) InTCPIIP,aprotocolforobtainingthephysical
address
ofanodewhentheInternetaddressisknown.
addressspaceThetotalnumber ofaddressesavailablebyaprotocol.
ADSLLite AsplitterlessADSL.ThistechnologyallowsanASDLLitemodemtobeplugged
directlyintoatelephonejackandconnectedtothecomputer.Thesplittingisdoneatthetelephone
company.
AdvancedEncryptionStandard(AES)Asecret-keycryptosystemadaptedbyNISTto
replaceDES.
AdvancedMobilePhoneSystem(AMPS) ANorthAmericananalogcellularphone
systemusingFDMA.
AdvancedResearchProjectsAgency(ARPA) Thegovernmentagencythatfunded
ARPANET.
AdvancedResearchProjectsAgencyNetwork
(ARPANET) Thepacket-switching
networkthatwasfundedbyARPA.
ALOHA Theoriginalrandommultipleaccessmethod inwhichastationcansendaframeany
time
ithasonetosend.
alternatemarkinversion(AMI) Adigital-to-digitalbipolarencodingmethodinwhich
theamplituderepresenting
1alternatesbetweenpositiveandnegativevoltages.
AmericanNational StandardsInstitute(ANSI) Anationalstandardsorganizationthat
definesstandardsintheUnitedStates.
AmericanStandardCodefor InformationInterchange(ASCII)Acharactercode
developedbyANSIthatusedextensivelyfordatacommunication.
amplitudeThestrengthofasignal,usuallymeasuredinvolts.
amplitudemodulation(AM) Ananalog-to-analogconversionmethodinwhichthecarrier
signal'samplitudevarieswiththeamplitude
ofthemodulatingsignal.
amplitudeshiftkeying(ASK) Amodulationmethodinwhichtheamplitude ofthecarrier
signalisvariedtorepresentbinary0or
1.
analogdataDatathatarecontinuousandsmoothandnotlimitedtoaspecificnumber ofvalues.

GLOSSARY 1073
analogsignal Acontinuouswaveformthatchangessmoothlyovertime.
analog-to-analogconversion Therepresentationofanaloginformationbyananalog
signal.
analog-to-digitalconversion Therepresentationofanaloginformationbyadigitalsignal.
angleofincidenceInoptics,theangleformedbyalightrayapproachingtheinterface
betweentwomediaandthelineperpendiculartotheinterface.
anycastaddress Anaddressthatdefinesagroup ofcomputerswithaddressesthathavethe
samebeginning.
aperiodicsignal Asignalthatdoesnotexhibitapatternorrepeatingcycle.
appletAcomputerprogramforcreatinganactiveWebdocument. Itisusuallywritten inJava.
applicationadaptationlayer(AAL)AlayerinATMprotocolthatbreaksuserdatainto
48-bytepayloads.
applicationlayerThefifthlayer intheInternetmodel;providesaccesstonetworkresources.
areaAcollectionofnetworks,hosts,androutersallcontainedwithinanautonomoussystem.
associationAconnectioninSCTP.
asymmetricdigitalsubscriberline(ADSL) Acommunicationtechnologyinwhichthe
downstreamdatarateishigherthantheupstreamrate.
asynchronousbalancedmode(ABM) InHDLC,acommunicationmodeinwhichall
stationsareequal.
asynchronousconnectionlesslink(ACL) AlinkbetweenaBluetoothmasterandslave
inwhichacorruptedpayloadisretransmitted.
AsynchronousTransferMode(ATM) Awideareaprotocolfeaturinghighdatarates
andequal-sizedpackets(cells);
ATM
issuitablefortransferringtext,audio,andvideodata.
asynchronoustransmission Transferofdatawithstartandstopbites)andavariabletime
intervalbetweendataunits.
A
TMLANALANusingATMtechnology.
ATMlayerAlayerinATMthatprovidesrouting,trafficmanagement,switching,andmulti­
plexingservices.
attachmentunitinterface(AUI) AlOBase5cablethatperformsthephysicalinterface
functionsbetweenthestationandthetransceiver.
attenuationThelossofasignal'senergyduetotheresistance ofthemedium.
audioRecordingortransmitting ofsoundormusic.
authenticationVerificationofthesenderofamessage.
AuthenticationHeader(AB)Protocol AprotocoldefinedbyIPSecatthenetworklayer
thatprovidesintegritytoamessage throughthecreation
ofadigitalsignaturebyahashingfunction.
authenticationserver(AS)TheKDCintheKerberosprotocol.
automaticrepeatrequest(ARQ) Anerror-controlmethodinwhichcorrectionismadeby
retransmission
ofdata.
autonegotiationAFastEthernetfeaturethatallowstwodevicestonegotiatethemodeor
datarate.
autonomoussystem(AS) Agroupofnetworksandroutersundertheauthority ofasingle
administration.

1074 GLOSSARY
B
backwardexplicitcongestionnotification(BECN) AbitintheFrameRelaypacket
thatnotifiesthesenderofcongestion.
band-passchannel Achannelthatcanpassarangeoffrequencies.
bandwidthThedifferencebetweenthehighestandthelowestfrequenciesofacomposite
signal.
Italsomeasurestheinformation-carryingcapacity ofalineoranetwork.
bandwidthondemandAdigitalservicethatallowssubscribershigherspeedsthroughthe
use
ofmultiplelines.
bandwidth-delayproductAmeasureofthenumberofbitsthatcanbesentwhilewaiting
fornewsfrom thereceiver.
banyanswitchAmultistageswitchwithmicroswitchesateachstagethatroutethepackets
basedontheoutputportrepresentedasabinarystring.
BarkersequenceAsequenceof 11bitsusedforspreading.
basebandtransmissionTransmissionofdigitaloranalogsignalwithoutmodulationusing
alow-passchannel.
baseheaderInIPv6,themainheader ofthedatagram.
baselinewandering Indecodingadigitalsignal,thereceivercalculatesarunningaverage
ofthereceivedsignalpower.Thisaverage
iscalledthebaseline.Alongstring ofOsorIscan
causeadriftinthebaseline(baseline wandering)andmakeitdifficultforthereceivertodecode
correctly.
BasicEncodingRule(BER) Astandardthatencodesdatatobetransferredthrougha
network.
BasicLatinASCIIcharacterset.
basicserviceset(BSS) Thebuildingblock ofawirelessLANasdefinedbytheIEEE
802.11standard.
Batcher-banyanswitchAbanyanswitchthatsortsthearrivingpacketsbasedontheir
destinationport.
baudrateThenumber ofsignalelementstransmittedpersecond.Asignalelementconsistsof
oneormorebits.
Bayone-Neill-Concelman(BNC)connector Acommoncoaxialcableconnector.
bidirectionalauthentication Anauthenticationmethodinvolvingachallengeanda
responsefromsendertoreceiverandviceversa.
bidirectionalframe(B-frame)AnMPEGframethatisrelatedtotheprecedingand
followingI-frameorP-frame.
binaryexponentialbackupIncontentionaccessmethods,aretransmissiondelaystrategy
usedbyasystemtodelayaccess.
binarynotationRepresentationofIPaddressesinbinary.
biphaseAtypeofpolarencodingwherethesignalchangesatthemiddleofthebitinterval.
ManchesteranddifferentialManchesterareexamples
ofbiphaseencoding.
bipolarencoding Adigital-to-digitalencodingmethodinwhich 0amplituderepresents
binary0andpositiveandnegativeamplitudesrepresentalternateIs.
bipolarwith8-zerosubstitution(B8ZS) Ascramblingtechniqueinwhichastream of8
zerosarereplacedbyapredefinedpatterntoimprovebitsynchronization.

GLOSSARY 1075
bitBinarydigit.Thesmallestunit ofdata(0or1).
bitrateThenumber ofbitstransmittedpersecond.
bitstuffingInabit-orientedprotocol,theprocess ofaddinganextrabitinthedatasection of
aframetopreventasequence ofbitsfromlookinglikeaflag.
bit-orientedprotocol Aprotocolinwhichthedataframeisinterpreted asasequenceofbits.
blockcipher Anencryption/decryptionalgorithmthathasablock ofbitsasitsbasicunit.
blockcode Anerrordetection/correctioncodeinwhichdataaredividedintounitscalled
datawords.Redundantbitsareaddedtoeachdatawordtocreateacodeword.
blockcoding Acodingmethodtoensuresynchronizationanddetection oferrors.
blockingAneventthatoccurswhenaswitchednetworkisworkingatitsfullcapacityand
cannotacceptmoreinput.
BluetoothAwirelessLANtechnology designedtoconnectdevices ofdifferentfunctionssuch
astelephonesandnotebooksinasmallareasuch
asaroom.
BootstrapProtocol(BOOTP) Theprotocolthatprovidesconfigurationinformationfrom
atable(file).
BorderGatewayProtocol(BGP) Aninterautonomoussystemroutingprotocolbasedon
pathvectorrouting.
bridgeAnetworkdeviceoperatingatthefirsttwolayers oftheInternetmodelwithfiltering
andforwardingcapabilities.
broadbandtransmissionTransmissionofsignalsusingmodulation ofahigherfrequency
signal.Thetermimpliesawide-bandwidthdatacombinedfromdifferentsources.
broadcastaddress Anaddressthatallowstransmission ofamessagetoallnodes ofanetwork.
broadcast/unknownserver(BUS) AserverconnectedtoanATMswitchthatcanmulticast
andbroadcastfranles.
broadcastingTransmissionofamessagetoallnodesinanetwork.
browserAnapplicationprogramthatdisplaysa WWWdocument.Abrowserusuallyuses
otherInternetservicestoaccessthedocument.
BSS-transitionmobility InawirelessLAN,astationthatcanmovefromoneBSSto
anotherbutisconfinedinsideoneESS.
bucketbrigade attackSeeman-in-themiddleattack.
bursterrorErrorinadataunitinwhichtwoormorebitshavebeenaltered.
burstydataDatawithvaryinginstantaneoustransmissionrates.
bustopology Anetworktopologyinwhichallcomputersareattachedtoasharedmedium.
bytestuffing Inabyte-orientedprotocol,theprocess ofaddinganextrabyteinthedatasection
ofaframetopreventabytefromlookinglikeaflag.
byte-orientedprotocol Aprotocolinwhichthedatasection oftheframeisinterpreted asa
sequence
ofbytes(characters).
c
cablemodem AtechnologyinwhichtheTVcableprovidesInternetaccess.
cablemodemtransmissionsystem(CMTS) Adeviceinstalledinside thedistribution
hubthatreceivesdatafromtheInternetandpassesthemtothecombiner.

1076GLOSSARY
cableTVnetworkAsystemusingcoaxialorfiberopticcablethatbringsmultiplechannels
ofvideoprogramsintohomes.
cachingThestoringofinformationinasmall,fastmemory.
CaesarcipherAshiftcipherusedbyJuliusCaesarwiththe keyvalueof3.
carrierextensionAtechniqueinGigabitEthernetthatincreasestheminimumlengthofthe
frame
toachieveahighermaximumcablelength.
carriersensemultipleaccess(CSMA)Acontentionaccessmethodinwhicheachstation
listens
tothelinebeforetransmittingdata.
carriersensemultipleaccesswithcollisionavoidance(CSMA/CA) Anaccess
methodinwhichcollision
isavoided.
carriersensemultipleaccesswithcollisiondetection(CSMA/CD) Anaccessmethod
inwhichstationstransmitwheneverthetransmissionmedium isavailableandretransmitwhen
collisionoccurs.
carriersignalAhighfrequencysignalusedfordigital-to-analogoranalog-to-analogmodu­
lation.Oneofthecharacteristics
ofthecarriersignal(amplitude,frequency,orphase)ischanged
accordingtothemodulatingdata.
cellAsmall,fixed-sizedataunit;also,incellulartelephony,ageographicalareaserved
bya
celloffice.
cell
networkAnetworkusingthecell asitsbasicdataunit.
cellulartelephonyAwirelesscommunicationtechnique inwhichanareaisdividedinto
cells.Acell
isservedbyatransmitter.
CertificationAuthority(CA)Anagencysuch asafederalorstateorganizationthatbinds
apublickeyto
anentityandissuesacertificate.
ChallengeHandshakeAuthenticationProtocol(CHAP)InPPp,athree-wayhandshaking
protocolusedforauthentication.
channelAcommunicationspathway.
channelizationAmultipleaccessmethodinwhichtheavailablebandwidth ofalinkis
sharedintime.
character-orientedprotocolSeebyte-orientedprotocol.
checksumAvalueusedforerrordetection. Itisformedbyaddingdataunitsusingone's
complementarithmeticandthencomplementingtheresult.
chipInCDMA,anumberinacodethatisassigned toastation.
chokepointApacketsentbyarouter tothesourcetoinformit ofcongestion.
chunkAunitoftransmissioninSCTP.
cipherAnencryption/decryptionalgorithm.
cipherblockchaining(CBC)modeADESandtripleDESoperationmodeinwhichthe
encryption(ordecryption)ofablockdependsonallpreviousblocks.
cipherfeedbackmode(CFB)ADESandtripleDESoperationmodeinwhichdata issent
andreceivedIbitatatime,witheachbitindependentofthepreviousbits.
cipherstreammode(CSM)ADESandtripleDESoperationmodeinwhichdata issent
andreceived1byteatatime.
ciphersuiteAlistofpossibleciphers.

GLOSSARY 1077
ciphertextTheencrypteddata.
circuitswitchingAswitchingtechnologythatestablishesanelectricalconnectionbetween
stationsusingadedicatedpath.
claddingGlassorplasticsurroundingthecore ofanopticalfiber;theopticaldensity ofthe
claddingmustbelessthanthat
ofthecore.
classfuladdressingAnIPv4addressingmechanisminwhichtheIPaddressspaceisdivided
into5classes:
A,B, C,D,andE.Eachclassoccupiessomepartofthewholeaddressspace.
classlessaddressingAnaddressingmechanisminwhichtheIPaddressspaceisnotdivided
intoclasses.
ClasslessInterDomainRouting(CIDR)Atechniquetoreducethenumber ofrouting
tableentrieswhensupemetting
isused.
clientprocessArunningapplicationprogramonalocalsitethatrequestsservicefroma
runningapplicationprogramonaremotesite.
client-servermodelThemodel ofinteractionbetweentwoapplicationprogramsinwhicha
programatoneend(client)requestsaservicefromaprogramattheotherend(server).
closed-loopcongestioncontrolAmethodtoalleviatecongestionafter ithappens.
coaxialcableAtransmissionmediumconsisting ofaconductingcore,insulatingmaterial,
andasecondconductingsheath.
codedivisionmultipleaccess(CDMA) Amultipleaccessmethodinwhichonechannel
carriesalltransmissionssimultaneously.
codewordTheencodeddataword.
ColdFusionAdynamicwebtechnologythatallowsthefusion ofdataitemscomingfroma
conventionaldatabase.
collisionTheeventthatoccurswhentwotransmitterssendatthesametimeonachannel
designedforonlyonetransmissionatatime;datawillbedestroyed.
collisiondomainThelengthofthemediumsubjecttocollision.
committedburstsize(Be)Themaximumnumber ofbitsinaspecifictimeperiodthata
FrameRelaynetworkmusttransferwithoutdiscardinganyframes.
committedinformationrate(CIR)Thecommittedburstsizedividedbytime.
commoncarrierAtransmissionfacilityavailabletothepublicandsubjecttopublicutility
regulation.
CommonGatewayInterface(CGI)AstandardforcommunicationbetweenHTTPservers
andexecutableprograms.CGIisusedincreatingdynamicdocuments.
communityantennaTV(CATV)Acablenetworkservicethatbroadcastsvideosignalsto
locationswithpooror
noreception.
compatibleaddressAnIPv6addressconsisting of96bitsofzerofollowedby32bitsof
IPv4.
competitivelocalexchangecarrier(CLEC)Atelephonecompanythatcannotprovide
maintelephoneservices;instead,otherservicessuch
asmobiletelephoneserviceandtollcalls
insidea
LATAareprovided.
complementarycodekeying(CCK)AnHR-DSSSencodingmethodthatencodesfouror
eightbitsintoonesymboL
compositesignalAsignalcomposed ofmorethanonesinewave.

1078 GLOSSARY
congestionExcessive networkorinternetworktrafficcausingageneraldegradation ofservice.
connectingdevice Atoolthatconnectscomputersornetworks.
connectionestablishment Thepreliminarysetupnecessaryforalogicalconnectionpriorto
actualdatatransfer.
connectionlessservice Aservicefordatatransferwithoutconnectionestablishmentor
termination.
constantbit rate(CBR)Thedatarate ofanATMserviceclassthatisdesignedforcustomers
requiringreal-timeaudioorvideoservices.
constellationdiagramAgraphicalrepresentation ofthephaseandamplitude ofdifferentbit
combinationsindigital-to-analogmodulation.
ConsultativeCommitteeforInternationalTelegraphy andTelephony(CCITT) An
internationalstandardsgroupnowknownasthelTD-T.
contentionAnaccessmethodinwhichtwoormoredevicestrytotransmitatthesametime
onthesamechannel.
controlledaccess Amultipleaccessmethodinwhichthestationsconsultoneanotherto
determinewhohastherighttosend.
convergencesublayer(CS) InATMprotocol,theupper AALsublayerthataddsaheader
oratrailertotheuserdata.
cookieAstringofcharactersthatholdssomeinformationabouttheclientandmustbe
returnedtothe serveruntouched.
coreTheglassorplasticcenter ofanopticalfiber.
Core-BasedTree(CBT)Inmulticasting,agroup-sharedprotocolthatusesacenterrouter
astheroot
ofthetree.
countrydomain AsubdomainintheDomainNameSystemthatusestwocharactersasthe
lastsuffix.
crossbarswitch Aswitchconsisting ofalatticeofhorizontalandverticalpaths.Atthe
intersection
ofeachhorizontalandverticalpath,thereisacrosspointthatcanconnecttheinput
totheoutput.
crosspointThejunctionofaninputandanoutputonacrossbarswitch.
crosstalkThenoiseonalinecausedbysignalstravelingalonganotherline.
cryptographyThescienceandart oftransformingmessagestomakethemsecureand
immunetoattacks.
cycliccode Alinearcodeinwhichthecyclicshifting(rotation) ofeachcodewordcreates
anothercodeword.
cyclicredundancycheck(CRC) Ahighlyaccurateerror-detectionmethodbasedon
interpretingapattern
ofbitsasapolynomial.
D
dataelementThesmallestentitythatcanrepresentapiece ofinformation.Abit.
dataencryptionstandard(DES)TheU.S.governmentstandardencryptionmethodfor
nonmilitaryandnonclassifieduse.
datalinkconnectionidentifier(DLCI) Anumberthatidentifiesthevirtualcircuitin
FrameRelay.

GLOSSARY 1079
datalinkcontrol Theresponsibilitiesofthedatalinklayer:flowcontrolanderrorcontrol.
datalinklayer ThesecondlayerintheInternetmodel.Itisresponsiblefornode-to-nodedelivery.
DataOverCableSystemInterfaceSpecifications(DOCSIS) Astandardfordata
transmissionoveranHFCnetwork.
datarate Thenumber ofdataelementssentinonesecond.
datatransferphase Theintermediatephaseincircuit-switched orvirtual-circuitnetworkin
whichdatatransfertakesplace.
datatransparency Theabilitytosendanybitpatternasdatawithoutitbeingmistakenfor
controlbits.
datagramInpacketswitching,anindependentdataunit.
datagramnetwork Apacket-switchednetworkinwhichpacketsareindependentfromeach
other.
datawordThesmallestblock ofdatainblockcoding.
defactostandard Aprotocolthathasnotbeenapprovedby anorganizedbodybutadopted
asastandardthroughwidespreaduse.
dejurestandard Aprotocolthathasbeenlegislatedbyanofficiallyrecognizedbody.
deadlockAsituationinwhichataskcannotproceedbecauseitiswaitingforaneventhatwill
neveroccur.
decibel(dB) Ameasureoftherelativestrength oftwosignalpoints.
decryptionRecoveryoftheoriginalmessagefromtheencrypteddata.
defaultmask Themaskforanetworkthatisnotsubnetted.
defaultrouting Aroutingmethodinwhicharouterisassignedtoreceiveallpacketswithno
matchintheroutingtable.
DefenseAdvancedResearchProjectsAgency(DARPA) Agovernmentorganization,
which,underthename
ofARPAfundedARPANETandtheInternet.
deltamodulation Ananalog-to-digitalconversiontechniqueinwhichthevalue ofthedigital
signalisbasedonthedifferencebetweenthecurrentandtheprevioussamplevalues.
demodulationTheprocessofseparatingthecarriersignalfromtheinformation-bearingsignal.
demultiplexer(DEMUX) Adevicethatseparatesamultiplexedsignalintoitsoriginal
components.
denialofserviceattack Aformofattackinwhichthesiteisfloodedwithsomanyphony
requeststhatiseventuallyforcedtodenyservice.
densewave-divisionmultiplexing(DWDM) AWDMmethodthatcanmultiplexavery
largenumber
ofchannelsbyspacingchannelsclosertogether.
differentialManchesterencoding Adigital-to-digitalpolarencodingmethodthatfeaturesa
transitionatthemiddle
ofthebitinterval aswellasaninversionatthebeginning ofeach1bit.
DifferentiatedServices(DSorDiffserv) Aclass-basedQoSmodeldesignedfor IF.
Diffie-Hellmanprotocol Akeymanagementprotocolthatprovidesaone-timesessionkey
fortwoparties.
digestAcondensedversion ofadocument.
digitalAMPS(D-AMPS) Asecond-generationcellularphonesystemthatisadigitalversion
ofAMPS.

1080 GLOSSARY
digitaldataDatarepresentedbydiscretevaluesorconditions.
digitaldataservice(DDS)Adigitalversion ofananalogleasedlinewitharate of64Kbps.
digitalsignalAdiscretesignalwithalimitednumberofvalues.
digitalsignal(DS)serviceAtelephonecompanyservicefeaturingahierarchyofdigital
signals.
digitalsignatureAmethodtoauthenticatethesenderofamessage.
digitalsubscriberline(DSL)Atechnologyusingexistingtelecommunicationnetworksto
accomplishhigh-speeddelivery
ofdata,voice,video,andmultimedia.
digitalsubscriberlineaccessmultiplexer(DSLAM) Atelephonecompanysitedevice
thatfunctionslike
anADSLmodem.
digital-to-analogconversionTherepresentationofdigitalinformationby ananalogsignal.
digital-to-digitalconversionTherepresentationofdigitalinformationbyadigitalsignal.
digitizationConversionofanaloginformation todigitalinformation.
Dijkstra'salgorithmInlinkstaterouting,analgorithmthat findstheshortestpathtoother
routers.
directcurrent(DC)Azero-frequencysignalwithaconstantamplitude.
directdeliveryAdeliveryinwhichthefinaldestination ofthepacketisahostconnectedto
·c.
thesamephysicalnetwork asthesender.
directsequencespreadspectrum(DSSS)Awirelesstransmissionmethodinwhicheach
bit
tobesentbythesenderisreplacedbyasequence ofbitscalledachipcode.
discardeligibility(DE)Abitthatidentifiesapacketthatcanbediscarded ifthereis
congestioninthenetwork.
discretecosinetransform(DCT)AJPEGphaseinwhichatransformationchangesthe
64values
sothattherelativerelationshipsbetweenpixels arekeptbuttheredundanciesarerevealed.
discretemultitonetechnique(DMT)AmodulationmethodcombiningelementsofQAM
andFDM.
DistanceVectorMulticastRoutingProtocol(DVMRP) Aprotocolbasedondistance
vectorroutingthathandlesmulticastroutinginconjunctionwith
IGMP.
distancevectorroutingAroutingmethodinwhicheachroutersendsitsneighborsalist of
networksitcanreachandthedistancetothatnetwork.
distortionAnychangeinasignalduetonoise,attenuation,orotherinfluences.
distributedcoordinationfunction(DCF)ThebasicaccessmethodinwirelessLANs;
stationscontendwitheachothertogetaccess
tothechannel.
distributeddatabaseInformationstoredinmanylocations.
distributedinterframespace(DIFS)InwirelessLAN s,aperiodoftimethatastation
waitsbeforesendingacontrolframe.
distributedprocessingAstrategyinwhichservicesprovidedforthenetworkresideat
multiplesites.
DNSserverAcomputerthatholdsinformationaboutthenamespace.
domainnameIntheDNS,asequenceoflabelsseparatedbydots.
domainnamespaceAstructurefororganizingthenamespaceinwhichthenamesare
definedin
aninverted-treestructurewiththerootatthetop.

GLOSSARY 1081
DomainNameSystem(DNS) ATCP/IPapplicationservicethatconvertsuser-friendly
namesto
IPaddresses.
dotted-decimalnotation Anotationdevisedtomakethe IPaddresseasiertoread;each
byteisconvertedtoitsdecimalequivalentand thensetofffromitsneighborbyadecimal.
downlinkTransmissionfromasatellitetoanearthstation.
downloadingRetrievingafile Ordatafromaremotesite.
dynamicdocumentA Webdocumentcreatedbyrunninga COlprogramattheserver
site.
DynamicDomainNameSystem(DDNS) AmethodtoupdatetheDNSmasterfile
dynamically.
DynamicHostConfigurationProtocol(DHCP) AnextensiontoBOOTPthatdynamically
assignsconfigurationinformation.
dynamicmappingAtechniqueinwhichaprotocolisusedforaddressresolution.
dynamicroutingRoutinginwhichtheroutingtableentriesareupdatedautomaticallybythe
routingprotocol.
E
ElinesTheEuropeanequivalent ofTlines.
electromagneticspectrumThefrequencyrangeoccupiedbyelectromagneticenergy.
electroniccodeblock(ECB)mode ADESandtripleDESoperationmethodinwhicha
longmessageisdividedinto64-bitblocksbeforebeingencryptedseparately.
ElectronicsIndustriesAssociation(EIA) Anorganizationthatpromoteselectronics
manufacturingconcerns.Ithasdevelopedinterfacestandardssuch
asEIA-232, EIA-449,and
EIA-530.
EncapsulatingSecurityPayload(ESP) AprotocoldefinedbyIPSecthatprovidesprivacy
aswellasacombination
ofintegrityandmessageauthentication.
encapsulationThetechniqueinwhichadataunitfromoneprotocolisplacedwithinthedata
fieldportion
ofthedataunit ofanotherprotocol.
encryptionConvertingamessageintoanunintelligibleformthatisunreadableunless
decrypted.
endofficeAswitchingofficethatistheterminusforthelocalloops.
endsystemAsenderOrreceiverofdata.
ephemeralportnumberAportnumberusedbytheclient.
errorcontrolThehandlingoferrorsindatatransmission.
EthernetAlocalareanetworkusingthe CSMAlCDaccessmethod.
excessburstsize(Be) InFrameRelay,themaximumnumber ofbitsinexcessofBethatthe
usercansendduringapredefinedperiod
oftime.
ExtendedServiceSet(ESS)AwirelessLANservicecomposed oftwoormoreBSSswith
APsasdefinedbytheIEEE802.11standard.
exteriorroutingRoutingbetweenautonomoussystems.
extranetAprivatenetworkthatusestheTCP/IPprotocolsuitethatallowsauthorizedaccess
fromoutsideusers.

1082 GLOSSARY
F
FastEthernetEthernetwithadatarate of100Mbps.
fastretransmission RetransmissionofasegmentintheTCPprotocolwhenthreeacknowledg­
mentshavebeenreceivedthatimplythelossorcorruptionofthatsegment.
FederalCommunicationsCommission(FCC) Agovernmentagencythatregulates
radio,television,andtelecommunications.
fiber-opticcable Ahigh-bandwidthtransmissionmediumthatcarriesdatasignalsinthe
form
ofpulsesoflight.Itconsists ofathincylinder ofglassorplastic,calledthecore,surrounded
byaconcentriclayer
ofglassorplasticcalledthecladding.
FileTransferProtocol(FTP) InTCPIIP,anapplicationlayerprotocolthattransfersfiles
betweentwosites.
filteringAprocessinwhichabridgemakesforwardingdecisions.
finitestatemachine Amachinethatgoesthroughalimitednumber ofstates.
firewallAdevice(usuallyarouter)installedbetweentheinternalnetwork ofanorganization
andtherest
oftheInternettoprovidesecurity.
first-in,first-out(FIFO)queue Aqueueinwhichthefirstitemin isthefirstitemout.
flagAbitpatternoracharacteraddedtothebeginningandtheendofaframetoseparatethe
frames.
flatnamespaceAnamespaceinwhichthereisnohierarchicalstructure.
floodingSaturationofanetworkwithamessage.
flowcontrol Atechniquetocontroltherate offlowofframes(packetsormessages).
footprintAnareaonEarththatiscoveredbyasatelliteataspecifictime.
forwarderrorcorrectionCorrectionoferrors atthereceiver.
forwardexplicitcongestionnotification(FECN) AbitintheFrameRelaypacketthat
notifiesthedestination
ofcongestion.
forwardingPlacingthepacketinitsroutetoitsdestination.
FourieranalysisThemathematicaltechniqueusedtoobtainthefrequencyspectrum ofan
aperiodicsignal
ifthetime-domainrepresentationisgiven.
fragmentationThedivisionofapacketintosmallerunitstoaccommodateaprotocol'sMTU.
frameAgroupofbitsrepresentingablockofdata.
frameburstingAtechniquein CSMAlCDGigabitEthernetinwhichmultipleframesare
logicallyconnectedtoeachothertoresemblealongerframe.
FrameRelayApacket-switchingspecificationdefinedforthefirsttwolayers oftheInternet
model.Thereisnonetworklayer.Errorcheckingisdoneonend-to-endbasisinstead
ofon
each
link.
FrameRelayassembler/disassembler(FRAD) AdeviceusedinFrameRelay tohandle
framescomingfromotherprotocols.
frequencyThenumber ofcyclespersecond ofaperiodicsignal.
frequencydivisionmultipleaccess(FDMA) Amultipleaccessmethodinwhichthe
bandwidthisdividedintochannels.
frequencyhopping spreadspectrum(FHSS)Awirelesstransmissionmethodinwhich
thesendertransmitsatonecarrierfrequencyforashortperiod
oftime,thenhopstoanother

GLOSSARY 1083
carrierfrequencyforthesameamount oftime,hopsagainforthesameamount oftime,andso
on.AfterNhops, thecycleisrepeated.
frequencymodulation(FM) Ananalog-to-analogmodulationmethod inwhichthecarrier
signal'sfrequencyvarieswiththeamplitude
ofthemodulatingsignal.
frequencyshiftkeying(FSK) Adigital-to-analogencodingmethod inwhichthefrequency
ofthecarriersignalisvariedtorepresentbinary0or 1.
frequency-divisionmultipleaccess(FDMA) Anaccessmethodtechniqueinwhich
multiplesourcesuseassignedbandwidthinadatacommunicationband.
frequency-divisionmultiplexing(FDM) Thecombiningofanalogsignalsintoasingle
signal.
frequency-domainplot Agraphicalrepresentation ofasignal'sfrequencycomponents.
full-duplexmode Atransmissionmodeinwhichbothparties cancommunicate
simultaneously.
full-duplexswitchedEthernet Ethernetinwhicheachstation, initsownseparatecollision
domain,canbothsendandreceive.
fullyqualifieddomainname (FQDN) Adomainnameconsisting oflabelsbeginning
withthehostandgoingbackthrougheachleveltotherootnode.
fundamentalfrequency Thefrequencyofthedominantsinewave ofacompositesignal.
G
gatekeeperIntheH.323standard,aserver ontheLANthatplaystherole oftheregistrar
server.
gatewayAdeviceusedtoconnecttwoseparatenetworksthatusedifferentcommunication
protocols.
genericdomain Asubdomaininthedomainnamesystemthatusesgenericsuffixes.
geographicalrouting Aroutingtechniqueinwhichtheentireaddressspaceisdividedinto
blocksbasedonphysicallandmasses.
GigabitEthernet Ethernetwitha1000Mbpsdatarate.
GlobalPositioningSystem(GPS) AnMEOpublicsatellitesystemconsisting of24satellites
andusedforlandandseanavigation.GPSisnotusedforcommunications.
GlobalSystemforMobileCommunication(GSM) Asecond-generationcellular
phonesystemusedinEurope.
GlobalstarAnLEOsatellitesystemwith48satellitesinsixpolarorbitswitheachorbithosting
eightsatellites.
Go-Back-NARQ Anerror-controlmethodinwhichtheframe inerrorandallfollowing
framesmust
beretransmitted.
graftingResumptionofmulticastmessages.
groundpropagation Propagationofradiowaves
tlU"oughthelowestportion oftheatmosphere
(huggingtheearth).
group-sharedtree Amulticastroutingfeatureinwhicheachgroupinthesystemsharesthe
sametree.
guardband Abandwidthseparatingtwosignals.
guidedmedia Transmissionmediawithaphysicalboundary.

1084GLOSSARY
H
H.323A standarddesignedbyITUtoallowtelephonesonthepublictelephonenetworktotalk
tocomputers(calledterminalsinH.323)connectedtotheInternet.
half-duplexmode Atransmissionmodeinwhichcommunicationcanbetwo-waybutnotat
thesametime.
HammingcodeAmethodthataddsredundantbitstoadataunittodetectandcorrectbit
errors.
HammingdistanceThenumber ofdifferencesbetweenthecorrespondingbitsintwo
datawords.
handoffChangingtoanewchannelasamobiledevicemovesfromonecelltoanother.
harmonicsComponentsofadigitalsignal,eachhavingadifferentamplitude,frequency,and
phase.
hashfunctionAnalgorithmthatcreatesafixed-sizedigestfromavariable-lengthmessage.
hashed-messageauthenticationcode(HMAC) AMACbasedonakeylesshashfunction
suchas
SHA-l.
headerControlinformationaddedtothebeginning ofadatapacket.
hertz(Hz)Unitofmeasurementforfrequency.
hexadecimalcolonnotation InIPv6,anaddressnotationconsisting of32hexadecimal
digits,witheveryfourdigitsseparated
byacolon.
hierarchicalrouting Aroutingtechniqueinwhichtheentireaddressspaceisdividedinto
levelsbasedonspecificcriteria.
highbitratedigitalsubscriberline(HDSL) Aservicesimilartothe Tl-linethatcan
operateatlengthsupto3.6km.
HighRateDirectSequence SpreadSpectrum(HR-DSSS)Asignalgeneration
methodsimilartoDSSSexceptfortheencodingmethod(CCK).
High-levelDataLinkControl(HDLC)Abit-orienteddatalinkprotocoldefined by
theISO.
hopcount Thenumber ofnodesalongaroute.Itisameasurement ofdistanceinrouting
algorithms.
hop-to-hopdelivery Transmissionofframesfromonenodetothenext.
hornantennaAscoop-shapedantennausedinterrestrialmicrowavecommunication.
hostAstationornodeonanetwork.
hostidThepartofanIPaddressthatidentifiesahost.
host-specificrouting AroutingmethodinwhichthefullIPaddress ofahostisgiveninthe
routingtable.
hubAcentraldeviceinastartopologythatprovidesacommonconnectionamongthenodes.
HuffmanencodingAstatisticalcompressionmethodusingvariable-lengthcodestoencode
aset
ofsymbols.
hybridnetworkAnetworkwithaprivateinternetandaccesstotheglobalInternet.
hybrid-fiber-coaxial(HFC)network Thesecondgeneration ofcablenetworks;uses
fiberopticandcoaxialcable.
hypertextInformationcontainingtextthatislinkedtootherdocumentsthroughpointers.

GLOSSARY 1085
HyperTextMarkupLanguage(HTML)Thecomputerlanguageforspecifyingthe
contentsandformat
ofawebdocument. Itallowsadditionaltext toincludecodesthatdefine
fonts,layouts,embeddedgraphics,andhypertextlinks.
HyperTextTransferProtocol(HTTP)Anapplicationserviceforretrievingaweb
document.
I
inbandsignalingUsingthesamechannelfordataandcontroltransfer.
incumbentlocalexchangecarrier(ILEC)Atelephonecompanythatprovidedservices
before
1996andistheownerofthecablingsystem.
indirectdeliveryAdeliveryinwhichthesourceanddestination ofapacketareindifferent
networks.
infraredwaveAwavewithafrequencybetween300GHzand400THz;usuallyusedfor
short-rangecommunications.
innerproductAnumberproducedbymultiplyingtwosequences,elementbyelement,and
summingtheproducts.
InstituteofElectricalandElectronicsEngineers(IEEE)Agroupconsistingof
professionalengineerswhichhasspecializedsocietieswhosecommitteespreparestandardsin
members'areas
ofspecialty.
IntegratedServices(IntServ)Aflow-basedQoSmodeldesignedfor IP.
interactiveaudio/videoReal-timecommunicationwithsoundand images.
interautonomoussystemroutingprotocolAprotocoltohandletransmissionsbetween
autonomoussystems.
interdomainroutingRoutingamongautonomoussystems.
interexchangecarrier(IXC)Along-distancecompanythat,prior totheActof1996,
providedcommunicationservicesbetweentwocustomersindifferent LATAs.
interfaceTheboundarybetweentwopiecesofequipment.Italsoreferstomechanical,electrical,
andfunctionalcharacteristics
oftheconnection.
interferenceAnyundesiredenergythatinterfereswiththedesiredsignals.
interframespace(IFS)InwirelessLANs,atimeintervalbetweentwoframes tocontrol
accesstothechannel.
InterimStandard95(IS-95)Oneofthedominantsecond-generationcellulartelephony
standardsinNorthAmerica.
interiorroutingRoutinginsideanautonomoussystem.
interleavingInmultiplexing,takingaspecificamountofdata fromeachdeviceinaregular
order.
InternationalOrganizationofStandardization(ISO)Aworldwideorganizationthat
definesanddevelopsstandardsonavariety
oftopics.
InternationalTelecommunicationsUnion-TelecommunicationStandardization
Sector(ITU-T)Astandardsorganizationformerlyknownasthe CCITT.
internetAcollectionofnetworksconnectedbyinternetworkingdevicessuchasroutersor
gateways.
InternetAglobalinternetthatusesthe TCPIIPprotocolsuite.

1086 GLOSSARY
Internetaddress A32-bitorl28-bitnetwork-layeraddressusedtouniquelydefineahoston
aninternetusingtheTCP/IPprotocol.
InternetArchitectureBoard(lAB) ThetechnicaladvisertotheISOC;overseesthe
continuingdevelopment
oftheTCP/IPprotocolsuite.
InternetAssignedNumbersAuthority(lANA) AgroupsupportedbytheU.S.govern­
mentthatwasresponsibleforthemanagement
ofInternetdomainnamesandaddressesuntil
October1998.
InternetControlMessageProtocol(ICMP) AprotocolintheTCP/IPprotocolsuite
thathandleserrorandcontrolmessages.
InternetControlMessageProtocol,version6(ICMPv6) AprotocolinIPv6that
handleserrorandcontrolmessages.
InternetCorporationforAssignedNamesandNumbers(ICANN) Aprivate,
nonprofitcorporationmanagedbyaninternationalboardthatassumed
lANAoperations.
Internetdraft AworkingInternetdocument(aworkinprogress)withnoofficialstatusanda
six-monthlifetime.
InternetEngineeringSteeringGroup(IESG) Anorganizationthatoverseestheactivities
ofIETF.
InternetEngineeringTaskForce(IETF) Agroupworkingonthedesignanddevelopment
oftheTCP/IPprotocolsuiteandtheIntemet.
InternetGroupManagementProtocol(IGMP) AprotocolintheTCP/IPprotocol
suitethathandlesmulticasting.
InternetKeyExchange(IKE) Aprotocoldesignedtocreatesecurityassociationsin
SADBs.
InternetMailAccessProtocol,version4(IMAP4) Acomplexandpowerfulprotocol
tohandlethetransmission
ofelectronicmail.
InternetMobileCommunication(ITM-2000) AnITUissuedblueprintthatdefines
criteriaforthirdgenerationcellulartelephony.
Internetmodel A5-layerprotocolstackthatdominatesdatacommunicationsandnetworking
today.
InternetNetworkInformationCenter(INTERNIC) Anagencyresponsiblefor
collectinganddistributinginformationaboutTCP/IPprotocols.
InternetProtocol(lP) Thenetwork-layerprotocolintheTCP/IPprotocolsuitegoverning
connectionlesstransmissionacrosspacketswitchingnetworks.
InternetProtocolnextgeneration(IPng) SeeInternetProtocolversion 6(IPv6).
InternetProtocolversion4(IPv4) Thecurrentversion ofInternetProtocoL
InternetProtocol,version6(IPv6) Thesixthversion oftheInternetProtocol.
InternetResearchTaskForce(IRTF) Aforumofworkinggroupsfocusingonlong-term
researchtopicsrelatedtotheInternet.
InternetSecurityAssociationandKeyManagementProtocol(ISAKMP) Aprotocol
designedbytheNationalSecurityAgency(NSA)thatactuallyimplementstheexchangesdefined
inIKE.
Internetserviceprovider(ISP) Usually,acompanythatprovidesInternetservices.
InternetSociety(ISOC) ThenonprofitorganizationestablishedtopublicizetheInternet.

GLOSSARY 1087
InternetstandardAthoroughlytestedspecificationthatisusefultoandadheredtobythose
whoworkwiththeInternet.Itisaformalizedregulationthatmust
befollowed.
internetwork(internet)Anetworkofnetworks.
InternetworkProtocolControlProtocol (lPCP)InPPP,theset ofprotocolsthat
establishandterminateanetworklayerconnectionfor
IPpackets.
internetworkingConnectingseveralnetworkstogetherusinginternetworkingdevicessuch
asroutersandgateways.
intranetAprivatenetworkthatusesthe TCP/IPprotocolsuite.
inversedomain AsubdomainintheDNSthatfindsthedomainnamegiventheIPaddress.
inversemultiplexing Takingdatafromonesourceandbreakingitintoportionsthatcanbe
sent
aCroSSlower-speedlines.
IPdatagramTheInternetworkingProtocoldataunit.
IPSecurity(IPSec) Acollectionofprotocolsdesigned bytheIETF(InternetEngineering
TaskForce)toprovidesecurityforapacketcarriedontheInternet.
IrDAportAportthatallowsawirelesskeyboardtocommunicatewithaPC.
IridiumA66-satellitenetworkthatprovidescommunicationfromanyEarthsitetoanother.
ISDNuserport(ISUP)Aprotocolattheupperlayer ofSS7thatprovidesservicessimilar
tothose
ofanISDNnetwork.
isochronoustransmission Atypeoftransmissionin whichtheentirestream ofbitsis
synchronizedunderthecontrol
ofacommonclock.
iterativeresolution ResolutionoftheIPaddressin whichtheclientmaysenditsrequestto
multipleserverSbeforegettingananswer.
J
jammingsignalInCSMAlCD,asignalsentbythefirststationthatdetectscollisiontoalert
everyotherstation
ofthesituation.
JavaAprogramminglanguageusedtocreateactiveWebdocuments.
jitterAphenomenoninreal-timetrafficcausedbygapsbetweenconsecutivepacketsatthereceiver.
JointPhotographicExperts Group(JPEG)Astandardforcompressingcontinuous-tone
picture.
K
KerberosAnauthenticationprotocolusedbyWindows 2000.
keydistributioncenter(KDC) Insecretkeyencryption,atlustedthirdpartythatsharesa
keywitheachuser.
L
LANemulation(LANE) LocalareanetworkemulationusingATMswitches.
LANemulationclient(LEC) InATMLANs,clientsoftwarethatreceivesservicesfrom aLES.
LANemulationserver(LES) InATMLANs,serversoftwarethatcreatesavirtualcircuit
betweenthesourceanddestination.
leakybucketalgorithmAnalgorithmtoshapeburstytraffic.

1088 GLOSSARY
least-costtree AnMOSPFfeatureinwhichthetreeisbasedonachosenmetricinstead of
shortestpath.
legacyA TMLANLANinwhichATMtechnologyisused asabackbonetoconnect
traditionalLANs.
linecoding Convertingbinarydataintosignals.
linearblockcode Ablockcodeinwhichaddingtwocodewordscreatesanother
codeword.
line-of-sightpropagation Thetransmissionofveryhighfrequencysignalsinstraightlines
directlyfromantennatoantenna.
linkThephysicalcommunicationpathwaythattransfersdatafromonedevicetoanother.
LinkControlProtocol(LCP) APPPprotocolresponsibleforestablishing,maintaining,
configuring,andterminatinglinks.
linklocaladdressAnIPv6addressusedbyaprivate LAN.
linkstate advertisement(LSA) InOSPF,amethod todisperseinformation.
linkstatedatabaseInlinkstaterouting,adatabasecommontoallroutersandmadefrom
LSPinformation.
linkstatepacket(LSP) Inlinkstaterouting,asmallpacketcontainingroutinginformation
sentbyaroutertoallotherrouters.
linkstaterouting Aroutingmethodinwhicheachroutersharesitsknowledge ofchangesin
itsneighborhoodwithallotherrouters.
localaccess andtransportarea(LATA)Anareacoveredbyone ormoretelephone
companies.
localareanetwork(LAN)Anetworkconnectingdevicesinsideasinglebuildingorinside
buildingsclosetoeachother.
localareanetworkemulation(LANE) SoftwarethatenablesanATMswitchtobehave
likeaLANswitch.
localexchange carrier(LEC)AtelephonecompanythathandlesservicesinsideaLATA.
localloop Thelinkthatconnectsasubscribertothetelephonecentraloffice.
localmanagementinformation(LMI) AprotocolusedinFrameRelaythatprovides
managementfeatures.
logicaladdress Anaddressdefinedinthenetworklayer.
logicallinkcontrol(LLC) Theuppersublayer ofthedatalinklayerasdefinedbyIEEE
Project
802.2.
LogicalLinkControlandAdaptationProtocol(L2CAP) ABluetoothlayerusedfor
dataexchangeonanACLlink.
logicaltunnel Theencapsulationofamulticastpacketinsideaunicast packettoenable
multicastroutingbynon-multicastrouters.
longestmaskmatchingThetechniqueinCIDRinwhichthelongestprefixishandledfirst
when searchingaroutingtable.
lowearthorbit(LEO)A polarsatelliteorbitwithanaltitudebetween 500and2000km.
Asatellitewiththisorbithasarotationperiod of90to120minutes.
low-passchannel Achannelthatpassesfrequenciesbetween aand!

GLOSSARY 1089
M
mailtransferagent(MT A)AnSMTPcomponentthattransfersthemailacrossthe
Internet.
ManagementInformationBase(MIB) Thedatabaseused bySNMPthatholdsthe
informationnecessaryformanagementofanetwork.
Manchesterencoding Adigital-to-digitalpolarencodingmethodinwhichatransition
occursatthemiddle
ofeachbitintervaltoprovidesynchronization.
man-in-the-middleattackAkeymanagementprobleminwhichanintruderinterceptsand
sendsmessagesbetweentheintendedsenderandreceiver.
mappedaddressAnIPv6addressusedwhenacomputerthathasmigratedtoIPv6wantsto
sendapackettoacomputerstillusingIPv4.
maskForIPv4,a32-bitbinarynumberthatgivesthefirstaddressintheblock(thenetwork
address)whenANDedwithanaddressintheblock.
maximumtransferunit(MTU)Thelargestsizedataunitaspecificnetworkcanhandle.
mediumaccesscontrol(MAC)sublayer Thelowersublayerinthedatalinklayer
definedbytheIEEE802project.Itdefinestheaccessmethodandaccesscontrolindifferentlocal
areanetworkprotocols.
mediumEarthorbit(MEO)Asatelliteorbitpositionedbetweenthetwo VanAllenbelts.
Asatelliteatthisorbittakessixhourstocircletheearth.
meshtopology Anetworkconfigurationinwhicheachdevicehasadedicatedpoint-to-point
linktoeveryotherdevice.
messageaccessagent(MAA) Aclient-serverprogramthatpullsthestoredemail
messages.
messageauthentication Asecuritymeasureinwhichthesender ofthemessageisverified
foreverymessagesent.
messageauthenticationcode(MAC) Akeyedhashfunction.
messagetransferagent(MTA) AnSMTPcomponentthattransfersthemessageacross
theInternet.
metricAcostassignedforpassingthroughanetwork.
metropolitanareanetwork(MAN) Anetworkthatcanspanageographicalareathesize
ofacity.
microwaveElectromagneticwavesrangingfrom2GHzto40GHz.
minimumHammingdistance Inasetofwords,thesmallestHammingdistancebetween
allpossiblepairs.
mobilehost Ahostthatcanmovefromonenetworktoanother.
mobileswitchingcenter(MSC) Incellulartelephony,aswitchingofficethatcoordinates
communicationbetweenallbasestationsandthetelephonecentraloffice.
mobiletelephoneswitchingoffice(MTSO) Anofficethatcontrolsandcoordinates
communicationbetweenallofthecellofficesandthetelephonecontroloffice.
modemAdeviceconsistingofamodulatorandademodulator.Itconvertsadigitalsignalinto
ananalogsignal(modulation)andviceversa(demodulation).
modificationdetectioncode(MDC) Thedigestcreatedbyahashfunction.

1090 GLOSSARY
modulararithmetic Arithmeticthatusesalimitedrange ofintegers(0to n-1).
modulationModificationofoneormorecharacteristics ofacarrierwavebyaninformation­
bearingsignal.
modulusTheupperlimitinmodulararithmetic (n).
monoalphabetic substitutionAnencryptionmethodinwhicheachoccurrence ofa
characterisreplaced
byanothercharacterintheset.
motionpictureexpertsgroup(MPEG) Amethodtocompressvideos.
multicastaddress Anaddressusedformulticasting.
multicastbackbone(MBONE) Asetofinternetrouterssupportingmulticastingthrough
theuse
oftunneling.
MulticastOpenShortestPathFirst(MOSPF) Amulticastprotocolthatusesmulticast
linkstateroutingtocreateasource-basedleastcosttree.
multicastrouter Arouterwithalist ofloyalmembersrelatedtoeachrouterinterfacethat
distributesthemulticastpackets.
multicastrouting Movingamulticastpackettoitsdestinations.
multicastingAtransmissionmethodthatallowscopies ofasinglepackettobesenttoa
selectedgroup
ofreceivers.
multihomingservice AserviceprovidedbySCTPthatallowsacomputertobeconnectedto
differentnetworks.
multilinetransmission,3-level(MLT-3)encoding Alinecodingschemefeaturing
3levels
ofsignalsandtransitionsatthebeginning ofthe1bit.
multimodegraded-indexfiber Anopticalfiberwithacorehavingagradedindex of
refraction.
multimodestep-indexfiber Anopticalfiberwithacorehavingauniformindex ofrefraction.
Theindex
ofrefractionchangessuddenlyatthecorelcladdingboundary.
multipleaccess(MA) Alineaccessmethodinwhicheverystationcanaccessthelinefreely.
multipleunicasting Sendingmultiplecopies ofamessage,eachwithadifferentunicast
address.
multiplexer(MUX) Adeviceusedformultiplexing.
multiplexingTheprocessofcombiningsignalsfrommultiplesourcesfortransmissionacross
asingledatalink.
multiplicativedecrease Acongestionavoidancetechniqueinwhichthethresholdissetto
half
ofthelastcongestionwindowsize,andthecongestionwindowsizestartsfromoneagain.
MultipurposeInternetMailExtension(MIME) AsupplementtoSMTPthatallows
non-ASCIIdatatobesentthroughSMTP.
multistageswitch An
mTayofswitchesdesignedtoreducethenumber ofcrosspoints.
multistreamservice Aserviceprovided bySCTPthatallowsdatatransfertobecarried
usingdifferentstreams.
N
namespace Allthenamesassignedtomachinesonaninternet.
name-addressresolution Mappinganameto anaddressoranaddresstoaname.

GLOSSARY 1091
Needham-Schroederprotocol Akeymanagementprotocolusingmultiplechallenge­
responseinteractionsbetween2entities.
netidThepartofanIPaddressthatidentifiesthenetwork.
networkAsystemconsistingofconnectednodesthatsharedata,hardware,andsoftware.
networkaccesspoint(NAP) Acomplexswitchingstationthatconnectsbackbonenetworks.
networkaddress AnaddressthatidentifiesanetworktotherestoftheInternet;itisthefirst
addressinablock.
networkaddresstranslation(NAT) Atechnologythatallowsaprivatenetworktousea
setofprivateaddressesforinternalcommunicationandaset
ofglobalInternetaddressesfor
externalcommunication.
networkallocationvector (NAV)InCSMAlCA,theamountoftimethatmustpassbefore
astationcancheckforanidleline.
NetworkControlProtocol(NCP) InPPP,asetofcontrolprotocolsthatallowsthe
encapsulation
ofdatacomingfromnetworklayerprotocols.
networkinterface card(NIC)Anelectronicdevice,internalorexternaltoastation,that
containscircuitrytoenablethestationtobeconnectedtothenetwork.
networklayer ThethirdlayerintheInternetmodel,responsibleforthedelivery ofapacket
tothefinaldestination.
NetworkVirtualTerminal(NVT) ATCPJIPapplicationprotocolthatallowsremotelogin.
network-specificrouting Routinginwhichallhostsonanetworkshareoneentryinthe
routingtable.
network-to-networkinterface(NNI) InATM,theinterfacebetweentwonetworks.
next-hoprouting Aroutingmethodinwhichonlytheaddress ofthenexthop islistedinthe
routingtableinstead
ofacompletelistofthestopsthepacketmustmake.
nodeAnaddressablecommunicationdevice(e.g.,acomputerorrouter)onanetwork.
node-to-nodedelivery Transferofadataunitfromonenodetothenext.
noiseRandomelectricalsignalsthatcanbepickedbythetransmissionmediumandcause
degradationordistortion
ofthedata.
noiselesschannel Anerror-freechannel.
noisychannel Achannelthatcanproduceerrorindatatransmission.
nonceAlargerandomnumberthatisusedoncetodistinguishafreshauthenticationrequest
fromausedone.
nonpersistentstrategy Arandommultipleaccessmethodinwhichastationwaitsarandom
period
oftimeafteracollisionissensed.
nonrepudiationAsecurityaspectinwhichareceivermustbeabletoprovethatareceived
messagecamefromaspecificsender.
nonreturntozero(NRZ) Adigital-to-digitalpolarencodingmethodinwhichthesignal
levelisalwayseitherpositiveornegative.
nonreturntozero,invert(NRZ-I)AnNRZencodingmethodinwhichthesignallevel is
invertedeachtimea 1 isencountered.
nonreturntozero,level(NRZ-L) AnNRZencodingmethodinwhichthesignallevelis
directlyrelatedtothebitvalue.

1092 GLOSSARY
normalresponsemode(NRM) InHDLC,acommunicationmodeinwhichthesecondary
stationmusthavepermissionfromtheprimarystationbeforetransmissioncanproceed.
NyquistbitrateThedataratebasedontheNyquisttheorem.
Nyquisttheorem Atheoremthatstatesthatthenumber ofsamplesneededtoadequately
representananalogsignalisequaltotwicethehighestfrequency
oftheoriginalsignal.
o
OakleyAkeycreationprotocol,developed byHilarieOrman,whichisone ofthethree
components
ofIKEprotocol.
omnidirectionalantennaAnantennathatsendsoutorreceivessignalsinalldirections.
one'scomplement Arepresentationofbinarynumbersinwhichthecomplement ofa
numberisfoundbycomplementingallbits.
openshortestpathfirst(OSPF) Aninteriorroutingprotocolbasedonlinkstate
routing.
OpenSystemsInterconnection(OSI)model Aseven-layermodelfordatacommunication
definedbyISO.
open-loop congestioncontrol Policiesappliedtopreventcongestion.
opticalcarrier(OC)Thehierarchyoffiber-opticcarriersdefinedinSONET.
opticalfiber Athinthread ofglassorothertransparentmaterialtocarrylightbeams.
orbitThepathasatellitetravelsaroundtheearth.
OrthogonalFrequencyDivisionMultiplexing(OFDM) Amultiplexingmethod
similartoFDM,withallthesubbandsusedbyonesOurceatagiventime.
orthogonalsequence Asequencewithspecialpropertiesbetweenelements.
Otway-Reesprotocol AkeymanagementprotocolwithlessstepsthantheNeedham-Schroeder
method.
out-of-bandsignaling Usingtwoseparatechannelsfordataandcontrol.
outputfeedback(OFB)mode AmodesimilartotheCFBmodewithonedifference.Each
bitintheciphertextisindependent
ofthepreviousbit orbits.
p
packetswitching Datatransmissionusingapacket-switchednetwork.
packet-filterfirewall Afirewallthatforwardsorblockspacketsbasedontheinformationin
thenetwork-layerandtransport-layerheaders.
packet-switchednetwork Anetworkinwhichdataaretransmittedinindependentunits
calledpackets.
parabolicdish antennaAnantennashapedlikeaparabolausedforterrestrialmicrowave
communication.
paralleltransmission Transmissioninwhichbitsinagrouparesentsimultaneously,each
usingaseparatelink.
paritycheckAnerror-detectionmethodusingaparitybit.
partiallyqualifieddomainname(PQDN) Adomainnamethatdoesnotincludeallthe
levelsbetweenthehostandtherootnode.

GLOSSARY 1093
PasswordAuthenticationProtocol(PAP)A simpletwo-stepauthenticationprotocol
usedinPPP.
pathvectorroutingAroutingmethodonwhichBGPisbased;inthismethod,theASs
throughwhichapacketmustpassareexplicitlylisted.
P-boxA hardwarecircuitusedinencryptionthatconnectsinputtooutput.
peer-to-peerprocess Aprocessonasendingandareceivingmachinethatcommunicatesat
agivenlayer.
perhopbehavior(PUB) IntheDiffservmodel,a6-bitfieldthatdefinesthepacket-handling
mechanismforthepacket.
periodTheamount oftimerequiredtocompleteonefullcycle.
periodicsignalA signalthatexhibitsarepeatingpattern.
permanentvirtualcircuit(PVC) Avirtualcircuittransmissionmethodinwhichthesame
virtualcircuit
isusedbetweensourceanddestinationonacontinualbasis.
persistentconnection Aconnectionwhichtheserverleavesopenforadditionalrequests
aftersendingaresponse.
PersonalCommunicationSystem (peS)Agenerictermforacommercialcellular
systemthatoffersseveralkinds
ofcommunicationservices.
phaseTherelativeposition ofasignalintime.
phasemodulation(PM) Ananalog-to-analogmodulationmethodinwhichthecarrier
signal'sphasevarieswiththeamplitude
ofthemodulatingsignal.
phaseshiftkeying(PSK) Adigital-to-analogmodulationmethodinwhichthephase ofthe
carriersignalisvariedtorepresentaspecificbitpattern.
PUYsublayerThetransceiverinFastEthernet.
physicaladdressTheaddressofadeviceatthedatalinklayer(MACaddress).
physicallayer Thefirstlayer oftheInternetmodel,responsibleforthemechanicaland
electricalspecifications
ofthemedium.
piconetABluetoothnetwork.
piggybackingTheinclusionofacknowledgmentonadataframe.
pipeliningInGo-Back-nARQ,sendingseveralframesbeforenewsisreceivedconcerning
previousframes.
pixelA pictureelementofanimage.
plainoldtelephonesystem(POTS) Theconventionaltelephonenetworkusedforvoice
communication.
plaintextInencryption/decryption,theoriginalmessage.
playbackbufferAbufferthatstoresthedatauntiltheyarereadytobeplayed.
pointcoordinationfunction(PCF) InwirelessLANs,anoptionalandcomplexaccess
methodimplementedinaninfrastructurenetwork.
pointofpresence(POP)A switchingofficewherecarrierscaninteractwitheachother.
point-to-pointconnectionA dedicatedtransmissionlinkbetweentwodevices.
Point-to-PointProtocol(PPP)A protocolfordatatransfer aCrOSSaserialline.
poisonreverseA featureaddedtosplithorizoninwhichatableentrythathascomethrough
oneinterfaceissettoinfinityintheupdatepacket.

1094 GLOSSARY
polarencodingAdigital-to-analogencodingmethodthatusestwolevels(positiveand
negative)
ofamplitude.
policyrouting Apathvectorroutingfeature inwhichtheroutingtablesarebasedonrulesset
bythenetworkadministratorratherthanametric.
pollIntheprimary/secondaryaccessmethod,aprocedureinwhichtheprimarystationasksa
secondarystation
ifithasanydatatotransmit.
poll/final(PIF)bitAbitinthecontrolfield ofHDLC;iftheprimaryissending,it canbea
pollbit;
ifthesecondaryissending,it canbeafinalbit.
poll/selectAnaccessmethodprotocolusingpollandselectprocedures.See poll.Seeselect.
pollingAnaccessmethod inwhichonedeviceisdesignatedasaprimarystationandthe
othersasthesecondarystations.Theaccessiscontrolled
bytheprimarystation.
polyalphaheticsubstitution Anencryptionmethodinwhicheachoccurrence ofacharacter
canhaveadifferentsubstitute.
polynomialAnalgebraictennthatcanrepresentaCRCdivisor.
portaddressInTCPJIPprotocolanintegerthatidentifiesaprocess.
portnumberSeeportaddress.
PostOfficeProtocol,version3(POP3) ApopularbutsimpleSMTPmailaccessprotocol.
p-persistentACSMApersistencestrategyin whichastationsendswithprobability pifit
findsthelineidle.
preambleThe7-bytefield ofanIEEE802.3frameconsisting ofalternatingIsandOsthat
alertandsynchronizethereceiver.
predictiveencoding Inaudiocompression,encodingonlythedifferencesbetweenthesamples.
prefixThecommonpartofanaddressrange.
presentationlayerThesixthlayer oftheOSImodel;responsiblefortranslation,encryption,
authentication,anddatacompression.
PrettyGoodPrivacy(PGP) Aprotocolthatprovidesallfouraspects ofsecurityinthe
sending
ofemail.
primarystationInprimary/secondaryaccessmethod,astationthatissuescommandstothe
secondarystations.
priorityqueueingAqueuingtechniqueinwhichpacketsareassignedtoapriorityclass,
eachwithitsownqueue.
privacyAsecurityaspect inwhichthemessagemakessenseonlytotheintendedreceiver.
privatekeyInconventionalencryption,akeysharedbyonlyonepair ofdevices,asender
andareceiver.
Inpublic-keyencryption,theprivatekeyisknownonlytothereceiver.
privatenetwork AnetworkthatisisolatedfromtheInternet.
processArunningapplicationprogram.
process-to-processdelivery Deliveryofapacketfromthesendingprocesstothedestina­
tionprocess.
Project802TheprojectundertakenbytheIEEEinanattempttosolve LANincompatibility.
Seealso
IEEEProject802.
propagationspeed Therateatwhichasignalorbittravels;measuredbydistance/second.
propagationtime Thetimerequiredforasignaltotravelfromonepointtoanother.

GLOSSARY 1095
protocolRulesforcommunication.
ProtocolIndependentMulticast(PIM) Amulticastingprotocolfamilywithtwomembers,
PIM-DMandPIM-SM;bothprotocolsareunicast-protocoldependent.
ProtocolIndependentMulticast,DenseMode(PIM-DM) Asource-basedrouting
protocolthatusesRPFandpruning/graftingstrategiestohandlemulticasting.
ProtocolIndependentMulticast,SparseMode(PIM-SM) Agroup-sharedrouting
protocolthatissimilartoCBTandusesarendezvouspointasthesource
ofthetree.
protocolsuite Astackorfamily ofprotocolsdefinedforacomplexcommunicationsystem.
proxyARPAtechniquethatcreatesasubnettingeffect;oneserveranswersARPrequestsfor
multiplehosts.
proxyfirewall A firewallthatfiltersamessagebasedontheinformationavailableinthe
messageitself(attheapplicationlayer).
proxyserver Acomputerthatkeepscopies ofresponsestorecentrequests.
pruningStoppingthesending ofmulticastmessagesfromaninterface.
pseudoheaderInformationfrom theIPheaderusedonlyforchecksumcalculationinthe
UDPandTCPpacket.
pseudorandomnoise(PN) ApseudorandomcodegeneratorusedinFHSS.
publickey infrastructure(PKI)Ahierarchicalstructure ofCAservers.
public-keycryptography Amethodofencryptionbasedonanonreversibleencryption
algorithm.Themethodusestwotypes
ofkeys:Thepublickeyisknowntothepublic;theprivate
key(secretkey)isknownonlytothereceiver.
pulseamplitudemodulation(PAM) Atechniqueinwhichananalogsignal issampled;
theresult
isaseriesofpulsesbasedonthesampleddata.
pulsecodemodulation(PCM) AtechniquethatmodifiesPAMpulsestocreateadigitalsignal.
pulsestuffing InTDM,atechniquethataddsdummybitstotheinputlineswithlowerrates.
pureALOHA TheoriginalALOHA.
Q
quadratureamplitudemodulation(QAM) Adigital-to-analogmodulationmethodin
whichthephaseandamplitude
ofthecarriersignalvarywiththemodulatingsignal.
qualityofservice(QoS) Asetofattributesrelatedtotheperformance oftheconnection.
quantizationTheassignmentofaspecificrange ofvaluestosignalamplitudes.
quantizationerrorErrorintroducedinthesystemduringquantization(analog-to-digital
conversion).
queueAwaitinglist.
R
radiowave Electromagneticenergyinthe
3-KHzto300-GHzrange.
randomaccessAmediumaccesscategoryinwhicheachstationcanaccessthemedium
withoutbeingcontrolledbyanyotherstation.
rangingInanHFCnetwork,aprocessthatdeterminesthedistancebetweenthe CMand
theCMTS.

1096 GLOSSARY
rateadaptiveasymmetricaldigitalsubscriberline(RADSL) ADSL-basedtechnology
thatfeaturesdifferentdataratesdependingonthetype
ofcommunication.
read-onlymemory(ROM) Permanentmemorywithcontentsthatcannot bechanged.
Real-TimeStreamingProtocol(RTSP) Anout-of-bandcontrolprotocoldesignedtoadd
morefunctionalitytothestreamingaudio/videoprocess.
Real-timeTransportControlProtocol(RTCP) AcompanionprotocoltoRTPwith
messagesthatcontroltheflowandquality
ofdataandallowtherecipienttosendfeedbacktothe
source
orsources.
Real-timeTransportProtocol(RTP) Aprotocolforreal-timetraffic;usedinconjunction
withUDP.
reconciliationsublayer AFastEthernetsublayerwhichpassesdatain4-bitformattotheMIL
recursiveresolution ResolutionoftheIPaddressinwhichtheclientsendsitsrequesttoa
serverthateventuallyreturnsaresponse.
redundancyTheadditionofbitstoamessageforerrorcontrol.
Reed-SolomonAcomplex,butefficient,cycliccode.
reflectionThephenomenonrelatedtothebouncingback oflightattheboundary oftwomedia.
refractionThephenomenonrelatedtothebending oflightwhenitpassesfrom onemedium
toanother.
regionalISPAsmallISPthatisconnectedto oneormoreNSPs.
registrarAnauthoritytoregisternewdomainnames.
relayagent ForBOOTP,arouterthatcanhelpsendlocalrequeststoremoteservers.
reliabilityA QoSflowcharacteristic;dependability ofthetransmission.
remotebridge AdevicethatconnectsLANsandpoint-to-pointnetworks;oftenusedina
backbonenetwork.
rendezvousrouterArouterthatisthecoreorcenterforeachmulticastgroup;itbecomes
theroot
ofthetree.
rendezvous-pointtree Agroup-sharedtreemethodinwhichthere isonetreeforeachgroup.
repeaterAdevicethatextendsthedistanceasignalcantravelbyregeneratingthesignal.
replayattack Theresendingofamessagethathasbeeninterceptedbyanintruder.
RequestforComment(RFC)A formalInternetdocumentconcerninganInternetissue.
resolverTheDNSclientthatisusedbyahostthatneedstomapanaddresstoaname ora
nametoanaddress.
ResourceReservationProtocol(RSVP) AsignalingprotocoltohelpIPcreateaflow
andmakearesourcereservationtoimproveQoS.
retransmissiontime-out Theexpirationofatimerthatcontrolstheretransmission ofpackets.
returntozero(RZ)A digital-to-digitalencodingtechniqueinwhichthevoltage ofthe
signaliszeroforthesecondhalf
ofthebitinterval.
reusefactor Incellulartelephony,thenumber ofcellswithadifferentset offrequencies.
ReverseAddressResolutionProtocol(RARP) ATCPIIPprotocolthatallowsahostto
finditsInternetaddressgivenitsphysicaladdress.
reversepathbroadcasting(RPB) Atechniqueinwhichtherouterforwardsonlythepackets
thathavetraveledtheshortestpathfromthesource
totherouter.

GLOSSARY 1097
reversepathforwarding(RPF) Atechniqueinwhichtherouterforwardsonlythepackets
thathavetraveledtheshortestpathfromthesourcetotherouter.
reversepathmulticasting(RPM) AtechniquethataddspruningandgraftingtoRPBto
createamulticastshortestpathtreethatsupportsdynamicmembershipchanges.
Rijndaelalgorithm AnalgorithmnamedafteritstwoBelgianinventors,VincentRijmen
andJoanDaementhatisthebasis
ofAES.
ringtopology Atopologyinwhichthedevicesareconnectedinaring.Eachdeviceonthering
receivesthedataunitfromthepreviousdevice,regeneratesit,andforwardsittothenextdevice.
Rivest,Shamir,Adleman(RSA)encryption SeeRSAencryption.
RJ45Acoaxialcableconnector.
roamingIncellulartelephony,theability ofausertocommunicateoutside ofhisownservice
provider'sarea.
rootserver InDNS,aserverwhosezoneconsists ofthewholetree.Arootserverusually
doesnotstoreanyinformationaboutdomainsbutdelegatesitsauthoritytootherservers,keeping
referencestothoseservers.
rotarydialingAccessingtheswitchingstationthroughaphonethatsendsadigitalsignalto
theendoffice.
rotationcipher Akeyedorkeylesscipherinwhichtheinputbitsarerotatedtotheleft or
righttocreateoutputbits.
round-triptime(RTT) Thetimerequiredforadatagramtogofromasourcetoadestination
andthenbackagain.
routeApathtraveledbyapacket.
routerAninternetworkingdeviceoperatingatthefirstthreelayers.Arouterisattachedtotwo
ormorenetworksandforwardspacketsfromonenetworktoanother.
routingTheprocessperformedbyarouter;findingthenexthopforadatagram.
RoutingInformationProtocol(RIP) Aroutingprotocolbasedonthedistancevector
routingalgorithm.
routingtable Atablecontaininginformationarouterneedstoroutepackets.Theinformation
mayincludethenetworkaddress,thecost,theaddress
ofthenexthop,andsoon.
RSAcryptosystem Apopularpublic-keyencryptionmethoddevelopedbyRivest,Shamir,
andAdleman.
s
samplingTheprocessofobtainingamplitudes ofasignalatregularintervals.
samplingrateThenumber ofsamplesobtainedpersecondinthesamplingprocess.
satellitenetwork Acombinationofnodesthatprovidescommunicationformonepointon
theearthtoanother.
S-boxAnencryptiondevicemade ofdecoders,P-boxes,andencoders.
scatternetAcombinationofpiconets.
scramblingIndigital-to-digitalconversion,modifyingpart ofthelUlesinlinecodingscheme
tocreatebitsynchronization.
secondarystation Inthepoll/selectaccessmethod,astationthatsendsaresponseinanswer
toacommandfromaprimarystation.

1098 GLOSSARY
secret-keyencryption Asecuritymethodinwhichthekeyforencryptionisthesame asthe
keyfordecryption;bothsenderandreceiverhavethesame
key.
SecureHashAlgorithm1(SHA-l) AhashalgorithmdesignedbytheNationalInstitute
ofStandardsandTechnology(NIST). ItwaspublishedasaFederalInformationProcessing
Standard(PIPS).
SecureSocket Layer(SSL)A protocoldesignedtoprovidesecurityandcompression
servicestodatageneratedfromtheapplicationlayer.
SecurityAssociation(SA) AnIPSecprotocolthatcreatesalogicalconnectionbetweentwo
hosts.
securityassociationdatabase(SADB) Adatabasedefiningaset ofsinglesecurity
associations.
securityparameterindex(SPI) Aparameterthatuniquelydistinguishonesecurity
associationfromtheothers.
segmentThepacketattheTCPlayer.Also,thelength oftransmissionmediumsharedby
devices.
segmentationThesplittingofamessageintomultiplepackets;usuallyperformedatthe
transportlayer.
segmentationandreassembly(SAR) ThelowerAALsublayerintheATMprotocolin
whichaheaderand/ortrailermaybeaddedtoproducea48-byteelement.
selectInthepolVselectaccessmethod,aprocedureinwhichtheprimarystationasksasecondary
station
ifitisreadytoreceivedata.
selective-repeatARQ Anerror-controlmethodinwhichonlytheframeinerrorisresent.
self-synchronizationSynchronizationoflongstringsof1sorOsthroughthecodingmethod.
semanticsThemeaning ofeachsectionofbits.
sequencenumberThenumberthatdenotesthelocation ofaframeorpacketinamessage.
serialtransmission Transmissionofdataonebitatatimeusingonlyonesinglelink.
serverAprogramthatcanprovideservicestootherprograms,calledclients.
servercontrolpoint(SCP) InSS7terminology,thenodethatcontrolsthewholeoperation
ofthenetwork.
SessionInitiationProtocol(SIP) Invoiceover IP,anapplicationprotocolthatestablishes,
manages,andterminatesamultimediasession.
sessionlayer Thefifthlayer oftheOSImodel,responsiblefortheestablishment,manage­
ment,andtermination
oflogicalconnectionsbetweentwoendusers.
setupphase Invirtualcircuitswitching,aphaseinwhichthesourceanddestinationusetheir
globaladdressestohelpswitchesmaketableentriesfortheconnection.
Shannoncapacity Thetheoreticalhighestdatarateforachannel.
shieldedtwisted-pair(STP) Twisted-paircableenclosedinafoilormeshshieldthat
protectsagainstelectromagneticinterference.
shiftcipher Thesimplestmonoalphabeticcipherinwhichtheplaintextandciphertextconsist
ofletters.Intheencryptionalgorithm,thecharactersareshifteddownthecharacterlist; inthe
decryptionalgorithm,thecharactersareshiftedupthecharacterlist.
shiftregister Aregisterinwhicheachmemorylocation,atatimeclick,acceptsthebitatits
inputport,storesthenewbit,anddisplays
itontheoutputport.

GLOSSARY 1099
shortinterframespace(SIFS) InCSMAlCA,aperiodoftimethatthedestinationwaits
afterreceivingtheRTS.
shortestpathtreeAroutingtableformedbyusingtheDijkstraalgorithm.
signaling connectioncontrolpoint(SCCP) InSS7,thecontrolpointsusedforspecial
servicessuchas800calls.
signalelement Theshortest sectionofasignal(time-wise)thatrepresentsadataelement.
signalpoint(SP) InSS7terminology,theusertelephoneorcomputerisconnectedtothe
signalpoints.
signalrateThenumber ofsignalelementssentinonesecond.
signaltransportport(STP)InSS7terminology,thenodeused bythesignalingnetwork.
SignalingSystemSeven(SS7) Theprotocolthatisusedinthesignalingnetwork.
signal-to-noiseratio(SNR) Theratioofaveragesignalpowertoaveragenoisepower.
sillywindowsyndrome Asituationinwhichasmallwindowsize isadvertisedbythe
receiverandasmallsegmentsentbythesender.
simpleandefficientadaptationlayer(SEAL) AnAALlayerdesignedfortheInternet
(AAL5).
simplebridge Anetworkingdevicethatlinkstwosegments;requiresmanualmaintenance
andupdating.
SimpleMail TransferProtocol(SMTP) TheTCP/IPprotocoldefiningelectronicmail
service
ontheInternet.
SimpleNetworkManagementProtocol(SNMP) TheTCPIIPprotocolthatspecifies
theprocess
ofmanagementintheInternet.
SimpleProtocol Thesimpleprotocolweusedtoshowanaccessmethodwithoutflowand
errorcontrol.
simplexmode Atransmissionmodeinwhichcommunicationisoneway.
sinewave Anamplitude-versus-timerepresentation ofarotatingvector.
single-biterrorErrorinadataunitinwhichonlyonesinglebithasbeenaltered.
single-modefiber Anopticalfiberwithanextremelysmalldiameterthatlimitsbeamstoa
fewangles,resulting
inanalmosthorizontalbeam.
sitelocaladdress AnIPv6addressforasitehavingseveralnetworksbutnotconnectedto
theInternet.
SKEME AprotocolforkeyexchangedesignedbyHugoKrawcyzk. Itisoneofthethree
protocolsthatformthebasis
ofIKE.
skypropagation Propagationofradiowavesintotheionosphereandthenbacktoearth.
slashnotation Ashorthandmethodtoindicatethenumber of1sinthemask.
slidingwindow Aprotocolthatallowsseveraldataunitstobeintransitionbeforereceiving
anacknowledgment.
slidingwindowARQ Anerror-controlprotocolusingslidingwindowconcept.
slottedALOHA ThemodifiedALOHAaccessmethodinwhichtimeisdividedintoslots
andeachstationisforcedtostartsendingdataonlyatthebeginning
oftheslot.
slowconvergence ARIPshortcomingapparentwhenachangesomewhereintheinternet
propagatesveryslowlythroughtherestoftheinternet.

1100 GLOSSARY
slowstartAcongestion-controlmethodinwhichthecongestionwindowsizeincreases
exponentiallyatfirst.
socketaddress AstructureholdinganIPaddressandaportnumber.
sourcequench Amethod,usedinICMPforflowcontrol,inwhichthesourceisadvised to
slowdownorstopthesending ofdatagramsbecause ofcongestion.
sourcerouting Explicitlydefiningtheroute ofapacketbythesender ofthepacket.
sourceroutingbridgeA sourceordestination stationthatperformssome ofthedutiesofa
transparentbridgeasamethodtopreventloops.
source-basedtreeA treeusedformulticastingbymulticastingprotocolsinwhichasingle
treeismadeforeachcombination
ofsourceandgroup.
source-to-destinationdelivery Thetransmissionofamessagefromtheoriginalsenderto
theintendedrecipient.
spacepropagationA typeofpropagationthatcanpenetratetheionosphere.
space-divisionswitching Switchinginwhichthepathsareseparatedfromeachotherspatially.
spanningtreeA treewiththesource astherootandgroupmembers asleaves;atreethat
connectsall
ofthenodes.
spatialcompression Compressinganimagebyremovingredundancies.
spectrumTherangeoffrequenciesofasignal.
splithorizonA methodtoimproveRIPstabilityinwhichtherouterselectivelychoosesthe
interfacefromwhichupdatinginformationissent.
spreadspectrumA wirelesstransmissiontechniquethatrequiresabandwidthseveraltimes
theoriginalbandwidth.
StandardEthernetTheconventionalEthernetoperatingat 10Mbps.
startopologyA topologyinwhichallstationsareattachedtoacentraldevice(hub).
startbitInasynchronoustransmission,abittoindicatethebeginning oftransmission.
statetransitiondiagramA diagramtoillustratethestatesofafinitestatemachine.
staticdocument OntheWorldWideWeb,afixed-contentdocumentthatiscreatedand
storedinaserver.
staticmappingA techniqueinwhichalist oflogicalandphysicaladdresscorrespondences
isusedforaddressresolution.
staticroutingA typeofroutinginwhichtheroutingtableremainsunchanged.
stationaryhostA hostthatremainsattached toonenetwork.
statisticalTDMATDMtechniqueinwhichslotsaredynamicallyallocatedtoimprove
efficiency.
statusline IntheHTTPresponsemessagealinethatconsists oftheHTTPversion,aspace,a
statuscode,aspace,astatusphrase.
stopbit Inasynchronoustransmission,oneormorebitstoindicatetheend oftransmission.
stop-aDd-waitARQ Anerror-controlprotocolusingstop-and-waitflowcontrol.
Stop-aDd-WaitProtocolA protocolinwhichthesendersendsoneframe,stopsuntilit
receivesconfirmationfromthereceiver,andthensendsthenextframe.
store-aDd-forwardswitchA switchthatstorestheframeinaninputbufferuntilthewhole
packethasarrived.

GLOSSARY 1101
straighttipconnector Atypeoffiber-opticcableconnectorusingabayonetlockingsystem.
StreamControlTransmissionProtocol(SCTP) Thetransportlayerprotocoldesigned
forInternettelephony
andrelatedapplications.
streamingliveaudio/video BroadcastdatafromtheInternet thatausercanlistentoorwatch.
streamingstoredaudio/video DatadownloadedasfilesfromtheInternetthatausercan
listentoorwatch.
strongcollision Creatingtwomessagewiththesamedigest.
StructureofManagementInformation(SMI) InSNMP,acomponentusedinnetwork
management.
STSmultiplexer/demultiplexerASONETdevicethatmultiplexesanddemultiplexes
signals.
stublink Anetworkthatisconnectedtoonly onerouter.
subnetsubnetwork.
subnetaddress Thenetworkaddress ofasubnet.
subnetmask Themaskforasubnet.
subnetworkApartofanetwork.
subscriberchannelconnector Afiber-opticcableconnectorusingapushipulllocking
mechanism.
substitutioncipher Abit-levelencryptionmethodinwhich nbitssubstituteforanother
nbitsasdefined byP-boxes,encoders,anddecoders.
suffixForanetwork,thevaryingpart(similartothehostid) oftheaddress.InDNS,astring
used
byanorganizationtodefineitshost orresources.
summarylinkto ASboundaryrouterLSAAnLSApacketthatletsarouterinsidean
areaknowtheroutetoanautonomousboundaryrouter.
summarylinktonetworkLSA AnLSApacketthatfinds thecostofreachingnetworks
outside
ofthearea.
supergroupAsignalcomposed offivemultiplexedgroups.
supernetAnetworkformedfromtwo ormoresmallernetworks.
supernetmask Themaskforasupernet.
switchAdeviceconnectingmultiplecommunicationlinestogether.
switchedEthernet AnEthernetinwhichaswitch,replacingthehub,candirectatransmission
toitsdestination.
switchedvirtualcircuit(SVC) Avirtualcircuittransmissionmethod inwhichavirtual
circuitiscreatedand
inexistenceonlyfortheduration oftheexchange.
switched/56Atemporary56-Kbpsdigitalconnectionbetweentwousers.
switchingoffice Theplacewheretelephoneswitchesarelocated.
symmetricdigitalsubscriberline(SDSL) ADSL-basedtechnologysimilartoHDSL,
butusingonly
onesingletwisted-paircable.
symmetric-keycryptography Acipherinwhichthesamekeyisusedforencryptionand
decryption.
synchronizationpoints Referencepointsintroducedintothedatabythesessionlayerfor
thepurpose
offlowanderrorcontrol.

1102 GLOSSARY
synchronousconnectionoriented(SCO)link InaBluetoothnetwork,aphysicallink
createdbetweenamasterandaslavethatreservesspecificslotsatregularintervals.
SynchronousDigital Hierarchy(SDH)ThelTD-Tequivalent ofSONET.
SynchronousOpticalNetwork(SONET) AstandarddevelopedbyANSIforfiberoptic
teChnologythatcantransmithigh-speeddata.Itcanbeusedtodelivertext,audio,andvideo.
synchronouspayloadenvelope(SPE) ThepartoftheSONETframecontaininguserdata
andtransmissionoverhead.
synchronousTDM ATDMtechniqueinwhicheachinputhasanallotmentintheoutput
evenwhenitisnotsendingdata.
synchronoustransmission Atransmissionmethodthatrequiresaconstanttimingrelationship
betweenthesenderandthereceiver.
synchronoustransportmodule(STM) AsignalintheSDHhierarchy.
synchronoustransportsignal(STS) AsignalintheSONEThierarchy.
syndromeAsequenceofbitgeneratedbyapplyingtheerrorcheckingfunction toacodeword.
syntaxThestructureorformatofdata,meaningtheorderinwhichtheyarepresented.
T
TlinesAhierarchyofdigitallinesdesignedtocarryspeechandothersignalsindigitalforms.
ThehierarchydefinesT-I,T-2,
T-3,andT-41ines.
tandemofficeThetollofficeinatelephonenetwork.
TCPIIPprotocolsuite Afive-layerprotocolsuitethatdefinestheexchange oftransmissions
acrosstheInternet.
teardownphase Invirtualcircuitswitching,thephaseinwhichthesourceanddestination
informtheswitchtoerasetheirentry.
telecommunicationsExchangeofinformationoverdistanceusingelectronicequipment.
teleconferencingAudioandvisualcommunicationbetweenremoteusers.
TeledesicAsystemofsatellitesthatprovidesfiber-opticcommunication(broadbandchannels,
lowerrorrate,andlowdelay)
telephoneuser port(TUP)AprotocolattheupperlayerofSS7thatisresponsiblefor
settingupvoicecalls.
temporalcompression AnMPEGcompressionmethodinwhichredundantframesareremoved.
Ten-GigabitEthernetThenewimplementationofEthernetoperatingat 10Gbps.
TerminalNetwork(TELNET) Ageneralpurposeclient-serverprogramthatallows
remotelogin.
three-wayhandshaking Asequenceofeventsforconnectionestablishmentortermination
consisting
oftherequest,thentheacknowledgment oftherequest,andthenconfirmation ofthe
acknowledgment.
throughputThenumber ofbitsthatcanpassthroughapointin onesecond.
ticket-grantingserver(TGS) AKerberosserverthatissuestickets.
timedivisionduplexingTDMA(TDD-TDMA) InaBluetoothnetwork,akind ofhalf­
duplexcommunicationinwhichtheslaveandreceiversendandreceivedata,butnotatthesame
time(half-duplex).

GLOSSARY 1103
timedivisionmultipleaccess(TDMA) Amultipleaccessmethodinwhichthebandwidth
isjustonetime-sharedchannel.
timetolive(TTL) Thelifetimeofapacket.
time-divisionmultiplexing(TDM) Thetechniqueofcombiningsignalscomingfrom
low-speedchannelstosharetimeonahigh-speedpath.
time-divisionswitching Acircuit-switchingtechniqueinwhichtime-divisionmultiplexing
isusedtoachieveswitching.
time-domainplot Agraphicalrepresentation ofasignal'samplitudeversustime.
time-slotinterchange(TSI) Atime-divisionswitchconsisting ofRAMandacontrolunit.
tokenAsmallpacketusedintoken-passingaccessmethod.
tokenbucket Analgorithmthatallowsidlehoststoaccumulatecreditforthefutureinthe
fonn
oftokens.
tokenpassing Anaccessmethodinwhichatokeniscirculatedinthenetwork.Thestation
thatcapturesthetokencansenddata.
TokenRing ALANusingaringtopologyandtoken-passingaccessmethod.
topologyThestructureofanetworkincludingphysicalarrangement ofdevices.
trafficcontrol Amethodforshapingandcontrollingtraffic inawideareanetwork.
trafficshaping Amechanismtocontroltheamountandtherate ofthetrafficsenttothe
networktoimproveQoS.
trailerControlinformationappendedtoadataunit.
transactioncapabilitiesapplication port(TCAP)Aprotocolattheupperlayer ofSS7
thatprovidesremoteprocedurecallsthatlet
anapplicationprogramonacomputerinvokea
procedureonanothercomputer.
transceiverAdevicethatbothtransmitsandreceives.
transientlink Anetwork withseveralroutersattachedtoit.
TransmissionControlProtocol(TCP) AtransportprotocolintheTCP/IPprotocolsuite.
TransmissionControlProtocollInternetworkingProtocol(TCP/IP) Afive-layer
protocolsuitethatdefinestheexchange
oftransmissionsacrosstheInternet.
transmissionmedium Thephysicalpathlinkingtwocommunicationdevices.
transmissionrateThenumber ofbitssentpersecond.
transparencyTheabilitytosendanybitpatternasdatawithoutitbeingmistakenfor
controlbits.
transparentbridgeAnothernameforalearningbridge.
transparentdata Datathatcancontaincontrolbitpatternswithoutbeinginterpreted ascontrol.
transportlayerThefourthlayerintheInternetandOSImodel;responsibleforreliable
end-to-enddeliveryanderrorrecovery.
TransportLayerSecurity(TLS) TheIETFstandardversion ofSSL.Thetwoarevery
similar,withslightdifferences.
transpositioncipherAcharacter-levelencryptionmethodinwhichtheposition ofthe
characterchanges.
trellis-codedmodulation Amodulationtechniquethatincludeserrorcorrection.

1104 GLOSSARY
trilaterationAtwo-dimensionalmethod offindingalocationgiventhedistancesfrom 3different
points.
tripleDESAnalgorithmcompatiblewithDESthatusesthreeDESblocksandtwo
56-bitkeys.
TrivialFile TransferProtocol(TFTP) AnunreliableTCP/IPprotocolforfiletransfer
thatdoesnotrequirecomplexinteractionbetweenclientandserver.
trunkTransmissionmediathathandlecommunicationsbetweenoffices.
tunnelingInmulticasting,aprocess inwhichthemulticastpacketisencapsulatedinaunicast
packetandthensentthroughthenetwork.InVPN,theencapsulation
ofanencryptedIPdatagram
inasecondouterdatagram.ForIPv6,astrategyusedwhentwocomputersusingIPv6wantto
communicatewitheachotherwhenthepacketmustpassthrougharegionthatusesIPv4.
twisted~pair cableAtransmissionmediumconsisting oftwoinsulatedconductorsinatwisted
configuration.
two-dimensionalparitycheckAnerrordetectionmethod intwodimensions.
typeofservice(TOS) AcriteriaOrvaluethatspecifiesthehandling ofthedatagram.
u
unbalancedconfigurationAnHDLCconfigurationinwhichonedeviceisprimaryandthe
otherssecondary.
unguidedmedium Atransmissionmediumwithnophysicalboundaries.
unicastaddress Anaddressbelongingtoonedestination.
unicastrouting Thesendingofapackettojustonedestination.
unicastingThesendingofapackettojustonedestination.
UnicodeTheinternationalcharactersetusedtodefinevalidcharactersincomputerscience.
unidirectionalantennaAnantennathatsends orreceivessignalsinonedirection.
UniformResource Locator(URL)Astringofcharacters(address)thatidentifiesapage
ontheWorldWideWeb.
unipolarencoding Adigital-to-digitalencodingmethodinwhichonenonzerovaluerepresents
either1
or0;theotherbitisrepresentedbyazerovalue.
unshieldedtwisted-pair(UTP) Acablewithwiresthataretwistedtogethertoreduce
noiseandcrosstalk.Seealsotwisted-paircableandshieldedtwisted-pair.
unspecifiedbitrate(UBR)Thedatarate ofanATMserviceclassspecifyingonlybest-effort
delivery.
uplinkTransmissionfrom anearthstationtoasatellite.
uploadingSendingalocalfile ordatatoaremotesite.
useragent(UA) AnSMTPcomponentthatpreparesthemessage,createstheenvelope,and
putsthemessageintheenvelope.
userauthenticationAsecuritymeasureinwhichthesenderidentityisverifiedbeforethe
start
ofacommunication.
userdatagramThenameofthepacketintheUDPprotocol.
UserDatagramProtocol(UDP) AconnectionlessTCP/IPtransportlayerprotocol.
usernetworkinterface(UNI) TheinterfacebetweenauserandtheATMnetwork.

GLOSSARY 1105
usersupportlayersThesession,presentation,andapplicationlayers.
user-to-networkinterface(UNI) InATM,theinterfacebetweenanendpoint(user)and
anATMswitch.
v
VseriesITU-Tstandardsthatdefinedatatransmissionovertelephonelines.Somecommon
standardsareY.32,V.32bis,Y.90,andV92.
variablebitrate(VBR)Thedatarate ofanATMserviceclassforusersneedingavarying
bitrate.
veryhigh bitratedigitalsubscriberline(VDSL) ADSL-basedtechnologyforshort
distances.
videoRecordingortransmitting ofapictureoramovie.
VigenerecipherApolyalphabeticsubstitutionschemethatusestheposition ofacharacterin
theplaintextandthecharacter'spositioninthealphabet.
virtualcircuit(Ve)Alogicalcircuitmadebetweenthesendingandreceivingcomputer.
virtualcircuitswitching AswitchingtechniqueusedinswitchedWANs.
virtuallinkAnOSPFconnectionbetweentworoutersthatiscreatedwhenthephysicallink
isbroken.Thelinkbetweenthemusesalongerpaththatprobablygoesthroughseveralrouters.
virtuallocal areanetwork(VLAN)AtechnologythatdividesaphysicalLANintovirtual
workgroupsthroughsoftwaremethods.
virtualprivate network(VPN)Atechnologythatcreatesanetworkthatisphysically
public,butvirtuallyprivate.
virtualtributary(VT)ApartialpayloadthatcanbeinsertedintoaSONETframeand
combinedwithotherpartialpayloadstofillouttheframe.
VoiceOverFrameRelay(VOFR) AFrameRelayoptionthatcanhandlevoicedata.
voiceover IPAtechnologyinwhichtheInternetisusedasatelephonenetwork.
w
Walshtable InCDMA,atwo-dimensionaltableusedtogenerateorthogonalsequences.
wave-divisionmultiplexing(WDM) Thecombiningofmodulatedlightsignalsintoonesignal.
wavelengthThedistanceasimplesignalcantravelinoneperiod.
weakcollision Givenadigest,creatingasecondmessagewiththesamedigest.
webpage AunitofhypertextorhypermediaavailableontheWeb.
weightedfairqueueing ApacketschedulingtechniquetoimproveQoSinwhichthepackets
areassignedtoqueuesbasedonagivenprioritynumber.
well-knownportnumberAportnumberthatidentifiesaprocessontheserver.
wideareanetwork(WAN)Anetworkthatusesatechnologythatcanspanalarge
geographicaldistance.
wideareatelephoneservice(WATS) Atelephoneserviceinwhichthechargesarebased
onthenumber
ofcallsmade.
WorldWideWeb(WWW) AmultimediaInternetservicethatallowsuserstotraversethe
Internetbymovingfromonedocumenttoanothervialinksthatconnectthemtogether.

1106 GLOSSARY
x
X.25AnITU-Tstandardthatdefinestheinterfacebetweenadataterminaldeviceanda
packet-switchingnetwork
X.509AnITU-T standardforpublickeyinfrastructure(PKI)
z
zoneInDNS,whataserverisresponsiblefor orhasauthorityover.

[AL98]
[AZ03]
[Bar02]
[BELOO]
[Ber96J
[Bis03]
[BlaOO]
[81a03]
[CBR03]
[ComOO]
[Com04]
[CouOl]
[DH03]
[Dro02]
Albitz,P.andLiu,C.DNSandBIND.Sebastopol,CA:O'Reilly,1998.
AgrawalD.andZeng,
Q.IntroductiontoWireless andMobileSystems.
PacificGrove,CA,NJ:Brooks/ColeThomsonLearning,2003.
Barr,
T,InvitationtoCryptology. UpperSaddleRiver,NJ:PrenticeHall,
2002.
Bellamy,
J.DigitalTelephony. NewYork, NY:Wiley,2000.
Bergman,
J.DigitalBasebandTransmission andRecording.Boston,
MA:Kluwer,1996.
Bishop,M.
ComputerSecurity. Reading,MA:Addison-Wesley,2003.
Black,U.
QoSInWideAreaNetwork. UpperSaddleRiver,NJ:Prentice
Hall,2000.
Blahut,
R.AlgebraicCodes forDataTransmission. Cambridge,UK:
CambridgeUniversityPress,2003.
Cheswick,
W.,Bellovin,S.,andRubin, A.FirewallsandInternetSecurity.
Reading,MA:Addison-Wesley,2003.
Comer,D.
InternetworkingwithTCPlIp,Volume 1:Principles,Protocols,
andArchitecture.UpperSaddleRiver,NJ:PrenticeHall,2000.
Comer,D.
ComputerNetworks. UpperSaddleRiver,NJ:PrenticeHall,
2004.
Couch,
L.DigitalandAnalogCommunicationSystems. UpperSaddle
River,NJ:PrenticeHall,2000.
Doraswamy,
H.andHarkins,D. IPSec.UpperSaddleRiver,NJ:Prentice
Hall,2003.
Drozdek,
A.ElementsofDataCompression. Brooks/ColeThomson
Learning,2003.
1107

1108 REFERENCES
[DutOl]
[FH98]
[For03]
[For06]
[FRE96]
[GarOl]
[Gas02]
[GW04]
[HaIOl]
[Ham80]
[Hsu03]
[HuiOO]
[IzzOO]
[Jam03]
[KCK98]
[Kei02]
[Kes97]
[KMK04]
[KPS02]
[KROS]
[Los04]
[Mao04]
Dutcher,D. TheNATHandbook.NewYork,NW:Wiley,2001.
Ferguson,
P.andHuston,G. Qualityo/Service. NewYork,NW:Wiley,1996.
Forouzan,B.
LocalAreaNetworks. NewYork,NY:McGraw-Hill,2003.
Forouzan,B.
TCPIIPProtocolSuite. NewYork, NY:McGraw-Hill,2006.
Freeman,
R.TelecommunicationSystemEngineering. NewYork,NW:
Wiley,1996.
Garret,
P.Making,BreakingCodes. UpperSaddleRiver,NJ:Prentice
Hall,2001.
Gast,M.
802.11WirelessNetwork. Sebastopol,CA:O'Reilly,2000.
Garcia,
A.andWidjaja,I,CommunicationNetworks. NewYork, NY:
McGraw-Hill,2003.
Halsall,
F.MultimediaCommunication. Reading,MA:Addison-Wesley,
2001.
Hamming,
R.CodingandInformationTheory. UpperSaddleRiver,NJ:
PrenticeHall,1980.
Hsu,H.
AnalogandDigitalCommunications. NewYork,NY:
McGraw-Hill,2003.
Huitema,C.
RoutingintheInternet. UpperSaddleRiver,NJ:Prentice
Hall,2000.
Izzo,
P.GigabitNetworks. NewYork,NY:Wiley,2000.
Jamalipour,A.
WirelessMobileInternet. NewYork,NY:Wiley,2003.
Kadambi,
j.,Crayford,I.,andKalkunte,M. GigabitEthernet. Upper
SaddleRiver,NJ:PrenticeHall,1998.
Keiser,G.
LocalAreaNetworks. NewYork, NY:McGraw-Hill,2002.
Keshav,S.
AnEngineeringApproach toComputerNetworking. Reading,
MA:Addison-Wesley,1997.
Kumar
A.,Manjunath,D., andKuri,1.CommunicationNetworking. San
Francisco,CA:Morgan,Kaufmans,2004.
Kaufman,c.,Pedmann,R.,andSpeciner,M. NetworkSecurity. Upper
SaddleRiver,NJ:PrenticeHall,2000.
Kurose,
1.andRoss,K.ComputerNetworking. Reading,MA:Addison­
Wesley,2005.
Loshin,
P.IPv6:Theory,Protocol,andPractice. SanFrancisco,CA:
Morgan,Kaufmans,2001.
Mao,
W.ModemCryptography.UpperSaddleRiver,NJ:PrenticeHall,
2004.

[Max99]
[MOV97]
[Moy98]
[MSOl]
[PD03]
[Pea92]
[PerOO]
[PHS03]
[ResOl]
[Rhe03]
[Ror96]
[SaI03]
[Sau98]
[Sch96]
[Sch03]
[Spi74]
[SpuOO]
[S8805]
[8ta02]
[Sta03]
[8ta04]
REFERENCES 1109
Maxwell,K. ResidentialBroadband. NewYork, NY:Wiley,2003.
Menezes,A.,Oorschot,
P.,andVanstone,S. HandbookofApplied
Cryptograpy.NewYork,NY: CRCPress,1997.
Moy,J.
OSPF:Anatomy ofanInternetRoutingProtocol. Reading,MA:
Addison-Wesley,1998.
MauroD.andSchmidtK.
EssentialSNMP Sebastopol,CA:O'Reilly,
2001.
Peterson,L.,andDavieB.
ComputerNetworks:ASystemsApproach.
SanFrancisco,CA:Morgan,Kaufmans,2000.
Pearson,J.
BasicCommunicationTheory. UpperSaddleRiver,NJ:
PrenticeHall,'1992.
Perlman,
R.Interconnection:Bridges,Routers,Switches,andIntemet­
workingProtocols.
Reading,MA:Addison-Wesley,2000.
Pieprzyk,J.,Hardjono,
T,andSeberry,J, FundamentalsofComputer
Security.
Berlin,Germany:Springer,2003.
Rescorla,E.
SSLand TSL.UpperSaddleRiver,NJ:PrenticeHall,2000.
Rhee,
M,InternetSecurity. NewYork, NY:Wiley,2003.
Rorabaugh,C.
ErrorCodingCookbook. NewYork,NY:
McGraw-Hill,1996.
Solomon, D.
DataPrivacyandSecurity. Berlin,Germany:Springer,
2003.
Sauders,S.
GigabitEthernetHandbook. NewYork,NY:McGraw-Hill,
1998.
Schneier,B.
AppliedCryptography. Reading,MA:Addison-Wesley,
1996.
Schiller,
B.MobileCommunications. Reading,MA:Addison-Wesley,
2003.
Spiegel,
M.FourierAnalysis.NewYork,NY:McGraw-Hill,1974.
Spurgeon,
C.Ethernet.Sebastopol,CA:O'Reilly,2000.
Shimonski,R.,Steiner,
R.Sheedy,S. NetworkCablingIlluminated.
Sudbury,MA:JonesandBartlette,2005.
Stallings,
W.WirelessCommunicationsandNetworks. UpperSaddle
River,NJ:PrenticeHall,2002.
Stallings,
W.CryptographyandNetworkSecurity. UpperSaddleRiver,
NJ:PrenticeHall,2003.
Stallings,
W.DataAndComputerCommunications. UpperSaddleRiver,
NJ:PrenticeHall,2004.

1110 REFERENCES
[S1398]
[Ste94]
[Ste96]
[Ste99]
[Sti02]
[SubOl]
[SWE99]
[SX02]
[Tan03]
[ThoOO]
[WVOO]
[WZOl]
[YSOl]
[Zar02]
Stallings,W.HighSpeedNetworks. UpperSaddleRiver,NJ:Prentice
Hall,1998.
Stevens,
W.TCPIIPIllustrated,Volume 1.UpperSaddleRiver,NJ:
PrenticeHall,2000.
Stevens,
W.TCPIIPIllustrated,Volume 3.UpperSaddleRiver,NJ:
PrenticeHall,2000.
StewartIII,J.
BGP4:Inter-DomainRoutingintheInternet. Reading,
MA:Addison-Wesley,1999.
Stinson,D.
Cryptography.NewYork,NY:Chapman &Hall/CRC,2002.
Subramanian,M.
NetworkManagement. Reading,MA:Addison­
Wesley,2000.
Scott,C.,Wolfe,
P,andErwin,M. VirtualPrivateNetworks. Sebastopol,
CA:O'Reilly,1998.
Stewart,
R.andXie,Q.StreamControlTransmissionProtocol(SCTP).
Reading,MA:Addison-Wesley,2002.
Tanenbaum,A.
ComputerNetworks. UpperSaddleRiver,NJ:Prentice
Hall,2003.
Thomas,S. SSLandTLSEssentials. NewYork, NY:Wiley,2000.
Warland,J.andVaraiya,
P.HighPeiformanceCommunication
Networks.
SanFrancisco,CA:Morgan,Kaufmans,2000.
Wittmann,R.andZitterbart,M.
MulticastCommunication. San
Francisco,CA:Morgan,Kaufmans,2001.
Yuan
R.andStrayer,W.VirtualPrivateNetwork. Reading, MA:Addison­
Wesley,2001.
Zaragoza,
R.TheArtofErrorCorrectingCoding. Reading,MA:
Addison-Wesley,2002.

Numerics
1000Base-CX,414
1000Base-LX,414
lOOOBase-SX,414
1000Base-
T,414
100Base-FX,410-411
100Base-T4,410,412
1
OOBase-TX,
410-411
lOBase2,404
10Base5,403
lOBase-F,405
lOBase-T,404
full-duplex,408
lOGBase-E,416
10GBase-L,416
IOGBase-S,416
2BIQ,111
HDSL,255
3DES.
SeeTripleDES
4B/5B,116
4D-PAM5,
113
GigabitEthernet,415
56Kmodem,250
ADSL,252
5-s10tframe,439
800service,247
802.11,428
8BIlOB,118
GigabitEthernet,415
8B/6Tcode,1055
8B6T,112
900service,247
A
AAbattery,60
AAL,532
AALl,532
AAL2,532
AAL3/4,534
AAL5,535
ABM,341
ACvalue,905
access,363
accesscontrol
datalinklayer,35
accesspoint.
SeeAP
accessrate,787
accounting management,877
ACK,724
duplicate,732
inpoll,
381
SelectiveRepeatARQ,339
ACKframe,318
ACKmessage,
921
acknowledgementnumber,
319,719
acknowledgementpolicy,766
acknowledgment,
731
circuitswitching,
217~218
CSMAlCA,378
flowcontrol,311
Go-Back-N,326
virtual-circuitnetwork,225
ACL,439
activedocument,860
activeopen,723
adhocarchitecture
network,421
additiveincrease,770
address,
1061
IP,47
link,46
logical,36
needformultiple,612
physical,46
port,49
service-point,38,701
types,45,52
virtual-circuitnetwork,222
addressaggregation,
561,652
addressallocation, 561
addressblock,555
addressfield
HDLC,342
addressmask
ICMPv6,640
addressmaskmessage,626
addressresolutionprotocol.
SeeARP
addressspace,550
address
toname
resolution,807
addressing,45
circuitswitching,215
Ethernet,400
VPN,1007
admission,
781
admissioncontrol,780
admissionpolicy,766
ADSL,252-253,255
adaptive,252
DMT,254
downstreamdataand
control,253
HDSL,255
idlechannels,252
localloop,252
upstreamdataandcontrol,
253
VDSL,255
voice,252
ADSLLite,254
AdvancedEncryption
Standard.
SeeAES
AdvancedMobilePhone
System.SeeAMPS
AdvancedResearchProjects
Agency.
SeeARPA
AES,943
configurations,944
round,944
structure,944
AFPHB,786
agent,877-878
database,878
function,
891
MIB,886
passiveopen,895
trap,878
AHprotocol,998
authenticationdata
field,999
ESP,
1001
nextheaderfield,999
sequencenumber,999
SPIfield,999
ALfield,534
alias,
831
Alice,932
allocation
ofresources,745
ALOHA,365
collision,365
pureALOHA,365
vulnerabletime,367
alternatemarkinversion.
SeeAMI
AM,153-155
bandwidth,153-154
carrier,
153
AMbandwidth,153
AMradio,71,167
AMstation,154
AmericanNationalStandards
Institute.
SeeANSI
AmelicanStandardCodefor
InformationInterchange.
SeeASCII
AMI,110
B8ZS,119
HDSL,255
synchronization,
111
amplifier,447
attenuation,
81
cableTV,256
amplitude,142,144
ASK,143
FM,
154
FSK,146
measurement,59
PM,
155
PSK,148
sinewave,
65
amplitudemodulation. SeeAM
amplitudeshiftkeying.
SeeASK
AMPS,470
analogdata,57
analoghierarchy
telephonesystem,
165
analogleasedservice,
165,247
analogservice,247
analogsignal,57-58,
101,120
digitize,120
periodic,59
1111

1112 INDEX
analogswitchedservice,247
analogtransmission,
141
Tline,177
analog
TV,71
analog-to-analogconversion,
141,152
analog-to-digital
conversion,
101
ANDoperation,557
angle
ofincidence,198
anonymousFTP,844
ANSI,20
antenna
focus,206
hom,207
line-of-sight,203
parabolicdish,207
satellite,480
anti-jamming,
183
anycastaddress,570
AP,421
APNIC,569
applet,860
applicationadaptationlayer.
SeeAAL
applicationlayer, 41
directoryservices,42
filemanipulation,42
mailservices,42
NVT,41
responsibilities,41,795
services,
41
TCPIIP,42,45
architecture
e-mail,824
OSImodel,30
area,671
areaborderrouter,671
ARP,
43-44,613
broadcastquery,612
encapsulation,615
fourcases,615
hardwarelengthfield,614
hardwaretypefield,614
host
tohostondifferent
networks,616
host
tohostonsingle
network,615
ICMPv6,596,640
operation,615
operationfield,614
packetcomponents,612
packetformat,613
process,615
protocollengthfield,614
protocoltypefield,614
proxy,617
querypacket,612
responsepacket,612
responsepacket
components,612
routertohostondifferent
networks,616
router
tohostonsame
network,616
senderhardwareaddress
field,614
senderprotocoladdress
field,614
targethardwareaddress
field,614
targetprotocoladdress
field,614
unicastresponse,612
ARPA,
17
ARPANET,17
ARQ,311
AS,
659,984
graphical
representation,673
multihomed,677
speakernode,674
stub,676
transit,677
types,676
ASCII,5,628,1029
charactercodetable,1032
ASK,142
bandwidth,144,146
binary,144
carriersignal,
143
constellation,151
implementation,144
multilevel,
145
withPSK,152
ASN.1,989
simpletypeexamples,883
SMI,882
ASP,859
association,737,743
termination,748
asymmetric
cryptography,932
asymmetricalDSL.
SeeADSL
asymmetric-key
cryptography,933
keys,933
asynchronousbalancedmode.
SeeABM
asynchronousconnectionless
link.
SeeACL
asynchronousTDM
ATM,525
asynchronous
transmission,133-134
AsynchronousTransmission
Mode.
SeeATM
AT&TBellSystem,1059
AT&Tdivestiture,1059
ATM,227,308,523,
526-527
AALl,532
AAL2,532
AAL3/4,534
AAL5,535
architecture,526
asynchronousTDM,525
ATMlayer,530
availablebitrateclass,789
backwardcompatibility,523
cell,527
celldelayvariation,790
cellerrorratio,790
celllossratio,790
celltransferdelay,790
cellvariationdelay
tolerance,790
connection
establishment,528
connectionrelease,528
connectiontypes,536
connection-oriented,538
connections,528
constantbitrateclass,789
designgoals,523
example,526
headerforNNI,
531
hierarchicalrouting,527
Identifier,527
InformationSuper-
Highway,523
layers,529
minimumcellrate,790
multimedia,536
multiplexing,525
network-related
attributes,790
peakcellrate,790
physicallayer,530
QoS,789
SONET,530
sustainedcellrate,790
SVC,529
switching,529
switchingfabric,529
unspecifiedbitrateclass,789
user-relatedattributes,790
variablebitrateclass,789
variablebitratenon-real
time,789
variablebitratenonreal
time,789
variablebitrate
real-time,789
virtualconnection,526
WAN,536
ATMForum,523
address,
1061
ATMLAN,536
advantages,536
architecture,536
BUS,539
client/server,540
expansion,536
LANE,538
legacy,536
mixedarchitecture,537
pure,536
ATMlayer,529
celllosspriority,532
cellsize,530
congestioncontrol,532
function,530
generic
flowcontrol,531
headererror
correction,532
headerforUN!.531
headerformat,531
NNIlevel
flowcontrol,531
payloadtype,531
UNIlevel
flowcontrol,531
VCIfield,531
VPI,531
VPIfield,531
ATMswitch,536
attenuation,81,446
amplifier,
81
opticalfiber,202
attribute,856
audio
compression,903
audiosignal,902
authentication,349
AHprotocol,1000
Diffie-Hellman,956
entity,962
IPv6,567,596
message,962
packet,349
PPP,352
authenticationdata,999
authenticationextension
header,602
AuthenticationHeader
protocol.
SeeAHprotocol
authenticationserve.
SeeAS
authenticationstate,349

automaticrepeatrequest.
SeeARQ
autonegotiation,409
autonomoussystem,671.
SeealsoAS
averagedatarate,762
B
B8ZS,118
backbone,
671
areaid,671
bus,11
logicalbus,456
logicalstar,457
virtuallink,
671
backbonenetwork,456
backbonerouter,67\
backoffstrategy
CSMAlCA,378
backofftime,366
backwardexplicit
congestionnotification.
SeeBECN
backwardsignal,768
band,204
AMPS,470
Bluetooth,437
D-AMPS,471
GSM,472
IS-95,474
band-limitedsignal,1049
band-passchannel,79,
141
low-pass,79
bandwidth,
69,89,103,143,
154,248,518
AM,153-154
AMradio,154,167
ASK,144,146
audiosignal,154--155
baudrate,104
BFSK,146
bitrate,78
BPSK,149
bridge,406
cellulartelephone,167
digitalsignal,74
digitalsignal
approximation,77
effective,104
Ethernet,406
FDM,162
flowcharacteristic,776
FM,154--155
FMrequirement,154
group,166
inbps,
89
inhertz,89
infinite,74
localloop,242
mastergroup,166
minimum,104
non-periodicsignal,69
NRZ-IandNRZ-L,108
opticalfiber,202
periodicsignal,69
PM,156
QAM,152
real-timetraffic,915
supergroup,166
telephoneline,248
throughput,90
transmissiontime,
91
bandwidthondemand
burstydata,518
bandwidth-delayproduct,
92,322
banyanswitch,233
internalcollision,235
Barkersequence,184
base,1050
base10,
1051
base256,1037,1040
tobinary,1042
weightandvalue,1040
base
e,1051
baseheader,597
basestation(BS),467
hasetransfonnation,1052
basebandlayer,437
basebandtransmission,75
approximation,
78
baseline,104
baselinewandering,104
Manchester,109
NRZ-L,107
BasicEncodingRules.
SeeBER
BasicLatin,1029
basicmultilingualplane
(BMP),1030
basicserviceset.
SeeBSS
BAsize,534
Batcher,235
Batcher-banyanswitch,235
baudrate,103,142
andbitrate,142
bandwidth,104
Be,787
Be,788
beaconframe,426
BECN,521
mechanism,773
sender,773
Bell OperatingCompany.
SeeBOC
BER,884
classsubfield,884
format,884
formatsubfield,884
integerexample,885
lengthfield,885
numbersubfield,884
SNMP,893
tagfield,884
valuefield,885
best-effortdelivery,44,583
B-frame,908
BFSK,146
BGP,659,676
external,677
internal,677
pathattributes,677
pathvectorrouting,676
port,1065
session,677
bidirectionaledge,673
bidirectionalframe,908
binaryASK,144
binaryexponential
backoff,366
binarynotation,550
findingtheclass,552
binarynumber,1038-1040
binaryPSK,148
symbols,1038-1039
tobase256,1042
tohexadecimal,1041
weightandvalue,1038
binarysystem,
1037-1038
biphasecoding,109
bipolarAMI,110
bipolarcoding,110
bit,102
bitpadding,174,176
bitrate,73,103,142
andbaudrate,142
bandwidth,
78
bitstuffing,174,310
bit-orientedcipher,938
bit-orientedprotocol,309
bitspersecond,
73
block,555
messagedigest,968
blockcode
errorcorrection,277
linear,277
minimumHamming
distance,276
non-linear,277
INDEX'1113
blockcoding,115,269
8B/I0B,118
combination,115
division,115
errorcorrection,273
errordetection,272
substitution,115
blockdescriptor,843
blockprocessing
RIPEMD-160,968
blocking,229
Blowfish,945
Bluetooth,421,434
applications,434
architecture,435
device,436
framefonnat,439
layers,436
BluetoothLAN,435
BNCconnector,
196
Bob,932
BOC,1059
BOOTP,618-619
binding,620
relayagent,619
staticconfiguration
protocol,620
staticprotocol,620
BorderGatewayProtocol.
SeeBGP
BPSK,
148
constellation,151
implementation,149
QPSK,149
bridge,406,447
asafilter,448
collisiondomain,407
connectingLANs,454
dynarnic,449
Ethernet,406
function,406,447
loopproblem,450
multipleLANissues,454
redundant,450
sourcerouting,454
transparent,449
bridgeprotocoldataunit
(BPDU),452
bridgedEthernet,406
broadcastaddress
Ethernet,400
broadcast/unknownserver.
Seebus
broadcasting,680
VLAN,460
browser,852
clientprotocol,852

1114 INDEX
browser-Cant.
controller,852
dynamicdocument,857
HTML,855
interpreter,852
markuplanguage,855
streamingstoredaudio/
video,909
BSS,421
BSS-transitionmobility,423
Btag,534
bucketbrigadeattack,956
buffer
circular,717
flowcontrol,311
messagedigest,968
packetswitch,232
receiversite,717
sendersite,717
TCP,717
bufferallocation,534
burst,267
bursterror,267-268
2single-biterrors,296
example,268
burstydata,518
FrameRelay,518
T-line,518
trafficcontrol,788
bursty
flow,763
burstytraffic
leakybucket,779
tokenbucket,779
bus,
9,11-12
advantages,II
backbone,II
disadvantages,12
droplines,11
fault,12
tap,
11
busringtopology,382
bustopology,34
BYEmessage,
921
bytenumber,719
bytestuffing,308
bytesynchronization,135
byte-orientedprotocol,736
byte-stuffing,349
C
CA,987,992
cable
coaxial,195
twisted-pair,
193
cablemodem. SeeCM
cablemodemtransmission
system.
SeeCMTS
cablenetwork,
241
cableTV,256
coaxialcable,197
headend,256
caching,808
counter,809
problems,809
time-to-live,809
unauthoritativesource,809
CaesarCipher,936
CANCELmessage,921
capacities,178,876
carrier,79,370
AM,153-154
FM,154-155
inter-LATA,243
PM,
155
carrierdivisionmultiple
access.
SeeCOMA
carrierextension,413
carrierfrequency,143-144
carriersensemultipleaccess.
SeeCSMA
carriersensemultiple
aCCess
withcollisionavoidance.
SeeCSMAICA
carriersensemultipleaccess
withcollisiondetection.
SeeCSMAICO
carriersignal, 143
ASK,143
cascading,82
casefactor,103
CAST-l28,945
CATV,256
CBC,946
characteristics,947
CBT,690
autonomoussystem,690
corerouter,
691
OVMRPandMOSPF,690
encapsulation,
691
leavingthegroup,690
multicastpacket,
691
rendezvousrouter,690
CCITT,20
CCK,434
COMA,162,383,385,
474-475,478
encoding,387
sequencegeneration,389
COMAmultiplexer,475
COMA2000,478
cell,524,527-528,790
ATM,527
definition,524
header,528
payload,527
size,527
structure,528
cellnetwork,524
concept,524
example,525
multiplexing,524
real-timetransmission,525
stream,525
vsframenetwork,524
cellrelay,523
cellulartelephone,
167
cellulartelephony,467
firstgeneration,469
handoff,469
MSC,469
placingacall,468
querysignal,469
radius,467
receivingacall,469
secondgeneration,470
thirdgeneration,477
tracking,467
transmissionpower,467
weaksignal,469
centerrouter,684
Cerf,Vint,
17
certificationauthority.
SeeCA
CFB,947
CGI,857
body,859
form,858
header,859
output,859
parameterpassing,858
querystring,858
ChallengeHandshake
AuthenticationProtocol.
SeeCHAP
channel,8,162
channelidentifier,533
channelization,383
channels
FDM,162
CHAP,352
packettypes,353
password,353
security,353
three-wayhandshake,352
character-orientedcipher,938
character-oriented
protocol,308
Cheapemet.
SeelOBase2
checksum,298,711,
731
ashashfunction,967
example,594
examples,298
fragmentation,591
headercoverage,594
IPv4,594
option,712
performance,
301
protocolfield,712
receiverprocedure,300
SCTP,740
senderprocedure,300
testing,628
UOP,711-712
chip,l84,386
chokepoint,767
chunk,739,743
format,743
identifier,741
TSN,739
CIDR,556
cipher,932
AES,943
bit-oriented,938
Caesar,936
character-oriented,938
compression
permutation,940
monoalphabetic,935
polyalphabetic,935
rotation,939
shift,936
straightpermutation,940
substitution,935,939
transposition,937
XOR,938
cipherblockchainingmode.
SeeCBC
cipherfeedbackmode.
SeeCFB
ciphertext,932
RSA,950
CIR,787
circuit
dedicated,217
circuitswitching,214
acknowledgment,217
datatransfer,217
delay,217
efficiency,217
telephonecompany,218
circuit-switchednetwork,
214,217
telephonenetwork,244
circularbuffer,717
cladding,198
step-indexmultimode,199
classAaddress,553
classBaddress,553

classCaddress,553
classfuladdressing,552
blocks,553
classes,553
classlessaddressing,554
classlessaddressing,555
addressallocation,
561
c1assfuladdressing,554
firstaddress,556
hierarchy,561
lastaddress,556
restrictions,555
routingtable,656
ClasslessInterdomain
Routing.
SeeClDR
clear
tosend(CTS),425
CLEC,242,1059
POP,243
client,704
clientprogram
portnumber,704
client/server
DNS,797
e-mail,827
LANE,539
paradigm,704
remotelogin,817
types,797
WWW,
851
client-serverparadigm,704
Closcriteria,230
closed-loopcongestion
control,765
coax.
Seecoaxialcable
coaxialcable,192,
195
applications,197
cable
TV,197,256
conductor,196
connector,196
Ethernet,
198
frequencyrange, 195
HFC,257
performance,197
sheath,196
standards,196
telephone
networlc,197
code,5
codedivisionmultipleaccess.
SeeCDMA
codepoint,585
codeword,271,275
dataword,292
geometry,276
coding,10I,269
AMI,110
complexity,106
errOrdetection,106
noise
coding,
106
NRZ,107
schemes,106
summary,114
codingtheory,386
coherentBFSK,147
ColdFusion,859
collision,364
CSMA,370
CSSMAJCD,374
hashfunction,967
slottime,
401
wireless,425
collisiondomain,407
Committed,787
committedburstsize.
SeeBe
committedinformationrate.
SeealsoCIR
calculation,788
commoncarrier,242
after1996,1059
CommonGatewayInterface.
SeeCGI
communityantenna
TV,256
compatibleaddress,
571
competitivelocalexchange
carrier.
SeeCLEC
complement
Walshtable,389
complementarycodekeying.
SeeCCK
compositeanalogsignal,74
compositesignal,66,1046
distortion,83
compression
FTP,843
MPEG,907
spatial,907
computerdata,80
conductor
twisted-pair,193
unguidedmedia,203
confidentiality,962, 964,991
configuration
management,874
documentation,874
hardware
reconfiguration,874
reconfiguration,874
subsystems,874
congestion,521,763,773
additive increase,770
buffer,623
destinationhost,623
example,763
FrameRelay,
521
ICMPv6,639
leakybucket,778
mUltiplicative
decrease,
771
prevention,766
queue,764
routers,623
congestionavoidance
FrameRelay,773
congestionavoidance
(additiveincrease),772
congestioncontrol,522,720,
761,763,765
closed-loop,767
FrameRelay,773
networkrole,769
open-loop,766
SCTP,742,753
congestionpolicy,769
congestionwindow,769
congestionwindow
(cwnd),730
congestion-controlled
traffic,599
connectingdevice,
36,445
connection
nonpersistent,868
persistent,868
connectioncontrol,38
connectionestablishment
procedure,723
three-way
handshaking,723
connectionsetup,217
connectionteardown,217
connectiontermination,748
connectionless,219
connectionlessnetwork,219
connectionlessservice,
582,707
UDP,713
connectionlesstransport
layer,38,
701
connection-oriented
protoco\'538
connection-orientedservice,
582,707,718,738
TCP,45
connection-orientedtransport
layer,38,
701
connector,193
coaxialcable,196
opticalfiber,200
constantbitratetraffic,762
constellationdiagram,150
INDEX 1115
ConsultativeCommitteefor
InternationalTelegraphy
andTelephony.
See
CCITT
contactaddress,
1061
contention,364
contentionwindow,378
controlchunk,742
controlfield
HDLC,342
types,343
controlframe,428
controlinformation
SCTP,740
controlvariable,319
controlledaccess,379
controller,
10,852
convergencesublayer. SeeCS
convolutioncoding,269
cookie,725,744-745,853-854
advertisingagency,854
COOKIEACKchunk,744
COOKIEECHOchunk,744
core,198
corerouter,684,690
Core-BasedTree.
SeeCBT
corruptedframe,318
cosinewave,1045
cosmicray,192
cotangent,1046
countrydomain,805
example,805
mapping,807
CPI,534-535
CRC,284,535
ATM,532
design,290
hardware
implementation,287
HDLC,342
PPP,348
standardpolynomial,297
CRC-32,399
wireless,427
criticalangle,198
crossbarswitch,228,233
limitation,228
crosspoint,228
crosstalk,84,193
cryptography,931,957
comparison,934
cryptosystem
Diffie-Hellman,952
CS,532
CSMA,370,377
collision,370
vulnerabletime,
371

1116 INDEX
CSMAlCA,365,377
procedure,378
wirelessnetwork,378
CSMAlCD,365,373,
377,401
Ethernet,399,401
framesize,374
full-duplexswitched
Ethernet,408
procedure,375
wireless,423,425
CTS,425
CU,785
curTSN,749
cycle,58
infinite,62
phase,
63
cycliccode,284
advantages,297
analysis,293
cyclicredundancycheck.
SeeCRC
D
DA,399
D-AMPS,471
data,
4,311
transmission,57
datachunk,742
datacommunications,4
datacompression
presentationlayer,
41
datadelivery,747
dataelement,102,142
DataEncryptionStandard.
SeeDES
dataframe,428
inpoll,
381
DataLinkConnection
Identifier.
SeeDLCI
datalinkcontrol,
307,311,363
datalinklayer,34,307
accesscontrol,35
addressing,35
errorcontrol,35,
311
flowcontrol,35,311
framing,35,308
function,34
physicaladdressing,
35
PPP,347
sub-layers,363,395
virtual-circuitnetwork,227
datalinkprocessor,232
DataoverCableSystem
InterfaceSpecification.
SeeDOCSIS
datarate,103
bandwidth,104
maximum,129
signalrate,
103
dataratelimits, 85
datatraffic,761
descriptor,761
datatransfer,725,747
circuitswitching,217
multi-homing,747
SCTP,745
virtual-circuitnetwork,223
vsdatadelivery,747
database
DHCP,620
multicasting,
681
datagram,45,219,583
format,583
inIPv4,583
IP,44
datagramnetwork,214,219
dataword,271,275
augmented,288
codeword,292
dccomponent,105
8B6T,112
bipolar,110
Manchester,109
NRZ-IandNRZ-L,108
DCF,423,442
PIFS,425
repetitioninterval,426
DCT,905
ACvalue,905
gradientcase,905
sharpchangecase,905
uniformgrayscale
case,905
DDNS,812
DHCp,812
DDS,248
defactostandard,20
dejurestandard,20
DEPHB,785
decibel,81
decimalnumber,1037
decimalsystem,1037
symbols,1037
tobinary,1038
weightandvalue,1038
decisionlogicanalyzer,280
decoder,278
decoding
CDMA,387
decryption,932
RSA,950
defaultmask,553
defaultmethod,649
defaultrouter,624
degree
ofpolynomial,291
delay,90,764
circuitswitching,217
datagramnetwork,
221
load,765
real-time,912
time-divisionswitch,231
virtual-circuitnetwork,226
delayedresponse,633
delimiter,309
delivery,647
direct,647
end-to-end,37,
701
indirect,647
source-to-destination,
36-37,547,701
station-to-station,36,547
deltamodulation.
SeeDM
demodulator,164
demultiplexer,162
demultiplexing,164,707
filters,164
transportlayer,707
DEMUX.
Seedemultiplexer
denial
ofserviceattack,725
denseWDM,168
Department
ofDefense.
SeeDOD
DES,
941
triple,943
designatedparentrouter,688
destinationaddress.
SeeDA
destinationhost
reassembly,590
destinationoption,603
destinationserviceaccess
point(DSAP),396
destinationunreachable,623
ICMPv6,639
DHCP,620
BOOTP,620
configuration,620
database,620
DDNS,812
dynamicconfiguration
protocol,620
dialogcontrol,39
DifferentialManchester,109
DifferentiatedServices.
SeeDF
Diffie-Hellman,952
DIFS,425
digital
vsanalog,57
digitalAMPS.
SeeD-AMPS
digitalcellulartelephone,80
digitaldata,
57,101
digitaldataservice. SeeDDS
digitalservice,247
noise,247
digitalserviceunit.
SeeDSU
digitalsignal,
57-58,
71,101
bandwidth,74
bitrate,73
compositeanalogsignal,
74,79
levels,
71
non-periodic,74
digitalsignalservice.
SeeDS
digitalsubscriberline.
SeeDSL
digitalsubscriberlineaccess
multiplexer.
SeeDSLAM
digitaltoanalog
encoding,142
digitaltransmission,
101
digital-to-analog,141-142
bandwidth,143
digital-to-digital
conversion,
101
Dijkstraalgorithm,668
multicastlinkstate
routing,685
directcurrent,105
directdelivery,647
directsequencespread
spectrum.SeeDSSS
directoryservices,42
discardingpolicy,766
DiscreteCosineTransform.
SeeDCT
discretemultitonetechnique.
SeeDMT
disklessmachine,618
distanceleaming,682
DistanceVectorMulticast
RoutingProtocol.
SeeDVMRP
distancevector
routing,660
initialtables,661
instability,663
RIP,665
sharing,661
distortion,83
distributedcoordination
function.
SeeDCF
distributedinterframespace
(DIFS),425
distributedprocessing,7
distributionhub,257

distributionsystem,422
divisor
CRC,286-287
DLCI,519
FrameRelay,520
DM,129
adaptive,131
demodulator,130
modulator,130
quantizationerror,
131
DMT,252,255
ADSL,253
divisionofbandwidth,252
FDM,252
QAM,252
VDSL,255
voice,252
DNS,797-798
caching,808
countrydomain,805
divisions,803
domain,802
encapsulation,812
genericdomain,804
Internet,803
inverted-tree
structure,799
labels,799
levels,799
message,809
primaryserver,
803
questionrecord, 811
recordtypes, 811
resolver,806
resourcerecord,
811
reversedomain,805
rootserver,803
secondaryserver,803
server,802
TCP,812
UDP,812
updating,812
zone,802
DNSmessage
additionalinformation
section,
811
answersection,810
authoritativesection,
811
header,809
identificationfield,809
questionsection,810
DNSresponse
answerrecordsfield,810
questionrecords
field,810
DOcommand,822
donotfragmentbit,
591
DOCSIS,260
downstream,261
upstream,260
document,854,965
active,860
dynamic,857
static,855
DOD,
17
domain,801
country,805
generic,805
inverse,805
domainname,799,
831
full,799
DomainNameSystem.
SeeDNS
domains,802
DONTcommand,822
dotted-decimalnotation,550
downlink,481
downloading
V90,250
dropcable,256
dropline,
11
dropper,786
DS,176,785
DS-Oservice,176
DS-lservice,176
DS-2service,176
DS-3service,177
DS-4service,177
field,785
hierarchy
ofdigital
signals,176
DS-O,I77
DSCP,785
DSL,241,251
limitation,257
DSLAM,254
DSSS,184,474-475
bandwidthsharing,185
HR-DSSS,434
wireless,432
DSU,248
dualringtopology,382
dualstack,604
duplex,7
duplicateACKs,732
DVMRP,686,690
CBT,690
MBONE,693
PIM-DM,692
DWDM,168
dynamic,658
dynamicdatabase,620
dynamicdocument,857
example,857
script,859
DynamicDomainName
System.
SeeDDNS
DynamicHostConfiguration
Protocol.
SeeDHCP
dynamicmapping,612
dynamicport,705
dynamicrouting,655
dynamicroutingtable,656
dynamictable,658
E
Eline,178
capacity,178
eavesdropping,603
ECB,946
echorequestandreply
messages,625
ICMPv6,640
e-commerce,854
EFPHB,785
effectivebandwidth,
104,762
efficiency
circuitswitching,217
datagramnetwork,220
virtual-circuitnetwork,226
EHF,204
EIA,20
interfaces,21
manufacturingconcerns, 21
electromagneticenergy,192
electromagneticsignals,57
electromagneticspectrum,
192,203
bands,204
ElectronicCodeBlock
(ECB),946
electroniccodebookmode.
SeeECB
ElectronicIndustries
Association.
SeeEIA
electronicmail.
Seee-mail
electronicserialnumber
(ESN),474
elm,829
e-mail,824
address,
831
alias,831
architecture,824
composing,828
forwarding,829
reading,829
replying,829
encapsulation
ARP,615
DNS,812
IGMP,635
INDEX 1117
EncapsulationSecurity
Payload.
SeeESP
encoder,278
CRC,286
encoding
Ethernet,403
RZ,108
encryptedsecuritypayload.
SeeESP
encryption,932
DES,941
IPv6,596
presentationlayer,40
RSA,950
symmetric-key,933
endoffice,241-242
endswitch,243
POP,243
endingtag,534
end-of-optionoption,595
energylevel,375
entity,19
envelope,830
AM,153
ephemeralportnumber,704
queue,714
error,267
errorcontrol,38,307,311,
702,720,
731
concept,311
datalinklayer, 311
HDLC,343
PPP,348
retransmission,
31]
SACKchunk,753
SCTP,742,751
TCP,715
transportlayer,37,
701
UDP,713
errorcorrection,269,273
blockcoding,273
minimumdistance,276
retransmission,269
errordetection,269
blockcoding,116,272
checksum,298
FrameRelay,518
HDLC,342
tools,731
errorreporting,638
ICMP,622
ICMPv6,639
escapecharacter(ESC),309
ESP,603,1000
AHprotocol,1001
authenticationdata
field,1001

1118 INDEX
ESP-Cont.
nextheaderfield,1000
padlengthfield,1000
paddingfield,1000
procedure,1000
sequencenumber
field,1000
SPIfield,1000
ESS,421
communication,422
composition,422
stations,422
ESS-transitionmobility,423
established,528
establishmentstate,349
Etag,534
Ethernet
addresstransmission,400
addressing,400
BNC,196
bridged,406
collision,401
collisiondomain,407
CRC,399
CSMA/CD,408
DA,399
datafield,399
fields,398
framelength,399
full-duplexswitched,408
implementations,402
IPv6address,570
length/typefield,399
MACcontrolsublayer,409
MACframe,398
MACsublayer,409
maximumframe
length,399
minimumdatalength,399
multicastaddress,400
multicasting,636
networklength,402
preamble,398
SA,399
SFD,398
sharedcapacity,406
slottime,401
switched,407
thick,403--405
thin,404
unicastaddress,400
Ethernetaddress,46
Eudora,830
Eve,932
excessburstsize.
SeeBe
exclusiveOR.
SeeXOR
exponentialfunction,1050
exponentialincrease,769
exposedstation,429,431
extendedaddress,
521
ExtendedASCII,1029
extendedserviceset.
SeeESS
extensionheader,602
authentication,602
destinationoption,603
ESP,603
fragmentation,602
hop-by-hopoption,602
sourcerouting,602
externalBGP(E-BGP),677
extremelyhighfrequency.
SeeEHF
F
fall-back,249
fall-forward,249
FastEthernet,397,409
autonegotiation,409
backwardcompatibility,409
encoding,411
MACsublayer,409
physicallayer,410
fastretransmission,732
faultidentification,10
faultisolation
ring,12
faultmanagement,
875
isolatingthefault,875
performance
management,876
proactive,876
reactive,875
subsystems,875
FCC,
205,477
address,1061
FCS,342
HDLC,342
PPP,348
FDM,162
applications,167
carrier,162
cellulartelphone,167
channels,162
circuit-switched
network,214
FDMA,384
guardbands, 163
implementation,167
OFDM,433
process,163
telephonesystem,165
TV,167
FDMA,383,470,473,478
FDM,384
FECN,521
receiver,773
FederalCommunications
Committee.
SeeFCC
Feistel,942
DES,
941
FHSS,181
bandwidth,182
bandwidthsharing,183
Bluetooth,437
wireless,432
fiber,168,491
fibernode,257
fiber-opticcable,192
bandwiddth
capabilities,491
trunk,242
FIFOqueueing,776
leakybucket,778
priorityqueueing,777
fifthharmonic,
68
filetransfer
problems,840
filetransferprotocol.
SeeFrP
filter
localloop,252
filtering,448
FINsegment,
727~728
FIN+ACKsegment,728
final,343
fingerprint,965
firewall,
1021
packetfilter,1022
proxy,1023
firstharmonic,68,77
fixedfilterstyle,784
flag
character-oriented
protocol,308
flagfield
HDLC,342
flat-topsampling, 121
flickering,903
flooding,667
multicastdistancevector
routing,686
RPF,686
flowcharacteristics,775
flowclass,776
flowcontrol,38,307,311,
701,720
buffer,311
concept,
311
congestion,623
datalinklayer,
311
FrameRelay,773
HDLC,343
inIF,623
PPP,348
receiver,
311
SCTP,742,748
TCP,715
transportlayer,37,
701
UDP,713
flowlabel,597,600
real-timetransmission,
601
rulesforuse,601
flowspecification,780-781
FM,153
bandwidth,154
FMradio,71,167
bandwidth,167
footprint,480
LEO,484
forums,
20~21
forwarderrorcorrection,269
forwardexplicit
congestionnotification.
SeeFECN
forwardsignal,768
forwarding,647-648
classlessaddrressing,650
forwardingtechniques,648
four-dimensionalfive-level
pulseamplitude
modulation.
See4D-PAM5
Fourieranalysis,67,
74,1046
Fourierseries,1046
Fouriertransform,1048
four-wayhandshake,
722,744
FQDN
DNSserver,800
FRAD,522
FrameRelay,522
fragmenation
fragment
ofa
fragment,593
fragmentation,589,602,747
checksum,
591
definition,590
donotfragmentbit,591
example,591
fieldscopied,590
flagsfield,
591
fragmentationoffset,591
headerfields,
591
ICMPerrormessage, 591
identificationfield,591
IPv6,639
morefragmentbit,
591
offset,591

reassembly,590
reassemblysteps,593
SCTP,747
wireless,426
frame,35,307,342,519,521,
773-774
Bluetooth,439
HDLC,341
MPEG,907
TDM,170
video,902
framebursting,413
framechecksequence.
SeeFCS
framelength
Ethernet,399
fraInenetwork,523
framesize,524
FrameRelay,227,517
accessrate,787
addressfield,520
architecture,518
BC,787
Be,788
BECN,521
burstydata,518
CIR,787
commandresponse
bit,521
congestion,521
congestionavoidance,773
congestionsituation,774
cost,518
datalinklayer,520
data rate,518
discardeligibilitybit,521
DLCI,519
extendedaddressbit,521
FECN,521
flowcontrol,773
FRAD,522
frameformat,520
framesize,518
layers,
518-519
LMI,522
QoS,787
switchtable,519
userrate,788
virtualcircuitnetwork,519
YOFR,522
FrameRelayassembler/
disassembler.
SeeFRAD
framesize
CSMAlCD,374
frametag,462
framenetwork
delay,524
framing,307,396
fixed-size,308
MAC,397
variable-length,308
framingbit,
J75
frequency,60, 62,121,
142,153
AM,153
asrate
ofchange,62
ASK,143
carriersignal,143
cellulartelephony,467
extremes,62
FM,154
high,62
infinite,62
inverse,60
low,62
non-periodicsignal,74
periodicsignal,74
PM,155
PSK,148
sinewave, 65
units,61
wavelength,64
zero,62
frequencyband
satellite
communication,480
frequencydivisionmultiple
access.
SeeFDMA
frequencyhoppingspread
spectrum.
SeeFHSS
frequencymasking,904
frequencymodulation.
SeeFM
frequencyshiftkeying.
SeeFSK
frequency-division
mUltiplexing.
SeeFDM
frequency-domainplot,
65
FSK,142,144
frequency,146
FTP,840,852-853
anonymousFTP,844
ASCIIfile,842
attributes
of
communication,842
binaryfile,842-843
block mode,843
clientcomponents,840
clientdefinitions,842
communication,
841
compressedmode,843
connections,840
controlconnection,
840-841
dataconnection,840-842
datastructure,842
fileretrieval,842
filestorage,842
filestructure,843
filetransfer,843
filetype,842
HTTP,861
NYT,841
pagestructure,842
port,1065
ports,840
recordstructure,842-843
sendingadirectoryorfile
name,842
servercomponents,840
textfile,843
transmissionmode,843
fulldomainname,799
full-duplex,7,34
Seeduplex
full-duplexservice,718,738
FullyQualifiedDomain
Name.
SeeFQDN
fundamentalfrequency,
68
G
G.71,924
G.723.1,924
G.723.3,903
G.729,903
gammaray,192
gap
asynchronous
transmission,133
gatekeeper,924
gateway,923
gatewaylink(GWL),484
G-Back-N
sendersite,328
generalheader
SCTP,743
generalquerymessage
generator,272, 278, 282,953
CRC,285
examples,297
generatorpolynomial,294
genericdomain,804
firstlevel,805
mapping,807
GEOsatellite,
480-481
geographicalrouting,655
geosynchronousorbit,481
geosynchronoussatellite,481
GETmessage,909-911
GFSK,437
GIF,857
INDEX 1119
GigabitEthernet, 397,412
carrierextension,413
encoding,415
framebursting,413
implementation,414
MACsublayer,412
mediumaccess,412
networklength,413
physicallayer,414
traditional,413
gigabitLAN
4D-PAM5,
113
globaladdress,222
globaladdressing,549
GlobalPositioningSystem
(GPS),481
GlobalSystemforMobile
Communication.
SeeGSM
Globalstar,486
Go-Back-N,324
acknowledgment,327
design,327
receiversite,330
receivewindowsize,328
sendwindowsize,328
senderslidingwindow,324
sequencenumber,324
timer,326
Go-Back-NARQ
Stop-and-WaitARQ,331
Go-Back-Nwindow,766
Gopher,853
port,1065
governmentregulatory
agencies,20
GPS,482
graded-indexmultimode
opticalfiber,199
grafting,689
groundpropagation,203
antenna,203
group,166
bandwidth,166
groupaddress,679
groupid,632
group-sharedtree,684
GSM,472,903
guardband,163,383
jumbogroup,166
telephonesystem,166
guardtime,384
guestpassword,844
guidedmedia,192
conductor,192
definition,192
fiber-opticcable,192

1120 INDEX
H
H.225,924
H.245,924
H.248,736
H.323,736,920,923
half-close,
727-728
half-duplex,6,34
Hamming,280
Hammingcode,280
performance,283
Hammingdistance,274
error,275
minimum,274
handoff,469
handshaking
wireless,425
hardhandoff,
469
hardstate,784
harmonics,1047
hashalgorithm,967
hashfunction,965
criteria,966
MAC,969
weakcollision,967
hashing
AHprotocol,999
HDB3,119
HDLC,340,346
addressfield,342
controlfield,342
definition,340
errordetection,342
flagfield,342
frameformat,342
frametypes,341
informationfield,342
LLC,396
NRM,340
stationaddress,342
synchronizationpattern,342
transfermodes,340
HDSL,255
2BIQencoding,255
HDTV,73
headend,256
header,32
cell,528
CGI,859
SCTP,740,743
headererror,624
headertranslation,605
HEC,534
hexadecimalcolon
notation,567
hexadecimalsystem,
1037,1039
tobinary,1042
weightandvalue,1039
HF,204
HFC,256
bands,258
bandwidth,257
datarate,
258-259
downstreamdata,258
downstreamsharing,259
modulation,258
sharing,259
transmissionmedium,256
upstreamdata,258
upstreamsharing,259
videoband,258
hiddenstation,423,429
hierarchicalnamespace,798
hierarchicalrouting,653
hierarchy
nameserver,802
highbitratedigitalsubscriber
line.
SeeHDSL
high-densitybipolar3-zero.
SeeHDB3
High-levelDataLink
Control.
SeeHDLC
high-rateDSSS.
SeeHR-DSSS
HMAC,970
hopcount,658
RIP,665
hop-by-hopoption,602
jumbopayload,602
Padl,602
PadN,602
payload,602
homantenna,206-207
host
routingtable,624
hostfile,798
hostid,553
host-to-hostdelivery,
579,703
host-to-hostprotocol,
44
Hotmail,839
housevoltage,
59
HR-DSSS,434
HTML,852,855
anchor,857
attribute,856
browser,856
example,855
graphicimage,857
markuplanguage,855
tag,856
HTTP,839,852-853,861,
909-911
body,866
client,861
embeddedcommands,861
entityheader,866
FrPsimilarity,861
generalheader,864
header,864
headercategories,864
messageformat,861
MIME,861
port,1065
proxyserver,868
requestheader,865
responseheader,865
retrievalExample,866
server,861
SMTPsimilarity,861
statuscode,863
statusphrase,863
transaction,861
version,863
WWW,861
hub,10
humanvoice,69
hybridnetwork,1005-1006
IPaddress,1006
hybrid-fiber-coaxialnetwork.
SeeHFC
HyperTextMarkup
Language.
SeeHTML
HypertextTransferProtocol.
SeeHTTP
I
IAB
address,1062
IANA,705
ICANN,561,811
address,1062
ICMP,43,621
checksum,626
checksumfield,622
codefield,622
datasection,622
echorequestandreply
messages,625
errorcorrection,622
errorhandled,622
errorhandling,
44
errormessage,622
errorreporting,622
error-reporting
message,621
ICMPtypefield,621
IPheader,623
loop,
624
messageformat,621
messagetypes,621
messages,
44
modifications,597
nongeneration
of
message,622
parameterproblem
message,624,639
portnumbers,623
purpose,622
querymessage,
621,625
redirectmessage,624
routersolicitationand
Advertisement,626
sourcequench
message,623
timeexceeded
message,624,639
timestampmessages,
626
ICMPv6
comparedtoICMPv4,
638-639
destinationumeachable
message,639
echorequestandreply,640
errorpacket,
638
errorreporting,638
groupmembership,640
IGMP,640
neighborsolicitationand
advertisement,640
packettoobig,639
parameterproblem,639
querymessages,639
redirection,639
routersolicitationand
advertisement,640
timeexceeded,639
idealsampling,
121
IEEE,20
address,1061
Project802,395
IEEE802.11,421
IEEE802.11FHSS,432
IEEE802.11infrared,432
IEEE802.11aOFDM,433
IEEE802.11bDSSS,434
IEEE802.15,435
IESG
address,1062
IETF,920
address,1062
ifconfig,657
I-frame,341,
343,907
IFS,377
IGMP,43,630
addressconversion,636
addressmapping,636
checksumfield,632

data-linklayer,636
delayedresponse,
633-634
destinationIP
address,635
distributingrouter,632
domain,635
encapsulation,635
Ethernetaddress,636
function,630
groupaddressfield,632
hostlist,632
hostmembership,632
ICMPv6,596,640
IPprotocol,630
joiningagroup,632
leavereport,631
leavingagroup,633
loyalmember,632
maximumresponsetype
field,
631
membershipreport,631
messageformat,
631
messagetypes, 631
monitoringgroup
membership,633
multicastrouting,685
physicalmulticast
addressing,636
protocolfield,635
queryformembership
continuation,633
querymessage,
631
queryrouter,635
routermembership,632
TTLfield,635
tunneling,637
typefield,
631
WAN,637
ILEC,242,1059
POP,243
image,5
IMAP4,838
IMP,17
impulsenoise,84
IMT-DS,478
IMT-FT,478
IMT-MC,478
IMT-SC,478
IMT-TC,478
inbox,829
incumbentlocal
exchangecarrier.
SeeILEC
index
ofrefraction,199
indirectdelivery,647
inducednoise,84
infinity
distancevector
routing,664
RIP,665
information
analoganddigital,57
types,5
informationfield
HDLC,342
InfraredDataAssociation
(IrDA),208
infraredlight,192
infraredwaves,204,207
applications,208
frequencies,207
infrastructurenetwork,421
INITACKchunk,744
INITchunk,744
initial sequencenumber
(ISN),721
initiationvector(IV),946
innerproduct,387
inputport
packetswitch,232
instability
distancevector
routing,663
instancesuffix,888
Institute
ofElectrical&
ElectronicsEngineers.
SeeIEEE
IntegratedServices.
SeeIntServ
integrity,962,964
AHprotocol,1000
checking,966
interactiveaudio/video,901
interconnectivity,20
interdomainrouting,659
pathvectorrouting,674
interexchangecarrier.
SeeIXC
interface
LSP,668
OSImodel,
31
interfacemessageprocessor.
SeeIMP
interference,193,267
interframespace.
SeeIFS
InterimStandard-95.
SeeIS-95
inter-LATAservice,243
interleaving
cellnetwork,525
framebuilding,172
synchronousTDM,171
TDM,l72
internal,235
internalBGP(I-BGP),677
InternationalDataEncryption
Algorithm(IDEA),945
InternationalStandards
Organization.
SeeISO
International
Telecommunications
Union.
SeeITU
International
Telecommunications
Union­
Telecommunication
StandardsSector.
SeeITU-T
Internet,
16~17,241
checksum,299,303
current,
17
datagramapproach, 581
datagramnetwork,221
DNS,803
draft,
21
history,17
packet-switched
network,581
standard,
21
internet,15
concept,611
definition,
17
logicaladdress, 611
packet,611,658
packetdelivery,612
physicaladdress,
611
purpose,817
InternetControlMessage
Protocol.
SeeICMP
InternetGroupManagement
ProtocoL
SeeIGMP
InternetMailAccess
Protocol,version
4.
SeeIMAP4
InternetMobile
Communication,477
Internetphone,912
InternetProtocol,579
InternetProtocolControl
Protocol.
SeeIPCP
InternetProtocolversion
4.
SeeIPv4
InternetProtocol,Next
Generation.
SeeIPng
InternetProtocol,Version
6.
SeeIPv6
Internetradio,902
Internet
TV,902
internetworklayer.
Seenetworklayer
INDEX 1121
internetworkprotocol. SeeIP
internetwork.
Seeinternet
internetworkingprotocol.
SeeIP
INTERNIC,569
interoperability,
19
InterpretAsControLSeelAC
interpreter,852
inter-satellitelink(ISL),484
intracodedframe,907
intradomainrouting,659
intra-LATAservice,242
inTransit,749
IntServ,781
DF,785
problems,784
RSVP,782
inversedomain,805
mapping,807
server,805
inversequery,805
INVITEmessage,
921
ionosphere,203
IP,17,43--44
advantages,44
analogy,583
congestion,623
connectionlessprotocol,44
datagram,44
deficiencies,621
flowcontrol,623
host-to-hostprotocol,44
lack
oferrorhandling,621
lack
ofmanagement
communication,621
networklayerprotocol,
43
protocols,43
routing,44
IPaddress,45,52,549,704
ARP,44
binarynotation,550
depletion,554
disklessmachine,618
dotted-decimal
notation,550
example,47
format,47
hierarchy,559
host,705
hostid,553
location,618
needfor,47
netid,553
notation,550
RARP,44
unique,549
universal,550

1122 INDEX
IPaddressing,549
lPpacket,647
lPSecurity.SeelPSec
lPtelephony,736
lPCP,354
packetformat,354
IPng,584
IPSec,996
modes,996
lPv4,549,579, 582,1040
addressspace,550
addressspaceproblems,
566,596
analogy,583
audioandvideo
problems,596
best-effortdelivery,583
comparedtolPv6
header,
601
comparisontolPv6,603
congestionhandling,584
connectionless,583
datagram,583
deficiencies,596
headertranslation,605
IPSec,IOO1
pairedwithTCP,583
reliability,583
securityproblems,596
transition
toIPv6,603
tunneling,604
unreliable,583
IPv4datagram
checksumfield,588
destinationaddress
field,588
destinationprotocol,587
differentiated
services,584
fragmentation,586,590
fragmentationoffset
field,587
headerlength
calculation,
586
headerlengthfield,584
hopsallowed,587
identificationfield,587
loopproblem,587
precedencesubfield,584
priority,584
protocolfield,587
reassembly,590
sourceaddressfield,588
time-to-livefield,587
TOSbitssubfield,584
totallengthfield,586
versionfield,584
IPv6,549,567,596
addressabbreviation,567
addressnotation,567
addressspace,568,597
comparedtolPv4
header,601
comparison
toIPv4,603
destinationaddress
field,599
destinationoption,603
ESP,603
extensionheader,602
extension
ofthe
protocol,597
flowlabel,598,600
flow
ofpackets,600
fragmentation,602
headerformat,597
headertranslation,605
hoplimitfield,598
IPSec,
1001
newfeatures,567,596
newoptions,597
nextheaderfield,598
PadN,602
payloadlengthfield,598
priorityfield,597,599
resourceaIlocation,597
routingprotocols,597
runsofzero,568
sourceaddressfield,598
sourcerouting,602
transitionfromIPv4,603
tunneling,604
versionfield,597
IPv6address
abbreviationexample,568
consecutivezeros,568
fields,569
lPv4,571
multicast,570
provider-based,569
spaceassignment,568
unicast,569
IPv6packet
baseheader,597
baseheaderfields,597
extensionheader,597
format,597
payload,597
lPv6traffic,599
congestion-controlled,599
flowlabel,601
noncongestion-
controlled,600
priorityassignments,599
IrDAport,208
Iridium,485
IRTF
IS-95,474,478
dataratesets,476
reversetransmission,475
ISMband,432
DSSS,432
FHSS,432
ISO,20,29
address,1062
purpose,29
ISOC
address,1062
isochronoustransmission,
135
ISP,653
addrressallocation,
561
local,653
national,653
PPP,346
regional,653
issues,454
iterativeresolution,808
ITM-2000,477
ITV,20
address,1062
ITD-T,20
ATM,523
IVA,736
IXC,1059
POP,244
IXCs,243
J
jamming,161
Java,852,860
Javaapplet,860
JavaScript,852,860
jitter,94,913
timestamp,913
JointPhotographicExperts
Group.
SeeJPEG
JPEG,857,904,908
compression,906
DCT,905
quantization,906
redundancy,904
spatialcompression,907
jumbogroup,166
bandwidth,166
jumbopayloadoption, 602
K
Kahn,Bob, 17
KDC,983
AS,984
Kerberos,983
ticket,983
Kepler's
law,479
Kerberos,983-984
operation,984
realm,986
Kevlar,200
key,932,934
private,934
public,934
RSA,949
S-box,939
secret,934
keyedhashfunction,969
L
L2CAP,440
multiplexing,441
label
countrydomain,805
genericdomain,805
LAN,395
bridge,454
connectionless,538
datarate,
14
example,14
Internet,395
interoperability,538
logicalsegments,459
media,
14
multicasting,538
physicaladdress,538
purpose,
14
size,14
switched,459
virtualconnection
identifier,538
VLAN,459
wireless,421
LANemulation.
SeeLANE
LANE,538
ATMLAN,538
client/servermodel,539
connectionless
protocol,538
LEC,539
LECS,539
LES,539
LANEclient. SeeLEC
LANEconfigurationserver.
SeeLECS
LANs,454
LATA,242,1059
communication,243
POP,244
latency,90
components,90
Latin-I,1029

LCP,350
codefield,350
PPP,350
leakybucket,777
tokenbucket,780
lease,620
leavereport,631,633
leavereportmessage
destinationIPaddress,636
LEC,242,539,1059
POP,243
LECS,539
legacyATMLAN,536
lengthfield,534
lengthindicator,533,535
LEOsatellite,480,484
lexicographicordering,889
LF,204
LI,535
light,192
linebandwidth,248
linecoding,
101
linearblockcode,277
cycliccode,284
minimumdistance,278
line-of-sight
microwaves,206
line-of-sightpropagation,
203,481
antenna,203
link,
8,36,162
OSPF,671
point-to-point,672
stub,673
transient,672
virtual,673
linkaddress,46
LinkControlProtocol.
SeeLCP
linklocaladdress,572
linkstatepacket.
SeeLSP
linkstaterouting,666
LISTcommand,842
LLC,363,395-397
framing,396
MAC,396
LMI,522
keepalivemechanism,522
multicastmechanism,522
statuschecking,522
load
delay,765
localaccesstransportarea.
SeeLATA
localaddress,571
localareanetwork. SeeLAN
localcallservice,247
localcentraloffice,242
localexchangecarrier.
SeeLEC
localInternetservice
provider.
SeelocalISP
local
ISP,19
locallogin
procedure,819
localloop,241-242
ADSL,252
bandwidth,252
filter,252
signal,247
switchingoffice,242
LocalManagement
Information.
SeeLMI
localpart,
831
LocalTalkaddress,46
locator,853
logarithmicfunction,1051
logicaladdress,36
logicaladdressing,549
logicallinkcontrol.
SeeLLC
logicalring,382
logicalstarbackbone,457
login,818
longsequence
ofOs,108
long-distancecompany,243
longestmaskmatching,653
loop
multicastdistancevector
routing,686
RPB,687
timeexceeded
message,624
loopprevention,675
loopbackaddress,
571
looseSOurceroute,602
loosesourceroute
option,596
lossycompression,906
lostframe,318
low-Earthorbitsatellite,484
low-passchannel,75,
141
band-pass,79
digitalsignal
approximation,76-77
limitedbandwidth,
75-76
widebandwidth, 75-76
LSP,667
flooding,668
generation,668
M
M2UA,736
M3UA,736
MA,365
MAA,827,838
MAC,307,363,
395,969
modules,397
StandardEthernet,398
MACaddress,579,704
MACcontrolsublayer,409
MACsublayer
FastEthernet,409
GigabitEthernet,412
wirelessLAN,423,442
mail,829
mailaccessagents.
SeeMAA
mailexchanger,
831
mailserver,825
mailbox,824,
831
managementframe,427
ManagementInformation
Base.
SeeMIB
manager,877-878
activeopen,895
database,878
function,891
remotereboot,878
Manchester
Ethernet,402
Manchestercoding,109
transition,109
man-in-the-middleattack,
955-956
mappedaddress,
571
mapping
dynamic,612
hostfile,798
logical
tophysical
address,612
static,612
marker,786
markuplanguage,855
mask,553
classlessaddressing,
556,559
mastergroup,166
masterstation,435
maximumburstsize,762
maximumtransferunit.
SeeMTU
mBlnB,115
mBnL,111
MBONE,693
MD5,967
MDC,969
media
guided,192
unguided,203
mediaaccesscontrol.
SeeMAC
INDEX 1123
mediagatewaycontrol,736
mediaplayer,909
medium,4
mediumaccess
contention,364
GigabitEthernet,412
random,364
medium-Emthorbit
satellite,481
membershipreport,
631,633
destinationIPaddress,635
MEOsatellite,480-481
mesh,9
advantages,10
backbone,10
definition,9
disadvantages,10
port,9
meshtopology,34
message,4,965
e-mail,830
messageauthenticationcode.
SeeMAC
messagedigest,965,968
secrecy,965
messageswitching,214
messagetransferagents.
SeeMTA
messagetransportpart.
SeeMTP
message-oriented
protocol,736
metafile,909
metric,658,671
OSPF,671
TOS,659
type
ofservice,671
MF,204
MFSK,147
MIB,878,886
accessingsimple
variable,887
agent,886
example,887
indexes,889
instancedefinition,888
lexicographicordering,889
objectcategories,886
objectidentifiertree,887
role,879
Tableidentification,888
mibobject,882
microswitch,234
microwaves,204,206
applications,207
band,206
frequencies,206

1124 INDEX
microwaves-Cont.
homantenna,207
IrDAport,208
parabolicdish
antenna,206
propagation,206
unidirectional,206
unidirectional
antenna,206
MID,535
MIME,
831
contentsubtype,833
content-description
header,834
content-Idheader,833
content-transfer-encoding
header,833
content-type
header,833
headers,832
NVTASCII,
831
textdatatype,833
types
ofdata,833
versionheader,832
minimumbandwidth,104
minimumHamming
distance,274-275
parity-checkcode,278
minislot,
261
mixedarchitecture
LAN,537
mixer,916
mixing,916
MLT-3,113
mobilestation(MS),467
mobileswitchingcenter.
SeeMSC
mode
ofoperation,945
modem,80,241,248-249
function,248
Shannonformula,250
standards,249
V.32,249
Y.32bis,26l
Y.33,261
Y.34bis,249
Y.90,250
Y.92,25l
modificationdetectioncode.
SeeMDC
modulararithmetic,270
modulation,
143
AM,153
analog-to-analog,
153
Bluetooth,437
DSSS,432
FHSS,432
PM,154
HR-DSSS,434
OFDM,434
PM,155
transmission,79
trelliscoding,249
modulationrate,
103
modulator
function,248
modulo2arithmetic,270
modulo2binarydivision,286
moduloarithmetic
addition,270
subtraction,270
modulus,270
monoalphabetic
substitution,935
morefragmentbit,
591
MOSPF,685
CBT,690
MotionPictureExperts
Group.
SeeMPEG
MP3,903
compression,904
datarates,904
MPEG,904,907
B-frame,908
frametypes,907
I-frame,907
P-frame,907
temporalcompression,907
versions,908
MPEGaudiolayer3,903
MSC,467
handoff,469
receivingasignal,469
transmission
ofsignal,468
MSS,769
MTA,825,834
client,834
server,834
MTP,246
MT-RJ,201
MTU,589,639
fragmentation,602
maximumlength,590
SCTP,752
valuesforprotocols,589
multicastaddress,400
IPv6,570
IPv6permanent,570
IPv6transient,570
multicastbackbone.
SeeMBONE
multicastdistancevector
routing,686
DVMRP,690
multicastlinkstate
routing,685
MulticastOpenShortestPath
First.
SeeMOSPF
multicastrouter,632
groupid,632
purpose,633
multicastrouting,682
designatedparent,688
shortestpathtree,682
source-basedtree,683
multicasting,630,678-679
applications,630,
681
dissemination,681
distancelearning,682
emulation,681
LAN,538
newsdissemination,
681
real-time,915
routerinterface,679
RSVP,782
teleconferencing,682
tunneling,693
UDP,715
unicasting,681
multidrop,8
multihomedAS,677
multi-homing,738
multilevelASK,
145
multilevelbinarycoding,110
multilevelcoding,
111
multilevelFSK. SeeMFSK
multilevelmultiplexing,174
multilinetransmission,three
level.
SeeMLT-3
multimode,199
opticalfiber,199
step-index,199
multipleaccess,363.
SeealsoMA
multipleslot
multiplexing,174
multipleunicasting,
680-681
multicasting,681
multiple-biterror,270,273
multiple-secondary
communication,438
multiple-streamdelivery,737
multiplexer,162
multiplexing,161,525,707
definition,
161
L2CAP,441
manytoone/oneto
many,
161
transportlayer,707
multiplexing
identification,535
multiplicativedecrease,
771-772
multiplicativeinverse,949
multipoint,
8,11
multipointconfiguration,34
MultipurposeInternetMail
Extensions.
SeeMIME
multistageswitch,228,
231-233
banyan,233
blocking,229
time-space-time
(TST),231
music
samplingrate,902
MUX.
Seemultiplexer
N
NAK
inpoll,
381
SelectiveRepeat
ARQ,336
nameserver
hierarchy,802
namespace,798
centralauthority,798
distribution,
801
flat,798
hierarchical,798
name-addressresolution,806
NAP,18
NAT,563
NationalInstitute
of
Standardsand
Technology.
SeeNIST
naturalbase,1050
naturalsampling,
121
NAV,425
NCP,17,353
netid,553
Netscape,830
network,7,790
categories,
13
criteria,7
definition,
17
hybrid,1006
performance,7
private,1006
reliability,8
networkaccesspoint.
SeeNAP
networkaddress,557
networkaddresstranslation.
SeeNAT
networkcapacity,765
NetworkControlProtocol.
SeeNCP

networkinterfacecard.
SeeNIC
networklayer,36,547,579,
701,795,929
atdestination,581
atrouter,581
atsource,580
logical Addressing,36
packet,36,547
responsibilities,
36
routing,36-37,547
TCPIIP,43
networklayerreliability,708
networklength
GigabitEthernet,413
networkmanagement,
873,879
accounting
management,877
configuration,874
faultmanagement,875
performance
management,876
programminganalogy,880
securitymanagement,876
networkperformance,
89,764
networksecurity,8
networkservice,582
networksupportlayers,
31
networktonetwork
interfaces.
SeeNNI
networkvirtualtenninal.
SeeNVT
network-specificmethod,648
next-hopmethod,648
NIC,400
Ethernet,400
stationaddress,
44
NIST,943
NNI,526-527
VPIlength,527
nooperationoption,594
node,
7,213
nodeidentifier,570
node-to-nodedelivery,703
noise,84
bursterror,269
coaxialcable,196
crosstalk,84
digitalservice,247
impulse,84
induced,84
thermal,84
noiselesschannel,86,
307,312
noisychannel,87,318
non-blockingswitch,230
non-coherentBFSK,147
noncongestion-controlled
traffic,
GOO
non-periodiccomposite
signal,
67-68
non-periodicsignal,58
frequency,74
nonpersistentconnection,868
non-returntozero.SeeNRZ
nonnalresponsemode.
SeeNRM
normalizederror,126
no-transitionmobility,422
NRM,340
NEtZ,106-107,144
ASK,144
BFSK,147
BPSK,149
NEtZ-I,107
synchronization,108
NRZ-Invert,107
NEtZ-L,107
baselinewandering,107
polarityswitch,108
synchronization,108
NEtZ-Level,107
internet,354
nullsuffix,800
numbersystem
comparison,1040
transformation,1041
NVT,41,819
characterset,819
controlcharacters,819
FTP,
841
TCPIIPstack,819
TELNET,819
tokens,819
Nyquist
bitrate,86
Nyquistbitrate,86
Nyquistformula,104
Shannoncapacity,
88
Nyquistnoiselesschannel,86
Nyquisttheorem,
121,902
frequency,121
o
objectidentifier,881
octalsystem,1037
octet,550
oddnumberoferrors,296
OFB,947
OFDM,433
offset,64
offsetfield,591
omnidirectionalantenna,205
on-demandaudio/
video,901
one'scomplement
arithmetic,298
one-slotframe,439
one-to-manyrelationship,936
one-to-onerelationship,935
one-wayness,966
OOK,I44
OpenShortestPathFirst.
SeeOSPF
opensystem,29
OpenSystemsInterconnection.
SeeOSI
open-loopcongestion
control,765
operatingsystem
locallogin,819
NVT,819
operation,234
opticalfiber,198
advantages,202
applications,201
ATM,523
attenuation,202
bandwidth,202
cable
TV,202
cladding,200
composition,200
connectors,200
core,200
corrosivematerials,202
cost,203
density,199
disadvantages,203
electromagneticnoise,202
expertise,203
graded-indexmultimode,
198-199
HFC,257
installationl
maintenance,203
Kevlar,200
LAN,202
light,198
lightweight,203
multimode,198
outerjacket,200
performance,
201
propagationmodes,198
reflection,198
single-mode,198-199
sizes,200
standardization,491
step-indexmultimode,198
tapping,203
INDEX 1125
unidirectional
propagation,203
WDM,168
options
endofoption,595
function,594
IPv4datagram,594
loosesourceroute,596
nooperationoption,594
recordrouteoption,595
strictsourceroute,595
timestamp,596
OPTIONSmessage,921
ORoperation,557
orbit,479
orthogonalfrequency­
divisionmultiplexing
(OFDM),433
orthogonalsequence,386,389
oscillator,
144
OSImodel,29,32,43
applicationlayer,
41
architecture,30
datalinklayer,
34
groupingoffunctions,30
header,32
layerinterface,
31
layeroverview,32
layers,
29-30,33
layerstraversed,30
networklayer,36,547
networksupportlayers,
31
organization,31
peer-to-peerprocess,30
physicallayer,30,33
presentationlayer,39
sessionlayer,39
summaryoflayers,42
TCPIIP,29,42--43
trailer,32
transportlayer,37,
701
usersupportlayers,32
OSPF,659,671
linktypes,671
metric,
671
networkasalink,671
stublink, 673
transientlink,672
virtuallink,673
outbox,829
Outlook,830
out-of-ordersegment,732
outputfeedbackmode.
SeeOFB
output port
packetswitch,232
outstandingframe,325

1126 INDEX
p
packet,658
SCTP,739
packetformat
SCTP,742
packetpayloadtype,533
packetpriority,599
packetswitch,224
components,232
outputport,233
switchingfabric,233
packetswitching,214
IPv4,583
packettoobig,639
packet-filterfirewall,1022
packet-switched
network,214
Pad1option,602
padding,587
AHprotocol,999
chunk,743
end
ofoptionoption,595
Ethernet,399
RTP,918
PadN,602
page,852
paging,469,475
PAM,121
PAP,352
parabolicdishantenna,206
paralleltransmission,
131
parameterproblem
message,624
ICMPv6,639
parity-checkbit,282
parity-checkcode,278
parkedstate,435
PartiallyQualifiedDomain
Name.
SeePQDN
PASScommand,844
passiveopen,723
password,352
PasswordAuthentication
Protocol.
SeePAP
path
virtual-circuit
network,222
pathattribute,677
non-transitive,677
ORIGIN,677
transitive,677
pathattributes
AS]ATH,677
NEXT-HOP,677
pathmessage,782
pathMTUdiscovery
technique,602
pathvectorrouting,674
loops,675
policyrouting,676
sharing,675
P-box,939
peF,423,425
AP,425
repetitioninterval,426
PCFIFS.
SeePIFS
PCM,121
bandwidth,128
coding,127
decoding,127
filter,128
sampling,
121
PCS,477
PDU
LLC,396
peakamplitude,59
peakdatarate,762
peer-to-peerprocess,30
perceptualencoding,903
performance,7
checksum,
301
Hammingcode,283
performance
management,876
capacity,876
responsetime,876
throughput,876
traffic,876
period,58,
60,479
example,60
inverse,60
units,
61
periodicanalogsignal,59
periodiccomposite
signal,67
periodicsignal,
58-59
frequency,74
periodicupdate,663
permutation
finalDES,
941
initialDES,941
permutationbox.
SeeP-box
persistencemethod
I-persistent,372
non-persistent
approach,372
p-persistent,373
persistencemethods,372
persistentconnection,868
personalareanetwork
(PAN),435
PersonalCommunications
System
(peS),477
P/Fbit,343
P-frame,908
Phase,155
phase,142,153
AM,153
ASK,143
definition,
63
example,64
FM,154
FSK,146
offset,64
PM,155
PSK,148
sinewave, 65
phasemodulation. SeePM
phaseshift,
63
phaseshiftkeying.
SeePSK
PHP,859
physical,520
physicaladdress,
45-47,
52,612
ARP,44
authority,46
needfor,612
RARP,44
sizeandformat,46
physicallayer,33,55
ATM,529
bitrepresentation,33
bitsynchronization,34
circuitswitching,215
datarate,34
Ethernet,397,402
FrameRelay,520
function,33
lineconfiguration,34
OSImodel,30
purpose,33
signals,57
tasks,55
TCPIIP,43
topology,34
transmissionmedia,
191
transmissionmode,34
wireless,432
physicallayerprocessor,232
physicalringtopology,382
piconet,435
PIFS,425
piggybacking,312,339,343,
720,722
example,345
Go-Back-NARQ,339
wirelesstransmission,426
pilotchannel,475
PIM,692
PIM-DM,692
PIM-SM,692
pipelining,323
pixel,S,
71,903,907
plaintext,932
plane,1030
PLAYmessage,
911
playbackbuffer,914
PM,153
pointcontroller,426
pointcoordinationfunction.
SeePCF
pointofpresence.
SeePOP
pointerquery,805
point-to-point,8,
10
definition,8
mesh,9
point-to-point
configuration,34
point-to-point
connection,213
point-to-pointlink,672
Point-to-PointProtocol.
SeePPP
poisonreversed,664
polarcoding,107
polarwith8-zerosubstitution.
SeeB8ZS
policyrouting,676
poll,343,381
polling,380
poll,
381
select,381
polyalphahetic
substitution,935
polynomial,
291
addition,291
characteristics,297
CRC,291
division,292
multiplying,292
shifting,292
subtracting,
291
POP,243
POP3,838
port,705
portaddress,49
portnumber,704
ephemeral,704
ICMP,623
process,705
well-known,705,709
PostOfficeProtocol,
version
3.SeePOP3
POTS,
241
power,192
satellite,480

PPM,432
PPP,346
addressfield,348
authentication,352
authenticationstate,349
controlfield,348
deadstate,349
establishmentstate,349
flagfield,348
frame,348
ISP,346
LCP,350
multilink,355
multiplexing,350
networkingstate,349
openstate,350
optionnegotiation,
351
payloadfield,348
protocolfield,348
terminationstate,350
transitionstates,349
PQDN
suffix,800
preamble,398
predictedframe,907
predictiveencoding,903
presentationlayer,39
compression,
41
encryption,40
responsibilities,40
translation,40
primary
Bluetooth,435
inpolling,
381
primaryaddress,747
primaryserver,803
primarystation,340,380
priorityfield,599
priorityqueueing,776
privacy,161,962
AHprotocol,1000
privateaddress
NAT,563
privatekey,933-934,986
privatenetwork,
1005-1006
Ipaddress,1006
privateuseplane
(PUP),1032
process-ta-process
commumcation,709,715
process-ta-process
delivery,703
Project802,395
propagationdelay,221
CSMA,370
LEO,484
propagationspeed,402
distortion,83
wavelength,64
propagationtime,90-91
circuitswitching,218
CSMA,371
latency,90
propagationspeed,90
protocol,S,19,30
definition,
19
elements,19
protocolfield
AHprotocol,999
ProtocolIndependent
Multicast.
SeePIM
protocolIndependent
Multicast,DenseMode.
SeePIM-DM
ProtocolIndependent
Multicast,SparseMode.
SeePIM-SM
provideridentifier,570
provider-based
address,569
proxy
ARP,617
proxyfirewall,1023
proxyserver,868
pruning,689
pseudoheader,712
purpose,712
pseudoterminal
driver,819
pseudoternarycoding,110
PSK,142,148,249
bandwidthexample,150
limitations,152
modern,249
withASK,152
psychoacoustics,903
publickey,933-934,986
Diffie-Hellman,954
publickeyinfrastructure
(PKI),989
public-keycryptography.
Seealsoasymmetric-key
cryptography
RSAalgorithm,949
pullprogram,828
pullprotocol,838
pulseamplitudemodulation.
SeePAM
pulsecodemodulation.
SeePCM
pulsepositionmodulation
(PPM),432
pulserate,103
pulsestuffing,174
pureALOHA,365
throughput,368
pureATMLAN,536
pushoperation,726
pushprogram,828
pushprotocol,837
PVC,528
ATM,528
establishment,528
Q
Q.931,924
QAM,142,252
bandwidth,152
trelliscoding,249
variations,152
QoS,775
admissioncontrol,780
ATM,789
Bluetooth,441
DF,785
FrameRelay,787
howtoimprove,776
IntServ,781
leakybucket,777
resourcereservation,780
switchednetwork,786
trafficshaping,777
QPSK,149-150
constellation,151
quadratureamplitude
modulation.
SeeQAM
quadraturePSK.
SeeQPSK
quality
ofservice.SeeQoS
quantization,
125,906
non-uniform,127
uniform,127
zone,
125
quantizationerror,126
quantizationlevel,126
quantizationnoise
V90,250
query
DNS,809
querymessage,625,631
destinationIPaddress,635
ICMP,
621
ICMPv4andICMPv6,640
ICMpv6,639
responsetime,633
special,633
queryrouter,634-635
questionrecord,
811
queue,764
input,764
output,764
overflowin
UDP,714
INDEX 1127
UDP,714
UDPclientsite,714
UDPoverflow,715
UDPport,714
UDPserversite,714
queuingtime,
92
QUITcommand,844
R
radiogovernment.
SeeRG
radiolayer,436
radiowave,192,204
band,205
ionospheric
propagation,203
mdiowaves,192,204
omnidirectional,205
penetration,205
RAM,231
TSI,231
randomaccess,364
mndomaccessmemory.
SeeRAM
ranging,260
RARP,43
firstboot,
44
ICMPv6,596
logicaladdress,618
physicalmachine,618
purpose,44
RARPreply,618
RARPrequest,618
RBOC,1059
RC5,945
RCH,257
realm,986
real-time
playbackbuffer,914
threshold,914
real-timeaudio,596
IPv6,567
real-timeaudio/video
example,912
real-timedata
timerelationship,912
real-timeintemctiveaudio/
video,912
Real-TimeStreaming
Protocol(RTSP),911
real-timetraffic
errorcontrol,916
mixer,916
multicasting,915
RTP,916
sequencenumber,915
TCP,916

1128 INDEX
real-timetraffic-Cant.
timestamp,914
translation,915
translator,915
UDP,916
real-timetransmission,4
Real-timeTransportControl
Protocol.
SeeRTCP
Real-timeTransportProtocol.
SeeRTP
receiveslidingwindow,324
receiver,4,300
flowcontrol,311
reservation,782
SCTPerrorcontrol,751
SCTP
flowcontrol,748
receiverwindow
(rwnd),730
recordrouteoption,595
pointer-length
comparison,595
recursiveresolution,808
redirectmessage,624
purpose,624
redirection
ICMPv6,639
redundancy,269,904
checksum,298
spreadspectrum,
181
reflection,198
refraction,198
RegionalBellOperating
System.
SeeRBOC
regionalcablehead,257
RegionalInternetService
Providersorregional
ISP.
SeeregionalISP
regionalISP,
19
regionaloffice,241
REGISTERmessage,921
registeredport,705
registrar,811
registrarserver,922
Registration!Administration!
Status(RAS),924
regulatoryagencies,
21
REI,344
relayagent,619
reliability,
7-8,775
reliableservice
SCTP,738
reliabletransportlayer
service,708
remainder
CRC,288
cycliccode,294
remotebridge,458
rendezvous,684
rendezvousrouter,684,690
selection,
691
repeater
amplifier,447
HDSL,255
hub,447
location,447
ring,12
segment,446
repetitioninterval,426
RequestforComment.
SeeRFC
RequestToSend(RTS),425
reservation,379,781
refreshing,784
reservationframe,379
reservedaddress,571
resolution,903
iterative,808
nametoaddress,806
recursive,808
resolver,806
resourceallocation,218
resourcerecord,811
resourcereservation,
226,780
ResourceReservation
Protocol.SeeRSVP
resources
circuitswitching,215
response
DNS,809
responsetime,876
Resvmessage,782
RETRcommand,842
retransmission,732
correction,269
Go-Back-N,327
retransmissionpolicy,766
retransmissiontimeout
(RTO),732
reusefactor,468
GSM,473
IS-95,476
reverseaddressresolution
protocol.SeeRARP
reversepathbroadcasting.
SeeRPB
reversepathforwarding.
SeeRPF
reversepathmulticasting.
SeeRPM
RFC,21,1063
RG,196
coaxialcable,196
ratings,196
Rijndaelalgorithm,943
ring,9,12
advantages,
12
definition,12
disadvantages,12
dual,12
repeater,12
ringtopology,34
RIP,665
port,1065
RIPNIC,569
RJ45,193
Rn,326
RNR,344
roaming,469
root,668
rootserver,803
rotarytelephone,244
rotation,939
rotationcipher,939
round,940
AES,944
roundcipher,940
AES,943
roundkey,941
router,36
address,626
areaborder,671
backbone,671
designatedparent,688
fragmentation,589
inputport,232
multicast,632
routeradvertisement
message,626
routersolicitationand
advertisementmessage
function,626
ICMPv6,640
routersolicitationmessage,626
routing
distancevector,660
example,654
multicast,682
networklayer,36-37,547
RoutingInformation
Protocol.SeeRIP
routingprocessor,233
packetswitch,232
routingprotocol,658
multicast,678
routingtable,220,224,648,
656,658
addedbyredirection
ftag,657
distancevector
routing,663
dynamic,656,658
flagsfield,656
gatewayflag,656
hierarchy,653
host-specificflag,657
interfacefield,656
linkstaterouting,667
maskfield,656
modifiedbyredirection
flag,657
networkaddressfield,656
nexthopaddressfield,656
referencecountfield,657
shortestpathtree,670
static,656
upflag,656
updatingof,624
usefield,657
RPB,687
RPF,688
RPC
port,1065
RPF,686
RPB,688
RPM,689
graftmessage,689
prunemessage,689
RR,343
RSA,949
keys,949
realisticexample,
951
Rspec,781
RSVP,
781-782
IntServ,782
message,782
reservationmerging,783
reservationstyle,784
RTCP,919
applicationspecific
message,920
byemessage,920
messagetypes,919
portnumber,920
receiverreport,920
RTP,919
senderreport,919
sourcedescription
message,920
RTO,732
RTP,916
contributor,918
contributorcount,918
extensionheader,918
header,917
marker,918
padding,918
payloadtype,918

portnumber,919
RTCP,919
sequencenumber,918
synchronization
source,918
timestamp,918
UTP,916
versionfield,917
run-lengthencoding,843
rwnd,749
RZ,108
complexity,108
disadvantage,108
signalchange,
108
values,108
S
SA,399
SACKchunk,753
sampleandhold,
121
sampling,121
PCM,121
samplingfrequency,
121
samplinginterval, 121
samplingrate,121,902
example,127
humanvoice,
127
telephonecompany,124
SAR,532
satellite,478
frequencyband,
481
geosynchronos,481
geosynchronous,481
trunk,242
satellitecommunication,478
satellitenetwork,478
satelliteorbit,479
satelliteperiod,479
sawtoothsignal,1048
S-box,939
scalability,784
DF,785
scatternet,435
scheduling,776
FIFOqueue,776
priorityqueue,777
weightedfairqueueing,777
SCO,439
scrambling,118
script
COl,859
SCTP,732
acknowledgment
number,
741
association,737
chunk,739
dataransfer,746
datatransfervsdata
delivery,747
features,736
flowcontrol,748
header,743
packetformat,742
reliableservice,738
stream,740
verificationtag,743
SCTPassociation,743
SCTPheader,740
checksumfield,743
destinationportaddress
field,743
sourceportaddress
field,743
SCTPpacket,739
vsTCPsegment,740
SDL
2BIQ,111
SDSL,255
SEAL,535
searching
classlessaddressing,655
secondary
Bluetooth,435
inpolling,
381
secondaryserver,803
secondarystation,
340,380
secrecy,964-965
secret
key,934
secret-keycryptography.
Seesymmetric-key
cryptogtaphy
secret-keyencryption
key,933
SecureHashAlgorithm.
SeeSHA-1
security,
7-8
authentication,962, 991
FHSS,183
integrity,962,991
nonrepudiation,962,
991
privacy,962, 991
securitymanagement,876
securityparameterindex.
SeeSPI
segment,
38,406,446,701,
718,721
format,
721
headerfields, 721
IPdatagram,45
size,721
TCP,45
TCP/lP,45
segmenttype,535
segmentation
L2CAP,441
segmentationandreassembly.
SeeSAR
select
addressing,381
frame,381
polling,381
SelectiveRepeat,766
SelectiveRepeatARQ,332
design,334
variables,337
window,333
windowsize,334
self-synchronization,105
semantics,19
sendslidingwindow,324
Sender,300
sender,4,773
flowcontrol,311
SCTPerrorcontrol,752
SCTPflowcontrol,749
sequencenumber,318,324,
532,535,719,914
ICMP,623
range,318
sequencenumberfield,318
sequencenumber
protection,532
serialtransmission,131-132
advantage,132
classes,
131
conversiondevice,132
types,132
server,704
primary,803
root,803
secondary,803
UDPqueue,714
WWW,852
serverprogram,705
portnumber,705
serviceclass,781,789
controlled-load,782
guaranteed,781
servicetype.
SeeTOS
service-pointaddress,
38,701
service-pointaddressing,38
service-typelimitation,784
DF,785
SessionInitiationProtocol.
SeeSIP
sessionkey,952
TGS,984
sessionlayer,39
dialogcontrol,39
INDEX 1129
responsibilities,39
synchronization,39
setup,215
virtual-circuitnetwork,
221,223
SETUPmessage,
911
setuprequest,224
SFD,398
S-frame,341,343
SHA-I,967
Shannon,87
Shannoncapacity,87
example,87
noisychannel,87
Nyquistformula,
88
telephoneline,87
shaper,786
sharedexplicitstyle,784
shared-grouptree
CBT,691
sharing,
661
distancevector
routing,
661
pathvectorrouting,675
sheath.196
SHF,204
shieldedtwisted-pair,193
shift,1044
shiftcipher,936
shiftkeying,143
shiftregister,290
shortinterframespace
(SIFS),425
shortest pathtree,668
linkstaterouting,667
multicastrouting,682
root,668
routingtable,670
unicastrouting,682
SI,739
SIFS,425
signal
amplitude,59
analoganddigital,58
aperiodic,58
CDMA,388
compositeperiodic
analog,59
degradation,12
non-periodic,58
periodic,58
types,
95-96
signalbandwidth,248
signalelement,
102,142
signallevel,86
signalpoint,245

1130 INDEX
signalrate,103
2B1Q,111
datarate,103
Manchester,110
NRZ-IandNRZ-L,108
worstcase,103
signaltransportport,245
signalingconnectioncontrol
point,246
SignalingSystemSeven.
SeeSS7
signal-to-noiseratio.
SeeSNR
simpleandefficient
adaptationlayer.
SeeSEAL
simpleciphers,938
SimpleMailTransfer
Protocol.See
SMTP
SimpleNetworkManagement
Protocol.See
SNMP
simplestprotocol,312
algorithm,314
design,313
receiversite,314
sendersite,314
simplex,
6,34
simultaneousopen,725
sinewave,59,1043
characteristics,59,
65,142
frequency,60
horizontalshift,1044
period,60
verticalshift,1045
single-biterror,
267-268,294
example,268
frequency,268
two,295
single-mode,199
density,199
distortion,199
opticalfiber,199
single-secondary
communication,437
single-stageswitch
blocking,229
SIP,736,920
addresses,921
messages,921
modules,921
tracking,922
sitelocaladdress,572
skypropagation,203
ionosphere,203
slavestation,435
slidingwindow,324
slottime,401
collision,401
propagationspeed,402
slottedALOHA,369
throughput,369
vulnerabletime,369
slowstart,769,868
slowstartthreshold,770
SMI,881
ASN.1,882
BER,884
datatype,881
encoding,884
encodingmethod,881
functions,881
objectidentifier,
881
objectname, 881
objectrepresentation,882
objecttype,882
objects,881
role,879
sequence
ofstructured
type,883
sequencestructured
type,883
simpledatatype,882
simpletype,883
simpletypeexamples,883
structureddatatype,882
structuredtype,883
treestructure,882
SMTP,834
clientcommands,835
commands,835
concept,834
HTTP,861
mailtransferphases,837
port,1065
responses,
835-836
Sn,319,325
SNMP,877,891
agent,877
agentdatabase,878
BER,893
clientprogram,878
client/server
mechanism,897
concept,877
data,893
errorindexfield,893
errorstatusfield,893
errortypes,893
format,892
function,877
GetBulkRequest,892
GetNextRequest,
891
GetRequest,891
header,893
InformRequest,892
managementbasics,878
manager,877-878
messageelements,893
PDU,891
port,1065
report,892
requestID,892-893
response,892
role,878
securityparameters,893
serverprogram,878
SetRequest,892
tag,893
trap,892
UDPPORTS,895
VarBindListfield,893
version,893
SNMPv3,893
security,897
SNMPv2,897
SNR,84
decibel,84
high,84
indB,
88
low,84
Shannoncapacity,
87
SNRdB,126
socketaddress,706
IPheader,706
pair,706
portnumber,706
softhandoff,469
IS-95,477
softstate,784
SONET,530
ATM,530
byteinterleaving,504
video,903
WDM,168
sourceaddress.SeeSA
sourcequenchmessage,
623,639
sourceroutingbridge,453
sourceroutingextension
header,602
sourceserviceaccesspoint
(SSAP),396
source-basedtree
multicastdistancevector
routing,686
space,
231
space-divisionswitch,227
advantage,231
time-division,231
spanningtree
algorithm,
452
spatialcompression,907
speakernode,674
initialization,674
specialquery
message,633
spectrum,154-155
speed
oflight,65
SPI,999
splithorizon,664
splitter,254
cableTV,256
splitterlessADSL,254
spreadspectrum,180
bandwidth,181
spreadingprocess,
181
spreading,161
squarewavesignal,1046
SREJ,344
SS7,218,245
datalinklayer,246
networklayer,246
physicallayer,246
transportlayer,246
upperlayers,246
SSN,739
ssthresh,770
ST,535
staircasesignal,130
StandardEthernet,397
standards,19
categories,20
creationcommittees,20
needfor,
19
ratification,21
standardsorganizations, 20
star,9, 11,24
advantages,10
centralcontroller, 10
disadvantages,11
star-ringtopology,382
startbit
asynchronous
transmission,133
startframedelimiter.
SeeSFD
state
multicastrouting,685
staticdatabase,620
staticmapping,612
limitations,612
overhead,612
staticrouting,655
staticroutingtable,655
statictable,658
stationaddress,44

statisticalTDM,179
addressing,179
bandwidth,180
slotsize,180
synchronizationbit,180
step-indexmultimode,199
stopbit
asynchronous
transmission,133
stop-and-wait,315
design,315
receiversite,317
sendersite,315
Stop-and-WaitARQ,318-
319
design,319
efficiency,322
Go-Back-N,331
receiversite,
321
sendersite,320
STORcommand,842
STP,193
straightpermutation,940
straight-tipconnector
(ST),201
stream
definition,45
SCTP,740
streamdelivery,716
streamidentifier.
SeeSI
stream
ofbits,55
streamsequencenumber.
SeeSSN
streaming,909
streamingliveaudio!video,
901,912
streamingserver,910
streamingstoredaudio!
video,
901
streamingserver,910
streamingserverand
RTSP,911
webserver,909
webserverandmeta
file,909
streamingstoredaudio!
visual,908
strictsourceroute,602
strictsourcerouteoption,595
concept,595
rules,596
strongcollision,967
stubAS,676
subblock,559
subnet
classlessaddressing,559
subnetidentifierfield,570
subnetmasking
ICMPv6,640
subnetting,554,647
SubscriberChannel
Connector(SC),
201
subscriberidentifier,570
substitution,935
monoalphabetic,935
substitutionbox.
SeeS-box
substitutioncipher,935
S-box,939
suffix,800
supergroup,166
supernet,554
supervisoryframe.
SeeS-frame
supplementaryideographic
plane(SIP),1032
supplementarymultilingual
plane(SMP),1032
supplementaryspecialplane
(SSP),1032
SVC,528-529
ATM,528-529
switch,37,2l3,233,408
banyan,233
Batcher-banyan,235
bridge,408
crossbar,228,233
logicalstarbckbone,457
multistage,228
non-blocking,230
space-division,227
structure,227
telephonenetwork,242
time-division,230
time-space-time
example,231
two-layer,454
switchedbackbone,457
switchedEthernet,407
switched/56,248
subscriber,248
switching
concept,213
example,213
methods,214
needfor,213
nodes,213
space
vstimedivision,231
switchingfabric,232-233
packetswitch,232
switchingoffice,241-242
switchingtable,224
symmetricdigitalsubscriber
line.
SeeSDSL
symmetrickey
Diffie-Hellman,952,955
symmetric-keycryptography,
932-933
SYNfloodingattack,725
SYNsegment,724
SYN+ACK,724
synchronization
asynchronous
transmission,133
blockcoding,115,117
bytelevel,133
clock,105
example,105
IS-95,474
NRZ-I,108
NRZ-L,108
TDMA,384
synchronizationpoints,39
synchronousconnection­
oriented(SCO)
link,439
synchronousTDM,169
datarate,170
frame,170
synchronoustransmission,
131,134
advantage,135
example,134
grouping
ofbits,134
receiverfunction,134
synchronization,134
syndrome,279
Hammingcode,282
syntax,
19
T
Tline,177
digitaltransmission,177
T-lline,177
capacity,178
datarate,178
frame,177
overhead,177
synchronizationbit,177
table
virtual-circuit
network,223
tablelookup,233
tag
format,856
tandemoffice,241
tandemswitch,243
POP,243
tangent,1046
tap,
11,256
TCB,745
INDEX 1131
TCP,17,45,583,703,708
andIPv4,
583
buffer,717,725
checksum,722
circularbuffer,717
connection-oriented
protocol,723
DNS,812
encapsulation,723
errorcontrol,731,
751
full-duplex,718
fUll-duplexmode,723
function,45
ICMP,623
OSImodel,42
ports,1065
pseudoheader,722
pushbit,726
pushoperation,726
pushingdata,725
real-timetraffic,916
reliableservice,719
segment,718,
721
segmentre-ordering, 45
segmentation,45,843
sequencenumber,45
SIP,920
streamdelivery,716
streamtransport
protocol,45
streamingliveaudio!
video,912
stream-oriented
protocol,726
transportlayerprotocol,43
urgentdata,726
vsSCTP,736
well-knownport
number,709
TCPheader
acknowledgmentnumber
field,72l
checksumfield,722
controlfield,722
destinationportaddress
field,721
headerlengthfield,722
optionsfield,723
reservedfield,722
sequencenumber
field,72l
sourceportaddress
field,72l
urgentpointerfield,723
windowsizefield,722
TCPsegment
vsSCTPpacket,739

1132 INDEX
TCP/IP,43
addresses,45,52
applicationlayer,42,45
applicationlayerandOSI
model,45
datalinklayer,43
filetransfer,840
hierarchicalstructure,43
hierarchy,43
Ip,582
networklayer,
43
NVT,819
OSImodel,29,
42--43
physicalanddatalink
layers,43
physicallayer,43
standardfiletransfer,840
transportlayer,43--44
UDP,45
TCPIIPprotocolsuite, 42
TDD-TDMA,437
TDM,162,
169
applications,179
circuit-switched
network,214
concept,169
datarate,170
dataratemanagement,173
emptyslot,173
framesynchronization,175
framingbit,175
TDMA,385
timeslot,169
TDMA,
383-384,473,478
Bluetooth,437
TDM,385
teardown
virtual-circuitnetwork,
221
TEARDOWN message,912
teardownphase,226
telecommunication,3
TelecommunicationsAct
of
1996,242,1059
teleconferencing,682
Teledesic,486
telephonecompany,218
telephonenetwork,241
analogleasedservice,247
analogservices,247
bandwidth,247
components,241
datatransfer,245
digitalservice,247
signaling,245
signalingsystem,244
telephonesubscriber
line,80
telephonesystem
analogswitched
service,
165
hierarchy,166
multiplexing,
165
telephoneUSerport,246
telephonysignalling,736
TELNET,817-849
charactermode,824
client,819
defaultmode,823
DONTcommand,822
embedding,820
linemode,824
mode,823
offertoenable,822
optionnegotiation,822
sendingcontrol
character,
821
sendingdata,820
suboptionnegotiation,822
timesharing,818
userinterface,823
WILLcommand,822
WONTcommand,822
temporalcompression,907
temporalmasking,904
Ten-GigabitEthernet,397,
416
terminal,818
terminalnetwork.See
TELNET
termination
SCTP,748
TFTP
port,1065
TGS,984
AS,984
Kerberos,984
thermalnoise,84
thickEthernet.
SeeIOBASE5
Thicknet.SeeIOBase5
thinEthernet.SeelOBase2
thirdharmonic,68
three-nodeinstability,664
three-wayhandshaking,723,
727,744
throughput,90,
764-765,876
bandwidth,90
CSMA/CD,376
load,765
pureALOHA,368
slottedALOHA,369
ticket,983
ticket-grantingserver.
SeeTGS
timedivisionmultipleaccess.
SeeTDMA
timeexceededmessage,624
latefragments,624
time-to-livefield,624
timeslot
switching,231
time-divisionmultiplexing.
SeeTDM
time-divisionswitch,
227,230
proandcon, 231
time-domainplot, 65
time-limitedsignal,1049
time-out,
731
timer,326
SelectiveRepeatARQ,339
time-slotinterchange.
SeeTSI
timestamp,913
ICMPv6,640
RTP,918
senderreport,919
timestampmessages
clocksynchronization,626
round-triptime,626
timestampoption,596
timestamprequestandreply
messages,626
time-to-live
caching,809
time-to-livefield,624
timing,
19
T-line
analogtransmission,177
burstydata,518
DSrelationship,177
E-line,178
framesize,177
multiplexing,177
token,
381
tokenbucket,777,779
leakybucket,780
meter,786
tokenbus,382
tokenpassing,381
network,382
tollcall,243
tollcallservice,247
tollfreecall,243
topology
definition,8
TOS,584
categories,585
interpretations, 584
valuesforapplication
programs,585
TP,526
traffic,876
framesize,524
trafficcontrol
FrameRelay,787
PVC,787
SVC,787
trafficdescriptor,761
trafficprofile,762
trafficshaping,777
transceiver,404
transientlink
costassignment,673
graphicalrepresentation,
673
transitAS,677
transition
strategies,603
transitionphasediagram,349
transitionstrategy,603
headertranslation,605
tunneling,604
translation,915-916
presentationlayer,40
translator,915
transmission,57,526
AMPS,470
baseband,
75
D-AMPS,471
digitalsignal,74
IS-95,474
modulation,79
serial,
131
TransmissionControl
Protocol.SeeTCP
transmissioncontrolprotocol.
SeeTCP
transmissionimpairment,
80,88
transmissionmedium,55
location,
191
physicallayer, 55
transmissionmode, 131
transmissionpaths.See TP
transmissionsequence
number.SeeTSN
transmissiontime,
91
bandwidth,91
latency,
91
transportlayer,37,
44,45,701
connectioncontrol,38
demultiplexing,707
errorcontrol,38,702
flowcontrol,38
multiplexing,707
protocols,44,708

real-timetraffic,916
reassembly,38
responsibilities,37,44,701
segmentation,38
service-pointaddressing,
38,701
TCP,45
TCPIIP,43-44
transportmode,996
transposition
DES,941
transpositioncipher,
935,937
P-box,939
trap,878
trellis-coding,249
triangulation,482
triggeredupdate,663
trigonometricfunctions,1043
trigonometricidentities,1046
TripleDES,943
2keys,943
3keys,943
trunk,
241-242
TSI
example,230
RAM,231
TSN,739
Tspec,781
TST,231
tunneling,604,637
multicasting,693
VPN,1007
TV,167
TVchannel,71
twisted-pair,192-193
applications,195
categOlies,193
components,
193
DSL,195
interference,193
LAN,
195
localloop,242
perfonnance,194
RJ45,193
telephonenetwork, 195
twists,193
twisted-paircable,193
twisted-pairEthernet.
See1OBase-T
twisting,193
two-dimensionalparity
check,280
two-nodeloop
instability,664
type
ofservice.SeeTOS
typeprefix,568
U
UA,824,828
command-driven,829
envelope,830
envelopeaddresses,830
GUI-based,829
mailformat,830
mailsummary,830
message,830
messagebody,830
messageheader,830
receivingmail,830
types,829
UDP,43,
45,703,707-708
advantages,709
checksum,712-713
comparedtoTCP,45
connectionless,709
connectionless
service,713
decapsulation,713
DNS,812
encapsulation,713
flowanderrorcontrol,713
forsimplecommunication,
715
ICMP,623
incomingqueue,714
internalcontrol
mechanism,715
managementprograms,
715
multicastingand
broadcasting,7
15
operation,713
outgoingqueue,714
portcreation,714
portunreachable,
714-715
ports,1065
process-to-process
protocol,45
queueoverflow,714
queuing,714
real-timetraffic,916
route-updating
protocols,715
RTP,916
RTPport,919
SIP,920
sizerestriction,713
SNMP,895
transportlayerprotocol,43
unreliable,709
uses,715
vsSCTP,736
well-knownport
number,709
UDPport
RTCP,920
U-frame,341,344
codes,344
connection,345
function,344
systemmanagement,341
types,344
UHF,204
ultravioletlight,192
unguidedmedia,192,203
UNI,526
VPIlength,527
unicastaddress,46,400,569
unicastrouting,682
shortestpathtree,682
unicastroutingtable
RPF,686
unicasting,630,678
multiple,680
routerinterface,679
Unicode,1029
plane,1030
unidirectionalantenna,206
uniformresourcelocator.
SeeURL
unipolarcoding,106
NRZ,106
UNls,527
universalADSL,254
unnumberedframe.
SeeU-frame
unreliabletransportlayer
service,708
unshieldedtwistedpair.
Seetwisted-pair
unspecifiedaddress,571
updating
distancevectorrouting,
662
pathvectorrouting,675
uplink,481
uploading
V90,250
URGbit,727
urgentbyte,726
URL
alias,853
anchor,857
components,853
host,853
HTIP,853
locators,853
pathname,853
portnumber,853
protocol,853
user,526
INDEX 1133
useragent.
SeeUA
USERcommand,843
userdatagram,710
checksumexample,712
checksumfield,
711
destinationportnumber
field,711
format,710
lengthcalculation,711
lengthfield,711
pseudoheader,712
sourceportnumber
field,710
userdatagramprotocol.
SeeUDP
usermobilelink(UML),484
usernetworkinterface.
SeeUNI
usersupportlayers,32
user-to-userID,535
UTP,195.
Seealsotwisted-pair
DU,535
Um,534
V
v'32,249
QAM,249
v'32bis,249
V34bis,249
v'90,250
uploading,250
v'92,251
VanAllenbelt,481
variablebitratetraffic,762
variable-lengthpacket
leakybucket,779
VC,526
cellnetwork,526
example,527
VCI,222,527
length,527
VPCswitch,529
VCO,
147
VCs,526
VDSL,255
verificationtag,740
veryhighbitratedigital
subscriberline.
SeeVDSL
verylowfrequency. SeeVLF
VHF,204
video,6,596,902
compression,904
IPv6,567
videoconferencing,912
violation,119

1134 INDEX
virtualcircuit
IntServ,781
virtualcircuitidentifier.
SeeVCI
virtualcircuitnetwork
datatransferphase,223
virtualcircuitswitching
cknow1edgment,225
virtualcircuits.SeeVC
virtualconnectionidentifier
(VCI),536
virtual
link,671
virtuallocalareanetwork.
SeeVLAN
virtualpath.SeeVP
virtualpathidentifier
(VPI),536
virtualpathidentifier.SeeVPI
virtualprivatenetwork.
SeeVPN
virtual-circuit
network,214,221
addressing,222
phases,223
visiblelight,192
VLAN
802.1Q,462
advantages,463
automatic
configuration,462
broadcastdomain,460
communicationbetween
switches,462
concept,458
configuration,461
frametagging,462
groupingbyIP
address,461
groupingbyMAC
address,461
groupingbymultiple
characteristics,461
groupingbyport
number,461
logicalLAN,459
manualconfiguration,461
membership
characteristics,461
multicast
IPaddress,461
semiautomatic
configuration,462
tablemaintenance,462
TDM,462
VLF,204
VOFR,522
PCM,522
voice
samplingrate,902
VOFR,522
VoiceOverFrameRelay.
SeeVOFR
voiceover IP,912,920
voltage-controlledoscillator.
SeeVCO
volts,59
VP,526
example,527
VPCswitch
cellrouting,529
example,529
mechanism,529
VPI,527
NNI,527
UNI,527
VPCswitch,529
VPls,527,529
VPN,1004,1007
method,1007
tunneling,1007
V-series,249
vulnerabletime,367
CSMA,371
pureALOHA,368
slottedALOHA,369
W
Walshtable,389
WAN
size,14
WATS,247
wave-divisionmultiplexing.
SeeWDM
wavelength,64
medium,64
period,
64
propagationspeed,64
W-CDMA,478
WDM,162,167
concept,167
dense,168
opticalfiber,168
SONET,168
weakcollision,967
Web
functions,853
Webpage,852
body,856
head,856
HTML,855
structure,856
tag,856
Webportal,854
Website,
851
weightedfair
queueing,777
well-knownport,705
list,715,1065
queue,714
well-knownportnumbers
SCTP,736
wideareatelephoneservice.
SeeWATS
wide-bandCDMA,478
wildcardfilter
style,784
WILLcommand,822
window
SelectiveRepeat
ARQ,334
windowsize,769
basisof,769
windowingpolicy,766
wireless,421
addressingmechanism,428
controlframe,428
CSMA/CA,423
CSMAlCD,423
dataframe,428
framecontrolfield,426
frameformat,426
frametypes,427
MAClayerframe,426
MACsublayer,423
managementframe,427
NAV,425
wirelesscommunication,203
wirelessEthernet,
421
wirelessLAN
stationtypes,422
wireless
LAN
station,422
wirelessnetwork
CSMAlCA,378
WorldWide
Web.
SeeWWW
WWW,851
concept,
851
documenttypes,854
staticdocument,855
x
Xray,192
X.25,517
X.509,989
xDSL,251
XOR,271,278,286
Hammingdistance,274
XORcipher,938-939
y
Yahoo,839
z
zone,802
zonefile,802