Computer Networking Problems and Solutions This page intentionally left blank Computer Networking Problems and Solutions An innovative approach to building resilient, modern networks Russ White and Ethan Banks Boston • Columbus • Indianapolis • New York • San Francisco Amsterdam • Cape Town • Dubai • London • Madrid • Milan Munich • Paris • Montreal • Toronto • Delhi • Mexico City • São Paulo Sidney • Hong Kong • Seoul • Singapore • Taipei • Tokyo Many of the designations used by manufacturers and sellers to distinguish their Editor-in-Chief products are claimed as trademarks. Where those designations appear in this book, Mark Taub and the publisher was aware of a trademark claim, the designations have been printed with initial capital letters or in all capitals. Product Line Manager Brett Bartow The authors and publisher have taken care in the preparation of this book, but make no expressed or implied warranty of any kind and assume no responsibility for errors Development Editor or omissions. No liability is assumed for incidental or consequential damages in Christopher Cleveland connection with or arising out of the use of the information or programs contained herein. Managing Editor For information about buying this title in bulk quantities, or for special sales Sandra Schroeder opportunities (which may include electronic versions; custom cover designs; and content particular to your business, training goals, marketing focus, Senior Project Editor or branding interests), please contact our corporate sales department at Tonya Simpson [email protected] or (800) 382-3419. Copy Editor For government sales inquiries, please contact [email protected]. Chuck Hutchinson For questions about sales outside the U.S., please contact [email protected]. Indexer Visit us on the Web: informit.com/aw Ken Johnson Library of Congress Control Number: 2017958319 Proofreader Copyright © 2018 Pearson Education, Inc. Abigail Manheim All rights reserved. Printed in the United States of America. This publication is Technical Reviewers protected by copyright, and permission must be obtained from the publisher prior Peter Welcher, Jordan Martin to any prohibited reproduction, storage in a retrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. Publishing Coordinator For information regarding permissions, request forms and the appropriate contacts Vanessa Evans within the Pearson Education Global Rights & Permissions Department, please visit www.pearsoned.com/permissions/. Cover Designer Chuti Prasertsith ISBN-13: 978-1-58714-504-9 ISBN-10: 1-58714-504-9 Compositor 1 17 codeMantra To Lori, my beautiful wife of 20 years. To Bruce Little and Doug Bookman; for challenging me to think. To Brett Bartow, Eyvonne Sharp, Phil Gervasi, and Jordan Martin; for inspiring me. May God bless each of you for the blessings you have brought into my life. —Russ White To Summerset; for enabling me to pursue the things I must chase. To Drew Conry-Murray; for commiseration, advice, and encouragement. To Robin Young and Greg Ferro; for freedom to write and moral support. To Jordan Martin; for not saying no. To the Packet Pushers community; for their multiplied voices, both frustrated and victorious. —Ethan Banks Contents Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxii Part I: The Data Plane . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 Chapter 1: Fundamental Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Art or Engineering? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 Circuit Switching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Packet Switching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Packet Switched Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Flow Control in Packet Switched Networks . . . . . . . . . . . . . . . . . 15 Fixed Versus Variable Length Frames . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 Calculating Loop-Free Paths . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 Quality of Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 The Revenge of Centralized Control Planes . . . . . . . . . . . . . . . . . . . . . . . 25 Complexity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 Why So Complex? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 Defining Complexity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 Managing Complexity through the Wasp Waist . . . . . . . . . . . . . . 32 Final Thoughts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 Chapter 2: Data Transport Problems and Solutions . . . . . . . . . . . . . . . . . . . 37 Digital Grammars and Marshaling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 Digital Grammars and Dictionaries . . . . . . . . . . . . . . . . . . . . . . . 40 Fixed Length Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 Type Length Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 Shared Object Dictionaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 vi Contents vii Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 Error Detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 Error Correction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 Multiplexing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 Addressing Devices and Applications . . . . . . . . . . . . . . . . . . . . . . 56 Multicast . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 Anycast . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 Flow Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 Windowing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 Negotiated Bit Rates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 Final Thoughts on Transport . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 Chapter 3: Modeling Network Transport . . . . . . . . . . . . . . . . . . . . . . . . . . .75 United States Department of Defense (DoD) Model . . . . . . . . . . . . . . . . 76 Open Systems Interconnect (OSI) Model . . . . . . . . . . . . . . . . . . . . . . . . . 80 Recursive Internet Architecture (RINA) Model . . . . . . . . . . . . . . . . . . . . 84 Connection Oriented and Connectionless . . . . . . . . . . . . . . . . . . . . . . . . 86 Final Thoughts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 Chapter 4: Lower Layer Transports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 Ethernet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 Multiplexing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 Error Control. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 Data Marshaling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 Flow Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 Wireless 802.11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 Multiplexing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 Data Marshaling, Error Control, and Flow Control . . . . . . . . . . 109 Final Thoughts on Lower Layer Transmission Protocols . . . . . . . . . . . . 110 Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 viii Contents Chapter 5: Higher Layer Data Transports . . . . . . . . . . . . . . . . . . . . . . . . . .115 The Internet Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 Transport and Marshaling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 Multiplexing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 Transmission Control Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128 Flow Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 Error Control. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 TCP Port Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135 TCP Session Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135 QUIC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136 ICMP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142 Final Thoughts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143 Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144 Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146 Chapter 6: Interlayer Discovery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .149 Interlayer Discovery Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150 Well-Known and/or Manually Configured Identifiers . . . . . . . . . 151 Mapping Database and Protocol . . . . . . . . . . . . . . . . . . . . . . . . . 152 Advertising Identifier Mappings in a Protocol . . . . . . . . . . . . . . 153 Calculating One Identifier from the Other . . . . . . . . . . . . . . . . . 154 Interlayer Discovery Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154 The Domain Name System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154 DHCP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156 IPv4 Address Resolution Protocol . . . . . . . . . . . . . . . . . . . . . . . . 159 IPv6 Neighbor Discovery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161 The Default Gateway Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164 Final Thoughts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167 Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168 Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169 Chapter 7: Packet Switching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .171 Physical Media to Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 Processing the Packet. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174 Switching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175 Routing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175 Why Route? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176 Contents ix Equal Cost Multipath . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178 Packet Processing Engines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183 Across the Bus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186 Crossbars and Contention . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188 Memory to Physical Media . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190 Final Thoughts on Packet Switching . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192 Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192 Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193 Chapter 8: Quality of Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .195 Defining the Problem Space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196 Why Not Just Size Links Large Enough? . . . . . . . . . . . . . . . . . . . 197 Classification. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199 Preserving Classification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203 The Unmarked Internet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206 Congestion Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207 Timeliness: Low-Latency Queueing . . . . . . . . . . . . . . . . . . . . . . 208 Fairness: Class-Based Weighted Fair Queueing . . . . . . . . . . . . . . 212 Overcongestion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214 Other QoS Congestion Management Tools . . . . . . . . . . . . . . . . 214 Queue Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215 Managing a Full Buffer: Weighted Random Early Detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215 Managing Buffer Delay, Bufferbloat, and CoDel . . . . . . . . . . . . . 216 Final Thoughts on Quality of Service . . . . . . . . . . . . . . . . . . . . . . . . . . . 218 Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219 Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220 Chapter 9: Network Virtualization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .221 Understanding Virtual Networks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222 Providing Ethernet Services over an IP Network . . . . . . . . . . . . . 226 Virtual Private Access to a Corporate Network . . . . . . . . . . . . . 227 A Summary of Virtualization Problems and Solutions . . . . . . . . 229 Segment Routing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230 Segment Routing with Multiprotocol Label Switching . . . . . . . . 232 Segment Routing with IPv6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236 Signaling Segment Routing Labels . . . . . . . . . . . . . . . . . . . . . . . . 237 Software-Defined Wide Area Networks . . . . . . . . . . . . . . . . . . . . . . . . . 239