CCENT™
®
Cisco Certified Entry Networking Technician Study Guide (Exam 640-822)
This page intentionally left blank
®
CCENT™
Cisco Certified Entry Networking Technician Study Guide (Exam 640-822) Matthew Walker Angie Walker This study/training guide and/or material is not sponsored by, endorsed by, or affiliated with Cisco Systems, Inc. in any manner. Cisco®, Cisco Systems®, CCDA®, CCNA®, CCDP®, CCNP®, CCIE®, CCIP®, CCSP®, CCVP®, CCDETM, CCENTTM, the Cisco Systems logo, and the Cisco Certified Internetwork Expert logo are trademarks or registered trademarks of Cisco Systems, Inc., in the United States and certain other countries. All other trademarks are trademarks of their respective owners. This publication and CD may be used in assisting students to prepare for an exam. Neither The McGraw-Hill Companies nor Boson Software warrant that use of this publication and CD will ensure passing any exam.
New York Chicago San Francisco Lisbon London Madrid Mexico City Milan New Delhi San Juan Seoul Singapore Sydney Toronto
Copyright © 2008 by The McGraw-Hill Companies. All rights reserved. Manufactured in the United States of America. Except as permitted under the United States Copyright Act of 1976, no part of this publication may be reproduced or distributed in any form or by any means, or stored in a database or retrieval system, without the prior written permission of the publisher. 0-07-164378-8 The material in this eBook also appears in the print version of this title: 0-07-159114-1. All trademarks are trademarks of their respective owners. Rather than put a trademark symbol after every occurrence of a trademarked name, we use names in an editorial fashion only, and to the benefit of the trademark owner, with no intention of infringement of the trademark. Where such designations appear in this book, they have been printed with initial caps. McGraw-Hill eBooks are available at special quantity discounts to use as premiums and sales promotions, or for use in corporate training programs. For more information, please contact George Hoare, Special Sales, at
[email protected] or (212) 904-4069. TERMS OF USE This is a copyrighted work and The McGraw-Hill Companies, Inc. (“McGraw-Hill”) and its licensors reserve all rights in and to the work. Use of this work is subject to these terms. Except as permitted under the Copyright Act of 1976 and the right to store and retrieve one copy of the work, you may not decompile, disassemble, reverse engineer, reproduce, modify, create derivative works based upon, transmit, distribute, disseminate, sell, publish or sublicense the work or any part of it without McGraw-Hill’s prior consent. You may use the work for your own noncommercial and personal use; any other use of the work is strictly prohibited. Your right to use the work may be terminated if you fail to comply with these terms. THE WORK IS PROVIDED “AS IS.” McGRAW-HILL AND ITS LICENSORS MAKE NO GUARANTEES OR WARRANTIES AS TO THE ACCURACY, ADEQUACY OR COMPLETENESS OF OR RESULTS TO BE OBTAINED FROM USING THE WORK, INCLUDING ANY INFORMATION THAT CAN BE ACCESSED THROUGH THE WORK VIA HYPERLINK OR OTHERWISE, AND EXPRESSLY DISCLAIM ANY WARRANTY, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. McGraw-Hill and its licensors do not warrant or guarantee that the functions contained in the work will meet your requirements or that its operation will be uninterrupted or error free. Neither McGraw-Hill nor its licensors shall be liable to you or anyone else for any inaccuracy, error or omission, regardless of cause, in the work or for any damages resulting therefrom. McGraw-Hill has no responsibility for the content of any information accessed through the work. Under no circumstances shall McGraw-Hill and/or its licensors be liable for any indirect, incidental, special, punitive, consequential or similar damages that result from the use of or inability to use the work, even if any of them has been advised of the possibility of such damages. This limitation of liability shall apply to any claim or cause whatsoever whether such claim or cause arises in contract, tort or otherwise. DOI: 10.1036/0071591141
This book is dedicated to my father, Ronald Walker (1947–2008). We miss you, Dad.
This page intentionally left blank
ABOUT THE AUTHORS
Matthew Walker is the IA Training Instructor Supervisor and a Sr. IA Analyst at Dynetics, Inc., in Huntsville, Alabama. An IT education professional for over 15 years, Matt served as the Director of the Network Training Center and the Curriculum Lead and Senior Instructor for the local Cisco Networking Academy on Ramstein AB, Germany. After leaving the US Air Force, Matt served as a Network Engineer for NASA’s Secure Network Systems, designing and maintaining secured data, voice, and video networking for the agency. He has written and contributed to numerous technical training books for Air Education and Training Command, United States Air Force, and continues to train, and write, certification and college-level IT and IA Security courses. Matt holds numerous commercial certifications, including Cisco Certified Network Professional (CCNP), Microsoft Certified System Engineer (MCSE), CEH (Certified Ethical Hacker), CNDA (Certified Network Defense Architect), and Certified Pen Test Specialist (CPTS). Angie Walker is currently the Chief Information Security Officer for the University of North Alabama, located in beautiful Florence, Alabama. Among the many positions she has filled over the course of her 20-plus years in Information Technology and Information Assurance are Manager of the Information Systems Security (ISS) Office for the Missile Defense Agency (MDA) South, as well as the lead for the MDA Alternate Computer Emergency Response Team (ACERT). She served as Superintendent of the United States Air Forces in Europe (USAFE) Communications and Information Training Center, Superintendent of the 386 Communications Squadron on Ali Al Saleem AB, Kuwait, and Senior Information Security Analyst for Army Aviation Unmanned Aircraft Systems. Angie holds several industry certifications, including CISSP, Network+ and Security+, and a master’s degree in Information Systems Management. With over nine years of IT and IA educational experience, she has developed and taught courseware worldwide for the US Air Force, as well as several computer science courses as an instructor for the University of Alabama in Huntsville, and Kaplan University in Fort Lauderdale, Florida.
Copyright © 2008 by The McGraw-Hill Companies. Click here for terms of use.
About the Tech Editor Bobby E. Rogers is a Senior Information Assurance Analyst for Dynetics, Inc., in Huntsville, Alabama. In addition to working in the Certification and Accreditation process for the U.S. government, Bobby also leads penetration testing teams for Dynetics. Bobby recently retired from the United States Air Force after almost 21 years, serving as a computer networking and security specialist, and has designed and managed networks all over the world. He has held several positions of responsibility overseeing network security in both the Department of Defense and private company networks. His duties have included perimeter security, client-side security, security policy development, security training, penetration testing, and computer crime investigation. As a trainer, he has taught a wide variety of IT-related subjects in both makeshift classrooms in tents in the desert and formal training centers. He also has taught a wide variety of courses as a part-time contractor for several nationally known training centers and a major university. Bobby is an accomplished author, having written numerous IT articles in various publications and training materials for the U.S. Air Force, and has authored several training videos on a wide variety of IT security topics. He is also a regular security article contributor for several online IT sites. He has a Bachelor of Science degree in Computer Information Systems from Excelsior College, and two Associates in Applied Science degrees from the Community College of the Air Force. Bobby’s professional IT certifications include: A+, Security+, ACP, CCNA, CCAI, CIW, CIWSA, MCP+I, MCSA (Windows 2000 & 2003), MCSE (Windows NT4, 2000, & 2003), MCSE: Security (Windows 2000 & 2003), CISSP, CHFI, CIFI, CPTS, and CEH.
Copyright © 2008 by The McGraw-Hill Companies. Click here for terms of use.
CONTENTS AT A GLANCE
1
Networking 101
..............................................................
1
2
TCP/IP
.......................................................................
31
3
Network Media and Devices
4
Ethernet Fundamentals
5
Switching: Moving Data Inside Your Network
6
Routing Essentials and IP Addressing
................................................
69
.....................................................
101
...........................
129
......................................
155
7
IP Address Subnetting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
191
8
Interfacing with Cisco Devices
.............................................
229
9
Cisco Switch Configuration
................................................
271
10
Cisco Router Configuration
................................................
315
11
WANs and WLANs
.........................................................
363
12
Applications, Security, and Troubleshooting
A
About the CD Glossary Index
..............................
403
................................................................
455
.......................................................................
461
. . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
495
ix
This page intentionally left blank
For more information about this title, click here
CONTENTS
Foreword . . . . . .................................................... xvii Preface . . . . . . ..................................................... xix Acknowledgments ................................................. xxv Introduction . ..................................................... xxvii
1
2
Networking 101 ................................................
1
Network Essentials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Network Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Network Topologies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Network Categories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The OSI Reference Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Functions and Advantages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Network Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Protocol Data Units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ✓ Two-Minute Drill . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Q&A Self Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Self Test Answers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2 2 5 8 11 11 12 17 19 23 25 28
TCP/IP ...........................................................
31
TCP/IP and OSI Reference Model Comparison . . . . . . . . . . . . . . . . . . . . . . . . . . TCP/IP History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Comparing the Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Application Layer Functions and Protocols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . DNS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . DHCP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Other Protocols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Exercise 2-1: Viewing TCP/IP Protocols in Action . . . . . . . . Transport Layer Functions and Protocols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . TCP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . UDP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Port Numbers and Multiplexing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
32 32 33 34 34 37 39 42 46 47 50 51
xi
xii
CCENT Cisco Certified Entry Networking Technician Study Guide
3
4
Internet and Network Access Layer Functions and Protocols . . . . . . . . . . . IP and ICMP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Network Access Layer Protocols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ✓ Two-Minute Drill . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Q&A Self Test . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Self Test Answers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
53 54 56 59 62 66
Network Media and Devices .................................
69
Network Media . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Media Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Copper Cabling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Fiber Cabling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Network Devices . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . NICs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Transceivers, Repeaters, and Hubs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Bridges and Switches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Routers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Security Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Putting It All Together . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ✓ Two-Minute Drill . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Q&A Self Test . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Self Test Answers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
70 70 71 77 79 79 80 81 85 87 88 92 94 98
Ethernet Fundamentals ...................................... 101 Ethernet History . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ethernet Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Frame Types and Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Media Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Data Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ethernet Standards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ✓ Two-Minute Drill . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Q&A Self Test . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Self Test Answers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5
102 103 103 107 112 116 121 122 126
Switching: Moving Data Inside Your Network ............. 129 Switch Fundamentals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Physical Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Switch Initialization Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
130 130 133
Contents
Duplex and Speed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Switch Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Switch Design Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Switch Installation and Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . Looping and STP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . VLANs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ✓ Two-Minute Drill . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Q&A Self Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Self Test Answers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6
136 137 139 139 140 142 146 148 152
Routing Essentials and IP Addressing ...................... 155 Routing Fundamentals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Routing Logic and Data Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Routed and Routing Protocols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . An Introduction to IP Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . IP Address Construction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . IP Address Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . IP Address Technologies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ✓ Two-Minute Drill . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Q&A Self Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Self Test Answers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7
xiii
156 157 162 168 168 171 174 183 185 189
IP Address Subnetting ........................................ 191 Foundation Skills . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Binary Math . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Boolean AND Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Exercise 7-1: Binary Math Skills . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Subnet Essentials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Subnet Definition and Construction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Subnet Mask Creation Steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Subnet Masks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Decoding Subnet Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Applying Subnet Masks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Subnetting Tips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Exercise 7-2: Decoding and Applying Subnet Information . . . ✓ Two-Minute Drill . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Q&A Self Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Self Test Answers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
192 192 197 198 199 200 202 206 206 208 210 214 220 223 226
xiv
CCENT Cisco Certified Entry Networking Technician Study Guide
8
Interfacing with Cisco Devices .............................. 229 The IOS and Configuration Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Boot Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Cisco IOS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Configuration Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Access Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Exercise 8-1: Router Connection Methods—HyperTerminal and Telnet . . . . . . . . . . . . . . . . . . . . . . . . The CLI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CLI Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CLI Help Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Exercise 8-2: Basic CLI Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Comparing the Router and Switch CLI . . . . . . . . . . . . . . . . . . . . . . . . . ✓ Two-Minute Drill . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Q&A Self Test . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Self Test Answers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9
230 230 234 238 241 244 249 249 252 257 258 263 265 269
Cisco Switch Configuration .................................. 271 About Cisco Switches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Physical Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Initial Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using the System Configuration Dialog . . . . . . . . . . . . . . . . . . . . . . . . . Basic Configuration Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Securing the Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Passwords . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . exec-timeout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Exercise 9-1: Basic Switch Configuration . . . . . . . . . . . . . . . . . . . . Configuring SSH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Exercise 9-2: SSH Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Interface Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . VLAN1 and the Switch IP Address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Speed, Duplex, and Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . VLAN Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Exercise 9-3: Interface and VLAN Configuration . . . . . . . . . . Port Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
272 272 274 275 276 278 281 282 285 285 287 289 290 291 292 294 297 299
Contents
xv
✓ Two-Minute Drill . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Q&A Self Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Self Test Answers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
305 309 313
10 Cisco Router Configuration .................................. 315 First Steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . About Cisco Routers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Physical Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Configuration Fundamentals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Initial Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Exercise 10-1: Basic Router Configuration . . . . . . . . . . . . . . . . . . Configure Routing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Exercise 10-2: Static Route Configuration . . . . . . . . . . . . . . . . . . Dynamic Routing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Routing Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Configuring RIPv2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Exercise 10-3: Configuring RIP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Configuring an Internet Access Router . . . . . . . . . . . . . . . . . . . . . . . . . . ✓ Two-Minute Drill . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Q&A Self Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Self Test Answers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
316 316 321 324 325 327 329 333 334 336 337 341 342 354 357 361
11 WANs and WLANs ............................................ 363 Wide Area Networking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . WAN Fundamentals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Point-to-Point Technologies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Packet Switched Technologies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Remote Access Technologies .................................... WAN Configuration Extras . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Wireless Networking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Fundamentals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Installing Wireless Networks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Wireless Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ✓ Two-Minute Drill . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Q&A Self Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Self Test Answers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
364 365 368 371 374 378 380 380 384 386 394 397 401
xvi
CCENT Cisco Certified Entry Networking Technician Study Guide
12 Applications, Security, and Troubleshooting ............... 403 Application Fundamentals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Application Needs and Quality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . telnet (SSH) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Exercise 12-1: telnet Sessions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Network Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Threats and Attacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Mitigations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Troubleshooting . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Troubleshooting Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Host Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Switch and Router Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Exercise 12-2: Using CDP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ✓ Two-Minute Drill . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Q&A Self Test . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Self Test Answers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
A
404 404 407 409 410 410 414 417 418 423 426 430 445 448 452
About the CD .................................................. 455 System Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Installing and Running the Boson NetSim LE and BEE . . . . . . . . . . . . . . . . . Boson NetSim LE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . BEE and Practice Exams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Electronic Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CertCams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Help . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Removal Installation(s) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Book Technical Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Boson Software Technical Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
456 456 456 457 458 458 458 459 459 459
Glossary ............................................................... 461 Index ................................................................... 495
FOREWORD
From Boson Software The Cisco CCENT certification requires that you learn and master a number of skills. As you read this book, incorporating Boson NetSim into your learning process will help you successfully complete the CCENT certification. The Boson NetSim Limited Edition (LE) included with this book will get you started on your way, and additional capability from the full edition is available after purchasing an upgrade. Boson NetSim will help you with the practical hands-on portion of your education, and it ensures that you not only understand the concepts of routing and switching but that you can actually configure and implement routing and switching on Cisco devices. Once you feel you have mastered both the theory and the practical labs, you can test your knowledge using the exams included with this book and the CD. You may also purchase ExSim-Max practice exams from Boson, available at http://www.boson.com. ExSim-Max is the most realistic practice exam on the market with questions that are well-written, technically accurate, and completely representative of those on the actual exam. With ExSim-Max, you can be sure you are ready to pass the real exam. Boson NetSim is the most advanced network simulator on the market for learning how to configure a Cisco router and Catalyst switch. Boson NetSim will not only help you become CCENT certified, it will actually help you learn and understand how to configure routers, switches, and networks. The Boson NetSim LE can be upgraded to the full edition for CCENT at any time at http://www.boson.com/mcgrawhill (with a valid activation code from your qualifying McGraw-Hill book). Upgrading enables all other Boson NetSim labs, commands, telnet, and advanced features. Don’t forget to complete your study with ExSim-Max practice exams. Thank you very much, and best wishes in your future studies! Boson Software http://www.boson.com
xvii Copyright © 2008 by The McGraw-Hill Companies. Click here for terms of use.
This page intentionally left blank
PREFACE
O
f course, the primary focus of our book is to help you achieve the Cisco Certified Entry-level Network Technician certification—but there’s more to it than that. We’ve provided all the background and technical knowledge in this book that you’ll need to be successful on the exam, as well as a few exercises and hands-on projects to increase your odds. Hopefully, though, we’ll also succeed in two other, secondary but just as important, goals. First, after reading through this we’d be happy to see you emboldened with confidence. Yes, we whole-heartedly believe, and would like to make sure you know, YOU CAN DO IT! Sure, certifications are hard—they’re supposed to be; if they were easy, everyone would do it—but this isn’t something you’re not capable of. This book was written in the same manner we learned the information—in a simple, easy and, yes, fun fashion. Look at it this way: If a couple of yahoos from Alabama, with four kids and two full-time jobs, can figure this stuff out, you should do just fine. Secondly, after all is said and done, we sure hope you don’t stop. CCENT is a great certification, but it’s not the end-all be-all. Instead, it should be a great beginning for you. After you pass—and you know you will—follow it up with personal practice, hands-on experience, and study. Put into play what you’ve been studying for all this time and prove you know it. Then, of course, start on your next certification—the CCNA. After you’ve completed the CCENT certification by passing the Interconnecting Cisco Network Devices (ICND) v1 640-822 exam, you’ll be (literally) halfway to a CCNA certification. The ICNDv2 640-816 exam covers the second half of the CCNA body of knowledge and is more Cisco IOS configuration-, and device-, centric. An excellent resource for studying for “part 2” is the Cisco Certified Network Associate (CCNA) Study Guide (McGraw-Hill) by Richard Deal.
In This Book This book covers all the exam objectives posted on Cisco’s web site concerning the CCNA 640-822 exam. Each chapter explores one or more of the main objectives in this list. You’ll also find much repetition from chapter to chapter since some objectives are covered across multiple chapters. The Introduction offers a breakdown of Cisco’s objectives and which chapter of this book covers each objective.
xix Copyright © 2008 by The McGraw-Hill Companies. Click here for terms of use.
xx
CCENT Cisco Certified Entry Networking Technician Study Guide
In Every Chapter Each chapter has several components designed to effectively communicate the information you’ll need for the exam: ■ Every chapter begins with the Certification Objectives. These identify the
major topics within each section on the exam, dealing with the chapter topic. Using these objective headings will help you keep track of where you are with your studies. ■ Practice Exercises, step-by-step exercises providing hands-on experience,
are found in chapters with configuration objectives. While some chapters require only knowledge and comprehension levels, other objectives require you to know how a specific configuration option is entered into the switch or router. These practice exercises are designed to reinforce the chapter verbiage and provide insight into the skills that are likely to be an area of focus on the exam. The information covered in these exercises is not simply for reading purposes—you’ll be required to perform configuration on a variety of scenario and simulation questions on the exam. Don’t fail to prepare for them by simply reading over the practice exercises—practice them and be very, very comfortable with their focus. These exercises will always work with the simulator product, produced by Boson and provided with this book, but they can be used anywhere. Practice as much as you can with the simulator and with real equipment, should you have the opportunity. ■ On the Job entries are found throughout all the chapters and are designed to
point out information and tips that will be helpful both in your day-to-day responsibilities and in studying for the exam. Please note that while these notes provide insights, tips, and otherwise interesting tidbits of information, they are also sometimes used to reinforce testable material. Don’t dismiss them as simply “neat”—some of the mistakes and real-world issues described in these notes may prove the difference in correctly answering a question or two on the exam! ■ Exam Watch notes highlight specific information within the section on
which to focus your studies. Do not rely on them totally, but be sure to read over them before the exam. ■
Remember the benefits and disadvantages of static routing, and commit Table 6-2 to memory.
An Inside the Exam entry is provided at the end of each chapter and basically summarizes the important aspects of the chapter in regards to the exam. Tips and tricks mentioned in this section will definitely help you understand what to expect on the test.
Preface
✓■ Q&A ■
xxi
The Two-Minute Drill is a full summary of the chapter, condensed and organized for quick last-minute review. The Self Test section at the end of each chapter offers questions similar to those found on the certification exams. Answers and explanations of both correct and incorrect choices are provided to assist in understanding the material.
Some Pointers This may seem strange to say, since we wrote this book and hope everyone in the networking arena gets a copy, but we’ll say it anyway: First and foremost, do not rely on this book alone to pass your CCENT exam. There’s not a book on the planet that, by itself, will fully prepare you for the test. Read this book, using the pointers we provide here to guide your study, but never forget to practice, practice, practice. The benefit of hands-on real-world experience in preparing you for the exam is immeasurable. This book is, we humbly feel, a great guide to follow in preparing for the exam, but you’ll definitely need plenty of practice outside its pages to succeed. Once you finish reading this book, be sure to do a thorough review of everything: 1. Reread all the Two-Minute Drills. These will serve as an excellent “cram” session just before the exam. 2. Reread all the Exam Watch notes. Knowing the information to satisfy each knowledge objective is one thing, but it’s only part of the battle. To be truly successful, you’ll need to know what to expect on the exam itself. Reading the Exam Watch notes will give you insights into how the information will be presented on the exam, and what to expect. If you know this upfront, you won’t be surprised on the exam, and your confidence will contribute to your success. 3. Retake the Self Test sections at the back of each chapter. Immediately after reading the chapter, give the accompanying Self Test a shot. Then, after you’re done with the entire book, go back and take each Self Test again. Facing all the questions at one time is very similar to the exam itself, and will help with your study. Please note that simply memorizing these questions and answers will NOT help you on the exam. The Self Test questions are similar to what you’ll see, but they’re not exact replicas. 4. Use the Exam Test Engine on the CD. The test engine, provided by Boson Software on the CD accompanying this book, provides plenty of questions to prepare you for the exam. You can choose to quiz yourself on all questions, much like the exam itself, or target your study by focusing on a single category.
xxii
CCENT Cisco Certified Entry Networking Technician Study Guide
Categories roughly match the chapter outline of the book, to help mark your progression. Additionally, you can also purchase extra tests from Boson Software at their web site (www.boson.com). 5. Do all the Practice Exercises in each of the chapters. You will be required to perform configuration and troubleshooting on simulators during the exam. While CCENT doesn’t go overboard with these, you’ll definitely need to be familiar with all the configuration commands and steps included in this text. Use the exercises in the book to reinforce concepts and prepare for the exam. Additionally, feel free to experiment on your own—especially if you have access to equipment. Interject problems to working environments and note various troubleshooting techniques you can use to fix the problem. The configuration of devices is a big part of the exam, but troubleshooting and examining configuration files for errors will play a large role in your success or failure. 6. There may be some simulation questions on the CCENT exam. In simulation questions, you’ll be required to perform basic configuration and troubleshooting tasks on a Cisco router and/or switch. Therefore, it is important that you have good configuration skills. Use the Practice Exercises to hone your configuration skills! You may come across a simulation scenario presenting a flawed configuration on the exam. The more you practice with the exercises and Boson’s NetSim, the easier it will be to spot these configuration errors right off the bat.
Practice Exams and the Simulator Hands-on practice and real-world experience are essential in your preparation for the exam. The practice exercises and simulator built for this book are designed with exactly that in mind—giving you hands-on experience and an opportunity to practice to your heart’s delight. The network provided in the simulator should allow you ample opportunity to see all the command and configuration options in action. The network is displayed in Figure 1, with addressing for all exercises spelled out in Figure 2. This network provides every configuration option covered in the book. As you go through the practice exercises, refer to Figures 1 and 2 to “see” how your configuration should be applied. Additionally, don’t just rely on the exercises, as written, for your study. Feel free to create your own configurations on each device. Use all the show and debug commands you want to see the IOS in action. Finally, after configuring the network to function, purposely change configuration options to see the results. Using the practice exercises and your own creativity on this network will greatly increase your odds of passing the exam.
Preface
FIGURE 1
A simulator network for practice exercises
PC-1
xxiii
PC-3
Fast Ethernet 2960-2 Switch
Serial Point-to-Point (T-line or DirectConnected in a Lab)
2960-1 Fast Switch Fast Ethernet Ethernet 2800-1 Router
Fast Ethernet
Fast Ethernet
2960-4 Switch
2800-2 Router
Fast Ethernet
2960-3 Switch Fast Ethernet
PC-4
PC-2
IP: 192.168.1.11 Mask: 255.255.255.0 Gateway: 192.168.1.1
FIGURE 2
Addressing for the network topology used for the practice exercises
PC-3
PC-1 MAC:
00-00-11-AA-BB-CC
IP: 192.168.2.10 Mask: 255.255.255.0 Gateway: 192.168.3.1 MAC:
00-00-33-AA-BB-CC
Fast Ethernet 2960-1 192.168.1.2/24
FA0/2 FA0/1
FA0/2 FA0/1
FA0/1
FA0/2 2960-2 192.168.1.4/24
FA0/3
FA0/3
FA0/2
FA0/1
FA0/3
2800-1 FA0/0: 192.168.1.1/24 S1/0: 172.16.0.1/24 (DCE)
2960-4 192.168.2.2/24
FA0/3 2800-2 FA0/0: 192.168.2.1/24 S1/0: 172.16.0.254/24 (DTE)
2960-3 192.168.1.3/24
PC-2
IP: 192.168.1.10 Mask: 255.255.255.0 Gateway: 192.168.1.1 MAC:
00-00-22-AA-BB-CC
PC-4
IP: 192.168.2.11 Mask: 255.255.255.0 Gateway: 192.168.3.1 MAC:
00-00-44-AA-BB-CC
This page intentionally left blank
ACKNOWLEDGMENTS
W
e would like to thank the following people: ■ This book would not have been possible without the support of Dynetics, Inc.,
and Matt’s supervisor, Paul Clark. Paul’s willingness to help—no matter what was asked nor when—was critical throughout this entire process. Balancing work, family, and writing is a tough business, and without the willingness displayed by Dynetics to support the effort, we never would have finished. ■ A special thanks to Bobby Rogers for providing excellent technical insight on
editing this book. Bobby’s acerbic wit and his attention to details we simply didn’t think about proved vital to the success of this project. ■ The team at McGraw-Hill (Jennifer Housh, Tim Green, Vasundhara
Sawhney, and Jody McKenzie) is due several toasts at the local establishment of their choice. The unbelievable patience and support they displayed throughout every stage of this process was nothing short of amazing. It’s been an honor and a privilege to work with such an outstanding, professional, and fun group of people. ■ Finally, there is no way this book could have ever even been started, much
less completed, without a lot of understanding and patience from our children. Faith, Hope, Charity, and Christian—thanks for putting up with us. All those nights of, “Not right now, Daddy’s writing,” are finally over! At least for now…
xxv Copyright © 2008 by The McGraw-Hill Companies. Click here for terms of use.
This page intentionally left blank
INTRODUCTION
How to Take a Cisco Certification Examination This introduction offers a host of information on your CCENT certification and prepares you for taking the actual examination. In this section, you’ll find a brief overview of Cisco’s certification program, and some guidelines on methods of preparing and studying for the exam, including what to expect on the exam itself and some simple things you can do on test day to increase your chances of passing.
Cisco’s Certification Program Cisco now has a number of certifications, ranging from entry level (CCENT) and advanced routing and switching (CCIE) to network security, wireless, and VoIP. Cisco recommends a variety of classes as training for these individual certifications, but they are not mandatory—all one need do to hold the certification is pass the appropriate test(s). With the right experience, study materials, and a good work ethic, you’ll pass any Cisco exam without necessarily attending the recommended course. Cisco is constantly changing and updating their certification requirements. For more information about Cisco certifications and exams, visit Cisco on the Web at www.cisco.com/web/learning/index.html.
Cisco’s web site is a veritable gold mine of information regarding your certification. Not only will you be referring to it for certification tracking purposes after your exam, but you can also find plenty of information to help you achieve the certification in the
first place. In addition to the objectives being tested for each exam, you will find exam-specific information, sample test questions, information on becoming certified, demonstration tutorial videos, and the latest news on Cisco certification.
xxvii Copyright © 2008 by The McGraw-Hill Companies. Click here for terms of use.
xxviii
CCENT Cisco Certified Entry Networking Technician Study Guide
Computer-Based Testing I know you’d probably prefer to be told that a certification exam actually tests your skills in a real-world hands-on environment, but unfortunately this just isn’t true. Imagine trying to ensure that a stable, secured, unchanging network is available at every test center, worldwide, for candidates attempting a certification. It simply couldn’t be—such logistics would preclude anyone from ever offering a certification—especially those as far reaching as Cisco’s certifications. To get around this, Cisco (and most vendors, for that matter) relies on a computer-based testing service, operated by Pearson Vue. Pearson Vue provides a secured testing environment in a number of facilities around the world (there’s probably a Pearson Vue test center in your own town). Tests on a Vue system are relatively straightforward and are similar from vendor to vendor. Cisco is unique in that they do not make use of the “adaptive” testing format (thank goodness). Cisco instead relies on a more traditional format, simply providing test questions in a random order and scoring participants according to their success or failure on each question. However, there is another characteristic of a Cisco test you will not find on any other vendor: Cisco does not allow you to mark a question for further review. In other words, whether you answer the question or not, once you press the “Next” button to move on, you are no longer allowed to view that question.
I cannot stress this point enough: You are not allowed to skip questions and return to them later on a Cisco exam! Most test-takers will tell you a good strategy on any exam is to skip the questions you don’t know and return to them later since many times
a question later in the exam will provide insight into those you don’t know. On a Cisco test, though, if you skip it, you miss it. Sometimes you may need to pass one over for time purposes. Just keep in mind that once it’s gone, you’ll never see it again!
Each test consists of a random set of questions pulled from an enormous pool of them. During the “beta testing” of the exam, Cisco will compile and refine a huge amount of questions for this pool. Thus, when you receive your test, it simply retrieves a unique combination of these questions to test your ability. Some are
Introduction
xxix
straightforward multiple-choice questions, while others are based on a simulator (forcing you to use your hands-on experience as well as your “book” knowledge). Cisco exams are also timed—lasting usually 75 to 90 minutes, depending on the number of questions and the particular test. The time you have remaining for your specific exam will be displayed in a small box on the corner of the computer screen. If your time elapses, the exam will be scored based on what you have answered up to that point (of course, all unanswered questions will be counted as incorrect answers). Lastly, the scoring of the test, and the feedback you’ll receive after an attempt, warrant some discussion. As soon as the exam is over, your score will be calculated and displayed onscreen for your review. It will also be passed on electronically to Cisco, for tracking purposes. Whether you pass or fail, you’ll receive a printed report from the test administrator, showing your overall score and a score for each objective the exam covered. Unfortunately, you will not receive a list of the questions you marked incorrectly.
Question Types Cisco uses many different question formats in their exams, most of which should be covered here in this section. While you’ll find a brief overview of what to expect here, your best resource on any particular exam is to talk things over with other testtakers. No, it won’t do you much good to ask exactly what’s on the exam, since each is different, but you can get an idea of what types of questions to expect. Check with Cisco’s web site for something called the Cisco Network Professionals Connection. Between this and other forums on the site, you can get a good idea of what the CCENT exam makeup will be like.
True/False Oh, I know what you’re thinking. I can sense it a mile away, and although I don’t like the idea of shattering your hopes on anything, anywhere, I am going to shut the door on this one. The simple 50-percent-chance classic true-or-false question will not be found anywhere on a Cisco exam. This is not to say that Cisco doesn’t employ true or false logic on their tests—in fact, you’ll find quite a few questions like this—just that Cisco will test your ability to determine a true or false statement or scenario using a multiple-choice question format. An example would be, “Choose the true (or false) statements from the following.”
xxx
CCENT Cisco Certified Entry Networking Technician Study Guide
Multiple Choice Multiple choice is the primary format for questions in Cisco exams. These questions may be posed in a variety of ways; however, no matter which way the question is presented, one tip will always apply on these questions: ALWAYS read the question very, very carefully. Sometimes you may understand the intent of the question perfectly, and know well what the answer is, only to wind up missing it because of a “technicality.” For example, if the question asks you to choose two answers, choose two ONLY.
Choose the Correct Answer Celebrate every time you receive one of these multiple-choice questions on the exam. This is the classic format, requiring you to choose one correct option from the four or five presented. In addition to the wording “Choose the Correct Answer,” indicating a single response, these single-answer questions will display Windows radio buttons—allowing only a single response to be entered. One final tip: If the question states, “Select the best answer,” it’s also a single-answer multiple-choice question. Choose X Correct Answers This type of multiple-choice question appears differently than the single-choice version listed earlier. On these, the question will ask you to choose X number of options, where X will be a number from 2 to (sometimes) 4. Instead of the radio buttons used before, you’ll find checkboxes used for marking answers. It’s very important to keep in mind that these questions are all-or-nothing: All the correct answers must be selected, otherwise the entire question is marked as incorrect. Additionally, the testing software prevents too many answers from being selected; if the question asks for two responses, you cannot choose three. Choose All that Apply Easily the most difficult, and unfortunately relatively common, multiple-choice question you’ll see on the exam, the choosing-all-thatapply type lets the candidate choose as many, or as few, answers as they wish. Since you don’t know how many answers the exam expects, you are at a distinct disadvantage. It’s important to note on these questions that they, too, are all or nothing enterprises: If too few, or too many, answers are given, you will miss the question.
Freeform Response You should not see any freeform response type questions on the CCENT exam. However, Cisco has surprised us from time to time on other issues, so you should at least know what to expect should they slip one in on you. A freeform response
Introduction
xxxi
question provides no choices (or help) at all. You are simply given a scenario with an empty text box and asked which command to enter. You must then type the command, precisely as it should be, into the freeform textbox provided. Obviously this is challenging and is the reason this type of question usually isn’t found on entry-level certifications. If you see one, however, be sure to type the entire command in—do not use a truncated version that would work just fine on a “real” router.
Exhibits While not actually a test question type in and of themselves, exhibits are a big part of the exam, and you should know about them upfront. You’ll find exhibits used constantly throughout your exam, with several questions sometimes referring to a single exhibit. These diagrams and pictures will normally appear in a separate window, which you can enlarge or minimize as you see fit, using a button on the screen.
Scenarios Scenario questions generally consist of one to two short paragraphs that describe a specific circumstance, network, or event, requiring you to pick the correct choice from a variety of answers. Additionally, you may sometimes find several questions referring to a single scenario (sometimes referred to as a “testlet” question). On any scenario question, pay close attention to the wording of the problem (if troubleshooting) and apply simple logic. Oftentimes, reading the question first, and then returning to the scenario, proves a useful practice in navigating the exam.
Simulations Simulation questions require you to enter a basic configuration on a Cisco switch or router, given a specific set of instructions and settings required. You’ll need to know how to access the device, navigate through the various IOS modes, enter commands, and save configurations. Additionally, sometimes these simulators have existing configurations with built-in errors that require you to troubleshoot and fix the problem. The context-sensitive help functions within the IOS are supposed to be available for you within the simulator, but don’t be surprised if it does not work exactly as you’d see it on a “live” router. For example, the simulator may force you to type certain commands completely, while allowing TAB and auto-complete on others.
xxxii
CCENT Cisco Certified Entry Networking Technician Study Guide
An important note here with this style of question is your ability to manipulate the simulator itself. In other words, knowing what configuration to enter does you no good if you cannot figure out how to enter the commands into the simulator in the first place. Before the exam begins, you will be presented with a screen asking if you’d like to become familiar with the simulator before the exam starts. Do not skip this. It does not affect your time for the exam and ensures you won’t be wasting valuable time during it figuring out how the simulator works. Additionally, for a demonstration of what the simulator is like, you can also visit www.cisco.com and browse to the certification section to find the demo. This example is very similar, but not exactly the same, as the simulator you would see on the real exam.
Studying Techniques When I’m asked, “How do I study for a Cisco exam?”, my first response seems almost out of place: To effectively study for the exam, first schedule the exam. You’re probably thinking that’s lunacy, but trust me, it’s the only way. Once your exam is scheduled, you’ll have a deadline and will be forced into studying for it. I can’t count the number of times I’ve heard students say they were planning on scheduling the exam, “after I’ve had time to study for it,” only to greet me months later with the same excuse. Let me assure you, soon-to-be fellow Cisco networking professional, you’ll never think you’re ready for it without some kind of deadline to push you. Sure, take some time to read this book (and encourage everyone you know to pick up a copy and do the same) and practice on your own, but schedule the exam as soon as you can. After reading through this book, schedule your exam no more than a month out. Spend that time studying, using the tips provided here, then just go knock it out! There are a million study tips out there, and just as many people willing to give them to you. Our suggestions are pretty simple, straightforward, and easy: Make the best use of your time available and practice, practice, practice. Time scheduling, for focused study, is the easy part—30 minutes of focused study time a day should do it. Any more than 30 minutes a day will, most likely, burn you out—any less and you’re just not willing to work for this. Additionally, you’ll be amazed at how easy it is to study during times when you’d least expect it. The principle is known as “stealing time,” and works very simply: While you’re accomplishing one task, make use of the slack time to work on another. For example, create an audio tape (or CD) of yourself asking questions and providing answers. Pop this into your vehicle on the drive to work and voilà, you’ve just added some free study time. Want another example? How about creating a cheat
Introduction
xxxiii
sheet, or a few flash cards, to keep handy in your jacket or wallet? While waiting for your lunch, sitting in the airport, or taking a break from work, bring it out and take a quick peek. There are a thousand ways to do this, but the point is simple: You can find ways to study during your day-to-day activities if you really look for them. Secondly, practice, practice, and practice some more. Experiment with both live equipment (if available) and the simulator provided with this book. Just memorizing facts and commands might, might, be enough to make it through a single exam, but it’s certainly not going to be enough in the real world. Your best bet, on both the exam and your job, is to not only know the “what” but the “how and why.” The best way to do this is to apply what you’ve read in this book on a system. Try commands out. Set up configurations that work, and then break them. Throw in weird configurations a college guy might try on Saturday night after the big game (and a celebratory adult beverage or two). Of course there’s a little humor here, but you get the point: The more you see the configuration, commands, and traffic in use, the better you’ll know how they work and why you need them. One last note on studying deals with the “dark side” of the network certification world. A wide variety of study guides and “braindumps” are available on the Internet. Many of these are legitimate vendors wishing to provide helpful insight on making you a better network professional. Others are charlatans, hoping to take your money at any cost (pardon the pun). Do not rely on a single study guide or braindump downloaded from the Internet. I can promise you, it’s NOT a copy of the Cisco exam and will do more harm than good to your studying. If you do find a practice test or study guide on the Internet, verify the answers through your own research. Simply memorizing test questions, from any resource, will NOT result in a passing score.
Scheduling Your Exam You can schedule any Cisco exam by calling Pearson Vue, or visiting their online registration web site at www.vue.com (if calling outside the United States, go to Vue’s web site to find your local number). Exams can be scheduled up to a year in advance, and can be rescheduled with 24 hours’ notice. If you miss your test date/ time, or fail to provide appropriate notice, you will lose your test fee. Payment for the exam is due upon registration with Vue and is accepted through a variety of means, credit cards being the most convenient. Vue e-mails a receipt and confirmation of your testing date, which typically arrives the same day you schedule the exam. If you need to cancel or reschedule an exam, remember to call at least one day before your exam, otherwise you’ll lose your test fee.
xxxiv
CCENT Cisco Certified Entry Networking Technician Study Guide
If this is the first time you’ve ever attempted a Cisco exam, Vue will provide a unique number for testing with Cisco. Be sure to keep this number handy and use it for every Cisco test for which you register. Additionally, address information provided when you first register is also used by Cisco to ship certificates and other related material, so make sure you get it right! You will also be required to give a valid e-mail address when registering. If you do not have an e-mail address that works, you will not be able to schedule the exam. Once you are registered, you will receive an e-mail notice containing your registration information for your scheduled exam. Examine it closely to make sure it’s correct.
Arriving at the Exam You should always arrive early for your exam, giving yourself time to relax and review last-minute key facts. While waiting for your exam, take the time to review notes, read over the Exam Watch sections of this book, and look over any cheat sheets and practice cards you have handy. Generally speaking, so long as a computer system is available, you can start your test any time before your scheduled test time. So, after your last-minute cram session, when you’re ready, you can begin. Be sure to bring two sets of identification with you to the testing center. Acceptable forms include government-issued IDs (for example, a passport or driver’s license) and credit cards. One form of ID must include a photograph. After the identification, though, you won’t need anything else. In fact, testing centers do not allow you to take anything else with you into the exam area: no books, papers, notepads, PDAs, cell phones, nothing. The test administrator will, however, provide you with a paper and pencil, or a small erasable marker board. These are to let you write notes and perform calculations during the exam. A helpful tip, though, is to hurriedly jot down any last-minute tidbits you looked at just before the exam, as soon as the administrator allows you to write. In other words, you can download everything in your brain directly to the paper or marker board before your exam ever starts. Just remember that’s the only material you’ll have to write on during the test, so leave a little room! You’ll have to return the paper (marker board) to the administrator immediately upon completion of the test. In the exam room, the exam administrator logs you in to your exam, and you have to verify that your name and exam number are correct. If this is the first time you’ve taken a Cisco test, you can select a brief tutorial for the exam software (which we mentioned before, and you should not skip). Additionally, you’ll be asked to take a survey before the exam. This does NOT count against your time, so take advantage of it and write down your notes during this survey.
Introduction
xxxv
Before the test begins, you will be provided with facts about the exam, including the duration, the number of questions, and the score required for passing. Once you click Begin Test, the clock starts ticking. The test will appear full screen, with a single question per screen. Navigation buttons allow you to move forward to the next question but, as discussed earlier, not back. The time countdown will appear in the corner and a variety of buttons may be available depending on the question asked (a “Display Exhibit” button, for example). Periodically check to ensure you’re budgeting your time wisely. Remember, once you pass over a question, it is scored immediately (you cannot return to it). Nevertheless, you don’t want to waste too much time on any one test question. Generally speaking, you’ll receive between 55 and 65 questions and will need to get at least 82–85% of them correct. Cisco does not provide specifics on either the number of questions, or the passing percentile, so you’ll never really know until the exam is finished.
The Grand Finale As soon as your exam is completed, it will be graded automatically. The actual real time that elapses between when you press Score Exam and when the results appear on the screen is just under ten seconds. In your mind, it will most likely seem like an eternity. The result of your exam is displayed showing the minimum passing score, your score, and a PASS/FAIL indicator. With some Cisco tests, the actual score isn’t displayed on the screen, only on the printed version of your test results. If you’re curious, you can review the statistics of your score at this time. Normally, though, candidates are either so elated they can’t sit still or too dejected to bother looking at the screen. Keep in mind, whether you pass or fail, Cisco does not show you the individual questions answered right or wrong. Instead, you’ll get a generic list, showing categories and your results within each one. This is also provided on the report that’s automatically printed at the exam administrator’s desk. Keep your results in a safe place and check back with Cisco’s web site over the next 48 hours to make sure your results are posted. After some time (a week or so), you’ll receive a folder in the mail from Cisco containing your official certificate and other goodies.
Retesting If you don’t pass the exam, don’t worry about it. Certification tests are, by design, very difficult and the vast majority of people who take them fail the first time.
xxxvi
CCENT Cisco Certified Entry Networking Technician Study Guide
Simply jot down those things you remember and go into the next attempt a little more educated on format and content. Additionally, the score report will help guide your study efforts, showing those areas you were weakest in. Cisco makes you wait five business days before you can sign up for another exam. During this time, continue with the study tips from before, but focus on those areas that need the most attention. When you’re ready, contact Vue and schedule another exam. You can track your current certification status by going to www.cisco.com/go/ certifications/login. You’ll need to use your Cisco testing ID number to log in.
Introduction
xxxvii
Study Guide Coverage
Ch#
Describe the purpose and functions of various network devices
Network Essentials Network Devices Switch Fundamentals Routing Fundamentals Wireless Networking
1 2 5 6 11
Select the components required to meet a given network specification
Network Essentials About Cisco Switches Routing Fundamentals
1 9 6
Use the OSI and TCP/IP models and their associated protocols to explain how data flows in a network
OSI Reference Model TCP/IP and OSI Reference Model Comparison Network Devices
1
Describe common networking applications, including web applications
Application Layer Functions and Protocols Application Fundamentals
Describe the purpose and basic operation of the protocols in the OSI and TCP models
Application Layer Functions and Protocols Transport Layer Functions and Protocols Internet and Network Access Layer Functions and Protocols
Describe the operation of data networks
2 2 2 12 2 2 2
Describe the impact of applications (Voice over IP and Video over IP) on a network
Application Fundamentals
12
Interpret network diagrams
Network Devices
3
Advanced
Official Objective
Beginner
Exam Readiness Checklist
Intermediate
CCENT 640-822
Official Objective
Study Guide Coverage
Determine the path between two hosts across a network
TCP/IP and OSI Reference Model Comparison Application Layer Functions and Protocols Transport Layer Functions and Protocols Internet and Network Access Layer Functions and Protocols Network Devices
Describe the components required for network and Internet communications
Ch# 2 2 2 2 3
Network Essentials TCP/IP and OSI Reference Model Comparison Network Devices WAN Fundamentals Wireless Networking
1
Identify and correct common network problems at layers 1, 2, 3, and 7 using a layered model approach
OSI Reference Model TCP/IP and OSI Reference Model Comparison Troubleshooting
1
Differentiate between LAN/WAN operation and features
Network Essentials WAN Fundamentals
1 11
2 3 11 11
2 12
Implement a small switched network Physical Media Select the appropriate media, cables, ports, and connectors to connect switches Network Devices to other network devices and hosts Switch Fundamentals
3 3 5
Explain the technology and media access control method for Ethernet technologies
Ethernet Characteristics Ethernet Standards
4 4
Explain network segmentation and basic traffic management concepts
Switch Fundamentals Switch Design Considerations Routing Fundamentals
5 5 6
Explain the operation of Cisco switches and basic switching concepts
Switch Fundamentals Initial Configuration About Cisco Switches
5 9 9
Beginner
Exam Readiness Checklist
Advanced
CCENT Cisco Certified Entry Networking Technician Study Guide
Intermediate
xxxviii
Study Guide Coverage
Ch#
Perform, save, and verify initial switch configuration tasks, including remote access management
The IOS and Configuration Files The CLI Initial Configuration Securing the Configuration
8 8 9 9
Verify network status and switch operation using basic utilities (including ping, traceroute, telnet, SSH, arp, ipconfig), SHOW, and DEBUG commands
The IOS and Configuration Files The CLI Securing the Configuration First Steps Troubleshooting
8 8 9 10 12
Implement and verify basic security for a switch (port security, deactivate ports)
Initial Configuration Securing the Configuration Interface Configuration
9 9 9
Identify, prescribe, and resolve common switched network media issues, configuration issues, autonegotiation, and switch hardware failures
Initial Configuration Securing the Configuration Interface Configuration Troubleshooting
9 9 9 12
Implement an IP addressing scheme and IP services to meet network requirements for a small branch office Describe the need and role of addressing in a network
Routing Fundamentals Introduction to IP Addressing Subnet Tasks Subnet Essentials
6 6 7 7
Create and apply an addressing scheme to a network
Routing Fundamentals Introduction to IP Addressing Subnet Tasks Subnet Essentials
6 6 7 7
Assign and verify valid IP addresses to hosts, servers, and networking devices in a LAN environment
Subnet Essentials Subnet Tasks
7 7
Explain the basic uses and operation of NAT in a small network connecting to one ISP
WAN Fundamentals Routing Configuration
11 10
Advanced
Official Objective
Beginner
Exam Readiness Checklist
xxxix
Intermediate
Introduction
Official Objective
Study Guide Coverage
Ch#
Describe and verify DNS operation
Application Layer Functions and Protocols
2
Describe the operation and benefits of using private and public IP addressing
Introduction to IP Addressing Subnet Essentials
6 7
Enable NAT for a small network with a single ISP connection using SDM and verify operation using CLI and ping
WAN Fundamentals Routing Configuration
11 10
Configure, verify, and troubleshoot DHCP and DNS operation on a router (including CLI/SDM)
WAN Fundamentals Routing Configuration
11 10
Implement static and dynamic addressing services for hosts in a LAN environment
Application Layer Functions and Protocols Introduction to IP Addressing WAN Fundamentals
2 6 11
Identify and correct IP addressing issues
Introduction to IP Addressing Troubleshooting
6 12
Describe basic routing concepts (including packet forwarding and the router lookup process)
Introduction to IP Addressing Routing Fundamentals Routing Configuration Subnet Tasks
6 10 7 7
Describe the operation of Cisco routers (including router bootup process, POST, and router components)
Routing Fundamentals First Steps Configuration Fundamentals Routing Configuration WAN Fundamentals
6 10 10 10 11
Select the appropriate media, cables, ports, and connectors to connect routers to other network devices and hosts
Network Essentials Physical Media Network Devices Configuration Fundamentals Routing Configuration Wireless Networking
1 3 3 10 10 11
Implement a small routed network
Beginner
Exam Readiness Checklist
Advanced
CCENT Cisco Certified Entry Networking Technician Study Guide
Intermediate
xl
Study Guide Coverage
Ch#
Configure, verify, and troubleshoot RIPv2
Routing Configuration
10
Access and utilize the router CLI to set basic parameters
The IOS and Configuration Files First Steps Configuration Fundamentals
8 10 10
Connect, configure, and verify the operation status of a device interface
Routing Configuration Troubleshooting
10 12
Verify device configuration and network connectivity using ping, traceroute, telnet, SSH, or other utilities
The IOS and Configuration Files The CLI Securing the Configuration First Steps Troubleshooting
8 8 9 10 12
Perform and verify routing configuration tasks for a static or default route given specific routing requirements
Routing Fundamentals Configuration Fundamentals Routing Configuration WAN Fundamentals
6 10 10 11
Manage IOS configuration files (including save, edit, upgrade, and restore)
The IOS and Configuration Files The CLI
8 8
Manage Cisco IOS
The IOS and Configuration Files The CLI
8 8
Implement password and physical security The IOS and Configuration Files The CLI Securing the Configuration
8 8 9
Verify network status and router operation The IOS and Configuration Files using basic utilities (including ping, The CLI traceroute, telnet, SSH, arp, ipconfig), Securing the Configuration and the SHOW and DEBUG commands First Steps Troubleshooting
8 8 9 10 12
Explain and select the appropriate administrative tasks required for a WLAN Describe standards associated with wireless media (including IEEE WI-FI Alliance and ITU/FCC)
Ethernet Standards Wireless Networking
4 11
xli
Advanced
Official Objective
Beginner
Exam Readiness Checklist
Intermediate
Introduction
Official Objective
Study Guide Coverage
Ch#
Identify and describe the purpose of the components in a small wireless network (including SSID, BSS, and ESS)
Wireless Networking
11
Identify the basic parameters to configure on a wireless network to ensure that devices connect to the correct access point
Wireless Networking
11
Compare and contrast the wireless security features and capabilities of WPA security (including open, WEP, and WPA-1/2)
Wireless Networking
11
Identify common issues with implementing wireless networks
Wireless Networking
11
Beginner
Exam Readiness Checklist
Identify security threats to a network and describe general methods to mitigate those threats Explain today’s increasing network security threats and the need to implement a comprehensive security policy to mitigate those threats
Network Devices Network Security
3 12
Explain general methods to mitigate common security threats to network devices, hosts, and applications
Network Devices Network Security
3 12
Describe the functions of common security appliances and applications
Network Devices Network Security
3 12
Describe security recommended practices, including initial steps to secure network devices
Network Devices Switch Design Considerations Initial Configuration Securing the Configuration First Steps Configuration Fundamentals Network Security
3 5 9 9 10 10 12
Advanced
CCENT Cisco Certified Entry Networking Technician Study Guide
Intermediate
xlii
Study Guide Coverage
Ch#
Implement and verify WAN links Describe different methods for connecting WAN Fundamentals to a WAN
11
Configure and verify a basic WAN serial connection
10 10 11
Configuration Fundamentals Routing Configuration WAN Fundamentals
xliii
Advanced
Official Objective
Beginner
Exam Readiness Checklist
Intermediate
Introduction
This page intentionally left blank
1 Networking 101
CERTIFICATION OBJECTIVES 1.01
Network Essentials
1.02
The OSI Reference Model
✓ Q&A
Copyright © 2008 by The McGraw-Hill Companies. Click here for terms of use.
Two-Minute Drill Self Test
2
Chapter 1:
Networking 101
Y
ou cannot begin learning any aspect of technology or industry without first mastering the basics. This chapter covers the building blocks you’ll need to be successful in the rest of your study. The first half explores some basic terminology and definitions, what networks look and act like, and the components that make up the network, while the second half—through an examination of the OSI Reference Model—looks at how data is treated as it moves through your network. A thorough understanding of this chapter should provide a great bedrock upon which to build the rest of your study!
CERTIFICATION OBJECTIVE 1.01
Network Essentials Any text on networking should begin by defining what, exactly, a network is. In its simplest terms, a network is a collection of systems and devices exchanging data over some form of media. The systems provide an interface for users to easily share, store, and access a variety of data, the network devices provide a means to control and regulate the traffic between the systems, while the media provides a pathway for the data to travel across. It sounds simple (and it really is), but it can get complicated in a hurry. Let’s keep it simple and start with the definitions and terminology you’ll need to know.
Network Definitions The world of networking has more than its share of terminology and jargon. In this section, we’ll introduce some terms and concepts you’ll need to be familiar with as you move forward. We’ll cover things in a logical order, hitting terms that range from what makes up a network and how data is transmitted on the wire, to how far the network reaches. When thinking about what components make up a network, most observers pick the obvious—the devices they can see or touch. As you’ll see, there’s more to it than that. A network is first made up of hosts. A host is defined as any device that holds a logical address on your network. Most commonly, this address is an Internet Protocol (IP) address, which we’ll cover later in the book. Hosts can be workstations, servers, printers, connection devices, or routers. Apprentice network technicians generally do a good job keeping track of the computers and printers on the network, but
Network Essentials
3
sometimes forget to include the connection devices and routers in their overall address plan. It’s important to remember that, even though you do not necessarily interact with them daily (as you would a workstation or server), switches and routers need attention, too. The next major term commonly left out in a discussion of networking is the information itself. After all, what would a network be without data to transmit? Information transmitted across a network can include voice, video, or data (text, presentations, pictures, and so on). Each of these requires special attention and functionality to traverse the network correctly. While we cover actual data types and terms later in this chapter, keep in mind that networking isn’t just data anymore. Modern networks are charged with delivering our phone calls and, soon, our television and entertainment options. Data—no matter what its form—is transmitted in the form of bits. A single bit is a 1 or a 0 (based on the binary number system of two digits versus the typically used decimal numbering system based on the digits 0–9). An arrangement of eight bits in a specific order is known as a byte. Bits can also be arranged to signify a hex digit. Hex digits are always four bits in length and are expressed to the human eye as the numerals and alpha characters 0–9 or A–F. Depending on the specific combination of bits, bytes, and hex digits received, a host will respond accordingly. Some bit streams, for example, tell the host, “A message is coming and it is intended for you. Please process the information contained inside.” After the hosts and connection devices are in place, you need something for the data to travel on between them. Transmission media is the physical pathway over which the data travels. A wide variety of media choices are available in networking and can be broken down into two major categories: bound or unbound (cabling or wireless). Akin to the roads on which you drive your car, cabling is the most common media choice, and includes two types: copper (transmitting electrical impulses) and fiber (transmitting data in the form of light impulses). Wireless makes use of radio frequency (RF) waves, microwaves, or infrared beams to send data packets from one host to the next. Our next definition has to do with the rules of the road. Human beings can, oftentimes, make up the rules as they go, while exchanging data. For example, while you may speak perfect fluent English, your client may not. They may speak slower, or broken, English—occasionally misusing a noun or applying the wrong tense of a verb or two. As a human, you can assimilate these changes to the expected spontaneously and apply understanding to the communication. Unfortunately, computer systems do not function this way. Standardized, near ritualistic, activities must be in place or the communications process cannot continue. Protocols provide this for your
4
Chapter 1:
Networking 101
network. A protocol is simply an agreed upon set of rules for a particular network function. For example, you may agree on a specific method of encoding an electrical signal on a wire to signify a 1 or a 0. Timing sequences, the specific arrangement of bits to signify an address, and how a host can tell that the other end is receiving all the data sent are all examples of protocols in use. Protocols in networking are usually combined in one grouping, referred to as a protocol suite or stack. Once you have bits from your hosts ready to travel on the media, you should familiarize yourself with a few more terms. The first is bandwidth. Just as with the roadways you drive on, a given media only has a finite number of lanes the data can travel on. The more lanes you have, the higher the bandwidth available to you. Bandwidth is generally considered to be the total amount of data (in bits) you can theoretically transmit within a given time period (typically one second). Bandwidth is expressed in bits or bytes per second in digital networking. For example, 10 Mbps would be 10 million bits per second (a million bytes per second would appear as 10 MBps). On analog circuits, bandwidth is expressed in cycles per second (Hertz, or Hz), and is usually simply the difference between the top and bottom frequency range available. Another term closely related to bandwidth is throughput. While bandwidth is the theoretical total amount of data a given media can transmit, throughput is the actual measurement of the data that’s able to pass through the media at any given time. Expressed in the same manner as bandwidth, throughput can be thought of as what you are really getting out of your network. In many cases, throughput is the more Pay close attention to the important measurement and can be affected bandwidth and throughput measurements by an increase in network traffic, transmission of network devices and media. errors, interference, network devices, and a host of other variants. Last in our terminology discussion is the method in which hosts can send and receive traffic. In simplex transmission, devices can only send in one direction. In duplex, devices can send in both directions. To further complicate things, duplex has two implementations: half and full. In half duplex, the systems can transmit in either direction, but only one at a time. In full duplex, both systems can transmit in either direction simultaneously. Whenever possible, network design should include as much full duplexing as possible. In many cases, your duplex setting may be more important than your overall bandwidth/speed available. Incorrect duplex settings could affect the perceived throughput of the network connection.
Network Essentials
5
Network Topologies One of the first steps in designing your network is to decide on its topology. A topology is simply the layout of your network hosts and media. The topology can refer to how the network actually looks (the physical topology), as well as how the data travels on your network (referred to as the logical topology).
Physical Topologies The physical topology of the network refers to how the network actually looks from a bird’s-eye view—the physical cabling layout of the network itself. Usually, these are very easy to distinguish from one another. The five different physical topologies are bus, ring, star, mesh, and hybrid. See Figure 1-1 for examples of physical topology appearances. A bus topology consists of all devices connecting to a single wire—a coaxial cable. A physical bus looks like a straight line—a stick—with connections to hosts coming off Be sure you understand in a “T” shape. Physical bus topologies are the appearance, benefits, and drawbacks simple to implement and use the least amount of each physical topology. of cabling of any topology; however, they are
FIGURE 1-1
Physical topologies
Mesh
Star
Ring Bus
6
Chapter 1:
Networking 101
relatively difficult to troubleshoot. A break in the cable in a bus topology brings the entire system down, and breaks are usually very difficult to locate. Additionally, terminators (50-ohm, usually) must be affixed to both ends. A terminator is a resistor attached to each end of a bus topology network to cause the signal to stop rather than reflect back toward the source. A loose or missing terminator will also bring down the entire network. In a ring topology, all devices are connected to each other in the shape of a circle—the first device feeds into the second device, which in turn feeds into the third, and so on and so on until the loop plugs back into the first device. As with bus topology, a break in the cable brings the entire network down. However, cable faults are much easier to find and resolve when compared to bus topology. Another disadvantage of ring topology is that it is difficult to expand. Each device must be reconfigured when you add a new one to the ring. Ring topologies can be either single ring or dual ring. Dual rings provide redundancy in the case of a line break—if a cable breaks on one ring, the devices can use the other to communicate until the fault is repaired. Star physical topology is by far the most common in day-to-day networking. In a star topology, all devices are connected to a single, central device—usually a hub or a switch. The benefits of star are fairly easy to decipher—cable faults only take down the host on that cable (not the entire network), the network is easily expandable, and troubleshooting is very simple. The only drawback is that it uses more cabling than a bus and provides a central point of failure—thus, if the central device fails, the entire network goes down. Star topologies can also include extended star, where the central device extends links to other hubs and switches. Mesh and hybrid topologies are the last two physical topologies. In a mesh topology, every device is directly connected to every other device. Mesh networks have the benefit of complete redundancy—a network break doesn’t affect anything. However, they do use the most cable and have scalability problems. Should you ever have to determine the number of links used in a mesh network, counting them may prove a challenge. The formula for calculating the number of links in a mesh network is N(N–1)/2, where N is the number of hosts. Hybrid topologies are simply any combination of two or more physical topologies. Which would you choose? Most office and home networks are built using star topology. Support is plentiful, media and connection devices are easy to come by, and installation and troubleshooting is a snap. Instances exist, however, where you should choose one of the others, but be prepared to see a lot of star networking.
Network Essentials
7
Logical Topologies The physical layout of the network is only half the picture. The logical topology refers to the path the data actually travels on its way through the network. Regardless of what the network physically appears to be, the pathway of the data itself may be something completely different. The two major logical topologies are bus (broadcast) and token (ring). A bus logical topology broadcasts data to all nodes on the network at the same time. This may seem like a difficult concept to grasp, but consider an analogy. Suppose you are holding a copper wire. Ten other people are holding the same wire with you. You apply voltage to the wire. Who gets shocked? The answer is, of course, everyone. It has nothing to do with the address—you may have been signaling the person at the very end of the cable, but given physics, anyone touching the copper will get shocked. In a bus topology, a system listens for the wire to get “quiet,” then broadcasts its message to the cable. All stations receive it, but only the one it is addressed to can open it. Also known as contention-based networking, bus is the most commonly used logical topology, and bus and star physical topologies make use of this method of communication. While it seems like a free-for-all and there’s no guarantee you’ll get to speak on the network, broadcasting is actually very fast and efficient when properly implemented. A token passing, or ring, topology works in a more organized, almost friendly format. In a token passing logical topology, systems can only transmit information when they hold a special data packet, known as a token. The token is passed from one device to the next, in a prescribed, circular path. Each device receives the token and examines it. If it holds a message for the device, it will open and process it. If it doesn’t, it will pass it on to the next device in the ring. If the token is empty and the device has something to transmit, it will place its message in the token and send it along the pathway. If the token is already in use, the device will have to wait for a free token to come along before transmitting. While this seems orderly and less contentious than bus topology, token passing is actually much slower and not used nearly as often. Also known as deterministic based networking, token passing can be used by bus, star, and ring physical topologies.
Pay attention to the wording of questions regarding the logical topology. Many times a physical star topology can still pass data from one
machine to the next, making it a logical ring. In the event that a star topology acts as a ring, the central device is called a Multi Station Access Unit (MSAU).
8
Chapter 1:
Networking 101
Network Categories Defining a network category usually revolves around two things: the geographical area covered and who owns the lines. Networks are typically of two types: LANs and WANs. Additionally, the implementation and functions of these networks also include several other terms, such as SOHO, branch office, and central office.
LANs A LAN (local area network) can be defined as a network that serves users within a small geographic footprint. Usually LANs are confined to a single room, floor, or building, although they can cover as much as an entire campus. LANs are generally created to fulfill basic networking needs, such as file and printer sharing, file transfers, or gaming. The key to defining a LAN usually comes with examining the administrative control boundary—if you own all the devices and cabling within it, and it is confined to a manageably small geographic area, it’s a LAN. LANs are generally high speed in nature and contain workstations, servers, printers, hubs, and switches. Depending on their use within the network, devices such as firewalls, gateways, proxies, and routers can also be considered part of a LAN. Lastly, one of the primary defining characteristics of a LAN is its physical data transmission technology. By far, Ethernet is the most common LAN technology, but there are many others, including Token Ring and ATM. LAN traffic is generally considered inside traffic, whereas WAN traffic is considered outside. Another term tossed about in networking is the Metropolitan Area Network (MAN). MANs are usually larger than LANs—spanning a city, for instance— but are not as large as a WAN. In most instances, the term MAN and WAN can be used interchangeably on a given network.
WANs A WAN (wide area network) is nothing more than the network connecting a collection of LANs across a wide geographic area—perhaps a state, nation, or even the whole world! Aside from the distance variable, another defining characteristic of WANs is the concept of a leased line. Most companies and individuals do not have the time or resources to install physical cabling across great distances to hook their networks together. Therefore, they simply lease bandwidth from a provider
Network Essentials
9
who already has those lines in place. WAN technologies include everything from dial-up networking with a modem to leased dedicated bandwidth space on frame relay networks. WAN technologies fall into three major categories: circuit switched, packet (or cell) switched, and dedicated connections (point to point). Circuit switched WAN connections work much like your telephone at home. When you wish to transmit, you make a call and the line is in use until you are finished transmitting. No one else can use the line, and it remains open, even when you’re not talking. WAN technologies using circuit switching include regular dial-up with a modem, using the plain old telephone system (POTS), or Integrated Services Digital Networking (ISDN), using specialized equipment to send digital messages over special phone lines. The advantages of circuit switched technologies include cost (cheaper, generally), scalability (easy to install and expand), and availability. Packet or cell switching technologies work a little differently than circuit switching. In a packet switched network, the point-to-point circuits between devices are opened for the length of time it takes to send a message, and are then cleared for use. Cell switching works in much the same way. The only difference has to do with the length of the individual packet sent. In cell switching, the cell size is always the same, whereas with packet switching, the sizes of individual packets vary. Packet switching allows multiple connections from one device, but is generally much more expensive than circuit switching. Packet/cell switched technologies are also harder to implement and may not be available in all locations. However, for larger companies or for companies requiring Quality of Service (QoS) features for specialized programs, these technologies are well worth the investment. Point-to-Point, or dedicated, WAN connections are exactly what they sound like—a leased line that directly connects one network to another. The advantage is that the connection is always up and available, and you are guaranteed 100 percent of the bandwidth available 100 percent of the time. The drawback is closely related—whether you use the bandwidth or not, you pay for it. Generally speaking, these connections are rather expensive to implement. Examples of dedicated connection include the “T” lines, such as T1 (1.544 Mbps), T2 (6.312 Mbps), and T3 (44.736 Mbps). Obviously, only one connection device per line is allowed on each end, so scalability with this option is also a concern. For example, suppose a network had one central office and five branch offices. To connect these together using T lines, the route at the central facility would need at least six ports available—one to serve the central office, and five for each branch office. Going a step further, if you decided to fully mesh this network, each router at each location would also need six ports available. In comparison with frame relay, each office router would only need one port, making scalability much easier.
10
Chapter 1:
Networking 101
Due to cost and ease of scalability, most enterprise networks make use of packet switched technologies, such as frame relay or ATM.
Location Terminology Within the LAN/WAN architecture, your business will have several offices and networks functioning toward your end goal. Each of these locations refers to a specific user, or groups of users, within your network, as well as to the location at which you would find them. A small office/home office (SOHO) is fairly self-explanatory. The SOHO refers to a single user, or a small group of people (one to ten), working from a single location, such as a home or office space. This location usually doesn’t require a dedicated connection to a corporate network, as SOHOs are generally considered to be independent businesses on their own. Typically, network connectivity for the SOHO requires lower bandwidth and, therefore, cheaper options are considered. The branch office is very close in definition to a SOHO, with one major difference. The branch office, oftentimes, supports a small group of people, just as the SOHO does. However, the branch office has its own LAN and is considered a part of the overall corporation or enterprise. Branch offices are, simply, portions of the enterprise that happen to be in different geographical locations than the corporate headquarters. Network connections to branch offices vary greatly depending on the bandwidth and traffic support needs, and can include any of the WAN technologies discussed earlier. Finally, the last “location” to worry about is the mobile user. A mobile user is part of the corporation, but is not located at a branch office. These users may be salespeople, technicians, managers, or any member of the company that is traveling on business. Oftentimes, these users, while not at a location that belongs to the company, need to connect back to the central office for any number of tasks. Connections for mobile users must be guarded very carefully, and strong caution is advised in setting up a method for remote access. Be sure to pay particular Generally speaking, mobile users connect via attention to the network connection dial-in or by using the existing public Internet, via technologies needed by each location. some form of a virtual private network (VPN).
The OSI Reference Model
11
CERTIFICATION OBJECTIVE 1.02
The OSI Reference Model Thankfully, standards exist for almost everything in day-to-day life. Imagine, for example, how difficult it would be to replace a missing bolt on your vehicle if the sizes weren’t standardized, or attempting to fix a plumbing problem in your home if every house used different-sized pipes. ISO, the International Organization for Standardization, has created standards for almost everything you can imagine—film, pipe and screw threads, even the size of holes for a paper punch are all covered by an ISO standard. In addition to the multitude of day-to-day life standards, ISO is also responsible for giving us the OSI Reference Model.
Functions and Advantages A common question asked by new networkers is, “What, exactly, does the OSI Reference Model do?” The answer may be a little surprising. Technically, the OSI Reference Model does…nothing. You do not buy a box of it, you don’t install it, and you don’t configure it on devices. The main purpose of the OSI Reference Model is to provide a means for us to break down the communications process between two computers into stages, and easily discuss and describe the steps within each stage. While imperfect, the model provides a good method of breaking down the communication process in an organized manner for discussion, troubleshooting, and training. One word bandied about quite a bit in regards to the OSI model is encapsulation. Encapsulation is the process of adding a header and a trailer to a piece of data. While each stage of communication (layer of the model) adds a header to the data, only one layer always adds a trailer. Some texts define encapsulation as occurring in all layers of the model; however, it technically only occurs at one—the Data Link layer. When ISO developed the OSI Reference Model, every effort was made to distinctly separate logical functions from one layer to the next. This design concept greatly enhances vendor efficiency in creating new network devices, protocols, and services. For example, a vendor can choose to work in one layer and modify/enhance
12
Chapter 1:
Networking 101
their product without adversely affecting the functions of the other layers. The OSI Reference Model provides several benefits: ■ It simplifies training and learning. ■ It reduces complexity in product and services design. ■ It provides for vendor interoperability. ■ It allows for modular construction.
The Layers The OSI Reference Model splits the communications process into seven distinct You should be able to modular layers, with each layer accomplishing explain the benefits of the OSI Reference a specific function independently of all other Model, as well as layered protocol stacks. layers. The layers do rely on layers above and below to provide something to work with, but they don’t necessarily care what they receive to work with. For example, as you’ll see, the network layer doesn’t really care which segment number it is addressing and routing—it simply knows it has a segment to send. Each layer is discussed in further detail next. The individual protocols mentioned will be discussed in greater detail in Chapter 2. Figure 1-2 displays the seven layers. FIGURE 1-2
The OSI Reference Model layers
Application layer (7)
Presentation layer (6)
Session layer (5)
Transport layer (4)
Network layer (3)
Data Link layer (2)
Physical layer (1)
The OSI Reference Model
13
Because the OSI model acts as a foundation for the rest of networking, it’s very important that you thoroughly understand the stack. It is essential you be able to identify: ■ The order of the layers, from top to bottom, and bottom to top ■ The number that corresponds to each layer ■ The function(s) of each layer ■ The protocols and devices that work at each layer
Memorizing the layers and their numbers is actually fairly easy using a mnemonic. Keeping in mind that the “top” of the stack is layer 7—Application—simply take the first letter of each layer and create a phrase to help remember their place in the stack. Common examples are, “Please Do Not Throw Sausage Pizza Away” and “All People Seem To Need Data Processing.” There are, literally, hundreds of different mnemonics new network technicians use to help remember the layers. Find one that works for you and stick Memorize the information with it! In the remainder of this section, we’ll in Table 1-1. Questions may or may not examine each layer in more detail. Refer to be explicit, but you will need to know this Table 1-1, OSI Protocols and Devices, as you information to correctly determine the read more information about the devices and question’s intent. protocols working at each layer.
TABLE 1-1
OSI Protocols and Devices
Protocols/Standards Working in the Layer
Layer
Devices Found in the Layer
Application
Firewall, Gateway, and IDS
SMTP, POP3, DNS, DHCP, FTP, HTTP, TFTP, SNMP, VoIP
Presentation
N/A
JPG, JPEG, TIFF, PNG, GIF, MIME
Session
N/A
NFS, ASP, SQL, RPC
Transport
Firewall
TCP, UDP, SPX
Network
Router
IP, IPX, Appletalk
Data Link
Bridge, Switch
Ethernet, PPP, HDLC, Frame Relay, ATM
Physical
Transceiver, Repeater, Hub
RJ45, ST/SC, V series (modem standards)
14
Chapter 1:
Networking 101
The Data Layers (Application, Presentation, and Session) It might help you to understand the functions of the seven layers of the OSI model if you think of them in terms of data layers and delivery layers. The data layers would be the top three layers of the model. At the top of the stack, we find layer 7—the Application layer. A common mistake made by new network technicians regarding the Application layer is the belief that the applications themselves reside here. This is not accurate. The Application layer holds the protocols that allow programs to access and make use of a network. For example, Microsoft Outlook—a common e-mail program—can work just fine without a network. You can open, edit, create, and delete e-mails offline just as well as you can online. However, if you wish to use the network to send and receive e-mail, you need an Application layer protocol to do this. In this example, the Application layer protocol would be SMTP. Continuing the e-mail analogy, imagine you are sending an e-mail from a Microsoft Outlook application to a computer running the Thunderbird e-mail application. You may have bold, italics, and any number of font settings within your e-mail. Additionally, you may attach a picture file (jpg) for the recipient to enjoy. Thunderbird might treat bold, italics, and font settings differently than does Outlook, and SMTP is only capable of sending ASCII code (a combination of bits representing an alphanumeric character, commonly referred to as, simply, text). Enter layer 6—the Presentation layer. The Presentation layer is responsible for formatting and code conversion between systems. This layer accepts the data from the Application layer and ensures it is placed in a format the end station can understand. In this case, the e-mail is in text mode, and another protocol, like MIME, translates the jpg into ASCII for transit. Once received at the far end, the recipient’s Presentation layer will perform the reverse, handing the data back to the Application layer protocol. Encryption is another function of the Presentation layer. While the Presentation layer has historically been responsible for encryption, modern systems make use of encryption at other layers—particularly layers 3 and 4. Layer 5—the Session layer—is perhaps the most enigmatic and troublesome of the entire stack. This layer doesn’t necessarily do anything to the data at all. Instead, its function is to work in the background, ensuring the communications process between two systems runs smoothly. The standard definition applied to the Session layer is that it creates, maintains, and tears down sessions. To correctly understand this, consider an analogy.
The OSI Reference Model
15
A person and their significant other are driving down the road, discussing the day’s events. While one partner is talking, the other begins to daydream a little. After a few seconds, the one talking says, “Are you listening to me?” BAM!—communications are reestablished and data flow is stabilized. Notice the communications process never actually stopped, it just needed a little “massaging” to continue properly. That is exactly what the Session layer does for us. In addition to changing the world and simplifying our lives, computers are, at heart, insecure little beings and need constant reassurance that the other end is still listening and still playing by the rules. The Session layer takes care of this throughout the communication process. An example of Session layer protocols would be an SQL session or an RPC session between two servers.
Certain things are just a given—the sun will set in the West, fried food is always better in the South, and RPC
will be used as an example for a Session layer protocol on exams.
The Delivery Layers Until this point in the process, we still have one giant block of data handed down from the Application and Presentation layers. In keeping with the old truism, “It’s easier to pour pebbles down a pipe than boulders,” it makes sense that this data could be sent faster if we were to break it up into smaller, more manageable segments. In doing this, each segment could be delivered very quickly, but we’d have to take steps to make sure the recipient could reassemble all the segments in the proper order. Enter layer 4: the Transport layer. The Transport layer’s main job is to efficiently and reliably transport the data from the sender to the recipient. It does this via three main functions: segmentation, the reliable delivery of data, and flow control. Transport layer functions are relatively easy to understand. Segmentation is simply taking a small piece of the bits making up the data as a whole. A small header is put in front of these bits. Inside the header is all sorts of information, including: ■ A sequence numbering system (one of X, two of X, and so on) to mark each
segment and provide a means to put them back together on the recipient end ■ A method to let the recipient know which application needs to look at the
bits in the data field
16
Chapter 1:
Networking 101
■ A method to ensure segments can be delivered as quickly as possible without
overwhelming the recipient ■ A means to ensure that the recipient actually received each segment
As you can see, the information in the header is used by both parties to ensure all the segments get there in the order they were sent (reliability) and the recipient is processing data as quickly as possible without being swamped (flow control). The segments are then passed down to layer 3. The Network layer—layer 3—then answers a question that, so far, has not been answered: “Just where is the segment going?” The Network layer is responsible for logical addressing and routing. Receiving a segment from the Transport layer, the Network layer adds a header that includes a source and destination logical (network) address. This address is read by layer-3 devices (routers) and best path determinations are made to deliver the segment to its final destination. At this point, your system has a packet ready to deliver, but still needs a couple of questions answered. Specifically, how do I get on the media and which device inside my network will deliver this to its destination? Enter the Data Link layer. The Data Link layer is responsible for media access, physical addressing, and framing. Media access refers to the method in which your system accesses the media—it either transmits when quiet, or waits for a token. Layer 2 takes the packet and attaches a header and a trailer. The header contains the source and destination physical addresses needed to move the data inside your network segment. The trailer contains something called an FCS—Frame Check Sequence. The FCS is used by layer-2 devices to ensure that the bits inside the frame are in good order. This process is called framing, and is also referred to as encapsulation. Each layer-2 technology has a different method of framing, which will be discussed in greater detail later in this book. Lastly, the frame is passed to layer 1—the Physical layer. At this layer, everything is simply bits. There are no addresses, no routing decisions, and no sense of which application is sending or receiving—if you receive an electrical shock, you give one. The Physical layer is responsible for encoding bits onto a media. Encoding is the process of manipulating an electrical (or light) signal to represent a 1 or a 0. Standards in the Physical layer vary greatly, and apply to such things as the way connectors are affixed to different cable types, or the impedance allowed on a given copper cable. As the bits hit the wire, they are passed up the stack on devices receiving them. The process is reversed on the recipient end, with each layer removing the header from the layer below it to examine the information in its own header. With this information, the recipient can make decisions to continue to pass it up the stack,
The OSI Reference Model
17
or dump it. When you consider that this process occurs for each segment of data traveling back and forth between our systems, it really puts into perspective a few second’s wait for a web page to load. The distinction between data and delivery, and the categorizing of the layers within them, can greatly help with troubleshooting and network design.The top three layers are generally application-oriented, and spend their time on the data itself.The bottom four layers are concerned with delivering that data to a recipient.
Network Components A thorough understanding of networking components, as well as their functions and placement, is essential to your success both as a networking technician, and as a potential candidate for certification. In this section, we will briefly cover some of the more common network components, and discuss several features, functions, and concerns with each. These devices will, quite obviously, be discussed at greater length throughout the rest of this text, and terminology like collision domain and broadcast domain will also be covered in greater detail. Additionally, the devices are discussed and listed within the layer where they work.
Physical Layer Devices Physical layer devices do nothing more than physically connect wiring together to complete a path, or change the connection from one type to another. Examples of physical layer devices include transceivers, repeaters, and hubs. Transceivers connect one media type to another, such as a fiber connection to a copper one. Repeaters are used to extend the range of a given media—whatever they take in one port, they regenerate and repeat out the other. Hubs are nothing more than multiport repeaters. Comparatively, where a repeater takes bits in one port to relay to another, hubs have several ports they accept and relay bits on. Simply speaking, these devices are “dumb” and neither read nor understand data. Physical layer devices will pass on an electric shock, or light signal, exactly as they received it, making no decisions on its path whatsoever. These devices are used to extend the reach of network segments and, in the case of a hub, to share a single media segment between several systems. In other words, if a single network segment is capable of a 10 Mbps transmission, and you connect ten users to it using a hub, each user has an effective bandwidth of 1 Mbps. Physical layer devices extend collision domains, increase network traffic problems, and decrease (effective) available bandwidth.
18
Chapter 1:
Networking 101
Data Link Layer Devices Data Link layer devices actually read your internal physical network addresses and make decisions on forwarding or filtering traffic. The addressing used inside your network segment is akin to the street address on the front of a letter addressed to you—it makes sense to your local postal carrier, but wouldn’t mean a thing to someone in a different city or state. These devices have the processing power to read these addresses and make decisions on which port(s) to send the data through. Layer-2 devices include bridges and switches. Switches and bridges split (or segment) collision domains, decrease network traffic problems, and increase effective available bandwidth to hosts. However, keep in mind they are incapable of moving traffic outside your LAN.
Network Layer Devices Network layer devices play a unique role in your network design. These devices read the logical network addresses on your data and make decisions about which route to send the data. This sounds very much like the switches and bridges discussed earlier, but keep in mind the layer-3 device not only knows which port to send the data out, but also the best route through outside networks to its final destination. Continuing the analogy from earlier, if the street address on your letter is akin to the physical address of your hosts, the logical address used by layer-3 devices is equivalent to the ZIP code. When you place a letter in your mailbox, the local carrier doesn’t look at the street address, they look at the ZIP code and make a determination about which post office should see the letter next. This process continues until the letter reaches a post office that does recognize the street address. Routers (and sometime firewalls) are layer-3 devices, and not only split collision domains, but also broadcast domains. Routers are placed on the borders of your networks and subnets, for obvious reasons.
Other Devices Networks can also include a variety of other devices, such as firewalls, gateways, and proxies. A firewall is a device that typically works at layers 3 and 4, and is used to filter network traffic based upon rules the administrator configures on the device. Generally placed between your network and the Internet, firewalls work on an implicit deny principle—if you do not explicitly allow the traffic, it is blocked. Gateways work at all layers and are generally used to connect networks and applications of different types together. A proxy is a system that provides a specific service to a host. For example, a web proxy will make requests to the Internet for web content on behalf of a host. This increases security and performance since web
The OSI Reference Model
19
traffic coming from your network appears from only one system, and hosts can access cached pages on the proxy instead of going out to find them. Generally speaking, these devices are usually placed between your network and the Internet in a special network called a DMZ.
While you may not see definition type questions regarding these devices, it’s extremely important to know
the basics of their function and placement within your network.
Protocol Data Units As important as it is for you to know the OSI model’s protocol and devices, it may be even more important to know the encapsulation steps as the data moves through systems. As the process in data exchange moves from one layer to the next, the information is given a specific name. The protocol data unit (PDU) is the name given to the bits at a given layer. As you remember from the earlier discussion, each layer adds a header to the information given to it from the layer above. The combination of that header and the information passed along from the preceding layer is known as a protocol data unit. PDUs can be referenced by a specific name, or by their layer. For example, the terms packet and layer-3 PDU mean the same thing. The PDUs are listed in Table 1-2.
TABLE 1-2
Protocol Data Units
Layer
PDU
Bits Added
Application
Data
Header
Presentation
Data
Header
Session
Data
Depending on the protocol, either none or a header
Transport
Segment
Header
Network
Packet
Header
Data Link
Frame
Header and trailer
Physical
Bits
N/A
20
Chapter 1:
Networking 101
The process of headers and/or trailers being affixed to data as it moves through the stack is referred to as encapsulation. It is vital to your success on the exam and as a network technician to know and understand these PDUs. Much like with the OSI model, a mnemonic can help you. An old mnemonic from the military is “Do Sergeants Pay For Beer?” Again, any mnemonic that helps you remember the terms will suffice. The Sergeants line is only one suggestion. Lastly, two additional terms need to be discussed here: adjacent layer interaction and same layer interaction. When the transport layer passes a segment on to the network layer for addressing and routing, that function is known as adjacent layer interaction. Quite simply, a layer interacts with a layer directly above or below it. Same layer interaction, ironically enough, occurs when two different computers interact using the same layer within their respective stacks. For example, the Transport layer on a recipient computer communicates with the Transport layer of the sending computer during the transmission process, to take care of retransmission requests, flow control, and acknowledgments. Despite the fact the layers are on different computers, this process is considered same layer interaction. Figure 1-3 demonstrates same layer and adjacent layer interactions.
Be very, very careful with the term encapsulation. Encapsulation is considered a layer-2 function because that is the only layer guaranteed to wrap the data with a header and a trailer. However,
FIGURE 1-3
Layer interaction
the term is also used to refer to the process at each layer, regardless of a trailer being affixed. Pay attention to the wording of the question to avoid misunderstandings here.
Computer A
Computer B
Application layer (7)
Application layer (7)
Presentation layer (6)
Presentation layer (6)
Session layer (5)
Session layer (5)
Transport layer (4)
Transport layer (4)
Network layer (3)
Network layer (3)
Data Link layer (2)
Data Link layer (2)
Physical layer (1)
Physical layer (1)
Certification Summary
21
INSIDE THE EXAM Network Essentials This chapter covered many of the bare-bones basics of networking, but don’t be surprised to see several questions on the exam concerning this material. Questions from the chapter may not be explicit—requiring a word-forword definition or a matching scheme—but the information in this chapter will help you answer questions you otherwise may have problems with. For example, a confusing scenario question may pop up, and the only real clue you can glean from it in the short time you have is the key word Frame. Well, framing is a layer-2 function, and the devices you’d need to look at are bridges or switches. Using this tip and the information in this chapter, combined with the explanations found throughout this book, will be the key to your success. Remember, networks require hosts, media, connection devices, data, and applications. The way the cabling appears from a bird’s-eye view is referred to as the physical topology, whereas the logical topology refers to the actual path the data uses to flow through the cabling. The devices making up a network range from Physical-layer dumb devices, all the way up to Application layer components, capable of making all sorts of decisions based
on the bit stream read. Network categories and locations deal mainly with the geographic footprint and the users on the network. Pay particular attention to the devices that actually read addresses and make filtering or forwarding decisions.
The OSI Reference Model The OSI Reference Model does a good job of breaking down the communication process into easily understood, manageable layers. Each layer has specific functions, devices, and protocols. The bits at each layer are known as PDUs, and each PDU has a specific name. Layers 2 through 4 will be tested most heavily on the exam, so pay close attention to the wording of the questions on the exam. Look for key words to help with each question: encoding is at the Physical layer, framing and error checking are at the Data Link layer, routing is at the Network layer, reliability and error correction are at the Transport layer, and encryption and formatting are at the Presentation layer. Lastly, be sure you can identify each layer by name and number, as well as which devices, protocols, and functions occur at each.
CERTIFICATION SUMMARY This chapter focused on two main topics: network terminology and the OSI Reference Model. Network terminology includes terms about what makes up a network (hosts, protocols, and media), how data is transmitted on the wire
22
Chapter 1:
Networking 101
(bandwidth, throughput, simplex, and duplex), and various network categories and locations (LANs, WANs, SOHOs, and branch offices). Network topologies include physical (bus, ring, star, and mesh), which describes how the cables physically appear, and logical (broadcast, or bus, and token passing, or ring), which describes how data actually flows through the media. Network categories (LANs and WANs) describe the geographical distance covered and the administrative control of a network. Network locations (SOHO, branch office, and mobile user) describe various users and functions in specific locations and circumstances. The OSI Reference Model provides an easily understood, modular description of data as it flows between two systems. The model splits the communications process into seven distinct layers, numbered seven to one, from top to bottom. Starting at the top, the layers include Application, Presentation, Session, Transport, Network, Data Link, and Physical. Each layer performs a specific function and relies on the layer above and below it to provide and/or take information. The information at each level has a specific name and is known as the PDU for that given layer.
Two-Minute Drill
✓
23
TWO-MINUTE DRILL Network Essentials ❑ Networks consist of specific devices exchanging data over a given media us-
ing a specific set of protocols. Transmission can be in one direction (simplex) or in both directions (duplex). Network topologies describe how the network physically appears and how the data moves within the network. The physical and logical topologies are independent of each other. ❑ Each network component provides a specific function and works at a specific
layer within a network model. Physical layer devices do not read addresses at all, Data Link layer devices read physical addresses, and Network layer devices read logical addresses. ❑ Network categories include LANs and WANs, with the overall geographic
distance covered and services rendered determining the classification. Users work in a SOHO (a stand-alone small office), a branch office (an offsite LAN that is part of the overall enterprise WAN), or connect to a corporate network using mobile technology or VPNs.
The OSI Reference Model ❑ The OSI simplifies training and education on networking concepts and stan-
dards. Its modular design contributes to easier development and maintenance from multiple vendors. ❑ The OSI layers are Application, Presentation, Session, Transport, Network,
Data Link, and Physical. The Application layer allows programs to access a network. The Presentation layer formats (and encrypts, if needed) data for transmittal. The Session layer opens, maintains, and closes a session. The Transport layer segments data and provides for reliable end-to-end delivery. The Network layer logically addresses packets and makes routing decisions. The Data Link layer assigns physical addresses, performs media access functions, and conducts framing (aka, encapsulation). The Physical layer encodes bits onto the wire. ❑ The bits making up the data payload and the header (and trailer for layer 2)
at each layer is known as a PDU. The PDU at each layer has a specific name. The PDU at the Application, Presentation, and Session layers is known as
24
Chapter 1:
Networking 101
data. At the Transport layer, the PDU is called a segment. The Network layer PDU is called a packet. At the Data Link layer, the PDU is known as a frame, and the PDU at the Physical layer is referred to simply as bits. ❑ In adjacent layer interaction, layers receive a PDU from a layer above or be-
low it to perform a function on. In same layer interaction, the same layers on two different machines communicate with each other to accomplish a task.
Self Test
25
SELF TEST The following Self Test questions will help you measure your understanding of the material presented in this chapter. Read all the choices carefully since there may be more than one correct answer. Choose all the correct answers for each question.
Network Essentials 1. Which of the following defines a host? A. Any device with a connection to a network B. Any device on wireless C. Any device processing data D. Any device with an address on a network 2. Which of the following is/are true regarding hex digits? (Choose all that apply.) A. Hex digits are made of four bits. B. Hex digits are made of four bytes. C. Hex can be expressed as 0–9 and A–G. D. Hex can be expressed as 0–9 and A–F. 3. Which physical topology has all systems connecting to a central connection device? A. Bus B. Ring C. Star D. Mesh 4. A new network trainee presents her network diagram, which shows all systems connecting to a hub. She also tells you messages flow from one system to the next in line, until the message reaches the intended recipient. Which physical and logical topologies are in use? A. Physical Bus, Logical Ring B. Physical Star, Logical Ring C. Physical Ring, Logical Bus D. Physical Ring, Logical Ring 5. Which addresses do physical layer devices—such as repeaters and hubs—examine in order to make forwarding decisions? A. Physical B. Logical
26
Chapter 1:
Networking 101
C. Host D. None of the above 6. Which of the following WAN technologies is considered packet switched? A. Frame relay B. T1 lines C. Dial-up D. DSL
The OSI Reference Model 7. Which OSI layer is concerned with reliable end-to-end delivery of data? A. Application B. Transport C. Network D. Data Link 8. At what layer of the OSI model would you find framing? A. Transport B. Network C. Data Link D. Physical 9. Logical addressing is found in the ________________ layer, while physical addressing is found in the ________________ layer. A. Physical, Network B. Network, Physical C. Data Link, Network D. Network, Data Link 10. The OSI Reference Model layers, in order from top to bottom, are: A. Application, Physical, Session, Transport, Network, Data Link, Presentation B. Application, Presentation, Network, Session, Transport, Data Link, Physical C. Physical, Data Link, Network, Transport, Session, Presentation, Application D. Application, Presentation, Session, Transport, Network, Data Link, Physical
Self Test
27
11. What is the PDU at layer 4 called? A. Data B. Segment C. Packet D. Frame E. Bit 12. What is the PDU at layer 3 called? A. Data B. Segment C. Packet D. Frame E. Bit 13. The Transport layer on the recipient machine requests a retransmission of a segment from the sending machine. This is an example of: A. Same layer interaction B. Adjacent layer interaction C. Cross layer interaction D. Split layer interaction
28
Chapter 1:
Networking 101
SELF TEST ANSWERS Network Essentials ✓ D. Any device with an address on a network (this will normally be an IP address). 1. ® ® ˚ A is incorrect because not every device touching the network has an address. B is incorrect because the media (wireless or wire) has nothing to do with it. C is incorrect because a computer (or any device) can process data without being connected to the network. ✓ A and D. Hex digits are four bits in length and can be manipulated to display the 2. ® alphanumeric characters 0–9, A–F. ® ˚ B. Hex digits are made of four bits, not four bytes. C. Hex digits can only represent characters up to F. ✓ C. A star topology connects all devices to a central point. 3. ® ® ˚ A. All devices are connected to a single wire. B connects all devices in a circle, with one device connected directly to the next. D has all devices connected directly to all other devices. ✓ B. The network diagram displays a physical star, and the description of the data pathway is 4. ® a logical ring. ® ˚ A, C, and D. The diagram is a physical star. ✓ D. Physical layer devices do not see addresses at all; they simply forward bits. 5. ® ® ˚ A. Physical addresses are used by layer-2 devices, such as switches and bridges. B. Logical addresses are used by layer-3 devices, such as routers. C “Host” is a synonym for logical addresses. ✓ A. Frame relay is a packet switched WAN technology. 6. ® ® ˚ B. T1 lines are examples of dedicated connection WAN technology. C. Dial-up is an example of point-to-point WAN connectivity. D. DSL is not a packet switched technology.
The OSI Reference Model ✓ B. The Transport layer is responsible for segmentation, flow control, and reliable end-to7. ® end data delivery. ® ˚ A. The Application layer allows programs to access a network. C. The Network layer is responsible for logical addressing and routing. D. The Data Link layer is responsible for encapsulation, framing, media access, and physical addressing. ✓ C. The Data Link layer is responsible for encapsulation, framing, media access, and physical 8. ® addressing. ® ˚ A. The Transport layer is responsible for segmentation, flow control, and reliable end-toend data delivery. B. The Network layer is responsible for logical addressing and routing. D. The Physical layer is responsible for encoding bits onto the media.
Self Test Answers
29
✓ D. The Network layer is responsible for logical addressing and routing, while the Data Link 9. ® layer is responsible for physical addressing and media access. ® ˚ A, B, and C are out of order. ✓ D. From layer 7 to layer 1, the order is Application, Presentation, Session, Transport, 10. ® Network, Data Link, and Physical. ® ˚ A, B, and C do not have the order correct. ✓ B. The layer-4 PDU is called a segment. 11. ® ® ˚ A. Data is the PDU for the top three layers. C. Packet is the PDU at the Network layer. D. Frame is the PDU for the Data Link layer. E. Bit is the PDU at the Physical layer. ✓ C. Packet is the PDU at the Network layer. 12. ® ® ˚ A. Data is the PDU for the top three layers. B. The layer-4 PDU is called a segment. D. Frame is the PDU for the Data Link layer. E. Bit is the PDU for the Physical layer. ✓ A. A layer on one machine communicating directly with the same layer on a distant 13. ® machine is known as same layer interaction. ® ˚ B. This interaction type involves a layer interacting with a layer directly above or below it in the same stack. C and D do not exist.
This page intentionally left blank
2 TCP/IP
CERTIFICATION OBJECTIVES 2.01
TCP/IP and OSI Reference Model Comparison
2.04
2.02
Application Layer Functions and Protocols
✓
2.03
Transport Layer Functions and Protocols
Q&A
Copyright © 2008 by The McGraw-Hill Companies. Click here for terms of use.
Internet and Network Access Layer Functions and Protocols Two-Minute Drill Self Test
32
Chapter 2:
TCP/IP
T
he OSI Reference Model and the TCP/IP stack are foundational topics covered in almost every text on networking ever written. The OSI model gives us a great overall picture of data networking, while the TCP/IP stack shows the actual protocols and functions working together to accomplish the task. This chapter is dedicated to examining the layers, functions, and protocols found within the TCP/IP protocol stack. The first part of this chapter compares the TCP/IP suite to the OSI Reference Model. The second, third, and fourth sections cover individual layers, and the functions and working protocols you would find in each. As with Chapter 1, this information helps complete a solid foundation of networking knowledge.
CERTIFICATION OBJECTIVE 2.01
TCP/IP and OSI Reference Model Comparison If you’ll remember from Chapter 1, each layer of the OSI model has a particular function or task to accomplish. The TCP/IP stack works in much the same way, with a few key differences. While the OSI Reference Model provides a great means for discussing data operations between two systems, it is not a viable, working protocol stack. TCP/IP has become the de facto protocol standard for networking and, like most operating protocol stacks, TCP/IP does conform to the same networking processes proposed by the OSI Reference Model.
TCP/IP History In the late 1970s, and on through the early 1980s, ISO began work on the OSI model in an effort to standardize the burgeoning network protocol field. Work on the OSI model continued and, modeled after the System Network Architecture (SNA) model promoted by IBM, it caught hold in educational and training institutions, but never really caught on as a working suite. Along the same timeline, a small, almost ignored Department of Defense initiative was working on a set of networking rules and functions that would wind up changing the world. The Advanced Research Projects Agency Network (ARPANET) was developed and started operations in 1969. The U.S. government had a simple, albeit never before attempted, goal: create a communications method that could tolerate and
TCP/IP and OSI Reference Model Comparison
33
automatically recover from massive outages at any given location. In other words, create a network capable of rerouting traffic around, say, an entire city destroyed by a nuclear bomb. From 1970 to 1983, government researchers and various educational institutions worked on this open standard. TCP/IP was officially adopted by ARPANET and all systems wishing to communicate with this network on January 1, 1983, and the Internet, as we know it, was born. TCP/IP eventually became accepted as the worldwide standard for communication due to its open architecture and, eventually, public input on its inner working. During development, and even today, details on individual protocols and needed functions are released in a Request for Comment (RFC). RFCs are open for public discourse; protocols and functions are refined and improved over time as individuals and institutions provide comments and recommendations on them. The eventual adoption of TCP/IP as an accepted standard greatly accelerated the development of the Internet, as well as the systems and devices connecting to it. The OSI model is still referenced in networking, with many of its terms and functionality used interchangeably with TCP/IP. However, the actual working stack of protocols is the TCP/IP model, and it differs slightly from the OSI stack.
Comparing the Models As with the OSI model, TCP/IP divides networking functions into distinct layers. However, TCP/IP does so with only four layers: Application, Transport, Internet, and Network Access. All the functionality of the OSI model also occurs within the TCP/IP model; however, the layers do not line up exactly. Figure 2-1 displays the OSI and TCP/IP model comparison.
FIGURE 2-1
OSI Model
OSI to TCP/IP comparison
Presentation layer (6)
TCP/IP Model
Application layer (7) Application
Session layer (5) Transport layer (4)
Transport
Network layer (3)
Internet
Data Link layer (2) Physical layer (1)
Network Access
34
Chapter 2:
TCP/IP
Carefully read questions asking you to match functions and protocols with a particular layer. Identify which stack the question is asking about before answering. For example, a question
asking about routing has two different answers, depending on which stack the question is referring to: the Network layer for OSI, or the Internet layer for the TCP/IP model.
CERTIFICATION OBJECTIVE 2.02
Application Layer Functions and Protocols As you can see in Figure 2-1, the Application layer of the TCP/IP model encompasses the top three layers of the OSI Reference Model (refer to Chapter 1 for a refresher on the Application, Presentation, and Session layers). All the functions, activities, and protocols from layers 7, 6, and 5 of the OSI model occur in the Application layer of TCP/IP. This TCP/IP layer: ■ Provides applications access to the network through a variety of specialized
protocols ■ Provides data formatting, code conversion, and encryption ■ Establishes, maintains, and terminates sessions
Literally hundreds of protocols are in the TCP/IP Application layer. Some of the more common protocols are covered throughout the rest of this section.
DNS The Domain Name Service (DNS) may well be the most widely and universally used protocol within the Application layer. Its use is so ubiquitous within Internet communications, it’s even used by other protocols! Therefore, it is absolutely essential you understand the purpose of DNS and how it functions. It probably goes without saying that computers and humans communicate in different ways. For one example, computers cannot communicate with each other
Application Layer Functions and Protocols
35
unless they are given a specific numerical address. This would work out great if we referred to each other by numbers instead of names: “Hello, 325176652, how are things? Heard from 447987768 lately?” However, people generally speak and communicate with names, and memorizing and using them is much easier for us. Names, though, simply don’t mean anything to computer systems. Consequently, we need a mechanism to give us the flexibility of remembering and referring to systems by easy-to-remember names, while simultaneously providing the numerical addresses computers need. This is where DNS enters the picture. DNS is simultaneously very simple, yet immense in nature and purpose. The main task of DNS is to resolve, or convert, an IP address for a given domain name. This allows an operator to type in a name for a resource, and provides a means for the system to find its numerical address equivalent. A domain name—sometimes referred to as a fully qualified domain name (FQDN)—is a name that is associated with one (or more) specific IP addresses. The name itself comes from a portion of something called the DNS namespace. The entire service referred to as DNS is comprised of three major components: the namespace, zones, and name servers (resolvers).
Be sure you understand the function, components, and basic name resolution steps within DNS. Exam questions will most likely reference DNS
operation as part of a scenario, and knowing what DNS does and how it works will greatly increase your ability to correctly choose the right answer.
The DNS namespace is comprised of a tree structure that, amazingly enough, begins with the root—a single dot (.). The DNS root symbolically provides a starting point for all lookups and names. One step below the root is the top-level domain. Many top-level domains (too many to list here) exist, with each established for a specific purpose. Some of the more common top-level domains are us, gov, edu, com, mil, net, and org. The level immediately below the top-level domain is known as the second-level domain—commonly referred to as the domain name. This portion of the namespace denotes a single organization or entity. For example, Cisco.com indicates a portion of the namespace, found inside the .com top-level domain, belonging to the Cisco organization. All computers and systems under Cisco’s control that Cisco wishes for people to locate via a name will be given an FQDN ending in cisco.com. For example,
36
Chapter 2:
TCP/IP
a server may be named srv1.cisco.com. This domain can additionally be further subdivided by additional names. For instance, accounting.cisco.com might contain all the computer names within the accounting department. Within each defined area of DNS namespace—referred to as a zone—there must be at least one server storing all the records for that particular zone. The zone file contains all the name-to-IP address mappings, and is queried by DNS to find the addresses of domain names. Table 2-1 lists some of the record types found in the zone file. The last major component of DNS is the servers themselves. Name servers hold the records for a single zone, or sometimes for several zones. Name servers answer DNS requests from clients to resolve FQDNs. The actual request to a given name server usually comes from a resolver. Resolvers are servers on your network that ask name servers for the information. To fully grasp this concept, consider a client trying to resolve the name www.cisco.com. Caching is a process used to limit the number of queries that have to go all the way to the root. Your computer has a DNS cache, and every name server and resolver along the way caches their results.This means systems can sometimes get the answer to a query very quickly, especially if others on their network have queried for the same record. The client operator types www.cisco.com into their web browser. The client system, to resolve to an IP address, sends its resolution DNS request to a local resolver. This resolver then queries name servers, all the way up to a root server, to find the one system holding all the records for cisco.com. That server responds to the resolver with the IP address. The resolver then responds to the client request, and this all results in the user happily surfing on Cisco’s web site.
TABLE 2-1
DNS Record Types
Record Type
Definition
SOA
Start of Authority: Defines the server that owns the zone records, as well as other administrative information (administrator name, current version, and so on)
NS
Name server: Defines a name server within the zone. Name servers hold all DNS records for the namespace.
A
Maps an IP address to a domain name.
MX
Mail Exchanger: Denotes the server within a namespace that takes care of e-mail traffic.
CNAME
Canonical Name: An alias used to mask the true identity of a server. This is often used as an alias for specific web sites within a domain.
Application Layer Functions and Protocols
37
DNS is a wonderful thing, but can sometimes cause unenviable frustration when working on Cisco products. For example, when working on a Cisco router or switch, if you type in an unrecognized command, the device assumes you want to make a DNS lookup and happily obliges.This lookup doesn’t work, obviously, and takes a long time to run through iterations before returning to the screen. In order to avoid this problem, use the command no ip domain-lookup on your devices (configuration of this command, and others, are covered later in the book—this is solely listed for reference and illustration).
DHCP Another well-known and oft-used Application layer protocol is Dynamic Host Configuration Protocol (DHCP). The main function of DHCP is to automatically assign IP addresses from a given pool of addresses to clients within a specific network segment. The pool of addresses a DHCP server uses is known as a scope. Servers and routers are generally configured as DHCP servers within a network. Every host on a TCP/IP network must have an IP address, which can be defined statically, if the administrator has plenty of time, patience, and organizational skills. Once a network grows, Don’t be surprised to see however, this becomes much more challenging DHCP listed as a Network layer utility on the and can quickly get out of hand. A better choice, exam.The actual protocol resides in the and one most administrators choose, is to use Application layer; however, the CCENT DHCP. To correctly apply and use DHCP within exam may list it as a Network, or layer-3, a network, you must install or enable the service, utility. configure the scope and other settings, and correctly place the server within the network. Installing and configuring the service is relatively easy, although there are many situations and configuration options to consider. When configuring the scope, savvy network administrators know to exclude or reserve certain addresses from the pool. Servers, switches, printers, and so on, all have a need for static IP addresses. Therefore, administrators can either assign these addresses statically and exclude those addresses from the scope, preventing clients from inadvertently pulling an address already in use, or reserve address space in DHCP so the devices always pull and maintain the same address. Other configuration additions include the address of the default gateway, DNS servers, WIN servers, and the amount of time a client is allowed to hold the IP address—known as a lease. Configuring DHCP on Cisco devices is covered later in this book. See Figure 2-2 for more information on the process a client uses to request and accept an IP address from a DHCP server.
38
Chapter 2:
FIGURE 2-2
The DHCP lease process
TCP/IP
START
New network client, no IP. TCP/IP stack initialization begins.
DHCP Discover
DHCP server responds with a lease proposal.
DHCP Offer Declined
Client restarts process.
Accept Requesting State: Client indicates to server it wants IP. DHCP Request DHCP server grants lease. DHCP Pack Binding State: Client uses lease information to complete TCP/IP stack configuration.
Pay particular attention to the location of DHCP servers in scenario questions. Remember, unless otherwise noted by an ip helper address
command within the scenario, DHCP servers will not offer IP addresses to clients on the far side of a router.
Application Layer Functions and Protocols
39
Finally, placement of your DHCP server is a very important consideration. DHCP works by broadcasting, which makes a lot of sense when you consider the process. When the computer first boots up, it does not know where the DHCP server is. In truth, it doesn’t even know its own network or address! So, the system sends a broadcast message asking for a DHCP server to provide an IP address. Every server running the DHCP service that receives the broadcast will respond, and the client generally takes the first offer it receives. Since routers do not forward broadcasts, it is important to remember to place a DHCP server on each network segment. If it is placed outside the segment, the systems cannot pull IP addresses. Watch for multiple or rogue DHCP servers on your network. A trainee learning how to configure DHCP on a server may inadvertently give out bogus addresses to many systems in your segment, causing issues for you and your users.
Other Protocols While there are many more protocols within the TCP/IP Application layer, and an entire book series could be written just about them, this section concentrates on the protocols you’ll most likely see on the exam. This is not to say this is all you’ll ever need to know about the Application layer; it’s just a focused view. Protocols covered in this section perform most of the basic day-to-day functions found in any network, such as file transfers, e-mail, web surfing, and network management.
File Transfer Protocols File Transfer Protocol (FTP) and Trivial File Transfer Protocol (TFTP) are both found in the TCP/IP Application layer, and they both perform the same function—they transfer files from one system to another. The manner in which they perform these functions differs, as well as where you would traditionally see them in play. FTP is as much a service as it is a protocol, and is comprised of a server, an authentication method, and the protocol itself. The FTP server is simply a machine that has installed and enabled the FTP service. The server administrator will define an authentication method within FTP (oftentimes completely separated from the operating system authentications), as well as assign permissions through the FTP directory structure. Users log on to the FTP service and, using a variety of commands, pull or put files from or to the server. FTP is considered a connection-oriented protocol, requiring a reliable transport protocol to manage acknowledgments of each packet sent. FTP can be installed on almost any server or workstation, as well as on many Cisco devices.
40
Chapter 2:
TCP/IP
FTP, while containing an authentication function, is not considered secure. Everything in FTP, including usernames, passwords, and data, is transmitted in clear text over the wire. Additionally, most FTP installations allow for an “anonymous” connection—meaning a user doesn’t even have to log on to use the service. TFTP operates a bit differently. While FTP is a reliable protocol, requiring acknowledgments for each packet sent, TFTP works in a “fire and forget” format: packets are sent as quickly as possible without any acknowledgment required (a process known as connectionless). This results in a much faster file exchange, but does not work well across long network segments or across network boundaries since some packets will, eventually, be lost. Another way this protocol differs from FTP is that TFTP requires no authentication at all—users simply connect and transfer files to and from the server. While there is no authentication method in place, TFTP does require the user to know the complete filename and location, as no directory listing is available. It is important to type the filename precisely when transferring to or from a TFTP server.
TFTP has traditionally been used to transfer Cisco IOS and configuration files between Cisco devices and a TFTP server on the network. Its small footprint, lack of extensive overhead, and
general ease of use make it an easy choice. FTP provides many more features, such as the ability to list the files within the directory, and is a better choice for end users.
E-mail Protocols Another important and very common network function is e-mail. The protocols in play to move e-mail through networks are Simple Mail Transfer Protocol (SMTP) and Post Office Protocol version 3 (POP3). SMTP, sometimes jokingly referred to as Send Mail To People, is always used to send mail and always transmits data in clear text (ASCII). Whether the file is being sent from a user or between servers, the protocol in use is always SMTP. POP3 comes in on the recipient side. When a client connects to an e-mail server to pull the messages down to read them, POP3 is the protocol in use. Both SMTP and POP3 are considered connection-oriented protocols. Because SMTP has little to no authentication features built in, attackers can sometimes abuse its hospitality to forward spam. Spam is unsolicited, unwanted e-mail sent in mass quantities, usually for commercial gain or malicious intent. An SMTP server, if not configured properly, will happily forward any e-mail
Application Layer Functions and Protocols
41
it receives—basically doing exactly what it was programmed to do. However, spammers connect to SMTP servers from outside the network and feed e-mails to it for delivery. This process is known as SMTP Relay and should be guarded against. IMAP4 (Internet Message Access Protocol) is another protocol that may be used to pull an e-mail message from a server. IMAP has a more sophisticated authentication structure than POP3, but is not as commonly used in modern networks.
Network Management Protocols Simple Network Management Protocol (SNMP) is another very important and oft-used Application layer protocol. SNMP provides a much needed, simple to use, and very powerful method of querying and managing devices on your network. However, it simultaneously opens significant security risks. SNMP consists of three major components: a central monitoring station, an agent on each device, and a database of questions. In a typical SNMP setting, a central monitoring station, running an SNMPcompliant application, is used to simplify management. The station begins by broadcasting SNMP GET requests to all devices within its network boundary. This message is received by each SNMP-enabled device and a small application, known as an agent, processes the request. To answer the request, the agent uses an agreed-upon standard set of questions and answers. These questions can be different per device type and vendor. The database that a particular device answers questions from is known as the Management Information Base (MIB). MIBs are normally unique for each device and vendor. The central station repeats SNMP requests against the MIB on each device and, eventually, builds a map of the network. This map can be used by a network management specialist to monitor network health, watch for potential problems, and even send configuration updates or changes to devices. Obviously, SNMP is very powerful. In an effort to provide at least some security to this process, SNMP was configured with two passwords in which to conduct business—a public and a private community string. The public community string is a password used to read information from SNMP-enabled devices. The private string is used to send configuration updates to devices. By default, the public and private strings on every SNMP-enabled device on the planet are set to (surprise) public and private, respectively. Should you choose to take advantage of SNMP within your network, these strings should, obviously, be changed to a more difficult password.
Web Surfing Protocols Lastly, no discussion on popular TCP/IP applications would be complete without at least briefly discussing web surfing. Most Internet browsing and viewing is done
42
Chapter 2:
TCP/IP
using two major protocols: HTTP and HTTPS. The World Wide Web (WWW) application, basically the complex combination of servers and specially formatted documents that make up the Web, is mostly accessed by browsers using Hyper Text Transport Protocol (HTTP). The main purpose of HTTP is to transport Hyper Text Markup Language (HTML) files; HTML is the language used to create a web page. The HTML instructions tell the browser what to display on the screen. The entire process is actually pretty simple. A user first enters a Uniform Resource Locator (URL) in the address bar of their web browser. For example, consider what happens when the user types in http://www.cisco.com/ccna.html. The browser then makes a request, using HTTP, for the HTML file named ccna.html, hosted on the computer (or domain) www.cisco.com, listed in the URL. The file is delivered, and the browser interprets and displays the HTML settings.
A URL is made up of three major components: the protocol used, the name of the server (or host) holding the resource, and the name of the page. The protocol comes first, before the //.
The domain name listed, such as Cisco .com, comes next and is the host holding the resource. Anything listed after the last “/” is the name of a specific resource (page) on the host.
Hyper Text Transport Protocol over SSL (HTTPS) uses much the same process, but adds security and encryption to the process. Secure Sockets Layer (SSL) is an encryption process that secures the communication between the client and the server hosting the site. An exchange of certificates ensures the client can safely exchange data without worrying about third-party interception. HTTPS is very common in online banking, shopping, and secured data sharing implementations. Both HTTP and HTTPS are connection-oriented protocols. CertCam
A multimedia demonstration of Wireshark can be found on the CD accompanying this book.
EXERCISE 2-1 Viewing TCP/IP Protocols in Action This exercise shows TCP/IP applications in action by viewing the packets captured during a live session. Please note the CCENT exam does not test on packet captures at all. This exercise is provided solely to enhance your understanding of TCP/IP by
Application Layer Functions and Protocols
43
viewing the packets in live action. Be sure you have Wireshark installed on your machine before proceeding. 1. Open a command prompt by clicking Start/Run/CMD. Type in ipconfig /release but do not press ENTER yet. 2. Open Wireshark and click Capture | Interfaces from the menu bar at the top. If you have more than one interface, the active interface will show packets being received and sent. Click the Prepare button beside the active interface and configure the settings to match Figure 2-3. Click Start. 3. Once the capture begins, you’ll see Figure 2-4. Additionally, Wireshark will display the capture packets in the background on the Capture Statistics window. At this point, go back to the command prompt window and press ENTER to release your IP address from all interfaces. After the interface releases the address (the command prompt window will display the IP address empty and a waiting prompt), type ipconfig /renew and press ENTER. After the interface gets a new address, type ping www.google.com and press ENTER. Close the cmd prompt window. 4. Go back to the capture window (shown in Figure 2-4) and press Stop—or press the Stop Capture button on the main menu. Wireshark displays the capture window, a frame display window, and a details window at bottom, as shown in Figure 2-5. Packets are displayed in the order in which they were captured. FIGURE 2-3
Interface capture options
44
Chapter 2:
TCP/IP
FIGURE 2-4
The Capture Statistics window
5. Click the Protocol column header, as shown in Figure 2-6. The packets are now displayed in the order of their type. ARP packets should show up first, with others following in alphabetical order.
FIGURE 2-5
Wireshark capture review
Application Layer Functions and Protocols
FIGURE 2-6
45
The Protocol column header
6. Highlight an ARP packet by clicking it once. Expand the Frame Display window in the middle of the screen by dragging the window open larger. Click the “+” signs beside each area to fully expand the information. All information about the packet, including frame type, protocol used, flags set, and addressing is displayed. Your display should look something like Figure 2-7. 7. Use the scroll bar to the right of the packet capture window to move down to the first DHCP packet. After selecting it and viewing the information in the frame display window, simply arrow down to the next DHCP packet. Notice the information in the frame display window changes to reflect the information from each new packet. Continue to arrow down to view the entire DHCP release and renew process. 8. Repeat the previous steps to view information on DNS packets, as well as any other protocols your particular system may be receiving or sending (FTP, SNMP, SMTP, and so on).
46
Chapter 2:
TCP/IP
FIGURE 2-7
Examining packets
CERTIFICATION OBJECTIVE 2.03
Transport Layer Functions and Protocols No matter what the application protocol, there must be a protocol in place to transport the request and, eventually, the return data. The TCP/IP Transport layer performs the same functions as its namesake layer in the OSI model: segmentation, reliable end-to-end delivery of data, and flow control. Transport layer protocols include Transport Control Protocol (TCP) and User Datagram Protocol (UDP).
Transport Layer Functions and Protocols
47
TCP TCP is a connection-oriented reliable transport protocol used by applications that require error correction in delivery. On the good side, TCP provides the reliability services that applications may not have built into them. The drawback is that, in order to do so, TCP adds a lot of overhead to the communications process (see Figure 2-8 to view the TCP header). This slows things down, consumes more bandwidth, and requires more processing for hosts during communication. Protocols making use of TCP as a transport protocol include SMTP, HTTP, HTTP(s), FTP, and a host of others. The TCP communications process encompasses three major functions: session establishment, error recovery, and flow control. Every TCP communication process begins with a session establishment process known as the three-way handshake. In the first phase, the requesting system sends a synchronization request segment, known as a SYN. The SYN segment is a simple request to open a communications channel, and includes the SYN flag set, a sequence number, and port numbers (covered later in this chapter). When the server receives this request, it formulates and sends a synchronization/acknowledgment segment, known as a SYN/ACK. This segment includes the SYN and ACK flags set, an acknowledgment of the requestor’s sequence number, and a separate sequence number. Finally, in the third step, the requesting system sends an acknowledgment segment, known as an ACK. This segment includes the ACK flag set, a copy of the acknowledgment of the original sequence number, and an acknowledgment of the server’s own sequence number. This process can be seen in Figure 2-9. Once the session is established, data can start flowing between the two systems. During data transmission, eventually segments get lost due to a variety of causes. TCP handles error recovery by using the sequence number and acknowledgment
FIGURE 2-8
0
4
10
16
SOURCE PORT
A TCP header
24
31
DESTINATION PORT SEQUENCE NUMBER ACKNOWLEDGMENT
HLEN
RESERVED CODE BITS* CHECKSUM
WINDOW URGENT POINTER
OPTIONS (IF ANY) DATA ....
PADDING
48
Chapter 2:
TCP/IP
FIGURE 2-9
SYN (Synchronization Request)
1
The three-way handshake 2
SYN/ACK (Acknowledgment)
Requesting host
Receiving host ACK
3
fields in the header. The sequence number agreed upon during the three-way handshake is incremented for every agreed-upon number of data bytes sent. For example, if the two systems agree to send 100 bytes at a time, the sequence number would increase by 100 for every segment sent. In other words, each segment that leaves increases the sequence number by a specific amount. On the receiving end, the recipient system acknowledges the receipt of each segment by incrementing the sequence number to the next expected segment. For example’s sake, imagine an established session with an agreed-upon sequence size of 100. If a system sends a segment with a sequence number of 422, the recipient would send an acknowledgment with the sequence number set to 522. An example of this in practice can be seen in Figure 2-10. Recovery of lost segments is easy to see within this process. The sending machine will wait until it receives an acknowledgment before it sends the next segment in line. If the acknowledgment does not come, or is not the expected reply, the sender knows to retransmit the previous segment(s). For example, imagine a sender has transmitted segments with sequence numbers of 122 and 222, and has received an acknowledgment of 322 (the next segment number). The sender knows the recipient has accepted both previous segments and is expecting 100 bytes (322). The sending machine transmits segments 322 and 422, and waits. If all goes well, the acknowledgment will read 522. If the end station loses the last segment, however, the acknowledgment is 422, telling the sender to retransmit the segment with sequence number 422. This process, also known as ordered data transfer, allows for retransmission of lost segments and ensures all segments are received in the order in which they were sent.
Transport Layer Functions and Protocols
FIGURE 2-10
Sequence Number: 422 —Send Acknowledgment
A TCP acknowledgment 2
4
1
ACK-522
Sequence Number: 522 —Send Acknowledgment
Requesting host
49
3 Receiving host
ACK-622
Sequence numbers not only help out in keeping segments in order, but they can also help in reducing the number of retransmissions. For example, consider a conversation occurring between two systems with an agreed-upon sequence increment of 1000 bytes. If the sending device has sent three segments and the sequence number started at 1000, the sending device would expect an acknowledgment of 4000. Suppose, however, the recipient only received the first and third segments. The acknowledgment would be 2000, notifying the sender it needed the second segment. However, immediately after sending the acknowledgment, the second segment finally arrived. The sending device, receiving an acknowledgment of 2000, would assume the second segment never arrived. It would then retransmit sequence number 2000 and await an acknowledgment. The recipient now has all three segments, having received the second segment in between all this activity. It now sends an acknowledgment for what it is expecting next—sequence number 4000. Requesting the retransmission of the third segment would have been a waste since it had already been received. TCP also makes use of a timer for error recovery. If the sending machine does not receive an acknowledgment within the allotted time, it will retransmit all outstanding segments.
50
Chapter 2:
TCP/IP
The last major function in TCP is flow control. This process ensures data is transmitted as quickly as possible without overwhelming the recipient machine. If TCP required an acknowledgment of each and every segment, flow control wouldn’t be needed at all. However, that wouldn’t be very efficient, and the communications process would be dramatically slowed. A more equitable solution would be to have the sending machine transmit several segments and wait for an acknowledgment from the recipient of the entire grouping. Both machines could communicate with each other until a maximum size of segment groupings is agreed upon. TCP accomplishes this by using the window size field in the TCP header. The window size field lets each system know the total number of unacknowledged segments that can be outstanding at any time, and can change at any time during the process. Keeping things simple, assume a sending machine sends segments 1, 2, and 3, with a window size of 3. If the path between the two can transmit all segments within the allotted time, and the recipient can handle it, the acknowledgment will read 4. This lets the sender know all three segments were received and it can send the next three. Starting small, the window size will be slowly incremented by the sending machine until a threshold is met. At this point, the sender and recipient are transmitting data as quickly as possible, without congestion problems. The process of the window size changing during communications is known as sliding windows.
Be sure to review and understand the three major functions accomplished within TCP. You will definitely be asked questions testing your knowledge on the order transfer of data, requiring
you to predict sequence numbers from a given scenario. Pay close attention to the sequence number itself, as well as the agreed-upon size.
UDP The second Transport layer protocol is User Datagram Protocol (UDP), shown in Figure 2-11. Unlike TCP, UDP is a connectionless protocol, meaning it does not require acknowledgments and does not provide for error correction. A much simpler protocol with a smaller header, UDP simply transmits segments as quickly as possible, without regard to the recipient. UDP has the advantage of being much faster than TCP, but it does not provide many of the services that TCP’s larger header allows for. If UDP is used as a transport protocol, reliability becomes a function of the applications themselves.
Transport Layer Functions and Protocols
FIGURE 2-11
A UDP header
Source Port Number (16 Bits) UDP Length (16 Bits)
51
Destination Port Number (16 Bits) UDP Checksum (16 Bits) DATA
The UDP header is only eight bytes long.
UDP is a good choice in a couple of scenarios. If the data transfer is one (or just a few) packets, then the overhead of TCP is unnecessary. Both DNS and DHCP are good examples. In another good UDP scenario, the applications themselves must be capable of tolerating lost packets, or have some means by which to ask for retransmissions. For example, streaming video and Voice over IP (VoIP) can both tolerate a packet or two lost along the way, as long as the stream doesn’t get too choppy.
Port Numbers and Multiplexing Regardless of the transport protocol in use, there must be a method in place to let the recipient Transport layer know which application protocol the transmitted segments should be passed to. For example, imagine a server simultaneously hosting a web site and running an FTP service. A TCP connection sequence occurs and a client connects to the server, sending a request for data. How does the server know which application protocol—HTTP or FTP—is to handle the request? Additionally, consider how confusing things could get if the same address asked for both services in different streams. Port numbers are used to identify which protocol is to answer a request and provide for multiplexing multiple requests from a single source. Both TCP and UDP use port numbers, from 0 to 65,535, which are divided into specific ranges. The numbers up to 1023 are called well-known port numbers and represent applications used by the operating system. Port numbers between 1024 and 49,151 are called registered ports, while those between 49,152 and 65,535 are dynamic ports. Dynamic ports are open for use without restriction, and are used by sending machines to identify individual communication sessions. Well-known ports are listed in Table 2-2. To understand the use of port numbers in TCP for multiplexing, consider the preceding example and the demonstration in Figure 2-12. First, the client requests a web page from the server by choosing a random port number (5000) in the dynamic range for the source, and using the port number for HTTP (80) as the destination. When the data is returned, the ports are reversed—80 is now the source, with 5000 as the destination. While surfing the web site, the same client decides to transfer a file from the FTP service on the server. A second communications request begins,
52
Chapter 2:
TABLE 2-2
Well-Known Port Numbers
TCP/IP
Port Number
Application Protocol
20
FTP (Data)
21
FTP (Control)
22
SSH
23
Telnet
25
SMTP
53
DNS
67,68
DHCP
69
TFTP
80
HTTP
110
POP3
161
SNMP
443
HTTPS (SSL)
with the recipient choosing another random port number (5001) as the source port, and using the port number for FTP (21) as the destination. Once again, as the data is returned, the port numbers are swapped—21 is now the source with 5001 as the destination. This process allows both systems to track each session separately, even though the address of the requestor and sender remain the same.
FIGURE 2-12 Source Port 5000
Port numbers and multiplexing 2
Source Port 80
Source Port 5001
Web server 2
Destination Port 80
Destination Port 5000
Destination Port 21
Source Port 21
1
1
Destination Port 5001
Client
Internet and Network Access Layer Functions and Protocols
53
Even though ports 1024 through 49,151 are considered registered ports, they can be used as dynamic ports by systems during communications.The combination of an IP address, a transport protocol, and a port number is known as a socket. Additionally, just for fun, the ports clients used are also known as ephemeral ports.They randomly are assigned from a pool of ports the client has available, and are never reused until a client has exhausted all of its pool of ports.
CERTIFICATION OBJECTIVE 2.04
Internet and Network Access Layer Functions and Protocols After the Application and Transport layers have accomplished their functions, the segment is passed down for logical addressing and routing. The same functions and activities from the Network layer of the OSI model occur in the Internet layer of the TCP/IP stack. As with any stack, two major protocol types occur in this layer: routed and routing protocols. Routed protocols define the format and fields of a packet, provide the logical addressing needed to be moved from one location to another, and can be routed from one subnetwork to another across a router. Routing protocols specify the manner in which routes are learned and placed in the route tables of routers, as well as define how the routers talk to each other. Routing protocols will be covered in greater detail in Chapter 6.
Routed protocols can be routed across networks (or subnets). Routing protocols are used to exchange information between routers to determine best path availability. You might also see a
reference to “non-routable” protocols on the exam. Non-routable protocols cannot, obviously, be moved from one subnet to another. An example is NetBEUI.
54
Chapter 2:
TCP/IP
IP and ICMP The Internet Protocol (IP) is the routed protocol found in this layer. It provides the hierarchical addressing and routing functions for data delivery across networks. IP addresses are 32 bits in length, with some bits providing a network address and others acting as host addresses inside the network. This ability acts much like a ZIP code in postal addressing, as discussed in the “Network Components” section of Chapter 1. IP address construction, use, and functionality are discussed in greater depth in Chapter 6. While considered a connectionless protocol, IP does make a sincere effort to forward all packets. This is commonly referred to as best-effort delivery. However, due to network congestion, cable faults along the way, and a host of other reasons, packets (sometimes referred to as datagrams) can get lost. In and of itself, IP has no way to deal with datagram loss, or with issues such as out-of-order receipt. The Internet Control Message Protocol (ICMP) was established to alleviate this problem. ICMP is an Internet layer protocol that provides error notification and, sometimes, error correction for IP datagram delivery. ICMP can notify sending hosts when packets are lost or congestion occurs. It can even alter their default gateway information to more efficiently send certain packets! A host of ICMP message types are available, but by far the most familiar and often used are the ECHO REQUEST and ECHO REPLY types. ping is a command-line tool used to test basic network connectivity. It sends an echo request to a distant host, and if the host receives the message, it responds with an echo reply. A successful test means the connection between the two hosts is good from layers 1 through 3. However, a number of reasons exist as to why the connectivity test would fail. A network segment along the path may be too congested to pass the requests, the host might be temporarily offline or configured to not respond to pings, a firewall may be preventing the ping, or a router along the way does not have a route listed in its table for the end destination IP address. Table 2-3 covers common ping responses and their meaning. ping is usually used to systematically test network connectivity between two devices. In doing so, you should always ping from local to remote. For example, suppose a user claims they cannot access a resource on the Internet. To properly troubleshoot this problem, you should first eliminate problems with the local machine by typing ping 127.0.0.1 (or ping localhost). The IP address 127.0.0.1 (also known as localhost) is used to test the TCP/IP binding on the local network card. Next, ping the default gateway for the system. The default gateway is the
Internet and Network Access Layer Functions and Protocols
TABLE 2-3
ping Responses
55
ping Response (ICMP Message Type)
Meaning
Reply from ______
Layer 1–3 connectivity is good for the pathway.
Request Timed Out
The host did not respond to the ping request. This could mean it is offline, the pathway is corrupt, or ping is being blocked.
Destination Unreachable
There is no route to the end station. This could mean your default gateway router cannot find the route, or a router along the way does not have a route.
router port or firewall port on the local subnet providing access to outside networks. Lastly, ping the remote host. This systematic approach simplifies and accelerates troubleshooting efforts.
The responses to a ping display differently in a Cisco device, with a single character indicating the message type. An exclamation point (!) indicates a good response. Other responses include a
dot (.) for timed out, and a capital “U” for destination unreachable. Also, be sure to remember to ping from local to remote in troubleshooting scenarios.
A final tool associated with ICMP is traceroute. The traceroute command displays all the IP addresses of all routers along the path to the final destination, which obviously provides a much more granular and meaningful snapshot in any troubleshooting scenario. The traceroute command on Cisco devices displays the IP address of the next hop device along the path. A sample network and traceroute output is displayed in Figure 2-13.
Be sure you understand how to use the traceroute command, as
well as the meaning of its expected output. You will definitely see exam questions on it.
56
Chapter 2:
TCP/IP
172.16.1.1
FIGURE 2-13
199.50.60.15
172.16.1.2
Traceroute 192.168.1.1
172.17.1.1 172.17.1.2
Host1 192.168.1.15
RTR1#traceroute 199.50.60.15 Type escape sequence to abort.
Host2 199.50.60.15
Tracing the route to 199.50.60.15 1 172.16.1.2
9 msec 4 msec 4 msec
2 172.17.1.2
22 msec 24 msec 22 msec
3 199.50.60.15 24 msec 24 msec 28 msec
Network Access Layer Protocols The Network Access layer of TCP/IP encompasses all the functionality of both the Data Link and Physical layers of the OSI Reference Model. Encapsulation, framing, media access, and physical addressing, as well as all the physical standards associated with cabling, connectors, and encoding, all occur here. Each Network Access layer protocol defines a specific frame type in which to encapsulate a packet for delivery within the network segment. In other words, the packet must be delivered somewhere locally first, before it can make its way out of the network. If all devices on the media use the same Network Access protocol and standard, the frame type is understood and the frame is delivered to the appropriate device. The Network Access layer encompasses a wide variety of protocols and standards, including SLIP, PPP, and Ethernet. Serial In-Line Protocol (SLIP) and Point-to-Point Protocol (PPP) are both designed for point-to-point network segments. SLIP was the first, and generally worked well. However, it was only capable of delivering TCP/IP traffic and, as networking grew, the need for transporting other protocol suites grew with it. PPP was created to address this problem, since it could transmit almost any Internet layer protocol. Within LANs, however, Ethernet is by far the most common Network Access layer standard. Ethernet also defines a specific frame type, using MAC addresses and
Internet and Network Access Layer Functions and Protocols
57
allowing for a host of services and functions within the LAN. While point-to-point connections generally do not need to worry about addressing (everything sent is always sent to the same recipient), multiple systems connecting to a single segment do need a method to determine who the message is intended for. Additionally, by putting more than one system on the wire, functionality for dealing with collisions had to be put into place. These functions, along with more details, are covered in Chapter 4.
Each network segment uses a specific Network Access layer standard. As the packet moves from one network segment to the next, the frame is stripped off by the router and a new frame is built
for transmission on the next segment. For example, an Ethernet segment may pass over a PPP or SLIP network on the way to its destination.
INSIDE THE EXAM TCP/IP Much like Chapter 1, questions from this chapter’s material on the exam may not be explicit, but instead be part of scenario-based queries. Direct questions about the material should be fairly straightforward, so a good understanding of the protocols discussed here will help out greatly. On matching questions asking you to identify a particular layer, remember that the TCP/IP layers do not match exactly with the OSI model. The TCP/IP Application layer encompasses the top three layers of the OSI Reference Model, the Internet layer replaces the Network layer, and the
Network Access layer encompasses the bottom two OSI layers. You should commit several key points to memory from this chapter, and be sure to understand the basic functions of each of the Application protocols mentioned. At the Transport layer, pay particular attention to the three-way handshake, port numbers, flow control, and multiplexing. Additionally, be very familiar with the differences between TCP and UDP. In the Network Access layer, be sure to remember the frame type changes as the packet travels from network to network.
58
Chapter 2:
TCP/IP
CERTIFICATION SUMMARY The TCP/IP chapter first compared and contrasted TCP/IP and OSI. All functionality from the OSI Reference Model also occurs within the TCP/IP stack; however, TCP/IP only has four layers. The TCP/IP Application layer comprises layers 7 through 5, and holds several protocols. DNS provides domain-name-to-IPaddress resolution, while DHCP dynamically tracks and assigns IP addresses within a network segment. FTP and TFTP are file transfer protocols. FTP is connectionoriented, while TFTP is connectionless and faster. SMTP and POP3 combine to move e-mail through networks. SNMP is a very powerful protocol for network management functions. HTTP provides for web surfing and HTML transport, while HTTPS provides secured methods for web access. Transport layer protocols include TCP and UDP. TCP is connection-oriented and uses a three-way handshake to set up a session. Within the session, TCP uses sequence numbers and acknowledgments for reliability, and sliding windows for flow control. UDP is connectionless, and faster than TCP, but does not have the flow control and reliability features of TCP. Regardless of TCP or UDP, port numbers are used to track multiple communications sessions between systems. Well-known ports are used to identify the Application layer protocol, while dynamic ports are used by requesters to identify the session. Internet layer protocols include IP and ICMP. IP is a routed protocol, providing hierarchical logical addressing; ICMP provides error notification and other services lacking in IP. Network Access layer standards include SLIP, PPP, and Ethernet.
Two-Minute Drill
✓
59
TWO-MINUTE DRILL TCP/IP and OSI Reference Model Comparison ❑ The TCP/IP model has four layers: Application, Transport, Internet, and
Network Access. ❑ TCP/IP’s Application layer maps to the Application, Presentation, and Ses-
sion layers of the OSI model. The Internet layer maps to OSI’s Network layer. The Network Access layer holds the Data Link and Physical layers.
Application Layer Functions and Protocols ❑ DNS provides domain-name-to-IP-address resolution. DNS makes use of
resolvers, name servers, and the domain namespace. Top-level domains fall immediately under the DNS root, and hold individual zones. Each zone has an SOA record and a name server that holds all the records for the zone. ❑ DHCP provides automatic dynamic IP address allocation within your net-
work segment. A DHCP server is configured with a range of addresses, called a scope, along with other information—such as default gateway and DNS server addresses. DHCP works on broadcasts, so placement of the server must be within the segment. Multiple DHCP servers on the same segment can be problematic, because bogus addresses may be handed out to clients. ❑ Both FTP and TFTP are file transfer protocols. FTP is connection-oriented
and requires some form of authentication, but is considered insecure because it passes everything in clear text. TFTP is connectionless and much faster, but does not offer directory listing or authentication. TFTP is commonly used to transfer Cisco IOS or configuration files. ❑ SMTP, POP3, and IMAP4 work together to transmit e-mail. SNMP is used
for network management and configuration options and relies on public and private community strings for security. HTTP transports HTML formatted pages, and HTTPS adds the SSL protocol for encrypted data transfer. ❑ Transport layer protocols include TCP and UDP. TCP is connection-
oriented and uses a three-way handshake, with a SYN, SYN/ACK, and ACK transfer to establish a communications channel before data is transmitted. TCP provides reliability by using acknowledgments, and flow control by using a sliding window. UDP is connectionless and does not provide the same
60
Chapter 2:
TCP/IP
services as TCP; however, it is much faster. UDP is typically used to transfer Cisco IOS and configuration files from devices to a server and vice versa. ❑ Port numbers are used to identify the Application layer protocol to be used.
A sending machine applies a source port dynamically and a destination port from the well-known range. Upon the response, the port numbers are swapped in the header. The combination of IP address, sequence number, and port number is known as a socket and allows for multiplexing between two systems. ❑ IP is a connectionless routed protocol assigning hierarchical addresses to
packets. IP allows for both host and network address bits within each address. ICMP provides error notification services for IP. ping responses include request timed out (host did not respond), destination unreachable (no route available in a router), and reply from (success). ❑ Network Access layer standards include SLIP, PPP, and Ethernet, as well as
many others. SLIP and PPP are used for point-to-point links, while Ethernet is used inside most LANs.
Transport Layer Functions and Protocols ❑ TCP is a connection-oriented, reliable layer-4 transport protocol. Applica-
tion protocols making use of TCP as a transport protocol include SMTP, HTTP, HTTP(s), and FTP. ❑ The steps within TCP session establishment (known as the three-way hand-
shake) include Synchronization, Synchronization Acknowledgment, and Acknowledgment packets (SYN, SYN/ACK, ACK). ❑ TCP handles error recovery by using the sequence number and acknowledg-
ment fields in the header. The sequence number agreed upon during the three-way handshake is incremented for every byte of data sent. ❑ Flow control in TCP is accomplished using the window size field in the TCP
header. ❑ UDP is a connectionless, unreliable layer-4 transport protocol. UDP does not
require acknowledgments, does not provide for error correction, and does not require a session establishment before data is transmitted. Application protocols making use of UDP as a transport protocol include DNS, DHCP, TFTP, and streaming audio programs.
Two-Minute Drill
61
❑ Port numbers in the TCP or UDP header identify which Application layer
protocol is to answer a request, as well as to provide for multiplexing multiple requests from a single source. Port numbers range from 0 to 65,535: 0 to 1023 are called well-known port numbers, 1024 to 49,151 are called registered ports, and 49,152 to 65,535 are dynamic ports. Source port numbers are dynamically assigned, and any number over 1023 is an acceptable source port.
Internet and Network Access Layer Functions and Protocols ❑ Routed protocols can be routed across networks (or subnets). Routing proto-
cols are used to exchange information between routers to determine best path availability. ❑ Internet Protocol (IP) is a routed protocol, using a 32-bit hierarchical ad-
dress. IP is considered a connectionless, best-effort protocol. ❑ ICMP is an Internet layer protocol that provides error notification and, some-
times, error correction for IP datagram delivery. ❑ ping is a command-line tool used to verify basic network connectivity (up to
layer 3). ping uses ICMP ECHO REQUEST, ICMP ECHO REPLY, and other ICMP message types to convey connectivity information. ❑ Encapsulation, framing, media access and physical addressing, as well as all
the physical standards associated with cabling, connectors, and encoding, all occur in the Network Access layer. ❑ Serial In-Line Protocol (SLIP) and Point-to-Point Protocol (PPP) are both
designed for point-to-point network segments. SLIP is only capable of delivering TCP/IP traffic, while PPP is capable of delivering almost any Internet layer protocol. ❑ Ethernet is the most popular layer-2 technology used within LANs.
62
Chapter 2:
TCP/IP
SELF TEST The following Self Test questions will help you measure your understanding of the material presented in this chapter. Read all the choices carefully since there may be more than one correct answer. Choose all the correct answers for each question.
TCP/IP and OSI Reference Model Comparison 1. Which of the following are true when comparing TCP/IP to the OSI Reference Model? (Choose two.) A. The TCP/IP model has seven layers while the OSI model has only four layers. B. The TCP/IP model has four layers while the OSI model has seven layers. C. The TCP/IP Application layer maps to the Application, Session, and Presentation layers of the OSI Reference Model. D. The TCP/IP Application layer is virtually identical to the OSI Application layer. 2. In which layer of the TCP/IP stack is routing and logical addressing found? A. Network B. Data Link C. Internet D. Network Access 3. In which layer of the TCP/IP stack is framing found? A. Network B. Data Link C. Internet D. Network Access 4. Formatting and code conversion occurs in the ________ layer of the OSI model, and the ________ layer of the TCP/IP stack. A. Data Link, Network Access B. Network Access, Data Link C. Application, Presentation D. Presentation, Application
Self Test
63
Application Layer Functions and Protocols 5. Which TCP/IP Application layer protocol provides IP address resolution for domain names? A. DHCP B. DNS C. SMTP D. SNMP 6. You receive several calls about a lack of network connectivity from a group of users. After investigating, you find all the users are on a brand-new segment off the internal router. Your network uses DHCP and all users on the original segment are functioning fine. What is the most likely cause of the problem? A. Every user on the new segment has manually assigned their own TCP/IP address information. B. The DHCP server is on the original segment, and DHCP requests are not allowed to cross a router. C. Cabling to a single host on the new segment has been severed, taking down the entire network. D. This is a temporary problem. Simply waiting longer will fix it. 7. Within SNMP, the ________ community string allows a central device to read MIB information, while a ________ community string provides the authentication to send configuration updates. A. Public, Private B. Private, Public C. Read, Read/Write D. Read/Write, Read 8. What signifies the hostname holding the resource in the URL http://www.cisco.com/ education.htm? A. http B. www.cisco.com C. education.htm D. www.cisco.com/education.htm
64
Chapter 2:
TCP/IP
Transport Layer Functions and Protocols 9. TCP completes a three-way handshake before exchanging data. In order, what are the steps? A. ACK, SYN/ACK, SYN B. ACK, SYN, SYN/ACK C. SYN/ACK, ACK, SYN D. SYN, SYN/ACK, ACK 10. What is the well-known port number for SMTP? A. 21 B. 22 C. 23 D. 25 E. 110 11. A client connects to a server and attempts to pull a web page. What port would appear in the destination field of the requesting machine’s TCP header? A. 23 B. 25 C. 80 D. 88 E. 110 12. Which of the following port numbers could appear in the source port field of a TCP header leaving a requesting system? A. 1022 B. 1023 C. 49,172 D. 80
Internet and Network Access Layer Functions and Protocols 13. Which protocol provides error notification services for IP? A. ping B. SNMP C. DNS D. ICMP
Self Test
65
14. While using ping to test network connectivity, you receive a “Destination Unreachable” reply. Which of the following is the most correct interpretation of the result? A. The end host is offline. B. A layer-1 problem exists between the two hosts. C. A layer-3 problem exists between the two hosts. D. The end host is online. 15. The point-to-point protocol ________ was replaced by PPP, largely because it could only transport TCP/IP. A. PPTP B. SLIP C. SNMP D. SMTP
66
Chapter 2:
TCP/IP
SELF TEST ANSWERS TCP/IP and OSI Reference Model Comparison ✓ B and C. The TCP/IP model has four layers. The Application layer maps to the top three 1. ® layers of the OSI Reference Model. ® ˚ A and D. These are contrary to B and C. ✓ C. Routing and logical addressing occur at the Internet layer of the TCP/IP stack. 2. ® ® ˚ A. The Network layer is an OSI model layer. B. Data Link is an OSI model layer. D. Framing, error checking, and media access occur at the Network Access layer of the TCP/IP stack. ✓ D. Framing, error checking, and media access occur at the Network Access layer of the 3. ® TCP/IP stack. ® ˚ A. The Network layer is an OSI model layer. B. Data Link is an OSI model layer. C. Routing and logical addressing occur at the Internet layer of the TCP/IP stack. ✓ D. Formatting and code conversion are Presentation layer functions in the OSI model. The 4. ® Application layer in TCP/IP maps to the top three layers of the OSI model. ® ˚ A, B, and C. None of the remaining options are correct.
Application Layer Functions and Protocols ✓ B. DNS resolves an IP address for a domain name. 5. ® ® ˚ A. DHCP provides automatic dynamic address allocation inside a network segment. C. SMTP provides e-mail transmission between clients and servers. D. SNMP provides network and configuration management services. ✓ B. DHCP messages are sent broadcast and, therefore, will not cross the router. 6. ® ® ˚ A. It is unlikely every client manually changed their TCP/IP configuration at the same time. C. Cabling to a single host would not bring the entire network segment down. D. Waiting will not fix this problem. ✓ A. Public and private community strings are used within SNMP to read and write, 7. ® respectively. ® ˚ B. The choices are backwards. Private allows for writing configuration data, while public allows for reading MIB information. C and D do not exist as community strings. ✓ B. Anything between the // and / in the URL is the hostname holding the resource. 8. ® ® ˚ A, C, and D. http is the protocol used, and education.htm is the individual page requested.
Self Test Answers
67
Transport Layer Functions and Protocols ✓ D. The three-way handshake begins with a synchronization packet (SYN), which is then 9. ® acknowledged (SYN/ACK). The last step is an acknowledgment of the sequence numbers (ACK). ® ˚ A, B, and C. The steps are out of order. ✓ D. The port number for SMTP is 25. 10. ® ® ˚ A. 21 is the port number for FTP. B. 22 is the port number for SSH. C. 23 is the port number for telnet. E. 110 is the port number for POP3. ✓ C. The port number for HTTP, used to pull HTML web pages, is 80. 11. ® ® ˚ A. 23 is the port number for telnet. B. 25 is the port number for SMTP. D. 88 is the port number for Kerberos. E. 110 is the port number for POP3. ✓ C. Source port numbers from a requesting machine are dynamic and must not be from the 12. ® well-known port range 0–1023. ® ˚ A, B, and D. All answers are from the well-known port range, which cannot be used here.
Internet and Network Access Layer Functions and Protocols ✓ D. ICMP provides error correction and notification services to IP. 13. ® ® ˚ A. ping is a command-line utility used to test network connectivity. B. SNMP is an Application layer protocol for network management. C. DNS provides IP address resolution for a domain name. ✓ C. Destination unreachable indicates there is no entry in the route table of your system, or 14. ® a router on the path, for the end host. ® ˚ A. If the packet makes it to the end station’s network, and the station is offline, you should receive a Reply Timed Out message. B. A Destination Host Unreachable message indicates a layer 3 problem, not one in layer 1. D. If the packet reaches the destination network and the device is online, you should receive a Reply From message. ✓ B. SLIP was a popular point-to-point protocol early on, but was only capable of 15. ® transmitting TCP/IP. ® ˚ A. PPTP is a tunneling protocol. C. SNMP is an Application layer protocol for network management. D. SMTP is an Application layer protocol for e-mail.
This page intentionally left blank
3 Network Media and Devices
CERTIFICATION OBJECTIVES 3.01
Network Media
3.02
Network Devices
✓ Q&A
Copyright © 2008 by The McGraw-Hill Companies. Click here for terms of use.
Two-Minute Drill Self Test
70
Chapter 3:
Network Media and Devices
S
o far, we’ve covered some basic essentials of networking knowledge, and discussed the grouping of rules needed for a network to function. However, while protocols provide the rules and standards needed on our networks, and the knowledge and definitions covered are essential, they only offer portions of the overall networking puzzle. To become an effective networking technician, you need to know the physical as well as the theoretical. In this chapter, we’ll begin the examination of the physical hands-on side of networking by taking an in-depth look at the pathways data uses to travel on a network, known as network media. We’ll first examine some basics and terminology on media in general, followed by a discussion on copper cabling characteristics, types, and connectors. Next, we’ll explore some basics of fiber cabling. Lastly, we’ll complete the chapter with wireless transmission media characteristics and fundamentals.
CERTIFICATION OBJECTIVE 3.01
Network Media Just as vehicles need roadways on which to travel, data needs a pathway to use to move from system to system. In the early days of networking, these choices were limited. However, in the modern world, your choice of data pathways ranges from physical cabling to a wide variety of wireless over-the-air options. Network media simply refers to the defined pathway data travels within a network. Your choice of media depends on a variety of considerations, such as bandwidth, attenuation, noise immunity, and cost. Every media choice has a specific maximum bandwidth it is capable of transmitting. In general, installers choose the highest grade of cable available, within cost, for a specific installation. This allows for upgrades in networking devices later on, without removing and installing new cabling. This section concentrates on physical media (cabling), while wireless communications are covered in Chapter 11.
Media Terminology Attenuation refers to the degradation of a signal over distance traveled on a media. As data travels down a cable, the signal strength weakens due to imperfections and
Network Media
71
interference. Each media type, therefore, has a specific cable length in which signaling works. Some cable types and implementations have relatively short distances, while others can span—literally—miles. Attenuation concerns, unless handled by the cable type itself, are usually mitigated with a layer-1 device—a repeater. Noise immunity is another concern in choosing appropriate media for your network. Noise is a catchall term used to refer to the many different forms of interference that can affect a data signal. Electromagnetic interference (EMI) and radio frequency interference (RFI) are two common culprits in damaging data signals. Depending on your media choice, your network may be susceptible to one, both, or neither. Lastly, many times media choice comes down to cost. Generally speaking, the cost of the media increases as its susceptibility to noise and attenuation decreases. Additionally, media can have several different grades or categories within a specific type. While you may wish to install the best media available, keep in mind that all the devices you purchase for your network must also work on the media, and some media requires a healthy investment in component/hardware upgrades. In other words, the cost isn’t necessarily just about the media, but also includes the upgrade in networking components you may need to run the media. Cabling falls into two major categories: copper-based and fiber-based. Copper cabling uses electrical impulses to send bits, while fiber cabling encodes bits using light impulses. Each category has several defining characteristics and is applied in different situations. In the next section, we’ll discuss some basics of cabling at the LAN level. Most, if not all, of the cable discussions following will be applicable to an Ethernet LAN. Ethernet networking is discussed in greater detail in the next chapter.
Copper Cabling Copper cables are the most common media choice for the majority of LAN installations, mainly due to cost and their relative ease of installation. Initially, copper-based networks used coaxial cables as their media; however, most modern implementations use a form of twisted pair. Regardless of which copper cabling you choose, attenuation and EMI are issues to deal with in your network planning. Some, like coax and shielded twisted pair, have at least a modicum of protection against EMI, but all are susceptible to noise interference and eavesdropping. While not a wise option for modern networks, in the early days of Ethernet networking coaxial (coax) cables provided the most popular media choice. A coax cable consists of a central copper core surrounded by insulating material and a
72
Chapter 3:
Network Media and Devices
braided metal shield. The signal travels through the central core, and the shield provides protection against EMI as well as acting as a ground for the signal. Another consideration with using coax is the actual physical properties of the electrical signal itself. All electrical signals require a terminated ground, or they will “bounce” back through the wire. In coax cabling, terminators must be affixed to both ends of the cable for data networking to function. If a terminator is loose or disconnected, the entire network segment will fail. Coax cables come in a wide variety of standards, but only two were normally used in LAN implementations. Coax cables aren’t a part of modern LAN implementations, but you will still see them on the job—particularly on the WAN provision side. Cable television providers are now taking advantage of the available bandwidth on the RG-6 coax cables already in place throughout much of the country, splitting the data signal from the analog waves carrying the television channels. You can easily tell whether a coax cable is for television/cable modem purposes by looking at the connector. An F-type connector is threaded and screws on a nut-and-bolt assembly. Thicknet cabling (also known as 10BASE5) was the original Ethernet transmission media. As its name implies, the cable itself is relatively thick, stiff, and hard to work with. The benefit of thicknet is that its solid core is capable of transmitting a signal up to 500 meters, and it is highly resistant to EMI. However, connections to the bus required “vampire” clasps (taps), and data transmissions were only capable up to 10 Mbps. Thicknet is no longer used as a data transmission media, although it may appear in older networks. If you were to see either coax type on an existing, relatively modern network, you’ll most likely see thinnet used as a backbone to connect several hubs together. Thinnet (also known as 10BASE2) rapidly replaced thicknet in most LAN installations during the early 1980s. Thinnet is much thinner, lighter, and, more flexible than thicknet, making it easier to work with and install. Due to its thinner core, however, data signals can travel only 185 meters before attenuating. However, attaching hosts to the bus was relatively easy, using Bayonet Neill-Concelman (BNC) and T connectors.
Network Media
Important topics to remember regarding coax cabling are the maximum data transmission rate (10 Mbps), the segment lengths (185–500), and the connector types (BNC,T, and Terminators). Additionally, remember coax
73
cabling is difficult to troubleshoot: loose or disconnected terminators and/or a single break in the cable will bring the entire segment down, and discovering where the link is broken can be frustrating.
Twisted pair has replaced coaxial cabling as the media of choice for most new network installations. Twisted pair cabling is relatively inexpensive and is simple to work with and install. Signals do not travel as far on twisted pair as they do on coax—generally, 100 meters on TP, with up to 500 meters on coax—however, they do provide more options for network topologies and offer much greater transmission speeds—up to 10 Gbps compared to coax’s 10 Mbps. Twisted pair consists of eight separate wires twisted into four distinct color-coded pairs. The pairs consist of four solid color wires—orange, green, blue, and brown—together with a white-striped version in each pair (for example, orange and white orange, green and white green, and so on). The twist ratio, twists per inch, is different on each pair and is used to reduce crosstalk and interference on the wire. Additionally, twisted pair comes in two distinct varieties: shielded and unshielded. The shielded version provides a metal shield to help protect against EMI. The Electronic Industries Alliance, the Telecommunications Industry Association (EIA/TIA), and the American National Standards Institute (ANSI) created several categories for twisted pair cabling in 1991, setting specific measurable standards for attenuation, twist ratio, and grade. The higher the category listed, the better the cable and the more options you have available to you as a network technician. For instance, Category 3 cabling is perfectly acceptable for 10 Mbps Ethernet. However, Category 5 can handle the same 10 Mbps rate, but can also run up into gigabit speeds. In most cases, network designers will call for the highest grade of cabling available in order to provide for Be sure to know the future growth and expansion of services. Twisted transmission rates and implementation pair categories are listed in Table 3-1. uses for each of the categories.
74
Chapter 3:
TABLE 3-1
Twisted Pair Categories
Network Media and Devices
Cable Category
Bandwidth Capability
Application
1
1 Mbps
Voice (telephone)
2
4 Mbps
Token ring
3
10 Mbps
Ethernet
4
16 Mbps
Token ring
5
100 / 1000 Mbps
Fast/gigabit Ethernet
5e
1000 Mbps
Gigabit Ethernet
6
1000–10,000 Mbps
Gigabit and 10-gigabit Ethernet
6e
10,000 Mbps
10-gigabit Ethernet
7
10,000 Mbps
10-gigabit Ethernet
Just as with coax cabling, one of the most important pieces of the overall cable plan is the connector allowing a device to access the wire. While thinnet cabling used BNC connectors, T connectors, and Terminators, twisted pair makes use of either an RJ11 or an RJ45 connector. RJ11 connectors—smaller, thinner, and using only six pins (three pair)—are used on telephone twisted pair, while RJ45—larger, thicker, and using eight pins (four pair)—is the choice for data networking. Attaching an RJ45 connector to a twisted pair cable end is a bedrock function for data networkers today and requires knowledge of the physical connector itself and the color-coded cable pairs. The connector has eight copper pins that, before crimped, jut out from the bottom of the connector. These pins have small “teeth” on the inside of the connector that will pierce each cable as the connector is crimped, providing the electrical conduit for the signal. These pins are designed to touch matching pins in an open port. Therefore, it is vitally important that all cables are cut square, arranged properly, and pushed all the way inside the connector before crimping. Poor connectors are the number one source for almost all physical network connectivity problems. On a twisted pair cable, be sure to check that the Kevlar sheath has been pushed into the connector before crimping. If not, the only things holding the connector to the wire are the small copper taps at the end of the connector, and as a result, sooner or later, you’ll have problems with that cable. Before learning the appropriate color combination for an RJ45 connector, you must first understand the pinouts on the devices you are connecting. A pinout is the
Network Media
75
allocation of a specific function to an individual pin. For example, one pin can be set to transmit, while another is set to receive. The pinouts on a device are defined by the network standard in use. Ethernet standards, covered more in depth in Chapter 4, prescribe the pinouts listed in Table 3-2. The pinouts on a device port dictate which type of cable should be used in any given scenario. Notice from Table 3-2, the transmit pins on an NIC, pins 1 and 2, are different than the transmit pins on a switch or hub port. Switches and hubs have a pinout that is the reverse of the NIC—pins 1 and 2 are set to receive, while 3 and 6 are set to transmit. Considering this, it should be easy to see that a cable connecting the pins directly to each other, allowing the signal to run straight through, works perfectly between devices of different pinouts. A twisted pair cable that has all pins running to their corresponding twin—pin 1 to pin 1, pin 2 to pin 2, and so on—is known as a straight-through cable. Examining the connectors on both ends of a straight-through cable, you’ll find they are identical. Consider, though, what would happen if you were to plug two devices of the same pinout together. For example, oftentimes network design will call for hubs or switches to be plugged together. If a straight-through cable were used in this instance, pin 1 on one switch port would transmit to pin 1 on the other switch port—which is also set to transmit. Therefore, communication could not occur; pins 1 and 2 on both ends would continually transmit to nothing, and pins 3 and 6 would always be listening, waiting for a signal that would never arrive. In this instance (plugging two devices of the same pinout together), a cable must be created that allows the signal to cross over from pin 1 to pin 3 and pin 2 to pin 6. This is accomplished by swapping the colored
TABLE 3-2
Device Pinouts
Devices NIC, Router, Wireless Access Point, Network Printers
Function and Pinout
Function and Pinout
Transmit
1
1
Receive
Transmit
2
2
Receive
Receive
3
3
Transmit
4
4
5
5
6
6
7
7
8
8
Receive
Transmit
Devices Hub, Switch
76
Chapter 3:
Network Media and Devices
pairs on one end of the cable to a different pin set than the original. A cable that maps pins this way is known as a crossover cable. If you examine the connectors at the ends of a crossover cable you’ll find the orange and green pairs are swapped, allowing the signal to cross from pins 1 and 2 to pins 3 and 6.
Be very aware of which and a computer have the same pinout, cable to use in a given scenario. Pay therefore, a crossover cable is the correct particular attention to the pinouts before choice. answering a question. For example, a router
The last cable type is more Cisco-specific and is not used to connect networking devices together. A rollover cable is used in conjunction with a PC serial port and a DB9-to-RJ45 transceiver to physically access a router or switch console port for administrative purposes. Rollover cables map the pins to their opposite on the end of the wire—pin 1 to pin 8, pin 2 to pin 7, and so on—rolling the signal over to the opposite end. More on rollover cables and console administration will be covered later. While true that a cable with a connector on both ends pinned out the same will suffice for straight-through uses, it’s obviously a better choice to make sure all cables within your network are created with the same color scheme. Imagine trying to troubleshoot connectivity problems in a network where every cable had a different pinout! Additionally, the cables are granted a category rating based in part on the twist ratio for each pair. In other words, the individual color codes are created with a specific purpose in mind, and are twisted accordingly. With eight pairs and multiple colors to choose from, it seems logical a standard should be set. Many new Cisco devices have a built-in method to assist with cabling—the port senses the pinout from the far end device and auto-configures the port’s pinouts to match, no matter whether the cable is straight-through or crossover. However, just because this feature is available, you shouldn’t throw caution to the wind and simply use any cable lying around. Sticking with convention assists in troubleshooting and reduces downtime later. The Electronic Industries Alliance and the Telecommunications Industry Association (EIA/TIA) created standards for color coding and connectors for
Network Media
77
twisted pair wiring. The EIA/TIA 568A and 568B standards are used for creating twisted pair cabling for Ethernet networks. 568B pinouts on both ends of the cable create a straight-through, while a crossover can be created by using 568B on one end and 568A on the other. The color codes for 568B, from left to right, with the tab down and the open end of the RJ45 connector toward you, are white-orange, orange, white-green, blue, white-blue, green, and white-brown, brown. The 568B standard is most commonly used for Ethernet networks. A simple way to remember the color layout is the pneumonic “Only Good Boys Get Brownies.” The first letter corresponds to the color, and you always alternate white, solid, white, solid, and so on. The 568A pinouts simply reverse the orange and green pair: white-green, green, whiteorange, blue, white-blue, orange, white-brown, brown. Either standard will work just fine for Make sure to familiarize Ethernet straight-through cabling, but typically yourself with the color codes for straightif you see a connector wired to 568A, it will be through (568B) and crossover (568A) a crossover cable, with a 568B pinout on the cables. far end. See Figure 3-1 for a picture of the cable layout by color for each standard.
Fiber Cabling While copper cabling is much more common in data networks, fiber cabling offers many advantages and is finding its way more and more into modern networks. Fiber cabling encodes bits into light signals, which are totally immune from both
FIGURE 3-1
The EIA/TIA pinouts
Pin Pin Pin Pin Pin Pin Pin Pin 1 2 3 4 5 6 7 8
Pin Pin Pin Pin Pin Pin Pin Pin 1 2 3 4 5 6 7 8
EIA/TIA 568B Standard
EIA/TIA 568A Standard
78
Chapter 3:
Network Media and Devices
EMI and eavesdropping. Fiber also offers longer segment lengths, much higher bandwidth speeds, and better security than copper cabling. On the other hand, fiber has historically been the most expensive option—not only the cabling itself but the devices and NICs used to access the fiber media drive up the installation cost. Until recently, it has also been considered relatively difficult to work with, as connectors are difficult to attach and the cable itself is relatively fragile. Fiber cables contain a glass or clear plastic core that is surrounded by a material known as cladding. Cladding works like mirrors to reflect the light signal back toward the core. As an analogy, consider a flashlight pointed at a wall. If you turn the flashlight on and begin walking backward, the circle of light on the wall gets larger, but dimmer. Light signals inside the wire tend to do the same thing, making the signal weaken the further down the wire it travels. Cladding controls this modal dispersion and ensures the signal stays clear and focused directly down the core of the wire. Most fiber cabling in LAN and WAN implementations falls into two major categories: single mode fiber (SMF) and multi mode fiber (MMF). SMF is generally yellow in color, uses a laser as a light signal source, and has a smaller core (9 microns or less in diameter). MMF is orange in color, uses an LED as a light source, and has a larger core (50 to 100 microns in diameter). SMF accommodates high bandwidths and very long segment lengths and is the primary fiber choice for network backbone lengths. MMF carries multiple light signals concurrently, but at a shorter distance than SMF. Just as with coax and twisted pair cabling, fiber cables have specific connectors for each cable type. The most common connectors used in fiber cabling are ST, SC, and MTRJ. ST connectors, often referred to as stick and twist connectors, look very much like the BNC connectors used on coax cabling. SC connectors, known as stick and click, are square and have a tab used for connectivity, much like the tab on the RJ45. Lastly, MTRJ connectors are small form factor (meaning they are smaller in physical size than typical connectors), and are normally used for connections to fiber modules in switches or routers. Fiber cable is used as a backbone inside most LANs. Many times, the cable (yellow or orange) will travel into a small transceiver, which allows a UTP or STP cable to then run into your router or switch. Fiber can be used straight to the desktop, but this is not very common.
Network Devices
79
CERTIFICATION OBJECTIVE 3.02
Network Devices Network media supplies the pathway on which data can travel, and protocols furnish the rules that data must comply with while “on the road.” However, it’s logical to then wonder what controls the traffic as it moves through our network highway. While Chapter 1 touched on the devices needed for a network to function, this section goes into a little greater detail on how these devices interact with one another to control traffic. In general, two terms are used in discussion with devices: flooding and filtering. Flooding a packet means the device sends it out of every port, regardless of address. Filtering implies the device reads an address and makes a decision about which port to send it out on, or whether to drop it. More information on Cisco devices is, of course, covered in much greater detail throughout the rest of this book. This section is merely an introduction to network device function.
Exam questions won’t usually be merely rote memorization. Rather, the exam will concentrate on the usage of each device in a given scenario.
Pay particular attention to the layer at which each device works, and how each device’s function affects network performance.
NICs Network interface cards (NICs) provide the interface your system needs to access to physical media. Usually, NICs are built into the motherboard on the computer itself, or are added as some form of expansion bus card. These cards can range from (older) ISA boards and (newer) PCI boards to PCMCIA cards inserted into a laptop port. The card installed on the system must match the media used. For example, you can’t have a 10BASE2 coax card on a network using UTP—the ports and connectors simply don’t match. NICs listen to the wire based on the media access method the network uses. When a frame is detected, the NIC reads the physical address (MAC address) and makes a determination on whether to pass it to the operating system (OS) through
80
Chapter 3:
Network Media and Devices
the protocol stack bound to the board, or to ignore the frame. If the address in the frame is unicast and matches the NIC’s MAC address, it will accept and process the frame. If the address is broadcast, it will open and process the frame to determine if action needs to be taken. If the address is multicast, the frame will be accepted and the layer-3 address will be used to determine if it is processed or discarded. Because NICs make processing decisions based on the layer-2 addresses, NICs are considered to be layer-2 devices.
Transceivers, Repeaters, and Hubs In many instances, various network media will find its way into a network design. For instance, a designer may use fiber cabling as a backbone, daisy-chaining several switches together on the segment, while using UTP for client connectivity to the switches. Something has to provide a means to translate the light signals on the fiber backbone to electrical signals for the UTP and vice versa. A transceiver is used for just such a purpose. Transceivers do not read addresses, nor affect the data at all. They simply convert the signal from one media type to another. Because they are “dumb” to addresses and work purely on bits, transceivers are known as Physical (layer 1) devices. Transceivers are most often seen when connecting a fiber ST or SC backbone to a UTP or STP network, or at legacy router ports. Older Ethernet router ports were built using an AUI connector, and a transceiver allowed a UTP cable to be used with the AUI port. On most modern networks, switches and routers can have a fiber module built in.The module is nothing more than a transceiver crafted to fit in the available slot on the router or switch. Occasionally in your network design, you will come across the need for a longer segment length than is allowed for a given media. For example, a single user may be 120 meters from the communications closet, and your UTP network is only capable of 100-meter segment lengths. To solve this problem, a repeater can be used. Repeaters have two ports and, like transceivers, do not read addresses of any kind, nor do they update the data. Repeaters simply repeat and regenerate a signal in order to overcome the attenuation restrictions of a media type. Because repeaters do not read addresses, nor make any changes to the data, they are also considered layer-1 devices.
Network Devices
81
A hub, another layer-1 device, is simply a multiport repeater. Hubs act as a wiring concentration point, allowing systems to plug into a central location, and do not look at addresses of any kind. Hubs do not make any decisions on filtering or forwarding data traffic—whatever enters the hub on one port is flooded out of every other port. To further examine this claim, consider Figure 3-2. Though this is an oversimplified depiction of a hub, the image does show why signals on a hub are sent to all devices. If you take off the top of the hub and examine the wiring within, you’ll notice that all ports basically run to a bus in the back of the box. This means all copper cables are touching; therefore, any electrical charge applied to a single port charges all other ports. The hub is nothing more than a box that ties all the wiring together. Hubs and repeaters provide both good news and bad news regarding your network. On the good side, repeaters allow designers to extend segment lengths in special situations, to provide services to individuals or offices that happen to fall outside the network’s serviceable footprint. On the bad side, repeaters allow for more systems to share the media. As more and more systems attach to the media, more and more bandwidth is shared, and the opportunity for collisions to occur increases (collisions and collision domains are covered in greater detail in Chapter 4). Because of their impact on network performance, and the fact they increase the size of collision domains, hubs and repeaters are not recommended in network design unless absolutely necessary.
Bridges and Switches Hubs and repeaters can result in very slow networks. Assume, for example, you have four hubs daisy-chained together, as shown in Figure 3-3, and each hub has ten users on it. After chaining all the hubs together, you have 40 users sharing the same wire segment. The result is that a message from any of the users is repeated to every other
FIGURE 3-2
A hub
82
Chapter 3:
Network Media and Devices
A collision domain with hubs
Message to PC3
FIGURE 3-3
PC2
PC3
PC4
PC5
PC6
PC7
PC8
PC1
member on the wire (in Figure 3-3, a message from PC1 to PC3 is flooded to all 40 users). Additionally, the chances of a collision (two devices transmitting at the same time) is relatively high. In this case, 40 systems are all part of the same collision domain—a shared segment of media where a message from one system could collide with messages from other systems. Collisions greatly slow not only the individual systems that are part of the collision, but the network as a whole. An answer to this problem is to segment the collision domain, and in this case, a bridge would work nicely. A bridge is a two-port layer-2 device that is used to effectively split a single collision domain in two. Continuing our example, the bridge would be placed between the hubs, with two chained hubs plugged into one side of the bridge, and the remaining pair plugged into the other port, as shown in Figure 3-4. When the bridge is powered on, it initially acts just like a hub, flooding all messages as they are received. However, it pays attention to the source MAC address in each frame and keeps a table in memory, recording the location of each MAC. After a short amount of time, the bridge learns the MAC addresses on each side of the network and can then begin filtering traffic. As a message is sent from one station, it floods through the hubs and reaches the bridge port. The bridge reads the MAC address and compares it to its table. If the MAC is on the other side of the network, the bridge will allow the message to cross and flood into that segment. If, however, the MAC is on the same side of the bridge as the sending PC, the bridge will not allow the message to cross, effectively splitting the collision domain in half. In our example shown in Figure 3-4, the message from PC1 to PC3 is not forwarded to the other side of the network segment. The bridge learned which side PC3 was on and, after reading the destination MAC address, knew to keep the message on the originating side.
Network Devices
Collision domain
FIGURE 3-4
83
Collision domain
Message to PC3
Segmenting with a bridge
PC2
PC3
PC4
PC5
PC6
PC7 PC8
PC1
Additionally, our bridge has split the collision domain in half. Because it blocks messages intended for one side from crossing over to the other side, the number of stations that can collide with each other reduces. In our example, the bridge has taken the original single-collision domain of 40 systems and segmented it into two domains of 20 systems each. Messages from PC1 can collide with PC2, PC3, and PC4, but not with systems from the other collision domain! This provides an obvious performance boost to your network and, effectively, cuts the number of collisions in half. This topic is touched on again in Chapter 4. In addition to improving network performance, bridges can also be used to connect two dissimilar layer-2 segments together under one logical address scheme. For example, consider Figure 3-5. In this instance, the bridge is placed between a segment using token passing and a segment using standard Ethernet. The frame type used by the token ring network will not make sense to systems on the Ethernet side, and vice versa. To solve this problem, a translational bridge will read the frame and compare the destination MAC address to its table. If the bridge determines that the destination MAC is on the other side of the segment, the original frame is stripped off and a new frame, matching that type, is built for delivery into the other segment.
84
Chapter 3:
FIGURE 3-5
Translational bridging
Network Media and Devices
Host A
Host B
Application
Application
Presentation
Presentation
Session
Session
Transport
Transport Bridge
Network
Network
IP PKT
LLC
Link
Data Link MAC
Ethernet
Data Link
Token ring
Physical
Physical Ethernet
Ethernet frame
Token ring
Physical
Token ring frame
Switches do an even better job of segmenting collision domains. A switch looks much like a hub, and it starts out just like a hub—forwarding all traffic to all ports. However, as you’ll see, this does not last long. As with the diagram for a hub, Figure 3-6 displays an oversimplified version of a switch, with the top taken off. Notice that each wire connection from a port ends with a physical switch that does not physically touch
FIGURE 3-6
A switch
Network Devices
85
the bus. Chips inside the switch monitor both the port wires and the bus itself. As a message hits a port, that wire energizes and the switch at the end closes, touching the bus. The chips inside the device read the source and destination MAC addresses and make a determination as to which port to send the message. The bus then closes the appropriate switch for that one port, and the message is delivered. After delivery, the switches are opened, awaiting the next message. A final advantage switches hold over hubs deals with simultaneous delivery of frames. If a hub receives two frames at the same time, a collision occurs and neither gets delivered; remember, all ports on a hub share the same media, so only one device can transmit at a time. On a switch, ports do not share the media; they see the line as available 100 percent of the time. Because of this design, a switch is capable of simultaneous frame transmission from multiple hosts — a significant advantage over hubs.
Be sure to familiarize yourself with bridge and switch operation in regards to splitting collision domains and speeding up network performance. Remember, both devices initially flood all traffic until the source addresses are learned and entered into an internal table. Exam questions will not only test
basic knowledge on this, but will provide scenarios in which you’ll have to determine which system can collide with the source, as well as trace the forwarding of a frame, based on its MAC address. Also, don’t forget: switches and bridges both flood broadcast and multicast traffic, no matter where it comes from.
This method of operation offers a couple of advantages. First, because only one wire is allowed to touch the bus at any given time, collisions are effectively eliminated. Second, since the bus ensures the switches close only between sender and receiver, each device receives 100 percent of the available bandwidth speed. Because switches read MAC addresses and make filtering decisions on frames, they are considered layer-2 devices.
Routers Bridges and switches do a great job of splitting collision domains and improving LAN traffic speeds. However, switches and bridges do nothing to limit broadcasts (bridges and switches flood all broadcast and multicast traffic), and cannot get traffic out of your network. For these functions, and more, you’ll need a router.
86
Chapter 3:
Network Media and Devices
Switches can be used to control broadcasts if you configure VLANs. However, VLANs can get very confusing, especially in a large network, and must be used with extreme caution and care. VLANs are covered later in this book. A broadcast domain is the area of your enterprise network a broadcast can be propagated through. Since hubs, bridges, and switches flood broadcast traffic, they serve to expand a broadcast domain—any host connected to these devices receives every broadcast sent by any other host on the device. Administrators should attempt to control broadcast propagation within the network for two main reasons: broadcasts can rapidly consume available bandwidth, and each host must spend its own processing cycles on broadcast messages. The only piece of equipment that splits broadcast domains is a layer-3 device, such as a router or firewall. Getting traffic out of the network is another job for the layer-3 appliance. While a bridge can be used to connect two layer-2 segments, they both must be in the same IP address subnet. For clarification, consider the post office analogy used earlier in this book: A layer-2 device acts like a single postal clerk inside a neighborhood. The clerk can deliver mail inside the neighborhood, where all houses have the same ZIP code, but is not responsible for delivering mail to houses in a different ZIP code. In fact, if the clerk receives a letter destined for another ZIP code, he takes it back to the post office (router) for delivery. A bridge can only connect layer-2 segments where all systems share the same network address. (More on network IP addresses and subnetting will be covered later in this book.) A router is used to connect networks. Acting much like a post office, the router strips off the frame and looks at the Logical (layer 3) address. It then compares the address to a route table and makes a determination on what to do with the packet. If a route exists in the route table, the router will build the appropriate frame for that network’s technology (Ethernet, Point-to-Point, Frame Relay, and so on) and send it out the appropriate port. If there is no entry in the route table, the router will drop the packet. Route tables are built in one of two ways: static or dynamic. Static routing means the administrator simply types in the routes for the route table. Dynamic routing allows the routers within your network to share information with each other about the networks they know of, and information regarding each link. This information is incorporated into the route table and keeps it constantly updated. Much more on routing, route tables, routing protocols, and the like is covered later in this book.
Network Devices
87
Security Devices While hubs, bridges, switches, and routers are used to move data around in the network (and you can apply security actions to each), modern networks also make use of devices specifically intended for security purposes. Probably the best known and most often referenced device involving network security is a firewall. Firewalls work by examining traffic at the Network and Transport layers and comparing the frame/packet with a filter list. If the administrator has specifically defined the traffic as allowable, the frame/packet is allowed through. If the traffic presents a security risk, the administrator can add an explicit deny statement, or simply choose to not address the traffic at all in the filter list. Firewalls work with an implicit deny feature, meaning if the traffic is not explicitly allowed by a filter rule, it is automatically dropped. For example, assume a firewall has been placed between an internal network and the Internet. The administrator decides to allow users from inside to surf web traffic, but does not want to allow users from outside (the Internet) to access web resources inside the network. The administrator could add two rules to the filter list: the first rule allows traffic with a source IP address matching the internal network and a destination port of 80 traveling to any IP address to pass through the firewall, and the second prevents traffic with a source IP address from any subnet other than the internal network destined to the internal network IP range with a destination port of 80.
You should be very familiar with firewall operations—not necessarily the configuration of the device—but the basics on how it operates. Pay particular
attention to the implicit deny feature, the idea of an inside and outside port (network), and how the firewall uses IP addresses and port numbers to filter traffic.
Obviously, careful planning is required before installing a firewall—simply taking it out of the box and installing it blocks all traffic to (and sometimes from) the network! Firewalls are typically placed between a public network and the Internet to protect internal users from attack. Additionally, firewall ports are treated just like router ports—each is a separate network. Most designers use firewalls to create demilitarized zone (DMZ) networks to help secure their internal networks. Devices that are to be publicly accessible—such as your company web, DNS, and e-mail servers—are placed in the DMZ, and firewall rules are used to allow access to them, but not your internal network.
88
Chapter 3:
Network Media and Devices
A firewall is only as good as the configuration placed on it and does not, by itself, represent a total security solution. Use care in the placement of a firewall, as well as in determining which configuration settings to set. A second, very commonly discussed network security device is an intrusion detection system (IDS). Intrusion detection systems perform exactly as the name implies. These devices are placed in a location to monitor all network traffic (usually, just inside—or immediately on the outside—of your network border) and compare the traffic against a set of criteria. If the packet stream matches the criteria (predefined indicators of an intrusion attempt), the IDS takes action. Depending on the type of system used, this could be as simple as an audible alarm and a notification to a log file (for administrator review), or a more active response, such as shutting down the communication stream or redirecting the traffic to another location for analysis during the attack. If the device takes action to prevent the attack, in addition to simply detecting and notifying administrators of it, the system is referred to as an intrusion prevention system (IPS). If the device simply detects attack signatures and provides notification on possible incidents, it is an IDS. More information on firewalls, IDS and IPS, network security, risks, and mitigations is covered in Chapter 12.
Putting It All Together Knowing how all the devices work together helps in the overall design of a network. Two of the most important tasks of a network installer are reviewing network diagrams for technical accuracy and performing troubleshooting. A thorough understanding of how data travels through the network via the stages of the OSI Reference Model and within the protocols of TCP/IP helps in this process. A typical network diagram appears in Figure 3-7. Most network diagrams follow the same symbology: ■ Routers are circles. ■ Switches are rectangles with multiple arrows pointing in each direction. ■ Hubs are rectangles with a single arrow pointing in each direction. ■ Bridges are rectangles with a half-moon shape cut out of the top.
Network Devices
89
FIGURE 3-7
A typical network diagram
Internet
Firewall Bridge Hub Workstation Router Switch
DMZ
Other oft-used symbols include those for firewalls (comprised of a wide variety of symbols, usually including bricks), the cloud (indicating the Internet, or another packet switched network that traffic must travel through), lines representing specific connections (such as wireless, serial, Ethernet, and so on), and other networking equipment (PCs, laptops, servers, firewalls, and others).
Make sure you are very familiar with network diagrams.The exam uses the same symbology discussed in this section, but may not label each device on the diagram. In other words, knowing what a switch and bridge do will help you in answering the question, but if you are
not familiar with the symbol for each, you may misdiagnose the network diagram provided. Be sure to check the icons used in the diagrams on the exam before the exam starts.The icons should be listed on one of the preparatory pages.
90
Chapter 3:
Network Media and Devices
INSIDE THE EXAM Network Media Exam questions on media may seem like a straightforward exercise, but be forewarned; they are trickier than you think. It is essential you understand port pinouts, both 568A and 568B cabling standards, and the different cable types (straight-through, crossover, and rollover). Most exam questions will involve a network diagram and a scenario, requiring the knowledge to identify which cable type to use and/or which pin number is being used from one device to the next. Make sure you know the differences between copper and fiber—chiefly the EMI implications. Lastly, be able to identify and match connectors, cables, and ratings.
Network Devices Much of the CCENT exam will center on diagnosing problems using a scenario and a
network diagram. Be sure you understand each device function and placement, paying special attention to how each device handles frames, packets, collisions, and broadcasts. Also, knowing what layer each device works at will help with many questions. Keep in mind that the layer a device is said to work at is the topmost layer that device works in. For instance, all devices work at the Physical layer and, of course, routers must read layer-2 addresses before processing the packet. Be sure you understand the process of a message received at an interface: bits are interpreted as frames and, once the address is determined to match, the frame is stripped off and the packet is handed up the stack. Lastly, make sure you’re very familiar with the icons used on the exam to represent each device—including the type of line connection to and from the device.
CERTIFICATION SUMMARY Important media terminology includes attenuation (the degradation of a signal over distance traveled on media), noise (any form of interference affecting the signal), and EMI (interference caused by magnetic interference). Cable falls into two categories: copper and fiber. Copper is generally cheaper and much more prevalent; however, it is susceptible to EMI. Fiber is immune to EMI but is more expensive. Copper cable includes coax and twisted pair.
Certification Summary
91
Twisted pair cables come in a variety of grades, with each Category rating providing a media for a specific purpose. Cat 5e is the minimum recommended for Fast Ethernet. The 568B standard is the most common wiring pinout for RJ45 connectors—white-orange, orange, white-green, blue, white-blue, green, white-brown, brown. 568A swaps the green and orange pairs. The pinout on NICs, routers, WAPs, and printers transmits on pins 1 and 2, and receives on pins 3 and 6. Hub and switch ports have a pinout with pins 1 and 2 set to receive, and 3 and 6 set to transmit. Straight-through cables are used for connecting devices with different pinouts, while crossover cables are used to connect devices with matching pinouts. Rollover cables are used between the serial connection on a PC and the console port on a Cisco router or switch. Fiber cable types include SMF, for high bandwidth and long distances, and MMF, for shorter distances and multiple concurrent signals. Fiber connectors include ST (stick and twist), SC (stick and click), and MTRJ, used mainly for connections to fiber modules in switches and routers. Network devices include NICs, transceivers, hubs, bridges, switches, routers, firewalls, and IDSs. NICs are considered layer-2 devices and allow hosts to access network media. Transceivers are layer-1 devices that translate one Physical layer connection to another. Hubs are layer-1 wiring concentrators, while bridges work at layer-2, and can effectively cut a collision domain in half, increasing performance. Additionally, bridges can be used to tie two different layer-2 segments together, known as translational bridging. Switches split the collision domain by every port, and also work at layer 2. Routers connect networks together and split broadcast domains, while security devices include firewalls and IDS. Firewalls filter traffic between two networks, examining the source layer-3 address and the destination port number to make a decision on permitting or denying the packet. All firewalls work with an implicit deny feature—unless the traffic is explicitly allowed, it is blocked. IDSs monitor network traffic and notify administrators when an attack is occurring. IPSs take action to prevent the attack from continuing.
92
Chapter 3:
✓
Network Media and Devices
TWO-MINUTE DRILL Network Media ❑ Concerns in selecting media for the network include attenuation, noise
immunity, features, and cost. ❑ Coax cabling is of two major types: thicknet and thinnet. Thicknet segment
lengths can reach up to 500 meters, while thinnet segments can reach 185 meters. Coax connectors include BNC and T connectors. ❑ The two major kinds of twisted pair cabling are unshielded twisted pair
(UTP) and shielded twisted pair (STP). Twisted pair cabling consists of four color-coded pairs, with each pair twisted at a specific rate (twist ratio), where segment lengths can reach up to 100 meters. ❑ UTP (and STP) is rated in several categories. Category 3 cabling is the mini-
mum required for Ethernet networking (10 Mbps). Category 5 cabling is the minimum for Fast and Gigabit Ethernet. ❑ The pinout on NIC, router, wireless access point, and printer ports has pins 1
and 2 set to transmit, and pins 3 and 6 set to receive. Hub and switch ports have pins 1 and 2 set to receive, and pins 3 and 4 set to transmit. ❑ Straight-through cables have all pins on one end of the cable mapped directly
to the same pins on the far end, and are used between devices with different pinouts. Crossover cables map pins 1 and 2 on one end to pins 3 and 6 on the far end. They are used between devices with the same pinout. Rollover cables map pins on one end to their opposites on the far end, and are used to connect a PC serial port to a router or serial console port. ❑ The EIA/TIA 568B standard from left to right, with the tab down, has colors
in this order: white-orange, orange, white-green, blue, white-blue, green, and white-brown, brown. 568B is the standard used on most straight-through cables. ❑ The EIA/TIA 568A standard from left to right, with the tab down, has the
colors in this order: white-green, green, white-orange, blue, white-blue, orange, and white-brown, brown. 568A is most often used on the other end of a 568B cable to create a crossover cable.
Two-Minute Drill
93
❑ Single mode fiber (SMF) has a small core, uses a laser as a transmission light
source, and can transmit high bandwidth over very long segment lengths. Multi mode fiber (MMF) has a larger core. ❑ Fiber connectors include ST, SC, and MTRJ connectors.
Network Devices ❑ Layer-1 devices include transceivers, repeaters, and hubs. Layer-1 devices
extend collision domains, slowing network performance and increasing collisions. ❑ Transceivers are used to connect one physical media type to another. Com-
mon examples include AUI to RJ45 and fiber to RJ45. Repeaters are used to amplify the signal, extending the length of a network segment. Hubs are multiport repeater wiring concentrators used in star and broadcast topologies. ❑ Layer-2 devices make filtering decisions based on the physical MAC addresses
in the frame, and are used to segment collision domains (reducing collisions and increasing performance). Bridges and switches are layer-2 devices. ❑ Layer-2 devices filter unicast messages, but flood broadcast/multicast messages. ❑ Layer-3 devices—routers—are used to move traffic between networks and
split broadcast domains. ❑ Routers strip off the frame and make filtering decisions based on the layer-3
address in the packet. If a route is found in the route table, the packet is then reframed and sent out the correct port. If there is no entry in the route table, the packet is dropped. ❑ Route tables are built statically or dynamically. Static tables are created and
updated manually, while routing protocols are used to dynamically update tables. ❑ Security devices include firewalls and IDS/IPS. Firewalls permit or block traffic
between networks based on layer-3 addresses and layer-4 port numbers. IDSs monitor network traffic and notify administrators when an attack is in progress. If the system takes action to prevent the attack, it is known as an IPS.
94
Chapter 3:
Network Media and Devices
SELF TEST The following Self Test questions will help you measure your understanding of the material presented in this chapter. Read all the choices carefully since there may be more than one correct answer. Choose all the correct answers for each question.
Network Media 1. A network designer is asked to recommend a media type. The customer desires a Fast Ethernet network, but wishes to keep costs at a minimum. Which of the following media types should be recommended? A. Cat 3 UTP B. Cat 5 UTP C. SMF D. MMF 2. Concerning coax cabling, which of the following statements is true? A. Thinnet is capable of bandwidth speeds of up to 100 Mbps, and has a maximum segment length of 500 meters. B. Thicknet is capable of bandwidth speeds of up to 100 Mbps, and has a maximum segment length of 500 meters. C. Thinnet is capable of bandwidth speeds of up to 10 Mbps, and has a maximum segment length of 185 meters. D. Thicknet is capable of bandwidth speeds of up to 10 Mbps, and has a maximum segment length of 185 meters. 3. A customer maintains a twisted pair network. The customer wishes to attain Fast Ethernet speeds, and wishes to take steps to prevent EMI as much as possible. Which cable type would you recommend? A. Cat 5 UTP B. Cat 5e UTP C. Cat 5 STP D. SMF 4. Which of the following is a true statement concerning the UTP cable connection between a PC and a switch? A. Pin 1 on the PC end is set to receive and is connected to pin 1 on the switch end. B. Pin 3 on the PC end is set to receive and is connected to pin 3 on the switch end.
Self Test
95
C. Pin 1 on the PC end is set to transmit and is connected to pin 3 on the switch end. D. Pin 3 on the PC end is set to transmit and is connected to pin 1 on the switch end. E. None of the above. 5. Which of the following is a true statement concerning the UTP cable connection between two hubs? A. Pin 1 on one end is set to receive and is connected to pin 3 on the other end. B. Pin 1 on one end is set to receive and is connected to pin 1 on the other end. C. Pin 3 on one end is set to transmit and is connected to pin 3 on the other end. D. None of the above. 6. Which cable type would be used to connect a PC to a router? A. Straight-through B. Crossover C. Rollover D. None of the above 7. Which cable type would be used to connect a router to a switch? A. Straight-through B. Crossover C. Rollover D. None of the above 8. A straight-through cable is created using the 568B standard. Which of the following correctly describes the color-coded cable layout within the connector (from left to right, with the tab down)? A. White-green, green, white-orange, blue, white-blue, orange, white-brown, brown B. White-green, green, white-blue, blue, white-orange, orange, white-brown, brown C. White-orange, orange, white-green, blue, white-blue, green, white-brown, brown D. White-orange, orange, white-blue, blue, white-green, green, white-brown, brown
Network Devices 9. A network technician is asked to diagnose network performance issues. An examination of the network shows new hubs were daisy-chained into the existing segment to allow for new users recently. Which of the following is true? A. The addition of hubs extends the collision domain, increasing the probability and frequency of collisions and slowing performance. B. The addition of hubs segments collision domains, decreasing the probability and frequency of collisions and slowing performance.
96
Chapter 3:
Network Media and Devices
C. The network performance issues will take care of themselves, as some time will be needed for the daisy-chained hubs to learn the MAC addresses of connected devices. D. Daisy-chaining new hubs into the segment has no effect on performance. 10. A network administrator adds a bridge to an existing network segment to increase performance. When the first unicast frame is received by the bridge, what action does it take? A. The frame is filtered based on the address table. B. The frame is kept on the source segment. C. The frame is flooded to the segment on the opposite side of the bridge. D. The frame is discarded, but the addresses are added to the MAC table. 11. A frame is received on switch port 3, and is addressed to the system on switch port 4. Assuming the switch has already built its CAM table, which of the following are true? (Choose two.) A. The switch floods the message to all ports. B. The switch opens the connection to port 4 only and delivers the frame. C. The connection between ports 3 and 4 is allowed to use 100 percent of the available bandwidth. D. The connection between ports 3 and 4 shares the available bandwidth with all connected devices. 12. A broadcast frame is received on switch port 3. Assuming the switch has already built its CAM table, which of the following is true? A. The switch floods the message to all ports. B. The switch discards the frame since switches do not forward broadcast messages. C. Broadcast frames are not sent by PCs. D. None of the above are true. 13. A broadcast frame is received by a router port. Which of the following is true? A. The router floods the broadcast frame to all ports. B. The router discards the frame. C. Broadcast messages are not delivered to routers. D. None of the above are true. 14. Which network device monitors network traffic for network attack signatures and notifies administrators when an attack is in progress? A. An IPS B. An IDS C. A firewall D. None of the above
Self Test
97
15. Which network device monitors network traffic for network attack signatures and is capable of stopping the attack in progress? A. An IPS B. An IDS C. A firewall D. None of the above
98
Chapter 3:
Network Media and Devices
SELF TEST ANSWERS ✓ B. Category 5 UTP best fits the scenario. Cat 5 UTP is the minimum cable requirement for 1. ® Fast Ethernet. ® ˚ A. Cat 3 UTP is only rated for 10 Mbps bandwidth speeds. C and D. Both SMF and MMF will comply with the bandwidth requirements; however, fiber is typically more expensive than UTP. ✓ C. Both statements match thinnet characteristics. 2. ® ® ˚ A, B, and D. These answers do not match thinnet and thicknet characteristics. Both can only transmit at 10 Mbps, at 185- and 500-meter segment lengths, respectively. ✓ C. STP has a metal shield around the twisted pairs to mitigate against EMI. 3. ® ® ˚ A and B. UTP has no protection against EMI. D. SMF is a fiber, not a twisted pair, cable. ✓ E. NIC pinouts have pins 1 and 2 set to transmit, and 3 and 6 set to receive. Since both 4. ® devices have different pinouts, a straight-through (pin 1 to 1, 2 to 2, and so on) cable would be used. ® ˚ A and B. Pin 1 on the PC NIC is set to transmit, not receive. C and D. The pinouts listed indicate a crossover cable. ✓ A. Hub port pinouts have pins 1 and 2 set to receive, and 3 and 6 set to transmit. Since 5. ® both devices have different pinouts, a straight-through (pin 1 to 1, 2 to 2, and so on) cable would be used. ® ˚ B. The pinout listed indicates a straight-through cable. C. Pin 3 on hub ports is set to receive. D is incorrect. ✓ B. PCs and routers have the same pinout; therefore, a crossover cable should be used. 6. ® ® ˚ A. A straight-through cable will not work between two devices of the same pinout. C. Rollover cables are used between a PC and a router/switch console port. D is incorrect. ✓ A. Switches and routers have different pinouts; therefore, a straight-through cable should 7. ® be used. ® ˚ B. A crossover cable will not work between two devices of different pinouts. C. Rollover cables are used between a PC and a router/switch console port. D is incorrect. ✓ C. This represents the correct pinout for an RJ45 connector using 568B. 8. ® ® ˚ A, B, and D. These choices do not represent the correct color-code pinout. ✓ A. Hubs are layer-1 devices, which increase the size of the collision domain, and degrade 9. ® performance. ® ˚ B. Layer-1 devices do not segment collision domains. C. Hubs do not learn, nor recognize, MAC addresses. D. Adding hubs decreases network performance.
Self Test Answers
99
✓ C. Bridges must first learn where devices are before filtering frames. Since the table is 10. ® empty at first, the bridge floods all the frames. ® ˚ A. Initially the table is empty, so the frame cannot be filtered. B. The bridge does not keep frames on a single segment until the table is built. D. Bridges do not discard frames. ✓ B and C. Switches provide 100 percent of the bandwidth to all connected hosts. 11. ® ® ˚ A. Switches do not flood unicast messages. D. Switches provide 100 percent of available bandwidth to all connected hosts. ✓ A. Switches flood broadcast frames. 12. ® ® ˚ B. Switches do not discard broadcast frames. C. PCs do send broadcast messages—and quite often! D is incorrect. ✓ B. Routers do not forward broadcast messages. After opening the frame to determine if the 13. ® router itself is to take action on it, the router will discard the packet. ® ˚ A. Routers do not forward broadcast frames. C. Broadcast messages are delivered to every device on the network segment, including the router. D is incorrect. ✓ B. Intrusion detection systems monitor and compare network traffic against attack 14. ® signatures and create notifications when an attack is in progress. ® ˚ A. IPSs not only monitor traffic, but can take action to prevent the attack. C. Firewalls permit or block traffic, based on a defined list of layer-3 source addresses and port numbers from an administrator. D is incorrect. ✓ A. IPSs not only monitor traffic, but can take action to prevent the attack. 15. ® ® ˚ B. IDSs monitor and compare network traffic against attack signatures, and create notifications when an attack is in progress. However, they cannot take action to prevent attacks. C. Firewalls permit or block traffic, based on a defined list of layer-3 source addresses and port numbers from an administrator. D is not correct.
This page intentionally left blank
4 Ethernet Fundamentals
CERTIFICATION OBJECTIVES 4.01
Ethernet History
4.02
Ethernet Characteristics
4.03
Ethernet Standards
✓ Q&A
Copyright © 2008 by The McGraw-Hill Companies. Click here for terms of use.
Two-Minute Drill Self Test
102
Chapter 4:
Ethernet Fundamentals
W
ith many variations and forms, Ethernet has become the most widely implemented networking technology in modern networks. Ethernet is a term used to describe a specific conglomeration of layer-2 technologies, media access methods, addressing, and functionality. Originally designed for smaller internal LAN implementation, Ethernet’s new standards and capabilities have moved it to the forefront of almost any networking need— including even MAN/WAN connections! In this chapter, we’ll examine how an Ethernet network looks and functions, as well as what it takes to put it all together. We’ll first start with a brief history discussion, followed by Ethernet frame types and addressing. After determining what a frame looks like in Ethernet and how addressing works, we’ll delve into Ethernet’s media access method, CSMA/CD. (Another media access method, CSMA/CA, is also covered here.) Finally, we’ll wrap up the chapter by examining the various Ethernet standards definitions, including both the physical and logical characteristics of each.
CERTIFICATION OBJECTIVE 4.01
Ethernet History In the early 1970s, researchers at the University of Hawaii began studying a unique problem: how to allow two or more systems access to the same media without their individual signals interfering with each other. The problem was fairly clear. Suppose a computer sends an electrical signal on a cable. Since it is a shared media, all systems receive the signal. Conversely, if a signal is placed on the cable by two systems at the same time, the electrical charge will be doubled and unreadable. If you further complicate the problem by choosing a wireless media, a whole host of other problems are also introduced—for example, if a system wishes to send, how does it sense if the media is cleared? To answer this dilemma, ALOHAnet was born. ALOHAnet was actually created on a wireless network concept. The addressing, frame type, and media access considerations of building this, at the time, were monstrous undertakings. However, the computer science department at the University of Hawaii came up with a method for all systems to share the wireless media, without interfering with each other. Although at the time it was not designated as Ethernet, the technology was born and, rapidly, spread to other media types and implementations.
Ethernet Characteristics
103
The first real Ethernet standard was born from a consortium of industry leaders. Digital Equipment Company, Intel, and Xerox (DIX) used the work and findings already accomplished by ALOHAnet to publish the first Ethernet standard. Released as an open standard—allowing others to improve on and add to it—DIX Ethernet transmitted data at 10 Mbps over thicknet cabling, with an overall network range of almost 2 kilometers. DIX Ethernet rapidly outgrew its humble origins and, together with the advent of more and better media, the need for new standardization grew. Starting in 1980, the Institute of Electrical and Electronic Engineers (IEEE) began work on defining new Ethernet standards. Over time, they developed new, better, and faster means for implementing Ethernet’s functionality and, in 1985, released the 802 series. Named the 802 series because the standards begin with an 802, these are the most popular LAN standards worldwide today. The specifics of both initial and newer IEEE 802 standards are covered later in this chapter.
CERTIFICATION OBJECTIVE 4.02
Ethernet Characteristics Every networking technology has unique characteristics that describe its functionality, and Ethernet is no different. Ethernet networks have distinctive frame types, media access methods, and data flow, and as the most common LAN technology in modern networks today, it’s important to understand how Ethernet works. In this section, we’ll cover Ethernet’s defining characteristics.
Frame Types and Addressing During our discussion on the OSI Reference Model and the TCP/IP stack, we learned that layer 2 requires specification on a specific frame type and physical addressing scheme. In other words, systems within a segment expect bits to fall in a specific order, so they can make a determination on addresses, port numbers, and others. Each frame is made up of bits divided into specific areas known as fields. A field contains a certain number of bits and tells the recipient a specific piece of information—such as address, protocol type, and so on. As bits arrive at an NIC interface one at a time, the NIC looks for them to fall into precise fields, depending on the frame type chosen.
104
Chapter 4:
Ethernet Fundamentals
Frame Types All frames, regardless of type, usually have some fields in common. Most frames begin with some sort of “start of frame” notification, followed by addresses and a small type field. Lastly, the frame finishes with the data payload and a Frame Check Sequence (FCS) field. The preamble, or “start of frame” notification, notifies systems connected to the media that a frame is incoming. Source and destination physical addresses, generally the next two fields, let systems know who the frame is from and to whom it is intended. The Type field, not present or used in all frame types, simply notifies the recipient system of which network layer protocol (IP, IPX, AppleTalk, or another) is being delivered. The data payload contains the original data, as well as (oftentimes) some padding bits to fulfill transmission size requirements. Lastly, the FCS field provides a means for the end station to verify the frame contents. A cyclic redundancy check (CRC) is run before the frame is transmitted, and the value is placed in the FCS field. On the recipient end, the CRC is run again and checked against the FCS. If the values don’t match, then it indicates the frame is bad. The world of Ethernet includes several different frame types. Luckily, though, implementation of Ethernet has resulted in only three major frame types—and they are so closely related they are often used interchangeably. The initial Ethernet frame was developed by Xerox, and then later changed and adapted by IEEE during the 1980s up through its final revision in 1997. The frame types, and included fields, can be seen in Figure 4-1.
FIGURE 4-1
Ethernet frame types
DIX (Ethernet II) Preamble Frame notification 8 bytes
Destination Recipient address 6 bytes
Source Sending address 6 bytes
Type Layer-3 protocol 2 bytes
Data/Pad
FCS
46–1500 bytes
CRC 4 bytes
IEEE 802.3 Preamble Synchronize 7 bytes
SFD Begin frame 1 byte
Destination Recipient address 6 bytes
Source Sending address 6 bytes
Length Length of frame 2 bytes
Data/Pad
FCS
46–1500 bytes
CRC 4 bytes
Preamble
SFD
Destination
Source
Data/Pad
FCS
Synchronize 7 bytes
Begin frame 1 byte
Recipient address 6 bytes
Sending address 6 bytes
Length/ Type Length or type 2 bytes
46–1500 bytes
CRC 4 bytes
Revised 802.3
Ethernet Characteristics
105
Ironically enough, the first Ethernet frame type is commonly known as Ethernet II and is still the most common frame type used. Also known as the DIX frame, it differs from the later IEEE standards in two small ways. First, the preamble and start of frame delimiter fields are found in only one field, known simply as the preamble. In later IEEE frame types, the bit pattern was split to designate both a preamble and a start of frame delimiter. Regardless of Ethernet II or IEEE frame, the bit pattern is the same—and always 1 byte. Second, the Type field in the DIX frame displays only that: the type of Network layer protocol held within the frame. In later frame specifications, the Type field could also be used to show the total length of the entire Ethernet frame. If this option was chosen, making the field a Length/Type field, another header would have to be added just before the data payload to identify the Network layer protocol. When sending IP packets, Ethernet frames could use two different headers for this purpose: the IEEE 802.2 Logical Link Control (LLC) header or the IEEE Subnetwork Access Protocol (SNAP) header. So how, exactly, is an NIC to determine whether the Length/Type field is for the length of the frame or the network protocol contained inside? The answer has to do with the numerical value within the field. If the value is 1536 in decimal (equating 0600 in hex) or less, then the field is used for length and the NIC must look for protocol type information in either the 802.2 or SNAP header. If the value is greater than 1536, then the numerical value equates to a specific network protocol type. For example, the numerical value of 2048 (hex value 0800) says, “This frame is transporting an IP packet.” The data payload field also warrants some discussion—it is, after all, the reason the frame is created in the first place. The data payload in an Ethernet frame can be as small as 46 bytes, and as large as 1500. If the upper layer protocol does not place at least 46 bytes in the payload field, the source host will fill the additional space with extra bytes. These extra bytes are known as padding, and do not affect the transmission nor the data itself. Lastly, the term Maximum Transmission Unit (MTU) refers to the largest frame size a particular communications protocol can support. The larger the MTU, the more efficiently bandwidth is used. The MTU size can be manually set (forced) on a segment, but you must use caution when doing so since larger MTU sizes can adversely affect some devices. While some transmission types have a fixed size (ATM cells are always 53 bytes, for instance), Ethernet frames can vary in size depending on what is being delivered. The minimum size—64 bytes—is specified to allow for collision detection, while the maximum size—1518 bytes—keeps devices and media complying with the standard from becoming overwhelmed.
106
Chapter 4:
Ethernet Fundamentals
You should know all three frame types, as well as the fields. Pay special attention to the Length/Type field (0600 or less is the length), and the use of
LLC or SNAP subheaders. You should also know the minimum and maximum size of an Ethernet frame—from 64 to 1518 bytes.
Addressing Addressing in Ethernet has very little to do with which systems receive the frame, but everything to do with which systems actually open and process it. This may seem confusing, but if you consider what we’ve already learned about Physical layer devices, it makes perfect sense. Older Ethernet implementations made use of coax cabling and T connectors, effectively connecting all devices to the same copper cable—an electrical shock (signal) from one device shocks all devices on the cable. Remember hubs do much the same thing, aggregating all wiring to a single point, ensuring all devices connected to the hub receive all messages from every other device. Therefore, on a lot of networks, every computer receives every message, regardless of who it was originally intended (and addressed) for. In short, addressing in Ethernet does not define who receives the message—it defines who is supposed to open the message. Quite obviously, every device on a segment must have a unique physical address. Ethernet networking makes use of the MAC address, burned into every NIC, to determine who is to process the frame. MAC addresses are 48 bits in length and are unique to each NIC. To ensure each NIC has an exclusive address, IEEE assigns an exclusive number, known as the Organizationally Unique Identifier (OUI), for the first half of the MAC address for each vendor. As the vendor produces NICs, the OUI makes up the first half (3 bytes, 12 bits, or 6 hex digits) of the address of the card, with the last half being assigned in any means the vendor chooses. When an Ethernet frame is built, the source and destination address fields are 48 bits in length to accommodate the Mac address of the sender and intended recipient. The address placed in this field determines the type of address the frame is being sent to. Ethernet and IP makes use of three types of addresses: unicast, multicast, and broadcast. Unicast messages are addressed to a single device. In other words, in a unicast frame, the MAC address in the destination field matches only one NIC on the network segment. All devices might receive the frame, but as they examine the destination MAC address in the destination field, only the NIC matching the address
Ethernet Characteristics
107
will process it—all others dump the frame. Examples of a unicast message would be a SYN packet sent from one computer to another on the same network segment. Broadcast addresses are just as easy to understand. In a broadcast frame, the destination address is always FF:FF:FF:FF:FF:FF, and its intent is to ensure all recipients open and process the frame. Broadcast messages are sent quite often in networking for fairly obvious purposes. For example, when a system turns on and requests an IP address using DHCP, it obviously does not know where the DHCP server is located. So, it sends a broadcast message to all devices on the segment, knowing only the DHCP server will respond. Broadcast traffic is a necessary evil on your network segments. However, it should be controlled as much as possible. Not only does broadcast traffic flood your network and take up valuable bandwidth, it also slows each device, requiring processing cycles for each host to examine the packet. Multicast addresses fall somewhere in between unicast and broadcast. The destination field of a multicast frame always begins with 01:00:5E, with the last half of the address being a unique number. Multicast addresses allow a specific subset of hosts of the same type—or those running a unique application—on a segment to communicate with each other. For example, some routers communicate with multicast messages. The message may travel through the network, with all hosts seeing it, but only router NICs will process them. As another example, many online games make use of multicast—with only the systems running the game application processing and sending the multicast addresses. Figure 4-2 displays these addresses in action. When Computer A turns on and asks for an IP address, it crafts the DHCP packet using a broadcast address in the frame. In the bottom portion of the figure, Computer A is carrying on a conversation directly with Computer B using a unicast addressed frame. Additionally, the routers are communicating using a multicast addressed frame. Since a hub is in place, all systems are receiving all frames, but the addresses are directing which recipient will open them.
Media Access The problem of shared media access—how to ensure two devices do not transmit data across the same shared media at the same time—was presented in the first section of this chapter. If two devices attempt to send a message at the same time, a collision is said to have occurred. Consequently, a collision domain is simply a group of devices that can collide with each other. As a general rule, the smaller the collision domain, the faster and better your network performance. Ethernet networks are
108
Chapter 4:
Ethernet Fundamentals
FIGURE 4-2
An Ethernet addressing example
Broadcast: DHCP
A
B
C
B
C
Unicast: to B
A
Media & direction Hub Workstation
Frame checked
known as contention-based networks since each device must contend for the network media, and therefore collisions can occur. Ethernet standards cover two different methods to control shared media access, and to attempt to handle collisions: Carrier Sense Multiple Access / Collision Avoidance (CSMA/CA) and Carrier Sense Multiple Access / Collision Detection
Ethernet Characteristics
109
(CSMA/CD). Carrier sense means the host listens to the media for a quiet moment (a time slot where no one else is using the media), while multiple access implies more than one system can access the same media. The collision avoidance and collision detection portions define how the hosts proactively or reactively respond to collisions. CSMA/CA (collision avoidance) is the media access method used in wireless networking and, judging by its name, you can probably guess it is decidedly proactive in its attempts to deal with collisions. In a CSMA/CA network, a system first listens to the media to determine if it is clear to send. If so, the host sends a Ready To Send (RTS) signal to all devices, alerting them that it is about to send a message. The RTS message contains a timer function that lets all systems know how long the host believes it will need to transmit its message. So long as no one else sends an RTS during that time frame, the host can send its message without fear of collision. After the frame is sent, the host waits for an acknowledgment. If the acknowledgment does not return, the host knows to resend. This method has the benefit of avoiding almost all collisions. However, performance on larger networks quickly reaches a plateau, and the overhead required for this implementation makes it a poor choice on most wired networks. IEEE defined CSMA/CD as the media access method on wired Ethernet networks. Collision detection is reactive in nature, assuming collisions will occur and defining a method to deal with them. In a CSMA/CD network, a device with a message to send first listens to the wire, waiting for a time when no other device is sending a message—in other words, when there is no electrical charge on the wire. If the line is clear, the device begins to send its signal; if not, it waits until the line is clear. When two systems send at the same time, they both register an increase of voltage on the line, indicating a collision. Both systems then send a jam signal (a 48-bit signal, with all 1’s turned on—equating to FF:FF:FF:FF:FF:FF) to let all systems on the segment know a collision has occurred. All systems then run a timing algorithm that provides a random wait time before retransmitting. The intent is that the two systems with messages to send will not wind up with the same timer and, thus, will not collide with each other when they attempt to retransmit. There is no guarantee which system will wind up transmitting first; however, CSMA/CD does provide a means to ensure they will not transmit at the same time. Considering how CSMA/CD works, it is of vital importance that the sending host can register a collision before it is finished transmitting a frame. If the collision signal does not return in time for the original host to realize it is part of the collision, it will not resend its frame, causing all sorts of transmission delays and problems. Round-trip time (RTT) and Ethernet’s 5-4-3 rule are important considerations in regards to media access.
110
Chapter 4:
Ethernet Fundamentals
Make sure you understand how CSMA/CD works. Remember, systems involved with a collision send a jam signal (48 bits, all set to 1’s) and run a timing
algorithm to generate random times before attempting retransmission, preventing both systems from transmitting at the same time again.
RTT refers to the total amount of time it takes for a message to travel from a sending host to the recipient and back. For Ethernet and CSMA/CD to work properly, the signal indicating a collision has occurred must have enough time to travel back to the sending machine before the frame has completely left the NIC. Consider Figure 4-3 for a moment. When system A sends the signal, the bits begin to travel through the media. At the far end, system B begins sending, thinking the media is cleared because it has not sensed PC A’s message on the wire yet. A collision then occurs when, just after beginning to send its bits, system B notices an increase in voltage on the wire. PC B now knows it is part of the collision and will need to retransmit its data. However, this increase in voltage (shown with the dotted line in Figure 4-3) must also have time to travel back through the wire for PC A to recognize the collision has occurred—remember, from PC A’s perspective, the collision occurred at the “far end” of the network. If PC A completes its transmission before the increase in voltage is registered at its NIC, it does not know it was part of the collision and won’t retransmit the lost data. In other words, RTT must be kept low enough that the signal indicating a collision has occurred must have time to travel
FIGURE 4-3
Collisions and round-trip time A
Jam signal Transmission Workstation
Hub Collision
B
Ethernet Characteristics
111
from just outside system B’s interface all the way back to system A while system A is still delivering bits. A general rule in place within Ethernet to accomplish this is the “5-4-3” rule. The rule states that, from a sending device to a recipient, the message cannot pass over more than 5 total segments within one collision domain. These five segments are connected over no more than 4 repeaters (Physical layer devices) and, of those five segments, only 3 of them are allowed to be “populated.” An example of the 5-4-3 rule can be viewed in Figure 4-4. Obviously, RTT and the 5-4-3 rule are important considerations when designing your network. Remember the 5-4-3 rule only applies within a single collision domain. If you use a bridge or a switch to split the collision domain, you begin a new 5-4-3 area. With the actions CSMA/CD takes to respond to collisions in mind, it’s easy to see why keeping your collision domains small is beneficial in your network design. The fewer devices you have contending for the media, the fewer collisions you have and, therefore, the less time your segment spends sending jam signals and running timing algorithms. Collision domains are segmented and controlled with layer-2 devices.
FIGURE 4-4
The 5-4-3 rule
Hub/Repeater User Segment
112
Chapter 4:
Ethernet Fundamentals
For example, consider a small network with ten systems connected to a hub. All ten devices are contending for the same media (the layer-1 hub does nothing but aggregate the wires) and can collide with each other, so the collision domain is 10. Suppose we take the same systems, but use a bridge and two hubs instead—depicted in Figure 4-5. A bridge splits collision domains in half, reading the destination MAC address and making a decision whether to keep the message on the originating side, or to let it pass over to the other side of the bridge. Therefore, computers on side A can collide with themselves, but not with computers on side B. The collision domains are now sized to five. Assuming the same network described above, suppose we instead replaced the bridge and hubs with one switch. Switches are, in effect, a bunch of bridges in a box and create a collision domain on each port. In this instance, no collisions can occur since each device is separated into its own collision domain. Examine Figure 4-6 for a depiction of this topic. More information on using switches within your network, to segment collision domains and move traffic efficiently and quickly, is covered throughout this book.
Data Flow Lastly, it is of vital importance—both for the exam and on the job—that you have a solid understanding of data flow through a network, Ethernet or not. Understanding what the data looks like at various stages of its delivery greatly simplifies troubleshooting and increases understanding of networking in general. To clarify,
FIGURE 4-5 A
Collision domains using a bridge
Collision domain Small hub Bridge Workstation
B
Ethernet Characteristics
FIGURE 4-6
Collision domains using a switch
113
Switch Collision domain Workstation Each network segment is its own collision domain.
consider the network shown in Figure 4-7. In our example, PC1 is sending a message to PC2. Both systems are on Ethernet segments and, for the sake of this discussion, Ethernet networks are used throughout the path. As PC1 prepares the data to send, moving through the TCP/IP stack, it reaches the Internet layer and determines it needs a destination IP address for the recipient. A DNS request is sent to find the correct IP address (which turns out FIGURE 4-7
Network data flow
PC2 IP: 195.250.5.100 MAC 00:00:08:AA:BB:CC RTR2 ETH1 Port: IP: 195.200.5.1 MAC 00:00:05:AA:BB:CC
4
3
RTR1 ETH1 Port: IP: 195.150.5.1 MAC 00:00:03:AA:BB:CC
2
1 RTR3 ETH1 Port: IP: 195.250.5.1 MAC 00:00:07:AA:BB:CC
RTR2 ETH0 Port: IP: 195.150.5.2 MAC 00:00:04:AA:BB:CC
RTR3 ETH0 Port: IP: 195.200.5.2 MAC 00:00:06:AA:BB:CC
PC1 IP: 195.100.5.100 MAC 00:00:01:AA:BB:CC
RTR1 ETH0 Port: IP: 195.100.5.1 MAC 00:00:02:AA:BB:CC
114
Chapter 4:
Ethernet Fundamentals
to be 195.250.5.100), the packet is built, and then handed to the Network Access layer for framing. In Ethernet, the MAC address is used for source and destination addresses within the frame, and PC1 needs a Physical layer address within its own Ethernet segment, to send the frame to. So, PC1 broadcasts an ARP request, asking “Who has the MAC address for the IP 195.250.5.100?” Since the destination IP address is not a part of PC1’s network (195.100.5.0), the router port answers the ARP request, providing its MAC as the delivery destination. PC1 then builds a frame using its MAC address (00:00:01:AA:BB:CC) as the source, with the router port (00:00:02:AA:BB:CC) as the destination. The frame, shown in Figure 4-8, is then placed on the wire. The switch reads the destination MAC address as it receives the frame and opens a pathway to the router’s port. The router port receives the frame and begins reading the destination MAC address as well. Since it is intended for the router, the router opens the frame, and discards the header and trailer, leaving only the packet. It then reads the destination IP address and compares it to an internal table. Noticing a route to the end destination exists by sending the packet through the ETH1 port, the router then goes through the same process as PC1: find a destination MAC address and build a frame for delivery in ETH1’s local network. After ARPing for a MAC address, the router builds a new frame and sends it out ETH1. The new frame appears in Figure 4-9. Notice the packet (containing the IP address) doesn’t change; however, the frame has new source and destination addresses. Inside ETH1’s network, the sending device is ETH1, and the destination device is RTR2’s ETH0 port!
Ethernet Frame at Stage 1:
FIGURE 4-8 PREAMBLE
FCS
The frame at Stage 1 Source MAC: Destination MAC: Source IP: 00:00:01:AA:BB:CC 00:00:02:AA:BB:CC 195.100.5.100
PC1’s MAC address
RTR1’s ETH0 MAC address
PC1’s IP address
Source IP: 195.100.5.1
PC2’s IP address
TCP Header
DATA and PAD
Ethernet Characteristics
115
Ethernet Frame at Stage 2:
FIGURE 4-9 PREAMBLE
FCS
The frame at Stage 2 Source MAC: Destination MAC: Source IP: 00:00:03:AA:BB:CC 00:00:04:AA:BB:CC 195.100.5.100
RTR1’s ETH1 MAC address
RTR2’s ETH0 MAC address
PC1’s IP address
Source IP: 195.100.5.1
TCP Header
DATA and PAD
PC2’s IP address
This process of the frame being stripped off, ARPing for a new destination MAC, and rebuilding occurs at each link in the delivery chain. The frame at Stages 3 and 4 is shown in Figure 4-10. When the frame is finally delivered to PC2, the frame and packet headers are removed and the Transport layers between the two systems can begin talking. Ethernet Frame at Stage 3:
FIGURE 4-10
FCS
PREAMBLE
The frame at Stages 3 and 4
Source MAC: Destination MAC: Source IP: 00:00:05:AA:BB:CC 00:00:06:AA:BB:CC 195.100.5.100
RTR2’s ETH1 MAC address
RTR3’s ETH0 MAC address
PC1’s IP address
Source IP: 195.100.5.1
TCP Header
DATA and PAD
PC2’s IP address
Ethernet Frame at Stage 4: FCS
PREAMBLE
Source MAC: Destination MAC: Source IP: 00:00:07:AA:BB:CC 00:00:08:AA:BB:CC 195.100.5.100
RTR3’s ETH1 MAC address
CertCam
PC2’s MAC address
PC1’s IP address
Source IP: 195.100.5.1
TCP Header
DATA and PAD
PC2’s IP address
A multimedia demonstration of data flow through a network can be found on the CD accompanying this book.
116
Chapter 4:
Ethernet Fundamentals
Make sure you’re very familiar with the data flow steps shown here. You’ll be asked to fill in frame fields and to decipher different message types during an information exchange (unicast, multicast,
and broadcast).The frame header and trailer is discarded at each router and replaced by a new frame for the destination port. Don’t forget the DNS and ARP messages sent before the frame is ever built.
CERTIFICATION OBJECTIVE 4.03
Ethernet Standards Ethernet has grown to more than just a small internal layer-2 LAN technology. In modern networking, Ethernet can run lengthy distances, cross over a variety of media, and move at insanely fast bandwidth speeds. Part of Ethernet’s success story has to do with the standards released early on by IEEE, ANSI, EIA, and TIA regarding its development. In this section, we’ll cover IEEE’s networking standards—paying particular attention to those dealing with Ethernet—and wrap things up by taking a look at the various Physical layer standards for each Ethernet implementation. As stated earlier in this chapter, IEEE released—and continues to work on— several standards regarding LAN networking. The IEEE 802 series provided a physical blueprint for several network models, including Ethernet. These standards defined the physical and logical topologies, the media used, the equipment needed, and many other characteristics defining a specific network model. The 802 series provides Physical and Data Link layer specifications for building a network. They are listed in Table 4-1. Considering the wide variety of media choices and the advent of full duplex– capable networking devices, it’s easy to see the need for standards in regards to Ethernet. For the most part, Ethernet framing, addressing, and media access stay the same regardless of the standard in play. However, everything else is up for grabs. The Physical layer portions of these standards were expressed in another format. Also considered as cable standards, many of the more common cable specifications
Ethernet Standards
TABLE 4-1
LAN Network Standards
Standard
Description
Maximum Speed
802.3
Ethernet
802.3(u)
117
Topology
Media
10 Mbps
Physical: Bus/star Logical: Bus
Coax or twisted pair
Fast Ethernet
100 Mbps
Physical: Star Logical: Bus
Twisted pair
802.3(ab)
Gigabit Ethernet
1000 Mbps (250 Mbps per pair)
Physical: Star Logical: Bus
Twisted pair
802.3(z)
Gigabit Ethernet
1000 Mbps
Physical: Star Logical: Bus
Twisted pair
802.4
Token bus
4 Mbps
Physical: Bus Logical: Ring
Coax
802.5
Token ring
4 Mbps 16 Mbps
Physical: Ring Logical: Ring
Twisted pair
802.11(a)
Wireless
54 Mbps
Wireless (5GHz)
802.11(b)
Wireless
11 Mbps
Wireless (2.4GHz)
802.11(g)
Wireless
54 Mbps
Wireless (2.4GHz)
are listed in Table 4-2. Physical layer specifications always follow the same format: Speed, Transmission Type, and Cable Type/Attenuation Rating. For example, consider these two standards: ■ 10base2
10 Mbps, baseband transmission, thinnet cabling up to 185 meters
■ 100baseTX
100 Mbps, baseband transmission, twisted pair cabling
Applying the same “formula,” it’s relatively easy to decipher which speed, transmission type, and cable type are specified with each standard.
Here’s a quick tip for learning the cable specifications—if the last digit is a T, the cable type is twisted pair. If it’s a number, it’s coax cabling. If it’s
anything else, it’s fiber.The only exception to this rule is CX, which is a specialized coax or twisted pair cable.
118
Chapter 4:
Ethernet Fundamentals
TABLE 4-2
Physical Layer Standards
Standard
Maximum Speed
Maximum Segment Length
Cable Type
10base2
10 Mbps
185 meters
Thinnet coax
10base5
10 Mbps
500 meters
Thicknet coax
10baseT
10 Mbps
100 meters
UTP (Cat 3 or higher)
10baseFL
10 Mbps
2000 meters
Multi mode fiber
100baseT4
100 Mbps
100 meters
UTP (Cat 3 or higher)
100baseTX
100 Mbps
100 meters
UTP (Cat 5 or higher)
100baseFX
100 Mbps
412 meters
Multi mode fiber
10,000 meters
Single mode fiber
1000baseCX
1 Gbps
25 meters
Coax
1000baseT
1 Gbps
100 meters
UTP (Cat 5 or higher)
1000baseLX
1 Gbps
550 meters
Multi mode fiber
5000 meters
Single mode fiber
1000baseSX
1 Gbps
500 meters
Multi mode fiber
These physical standards define not only the cable type, but the transmission method used to achieve a certain specification. For example, You should be very both 100baseTX and 100baseT4 transmit at familiar with the networking standards 100 Mbps, and both use twisted pair. However, and Physical layer specification from TX uses only two pairs running at full duplex, Tables 4-1 and 4-2. while T4 uses all four pairs at half duplex. Because it spreads the data transmission bandwidth over all four pairs, T4 can make use of lower category cabling. 100baseTX, the most common Fast Ethernet specification, requires Category 5 or higher cabling, while 100baseT4 requires only Category 3. To view how both sets of standards work with each other, consider the 802.3 standard. The Ethernet standard, 802.3 defined the first Ethernet network. Original 802.3 networks ran at 10 Mbps over coax cabling, with devices connecting using T connectors. The cable specification used for these networks was either 10base2 or 10base5. Rapidly, the standard evolved to allow for star configurations on twisted pair cabling, but still maintain the half duplex, speed, and attenuation restrictions as the original. Rapidly evolving, Ethernet users soon demanded more bandwidth, and there were plenty of options, and media types, available. Fast Ethernet, running at 100 Mbps, came about with the 802.3(u) standard. Using at least Category 5 cabling (Category 5e is preferred), the 802.3u standard
Ethernet Standards
119
accomplished 100 Mbps speeds over copper cabling using a variety of different techniques, depending on the Physical layer specification chosen (100baseTX or 100baseT4). The 802.3z standard pushed Ethernet’s bandwidth limits even further, using long wavelength (LX) or short wavelength (SX) light signaling over multi mode cabling. A gigabit speed standard over copper came about with the 802.3ab standard, using 1000baseT cabling. The gigabit speed is accomplished by transmitting 250 Mbps over each pair, giving a total of 1000 Mbps.
INSIDE THE EXAM Ethernet History The ALOHAnet was the first attempt at multiple system access to a shared media. The first real Ethernet standard was born from a consortium of industry leaders: Digital Equipment Company, Intel, and Xerox (DIX). DIX Ethernet transmitted data at 10 Mbps over thicknet coax cabling, with an overall network footprint of almost 2 kilometers. IEEE began work on various networking standards, including Ethernet, in 1980.
Ethernet Characteristics Frames are a series of bits, received in an expected order and separated into fields. Ethernet has three main frame types: DIX (Ethernet II), 802.3, and 802.3 revised. If the Length/Type field entry is 1536 (0600) or less in the 802.3 frames, the field indicates length. 1537 or more indicates a layer-3 protocol type. The MTU size on Ethernet is 1518 bytes. Ethernet is a contention-based specification, and care should be taken to reduce the size of collision domains. Layer-2 devices— bridges and switches—are used to segment
collision domains. Ethernet used Carrier Sense Multiple Access Collision Detection (CSMA/CD) as its media access method, while wireless uses CSMA/CA. Devices involved in a collision send jam signals, and then run a timing algorithm before transmitting again.
Ethernet Standards Ethernet standards define the Physical and Data Link specifications necessary for networking. IEEE 802.3 standards define Ethernet networking. Various physical specifications for cabling exist—such as 10baseT, 100baseTX, and 1000baseLX— and follow the same format: speed (in Mbps), transmission type (Baseband), and cable type/distance rating. The Ethernet standard chosen defines the speed while the Physical layer specification defines the transmission method involved. Ethernet runs at 10 Mbps, Fast Ethernet runs at 100 Mbps, and Gigabit Ethernet runs at 1000 Mbps. These data rates are achieved using a variety of cable types and duplex options.
120
Chapter 4:
Ethernet Fundamentals
CERTIFICATION SUMMARY Researchers at the University of Hawaii created the first Ethernet-like network (ALOHAnet). Digital Equipment Company, Intel, and Xerox (DIX) used the work and findings already accomplished by ALOHAnet to publish the first Ethernet standard. Released as an open standard, DIX Ethernet transmitted data at 10 Mbps. In 1980, IEEE began work on several network specifications, including the 802.3 series—defining Ethernet layer 1 and layer 2 standards for vendors. All frames, regardless of type, begin with some sort of “start of frame” notification, followed by addresses, a small Type field, a data payload, and a Frame Check Sequence (FCS) field. The three major Ethernet frame types are DIX (or Ethernet II), 802.3, and 802.3 revised. The Length-Type field entry indicates either the length of the frame (1536 or less in decimal) or the type of network protocol being transmitted (1537 or higher). If the length is indicated, a second subheader—such as LLC or SNAP—must be present to indicate the layer-3 protocol contained in the payload. Ethernet uses 48-bit MAC addresses. Each MAC address is unique due to the OUI—the first half of the address assigned by IEEE. Within Ethernet, MAC addresses are used as either unicast, broadcast, or multicast addresses. A unicast message is addressed to one host. A broadcast message is addressed to all systems on the segment (FFFF.FFFF.FFFF). A multicast address uses a special address that is only recognized by a specific subset of hosts on the segment. A collision domain is a group of systems, sharing the same media, which are capable of colliding with each other. Collision domains should be kept small, and can be segmented with bridges and switches. Within a collision domain, Ethernet uses CSMA/CD as a media access method. Within CSMA/CD, systems listen for a clear line, and then attempt to transmit. If a collision occurs, both systems send jam signals, and then run a random timing algorithm to avoid colliding again. CSMA/ CA is used on wireless and employs an RTS signal with a timer to avoid collisions. Ethernet standards include the 802.3 series, as well as several Physical layer cable specifications. The Ethernet standard is 802.3 and runs at 10 Mbps over 10base2, 10base5, or 10baseT. Fast Ethernet is 802.3u and runs at 100 Mbps over 100baseT, 100baseTX, or 100baseFX. Gigabit Ethernet is 802.3z and runs at 1000 Mbps over various copper and fiber cabling.
Two-Minute Drill
✓
121
TWO-MINUTE DRILL Ethernet History ❑ ALOHAnet was the first attempt at Ethernet-type messaging. ❑ Digital Equipment Company, Intel, and Xerox (DIX) published the first
Ethernet standard. ❑ IEEE began work on networking standards, including Ethernet, in 1980.
The Ethernet series is the 802.3 specifications.
Ethernet Characteristics ❑ Frames include fields for preambles, addresses, length/types, data payloads,
and FCS. ❑ The DIX, or Ethernet II, frame is the most common frame type in use. ❑ CSMA/CD is the media access method used by Ethernet. ❑ Ethernet nodes, wanting to transmit, first listen to the wire to determine if it
is clear. During transmission, if another device attempts to transmit, a collision occurs. Both devices involved in the transmission send a jam signal, and then wait a random amount of time (due to an algorithm) before attempting to transmit again. ❑ Round-trip time (RTT) and the 5-4-3 rule ensure collisions are properly
detected. Within a single collision domain, a message cannot cross over more than five segments connected by four repeaters if more than three of the segments are populated.
Ethernet Standards ❑ IEEE 802.3 standards define layer-1 and layer-2 specifications for Ethernet.
802.3 is Ethernet, 802.3u is Fast Ethernet, and 802.3z is Gigabit Ethernet. ❑ The Physical layer, cable, and specifications for networking define the speed,
transmission type, and cable type/maximum segment length. 10baseT and 100baseT both define baseband transmission of twisted pair cabling, but at different speeds. ❑ Cable specifications also require a specific cable grade to accomplish their
transmission speed. 100baseT4 can make use of lower grade cabling while 100baseTX requires Category 5 or higher.
122
Chapter 4:
Ethernet Fundamentals
SELF TEST The following Self Test questions will help you measure your understanding of the material presented in this chapter. Read all the choices carefully since there may be more than one correct answer. Choose all the correct answers for each question.
Ethernet History 1. Which organization defined the first Ethernet standard? A. IEEE B. ISO C. ANSI D. DIX
Ethernet Characteristics 2. Which frame field is responsible for error checking? A. Preamble B. SFD C. FCS D. Length/Type 3. Which frame type uses a preamble with an SFD? A. DIX B. 802.3 C. Token ring D. None of the above 4. Which frame type uses a Length/Type field? A. DIX B. 802.3 revised C. Token ring D. None of the above 5. While examining an 802.3 Ethernet frame from a packet capture, you notice the entry in the Length/Type field is 0800 (in hex). Which of the following are true? (Choose two.) A. The entry indicates the length of the frame. B. The entry indicated the layer-3 protocol being transported.
Self Test
123
C. The frame is 0800 bits in length. D. The frame is transporting an IP packet. 6. What is the MTU for Ethernet? A. 1500 B. 1518 C. 1536 D. 1537 7. The MAC address of your NIC is 0A:12:3C:4B:67:DE. Which of the following represents the Organizationally Unique Identifier? A. 0A:12:3C B. 4B:67:DE C. 12:3C:4B D. 3C:4B:67 8. Twenty hosts are connected to a hub. Host A sends a unicast message to Host B. Which of the following is NOT true? A. Only Host B opens and processes the message. B. All hosts receive the message. C. All hosts open and process the message. D. The destination address field holds Host B’s MAC address. 9. Your network has 20 computers connected to a hub. You wish to increase performance by reducing the size of the collision domain. Which of the following devices can be used to do this? (Choose all that apply.) A. A hub B. A bridge C. A switch D. None of the above 10. How does CSMA/CD react to collisions? A. All systems jam the network, and then all begin transmitting again. B. Hosts involved in a collision send an RTS signal indicating a time frame in which to retransmit. C. Hosts involved in the collision send a jam signal, and then run an algorithm before retransmitting. D. Collisions do not occur on CSMA/CD.
124
Chapter 4:
Ethernet Fundamentals
11. Which of the following correctly describes the 5-4-3 rule within Ethernet? A. 5 hosts per segment, 4 total segments, 3 repeaters B. 5 repeaters, 4 total segments, 3 hosts per segment C. 5 segments total, 4 repeaters, 3 segments must be unpopulated D. 5 segments total, 4 repeaters, 3 segments can be populated 12. On an Ethernet network, PC1 sends a message to PC2. The message must cross two routers along the pathway. Which of the following statements are true concerning the communication between PC1 and PC2? A. The frame header changes twice during the time it is sent from PC1 to finally reaching its destination at PC2. B. The frame header changes three times during the time it is sent from PC1 to finally reaching its destination at PC2. C. The packet header changes at each router in the delivery path. D. The packet header never changes during the delivery path. E. PC1 broadcasts a DNS message to determine PC2’s MAC address before building the frame. F. PC1 broadcasts an ARP request to determine PC2’s MAC address before building the frame.
Ethernet Standards 13. Which IEEE standard equates to Fast Ethernet? A. 802.3 B. 802.3u C. 802.3z D. 802.4 14. Which of the following is NOT true regarding 10base2? A. Data is transmitted up to 10 Mbps. B. Data is sent using baseband transmission. C. The cable type is thinnet coaxial. D. The cable type is thicknet coaxial. 15. What is the maximum segment length on 10baseT? A. 100 meters B. 185 meters
Self Test
C. 500 meters D. 10 meters 16. Which Ethernet standard refers to Fast Ethernet over fiber cabling? A. 10base5 B. 100baseT C. 100baseFX D. 100baseTX
125
126
Chapter 4:
Ethernet Fundamentals
SELF TEST ANSWERS Ethernet History ✓ D. Digital Equipment Company, Intel, and Xerox teamed up for the first standard. 1. ® ® ˚ A. IEEE did create Ethernet standards, but they were not the first. B. ISO created the OSI Reference Model, not the first Ethernet standard. C. ANSI is incorrect—normally associated with ASCII code and other standards.
Ethernet Characteristics ✓ C. The Frame Check Sequence (FCS) field provides a CRC or checksum for error 2. ® checking. ® ˚ A. The preamble indicates a frame is coming. B. The start frame delimiter indicates the preamble is finishing and the next bits begin the frame. D. Length/type indicates the length of frame or type of layer-3 protocol transmitted. ✓ B. The 802.3 frame has an SFD after the preamble. 3. ® ® ˚ A, C, and D. None of these frame types has an SFD. ✓ B. The 802.3 revised frame type has a Length/Type field. 4. ® ® ˚ A, C, and D. DIX frames have only a Type field. Token ring and “none of the above” are incorrect choices. ✓ B and D. If the entry is larger than 0600, it indicates the layer-3 protocol being transmitted. 5. ® IP equates to 0800 in hex. ® ˚ A and C. Because the entry is larger than 0600, neither of these can be true. ✓ B. 1518 is the largest allowable Ethernet frame size. 6. ® ® ˚ A, C, and D. None of these choices equates to Ethernet’s largest frame size. 1536 is the maximum allowable number in the Length/Type field indicating the length of the frame. ✓ A. The OUI is the first half of a MAC address. 7. ® ® ˚ B, C, and D. These choices are not the first half of the MAC address. ✓ C. Only the host the unicast message is addressed to will open and process the message. 8. ® ® ˚ A, B, and D. All hosts receive the message since they are all connected to a layer-1 device. Only Host B will open and process the message since the destination address field matches its MAC address. ✓ B and C. Layer-2 devices are used to split collision domains. Bridges and switches are 9. ® layer-2 devices. ® ˚ A. Hubs are layer-1 devices and extend collision domains. D is incorrect.
Self Test Answers
127
✓ C. In CSMA/CD, systems involved in a collision send a jam signal to indicate a collision 10. ® to all devices. They then run a timer algorithm, allowing them to retransmit at a random time interval. ® ˚ A, B, and D. Only systems involved in the collision send a jam signal. RTS messages are sent on CSMA/CA, not CSMA/CD. Collisions do occur on CSMA/CD. ✓ D. The 5-4-3 rule is implemented to keep RTT within acceptable bounds for collision 11. ® detection. One collision domain can have 5 segments connected with 4 repeating devices, with 3 populated segments. ® ˚ A, B, and C. These choices are incorrect, based on the 5-4-3 rule. ✓ B, D, and F. The frame header is removed and replaced by each router along the pathway. 12. ® Therefore, the frame header will change three times during delivery (one header from PC1, one from the first router, and a final header from the second router). The packet information is never stripped off until it reaches its final destination. Finally, PC1 broadcasts an ARP message for PC2’s IP address, looking for a MAC. The router will respond. ® ˚ A, C, and E. These are all false statements.
Ethernet Standards ✓ B. Fast Ethernet is defined by the 802.3u standard. 13. ® ® ˚ A. 802.3 defines Ethernet at 10 Mbps. C. 802.3z defines Gigabit-speed Ethernet. D. 802.4 defines token bus. ✓ D. The thicknet cabling standard is 10base5, not 10base2. 14. ® ® ˚ A, B, and C. All are correct. 10base2 equates to 10-Mbps baseband data transmission over thinnet coax cabling. ✓ A. The 10baseT maximum segment length is 100 meters. 15. ® ® ˚ B. Thinnet cabling (10base2) has a maximum segment length of 185 meters. C. Thicknet cabling (10base5) has a maximum segment length of 500 meters. D. 10 meters is incorrect and does not match a standard. ✓ C. Fast Ethernet runs at 100 Mbps. The only standard listed that complies with the speed 16. ® and fiber cable type is 100baseFX ® ˚ A. 10base5 is coax running at 10 Mbps. B. 100baseT runs on copper (twisted pair) cabling. D. 100baseTX runs on copper (twisted pair) cabling.
This page intentionally left blank
5 Switching: Moving Data Inside Your Network CERTIFICATION OBJECTIVES 5.01
Switch Fundamentals
5.02
Switch Design Considerations
✓ Q&A
Copyright © 2008 by The McGraw-Hill Companies. Click here for terms of use.
Two-Minute Drill Self Test
130
Chapter 5:
Switching: Moving Data Inside Your Network
C
ustomers looking for a modern network want several things, and chief among them are speed, reliability, and services. To provide the benefits of 100 percent bandwidth availability, collision avoidance, duplexing, and other services, most modern LANs are built on switching. While switches were introduced in Chapter 3, this chapter’s main goal is to provide a bedrock of information that can be used to discuss switch configuration later. Topics covered include everything from switch basics (modes of operation and startup functions) to discussions of advanced features, such as broadcast loop prevention and virtual networking. This chapter provides the perfect backdrop to later chapters on Cisco switch configuration.
CERTIFICATION OBJECTIVE 5.01
Switch Fundamentals An important part of almost every modern Ethernet LAN installation, switches are one of the most important network devices for new network technicians—and CCENT candidates—to know about. Switches provide high-speed data transport inside our network, allow for virtual broadcast domains to control traffic, and help secure network traffic from observers. In this section, we’ll cover some basic fundamentals of switches, including the switch’s physical appearance and basic functions, the modes switches are capable of working in, and what happens when you power on the switch.
Physical Features Switches come in a wide variety of styles, colors, and models. Cisco provides two major brands of switches: the Linksys and Catalyst brands. Generally, Linksys switches are used in personal systems to connect a home network, while Catalyst switches are used in commercial LAN implementations. Since the CCENT exam concentrates on the Catalyst series, most of the descriptions of switch physical characteristics come from Catalyst switches. As seen in Figure 5-1, a typical switch (Catalyst included) usually has the following common features: ■ An LED panel ■ A series of ports (aka interfaces) for host connections ■ An uplink port (or two), generally separated from the host interfaces
Switch Fundamentals
Interface LEDs
FIGURE 5-1
The physical features of a switch
131
1
2 3
4 5
6 7
8 9
10 11
12
SYST RPS
System indicator LEDs
STAT DUPLX SPEED
Mode LEDs
MODE
Mode button
Uplink ports
The LED panel on a Catalyst switch contains two system indicator lamps, and three mode indicator lamps. The system indicator lamps are the SYST (System) and RPS (Redundant Power Supply) LEDs. The SYST LED indicates the overall system status. The RPS LED shows the status of the redundant power supply—if one is even present. The LED status and meaning of both system indicator lamps are listed in Table 5-1. Generally speaking, with LEDs green equates to good while amber equates to bad. If you see amber in the system indicator LEDs, don’t panic! Usually the fix is fairly simple. If the SYST lamp is amber, turn the device off and on again. If the RPS lamp is solid amber, press the Standby/Active button—it should return to green. If either fix fails, you may have a problem requiring Cisco’s help, so give them a call.
TABLE 5-1
Switch System Indicator LED Status
LED
Color
Status
SYST
Off
Switch is not powered on.
Green
Powered on, IOS is loaded, and switch is functioning normally.
Amber
POST failed, IOS did not load, and switch is not functioning.
Off
RPS is not functioning or connected.
Green
RPS is connected and ready to provide power. (Blinking green indicates it is providing power to another device.)
Amber
RPS is in a fault or standby condition.
Blinking Amber
Internal power has failed and RPS is providing power to the device.
RPS
132
Chapter 5:
Switching: Moving Data Inside Your Network
The mode lamps indicate the LED mode the switch is operating in. The LED mode has nothing to do with switch operation—no matter what mode you choose to display the LEDs in, the switch will continue to forward frames, as it was intended and configured to do—and is changed by pressing a mode button on the front of the switch. The LED modes simply provide a quick means for administrators to discover information about the switch. Additionally, each host interface port has LEDs, and the LED mode affects how each is displayed. LED modes and their effect on interface LEDs are listed in Table 5-2. The LEDs on individual switch interfaces provide a quick means of troubleshooting for administrators and technicians. Lastly, most modern switches have at least one uplink port. These ports can be RJ45, twisted pair, or fiber, depending on which module is purchased and installed on the router. If the port is RJ45, it will have a different pinout than the rest of the switch interfaces, to allow a straight-through cable to be used between a directly connected switch or hub. If the uplink port is fiber (ST or SC), the module has a transceiver on the interior of the switch, to transform the bits from electric to light and vice versa. In any case, the uplink ports are there for convenience sake. They don’t necessarily have to be used when daisy-chaining devices; it’s just good design practice. Most Catalyst switches not only autonegotiate for speed and duplex, but they’re also capable of detecting which cable type is connected to the interface. If you mess up and connect the wrong cable between switches (for instance, use a straight-through instead of a crossover), no problem—the switch simply changes the pinout to match it and you’re off and running.
TABLE 5-2
Switch Mode LEDs
LED Mode
Interface LED Color
Status
STAT
Off
Not in use, or administratively down
Green
Link present. Blinking green indicates activity.
Green/amber
Excessive collisions and jabber errors are creating a link fault.
Amber
Port is blocked by Spanning Tree Protocol (STP). Blinking amber indicates activity on the blocked port.
Off
Half Duplex
Green
Full Duplex
Off
10 Mbps
Green
100 Mbps
DUPLX SPEED
Blinking green 1000 Mbps (gigabit speed)
Switch Fundamentals
133
Switch Initialization Functions With all the features switches can provide for a network, it is sometimes a daunting task—especially as a new networker—to install a new switch on the network. Several questions come to mind: “What is needed to connect it? What configuration do I need to set up? How do I proceed?” Thankfully, installing a switch is a relatively easy task (configuration is covered later in this book). Simply taking the switch out of the box, plugging in the power supply, and connecting the hosts is all that needs to be done. Most modern switches allow for autonegotiation of speed and duplex, and can even overcome the wrong cable type connection to the host! While this is an easy task, it is important that CCENT candidates be very familiar with how a Catalyst switch operates at bootup.
While this section concentrates on switches, remember that bridges can also perform some of these functions. Bridges also split collision domains, build and update port address tables, and improve performance. However, switches do provide one additional
benefit bridges do not: a switch allows for simultaneously delivery of frames. In other words, a switch is capable of forwarding two frames at the same time on its media backbone, providing a significant speed advantage.
For all intents and purposes, a switch is much like a computer and performs many of the same tasks your PC does at bootup. The first step in the switch boot process is a simple power on self test (POST). Exactly as on a PC, the POST checks to ensure memory, processing, and physical components are connected and functioning. LEDs on the front of the switch indicate the boot process, and POST errors will be displayed there. For example, on a PC a POST problem normally is indicated by a beep or a series of beeps. As stated earlier, a POST problem with a switch results in an amber SYST LED. After the POST runs, a bootstrap program is called from a read-only memory (ROM) location. The bootstrap looks for the Cisco Internetwork Operating System (IOS) in flash memory and loads it into RAM. The next step calls for the configuration files to be loaded from a special storage location known as NVRAM. After the IOS and configuration files are loaded and active, the switch can begin work.
134
Chapter 5:
Switching: Moving Data Inside Your Network
Cisco’s operating system, for both routers and switches, is known as the IOS. Originally, Cisco had two different operating systems available for switches: the IOS and the Catalyst Operating System (CatOS). However, modern Cisco switches have dropped the CatOS in favor of the IOS. After the operating system and configuration file, if any, is loaded, the switch begins to read and forward frames. The switch can receive three types of frames: unicast, multicast, and broadcast. As discussed earlier, switches filter unicast messages to the appropriate port, while flooding multicast and broadcast messages. Surprisingly, though, when the switch is first deployed it floods all the frames it receives. The reason for this is quite simple: initially the switch doesn’t know where everyone is located. Before a switch can determine which port to send an incoming frame to, it must first build something called a content addressable memory (CAM) table. The CAM table, also known as a port address table, contains a list of MAC addresses mapped to specific interfaces on the switch and is built as frames are received by the switch. The source MAC address in each received frame is added to the CAM table and, as the table populates, the switch learns to which interface to send the frames. At power up, the switch’s CAM table is empty. As the first frame enters through an interface, the switch writes the source MAC address and interface mapping in the CAM table. The frame is then flooded to all ports. This process is repeated until the switch receives a frame with a destination address already in the CAM table. With an entry in the table already, the switch knows which interface to open for the frame delivery. This process holds true even when a hub or switch is connected to a switch port—the CAM table simply matches all the connected MAC addresses on the distant end hub or switch to that one interface. See Figure 5-2 for an example of correct CAM table entries.
Make sure you understand how switches operate at startup. You can expect a few questions on the boot process as well as how frames are treated within a startup switch. Remember, initially the
CAM table is empty, so all frames are flooded until the interface to MAC address pairings are learned.The table is built by recording the source address of frames as they enter the interface.
Switch Fundamentals
135
FIGURE 5-2 CAM Table
CAM table entries
INT 3
INT 0
INT 0
00:00:01:AA:BB:CC
INT 1
00:00:02:AA:BB:CC
INT 2
00:00:03:AA:BB:CC
INT 3
00:00:04:AA:BB:CC 00:00:05:AA:BB:CC
INT 2 INT 1
PC5 00:00:05:AA:BB:CC
PC4 00:00:04:AA:BB:CC
PC3 00:00:03:AA:BB:CC
PC2 00:00:02:AA:BB:CC
PC1 00:00:01:AA:BB:CC
The question then becomes, “So what happens when a host is moved from one port to another? If the CAM table has old information in it, won’t frames be delivered to the wrong interface?” To answer this, consider how the table updates itself. We already know the switch reads the source MAC address and equates it to the interface on which the frame was received. However, this process doesn’t end as soon as the MAC address is added—it continues for every frame received. The switch looks at the incoming frame and compares its source MAC address and incoming port with the CAM table. If there is no entry, it simply adds the pair to the table. If the entry does exist, it verifies that the pair matches. If the new frame entered is on a different interface than the one listed in the table, the switch updates the information. In other words, the CAM table is dynamic, updated constantly, and allows for systems to be seamlessly added and removed from the switch, as well as to be moved from port to port. For clarification, consider an example. Earlier in the week, a switch was installed and all hosts were connected and powered on. At that time, PC 1 was connected to port 1 and the port address table entry showed 0A:0B:0C:12:34:56 as being located on port 1. So, all messages with the destination address 0A:0B:0C:12:34:56 were sent to interface 1. Later in the week, a user moves to another office and changes PC 1’s location, placing it on port 5. When PC 1 sends its first frame, the switch
136
Chapter 5:
Switching: Moving Data Inside Your Network
compares the source MAC address, 0A:0B:0C:12:34:56, with the port information it has in the table, port 1. Since the message originated from port 5, the port address table is updated and PC 1 will receive all messages on the correct port. CAM tables can also be configured manually. Be very careful in doing so, as pesky users have a habit of changing your physical network configuration without your knowledge or approval!
Duplex and Speed Aside from the collision domain segmentation and bandwidth speed allocation benefits, switches offer two additional advantages over hubs in network design. First, switches provide the option of using full duplex. All data communication, regardless of media, media access method, or data type, works in one of three different transmission methods: simplex, half duplex, or full duplex. Simplex transmissions travel in one direction only, while half duplex transmissions can travel in both directions. Full duplex adds the ability for data to travel in both directions simultaneously. Quite obviously, this provides a big boost in bandwidth and, for all practical purposes, eliminates collisions. Secondly, switches allow for devices of different speeds to communicate with each other. On most modern switches, systems at 10 Mbps, 100 Mbps, and 1000 Mbps can all communicate freely over the same device. The switch can operate using store and forward, allowing the frame to be slowed down or sped up on transmission to the destination interface. Many hair-pulling troubleshooting adventures have resulted from autonegotiation problems. One workaround many network administrators use is to manually configure either the switch or the NIC to a speed/duplex setting. See Chapter 9 for more information on this. Both duplex and bandwidth speed settings are assigned per interface, and can be manually configured or left to autonegotiation. During the development of the 802.3u standard, IEEE established the principles for autonegotiation on switch interfaces to allow for backwards compatibility to 10 Mbps. By default, every interface on a Catalyst switch is set to autonegotiate, based on the IEEE standard. When a host is connected to an interface, the switch and the host NIC exchange information to discover the speed settings and automatically agree to use the fastest available. Next, both devices determine whether full duplex is enabled on
Switch Fundamentals
137
each device. After some time (less than 30 seconds), the communications process is enabled and the port goes live. This works wonderfully, so long as both devices are set to autonegotiate. If, however, either the NIC or the switch interface is not set for autonegotiate, the process cannot maneuver the best duplex and speed settings for the connection. In this case, the device that is performing autonegotiate simply defaults to a standard, based on the speed of the connection. If the speed is determined to be less than 1000 Mbps (gigabit), the connection is set to half duplex. If the connection speed equates to gigabit, the duplex setting defaults to full duplex. If speed can’t be determined at all, the device goes to the basics: 10 Mbps at half duplex.
Be sure to know the basics on autonegotiation: speed < gigabit = half duplex, speed > or = gigabit = duplex. If the speed can’t be determined at all, it defaults to 10 Mbps at half duplex. If you keep in mind that higher speeds require duplex and,
normally speaking, simplifying things always helps in troubleshooting (IOW—defaulting to the simplest transmission method available), you should have no problems with these questions.
Switch Modes As already covered in Chapter 3, all switches read MAC addresses to make filtering decisions on incoming frames. However, the method in which they go about forwarding the frames determines which mode the switch is operating in. Some read just a portion of the frame, while others examine the entire thing, and each switching mode has its benefits and drawbacks. Switches operate in three different modes: cut through, store and forward, and fragment free. Switches operating in cut through mode forward frames as quickly as possible. As a frame arrives, the switch reads only enough bits to discover the destination address in the correct field of the frame. Once the destination address is determined, the switch makes a quick comparison to its CAM table and opens the pathway to the destination port. The frame is then sent to the destination port while bits are still being received on the original port. Obviously, this mode of switching is very fast—frames are forwarded almost as soon as they enter their switch port—but it does have one glaring disadvantage. Because the switch only reads to the destination address, cut through mode results
138
Chapter 5:
Switching: Moving Data Inside Your Network
in the forwarding of frames that contain errors. Remember from Chapter 4, the FCS field in an Ethernet frame provides for error checking on the recipient end. Because the switch doesn’t read to the FCS field, it forwards frames that are too short (runts) and too long (giants). This results in retransmission requests and a host of other headaches for your systems—and network—to deal with. By default, most switches used to operate in cut through mode. Of late, however, most newer switches, including Catalyst switches, default to store and forward due to the prevalence of hosts running at different bandwidth speeds and duplex settings. The second switch mode operates much differently. In store and forward mode, the switch accepts the entire frame before it allows even a single bit to be transmitted through the destination port. Although it slows things down—latency added to the transmission of the frame is obvious—this method provides two distinct benefits. First, store and forward allows the switch the opportunity to verify that frames are error-free. By taking the entire frame in before transmitting the first bit, the switch can verify the FCS field before sending, making sure no bad frames are propagated through the network. If the frame is found to be erroneous, the switch simply discards it. Secondly, store and forward allows for systems operating at different bandwidth speeds to communicate on the same switch. For example, assume a switch is rated 10/100 and two hosts are connected; one running at 10 Mbps, the other running at 100 Mbps. If the faster machine sends a message to the slower machine without store and forward, the slower machine would quickly become overwhelmed. With store and forward, the entire frame is brought into the switch, and then transmitted at the appropriate speed for the destination port. The third switch mode is somewhat of a compromise between cut through and store and forward. Fragment free switch mode forwards the frame after receiving the first 64 bytes. Much Be sure you can identify like cut through, this mode opens a pathway to the functions, benefits, and drawbacks the destination port before all the frame’s bits of each switch processing mode. are received; however, it adds the benefit of cutting down on the number of erroneous frames propagated by the switch. Reading the first 64 bytes of the frame allows the switch to determine most collision-type errors within the frame and, much like store and forward, if the frame is in question, the switch can discard it.
Switch Design Considerations
139
CERTIFICATION OBJECTIVE 5.02
Switch Design Considerations Understanding what the switch looks like and how it operates is only a first step. Applying this knowledge to LAN design and switch placement is just as important. Using a fully switched network can greatly improve performance and strengthen security. However, there are several considerations to keep in mind while designing and building the network. In this section, we’ll cover switch installation, broadcast loop mitigation, and VLANs.
Switch Installation and Connections Network design, with regard to switches, requires consideration of segment lengths, data bandwidth needs, cost, performance, and reliability. Using switches instead of hubs negates much of the 5-4-3 rule discussed earlier and provides for the maximum segment length on each cable run; however, designers still need to stay within rated segment lengths. Bandwidth requirements can vary wildly within a single network—segments serving users don’t necessarily require the same bandwidth and segments connecting a server farm to the network, for example. Cost, performance, and reliability generally are closely related since increasing performance and redundancy increases the price paid.
The CCENT exam doesn’t spend a whole lot of time on network design. However, you should still be familiar with Cisco’s design methodology and the role each switch plays. Plus, you will be expected to know how to determine how many collision and broadcast domains exist
in a network diagram. Remember, switch ports equate to a single collision domain, while router ports equate to a broadcast domain. Don’t forget VLANs act as their own broadcast domain as well—see Chapter 9 for more information.
With these considerations in mind, Cisco defines three separate roles for switches within a network: access, distribution, and core. The idea behind Cisco’s design is to increase performance, security, and reliability while reducing cost, equipment,
140
Chapter 5:
Switching: Moving Data Inside Your Network
and confusion as much as possible. Access layer switches are used to connect hosts to the network. Distribution layer switches provide an aggregation point for the access layer switches. Core layer switches, if needed, are very high-end high-bandwidth devices providing aggregation points for distribution switches in a large enterprise network. The concept behind the three layers is relatively simple: hosts must connect to switches, and those switches should not be connected together. Data that travels from one switch to another should go through an aggregation point (a high-bandwidth switch), and have redundant paths available, should a problem occur. This concept reduces the amount of cabling required to provide for maximum performance and redundancy while increasing performance networkwide. For example, consider the network portrayed in Figure 5-3. Most networks are designed with redundancy in mind. Multiple pathways to the end station eliminate the worry of a single cable fault gumming up the works. In Figure 5-3, redundancy is provided by using distribution layer switches. If the access switches were connected redundantly, much more cabling would be needed, thereby reducing the number of interfaces on the access switch to which hosts could connect. In this case, if you fully meshed the access switches, each switch would use three ports for connectivity to other switches. It’s much more efficient to use the up-layer distribution switch and have data travel from access switch to access switch—utilizing only two ports per switch.
Looping and STP Cisco offers a great switched network design, but a few other considerations and potential problems must still be taken into account when designing your network. As discussed earlier, switches flood all broadcast traffic. Suppose, whether by accident or by design, a network is built connecting several switches in a loop, as FIGURE 5-3
Distribution layer switches
A Cisco switched network design Access layer switches
Switch Design Considerations
FIGURE 5-4
141
Host A
Broadcast loops
Switch A
Switch D
Switch B
Switch C
seen in Figure 5-4. If Host A sends a broadcast message to switch A, the switch will, in turn, flood it out every available port. The broadcast message, received by switches B and D, will also flood the broadcast out their ports. Switch C—and A (again)—receive the broadcast and flood it again. This process can repeat for eternity. In other words, if a broadcast message enters a switched network that is built with redundant connections, it will loop indefinitely. This problem can be avoided in two ways. The first is to simply design the network in such a way as to avoid broadcast loops. If the designer does not connect switches together redundantly in the first place, then broadcast looping does not occur. This sounds simple enough but, over time, accidents happen. Whether planned or not—with the addition of a switch here, and a new segment there—before you know it, a redundant loop is in place. Not to mention, most designers and customers prefer redundancy in their networks, so avoiding loops via this method is, oftentimes, impossible. The second method to head off broadcast looping deals with the functioning and makeup of the Catalyst switches themselves. Spanning Tree Protocol (STP) runs on all Catalyst switches by default—meaning that if you do not wish to use it, you must turn it off. STP defeats broadcast loops by allowing switches to negotiate a solution. STP switches elect a “root bridge” within the network and, after gathering enough data, an interface (or a few) is then The CCENT exam does put into a blocking state. This not cover STP extensively. You’ll need to shuts down the port and stops know what it is and the basics of how the broadcast from perpetuating it works, but nothing more.The CCNA through the network. STP is ICND2 exam covers this information. dynamic, so if it turns out the
142
Chapter 5:
Switching: Moving Data Inside Your Network
port is needed at a later time (say, a link going down elsewhere in the network caused a need for the redundant path to be opened), STP will put it back in a forwarding state. For instance, in the network depicted in Figure 5-4, STP would block one of the ports connecting two of the switches together.
VLANs Another switch technology that affects network design is the concept of virtual LANs (VLANs). A VLAN is exactly what it sounds like: a broadcast domain created not by routers and physical networking, but by the assignment of devices to a virtual network. VLANs can quickly become confusing and bothersome— especially when troubleshooting or monitoring network traffic (sniffing). However, VLANs offer several benefits. Some of the more important reasons for using VLANs within a network design are: ■ VLANs can segment broadcast domains without the need for purchasing new
devices (routers). ■ VLANs can improve performance on hosts, reducing their processing
overhead by limiting the broadcast messages, and separating traffic types. ■ VLANs provide better security by separating devices, and their message traffic.
Remember from Chapter 4, a broadcast domain is basically a network created and bordered by routers. A broadcast from one device in the LAN is transmitted to all devices in the LAN and stops at the router. A virtual LAN works in much the same fashion, except the VLAN is created by joining a group of switch ports together and properly configuring the switch. While normally all ports on a switch would belong to a single broadcast domain, the switch can be configured to treat them as separate networks (broadcast domains). Additionally, using VLANs can improve performance by restricting other data flow through your network. For all practical purposes, when a VLAN is created, it is as if the devices within it are on completely separate networks, with no connectivity whatsoever between them. In other words, devices in one VLAN cannot talk to devices in another—the switch will not allow the traffic to mix between the two. Administrators may use this to their advantage, separating data traffic types for maximum performance benefit. For example, VoIP traffic from IP phones could be in a separate network than data traffic from hosts, and/or traffic from critical hosts requiring preferential treatment could be separated from “normal” data traffic. Security-wise, this presents a lot of flexibility in network design, allowing administrators to group hosts based on the task or data security level instead of just the physical location.
Switch Design Considerations
Make sure you are very familiar with the key concepts regarding VLANs: they are created on switches, create multiple broadcast domains within a single LAN, provide better performance by reducing/restricting broadcast traffic, and present greater security options. Many CCENT questions require you to identify
143
data traffic patterns within a network diagram, and VLANs will definitely be a part of that. Remember that a message sent by a member of a VLAN can only be received by other members of that same VLAN—unless a router is installed to allow for cross-VLAN traffic.
For clarification sake, consider an example. Suppose a network administrator is examining the network in Figure 5-5. The top of Figure 5-5 shows a switch, using a default configuration, with four hosts connected to it. All four of these hosts belong to the same broadcast domain. If Host A sends a broadcast frame, the switch will flood the message and all hosts will receive it. On its own, this works fine, with one exception—the customer does not want Hosts C and D to view messages to or from Host A or B. The bottom of Figure 5-5 shows the same network, except this time the Default configuration
FIGURE 5-5
VLAN switching
Host A
Host B
Host C
Host D
With VLANs
Host A VLAN 1
Host B VLAN 1
Host C VLAN 2
Host D VLAN 2
144
Chapter 5:
Switching: Moving Data Inside Your Network
administrator has configured the switch to say, “Hosts A and B are in Virtual LAN 1. Hosts C and D are in Virtual LAN 2.” In this instance, if Host A sends a broadcast frame, only Host B will receive it. The switch still floods the frame, but only within the broadcast domain (VLAN) Host A is connected to. It should be noted that, while VLANs are treated as completely separate physical networks (virtually), it is possible to have multiple VLANs on your network and allow communication between them. In the physical realm, to connect networks you’d need a router and, since VLANs are treated as separate physical networks, the same thing applies in this scenario. If you have multiple VLANs and want them to communicate with each other, the traffic must go through a router.
INSIDE THE EXAM Switch Fundamentals Be familiar with the switch LEDs and the bootup process. The exam will have several questions regarding the treatment of frames by a switch, so it is essential to understand CAM (or port address, if you prefer) table updates and frame treatment before, during, and after. Additionally, switches provide for simultaneous frame delivery. Duplex operations eliminate collisions and increase bandwidth, and most modern switches can use autonegotiation for both speed and duplex. You should be able to identify characteristics of cut through, store and forward, and fragment free switching modes.
Switch Design Considerations The exam won’t pester you with a lot of design questions, but you will be faced with
a variety of network diagrams to decipher. Be familiar with Cisco’s switched network design terminology, but don’t expect very many questions dealing directly with it. You should be intently focused on how switches learn MAC address locations, build the CAM table, and handle different message types (unicast, multicast, and broadcast). Be prepared to identify basic features of STP and loop avoidance in a fully switched, redundant network. Not much was covered here on the inner workings of STP because, frankly, you won’t be asked much about it— that’s a topic for the ICND2 exam. Lastly, be aware of what VLANs are and what their effect is on data traffic. Keep in mind that they not only control broadcast propagation, but separate traffic altogether—as if the devices are on totally separate networks.
Certification Summary
145
CERTIFICATION SUMMARY Switches provide better network performance, split and manage collision domains, and result in better security on the network. Switch LEDs provide a host of information on system status. Initially flooding frames, switches quickly build a port address (or CAM) table that maps the source MAC address to its arrival interface. This table allows the switch to provide 100 percent bandwidth between hosts, delivering the message to only the port the destination address is intended for. Switches also allow for best duplex and speed options on a network. IEEE autonegotiation sets up the highest available bandwidth speed and makes every attempt to run at full duplex between the host and the switch. Switch modes include cut through (fastest, but with most errors), store and forward (the default behavior; slower but with no bad frames delivered), or fragment free (the compromise version; it reads the first 64 bytes of the frame before sending). Broadcast loops within a fully switched environment are mitigated by STP. Ports are put in either a forwarding or a blocking state, depending on the network discovery by STP running on all switches. VLANs can also be used to contain broadcast traffic (for security reasons as well). Devices within a VLAN (a defined group of switch ports) can only transmit data to members of their own VLAN.
146
Chapter 5:
✓
Switching: Moving Data Inside Your Network
TWO-MINUTE DRILL Switch Fundamentals ❑ Switch system indicator LEDs show the status of the switch and the redun-
dant power supply. The LED mode indicators affect how the interface LEDs display information. ❑ Switch ports can be half or full duplex, and can run at multiple speeds. IEEE
autonegotiation between the switch and the host NIC determines the fastest bandwidth rate and always attempts full duplex. ❑ Switches run a POST at bootup. If the IOS does not load properly, the SYST
LED will glow amber. ❑ Switches filter unicast messages and flood multicast and broadcast messages.
Unicast messages are flooded only until the CAM table is updated to reflect the destination MAC address / interface pairing. ❑ Unicast messages are filtered based on entries in the CAM, or port address,
table. The table is built and updated dynamically by comparing the source MAC address and incoming interface pairing with the table. If there is no entry, the pair is added. If there is an entry, the information is updated if necessary. ❑ Cut through switching mode begins delivering the message as soon as the
destination address is discovered (while bits are still incoming to the switch). This results in faster processing, but the delivery of more erroneous frames (runts and so on). Fragment free reads the first 64 bytes and then begins delivering the frame. ❑ Store and forward brings the entire frame into the switch and examines it
before opening the correct interface for delivery. This adds to latency, but does not transmit erroneous frames and allows for devices of different bandwidth speeds and duplex setting to communicate over the same switch. This is the current default setting for most switches.
Switch Design Considerations ❑ Proper design for a fully switched network includes three types of switches.
Access layer switches are used to connect hosts, distribution layer switches are used to connect access switches together (for redundancy), and core layer switches provide high-bandwidth aggregation for distribution layer switches in large networks.
Two-Minute Drill
147
❑ STP is used to automatically protect against routing loops in a switched
network. Interfaces are placed in either a forwarding or blocking state in order to successfully block broadcast propagation. ❑ Administrators create VLANs by grouping switch ports together. The group of
ports is treated as a completely separate physical network, limiting broadcasts and preventing traffic from traveling into or out of it.
148
Chapter 5:
Switching: Moving Data Inside Your Network
SELF TEST The following Self Test questions will help you measure your understanding of the material presented in this chapter. Read all the choices carefully since there may be more than one correct answer. Choose all the correct answers for each question.
Switch Fundamentals 1. You connect a host to a switch and the switch LED mode is set to DUPLX. The host is only capable of half duplex. After the connection is negotiated, how should the interface LED appear? A. Amber B. Green C. Green/amber D. Off 2. A switch is powered on for the first time. Ten devices, Hosts A through J, are connected to the switch. Host A sends a unicast message to Host B. Which of the following are true? (Choose two.) A. The switch records the destination MAC address in the frame and the incoming interface pair in the port address table. B. The switch records the source MAC address in the frame and the incoming interface pair in the port address table. C. The frame is flooded to all devices connected to the switch. D. The frame is sent only to Host B. 3. Hosts A through J have been connected to a switch for some time, with each device connected to a matching port—Host A is on port 1, Host B on port 2, and so on. A user moves his system and connects Host A to interface 12. Immediately after the connection, Host A sends a unicast message to Host B. Which of the following are true? A. When the frame enters the switch, it is flooded to all interfaces. B. When the frame enters the switch, it is sent directly to interface 2, and no other. C. After this unicast message is sent, frames addressed to Host A will continue to be sent to interface 1. D. After this unicast message is sent, frames addressed to Host A will be sent to interface 12. 4. A host using a 10/100 NIC is connected to a Catalyst switch. The switch interface is configured for autonegotiate, but the NIC is not. Assuming speed can be determined by the switch, which of the following will autonegotiation default to for this scenario? A. 10 Mbps, half duplex B. 10 Mbps, full duplex
Self Test
149
C. 100 Mbps, half duplex D. 100 Mbps, full duplex 5. Host A and Host B are connected to the same switch, and Host A sends a message to Host B. When the switch starts receiving the bits, it reads the destination MAC address, determines the port Host B is on, and immediately opens a channel to that port while bits are still being received. Which switch mode is being used? A. Cut through B. Store and forward C. Fragment free D. Full duplex 6. Host A and Host B are connected to the same switch, and Host A sends a message to Host B. When the switch starts receiving the bits, it reads the first 64 bytes, determines the port Host B is on, and opens a channel to that port while bits are still being received. Which switch mode is being used? A. Cut through B. Store and forward C. Fragment free D. Full duplex 7. You have 10-Mbps and 100-Mbps hosts throughout your network. A new trainee asks you which switching method is used on your switches. Which is the correct response? A. Cut through B. Store and forward C. Fragment free D. Full duplex
Switch Design Considerations 8. Refer to Figure 5-6. Which of the following statements are true? A. Hosts A and B are in the same collision domain. B. Hosts A and B are in different collision domains. C. Hosts C and D are in the same collision domain. D. Hosts C and D are in different collision domains. E. Hosts A, B, C, and D are in the same broadcast domain. F. Hosts A, B, C, and D are in different broadcast domains.
150
Chapter 5:
FIGURE 5-6
A switched network
Switching: Moving Data Inside Your Network
Switch Hub Workstation
Host A Host B VLAN 1 VLAN 1 Host D Host E Host C VLAN 1 VLAN 1 VLAN 1
Host F Host G Host H VLAN 2 VLAN 2 VLAN 2
9. Hosts A, B, C, and D are all connected directly to a switch with no additional configuration. Which of the following statements are true? (Choose all that apply.) A. There is one collision domain. B. There are four collision domains. C. There is one broadcast domain. D. There are four broadcast domains. 10. According to Cisco design theory for a fully switched network, hosts do not connect directly to which type(s) of switch(es)? (Choose all that apply.) A. Access B. Core C. Distribution D. Cut through E. Fragment free 11. Refer to Figure 5-6. Assuming all CAM tables are up-to-date, if Host A sends a broadcast message, which of the following are true statements? (Choose all that apply.) A. Host B will receive the message. B. Hosts C and D will receive the message. C. Hosts E and F will receive the message. D. Hosts G and H will receive the message. E. The broadcast message is not propagated by the switch.
Self Test
151
12. Refer to Figure 5-6. Assuming all CAM tables are up-to-date, if Host A sends a unicast message to Host E, which of the following are true statements? A. Hosts B and E will receive the message. B. Hosts C and D will receive the message. C. Hosts E and F will receive the message. D. Only Host E will receive the message. E. The switch cannot forward the message. 13. Refer to Figure 5-6. Assuming all CAM tables are up-to-date, if Host A sends a unicast message to Host F, which of the following are true statements? A. Hosts B and F will receive the message. B. Hosts G and H will receive the message. C. Hosts E and F will receive the message. D. Only Host F will receive the message. E. The switch cannot forward the message. 14. A trainee is examining a switch. Port 1 is directly connected to another switch; however, the port’s LED is solid amber. The trainee asks if this is a problem. You determine the LED mode is set to STAT. Which of the following is the correct response? A. This is not a problem since all ports are amber in STAT mode. B. This is a problem since no port should ever appear amber. C. This is a problem. STP has the port in a forwarding state. D. This is not a problem. STP has the port in a blocking state.
152
Chapter 5:
Switching: Moving Data Inside Your Network
SELF TEST ANSWERS Switch Fundamentals ✓ D. If the LED mode is set to duplex, there are only two options: green for full duplex, and 1. ® off for half duplex. ® ˚ A. Amber LEDs do not appear when the mode is set to duplex. B. Green LEDs indicate a full duplex connection when the mode is set to duplex. C. Green/amber LEDs do not appear when the mode is set to duplex ✓ B and C. As frames enter a newly powered on switch, the CAM table is empty. The switch 2. ® records the source address, and its originating interface, in the table and floods the message. ® ˚ A. Recording the destination address with an incoming interface would not work. Switches record the source address. D. A switch will flood any unicast message it receives that does not match an entry in the CAM table. ✓ B and D. Moving Host A to a different port would not affect the delivery of frames with a 3. ® destination MAC for Host B—still on port 2. As the first message from Host A is received, the CAM table will update to the new port (12). ® ˚ A. Only three types of frames are flooded by switches: broadcast, multicast, and frames without a matching entry in the CAM table. Since B is still in the CAM table, the message would be delivered appropriately. C. The CAM table is updated to Host A’s new port number immediately after the frame enters the switch. ✓ C. If speed is determined to be less than gigabit, the switch always defaults to half duplex. 4. ® ® ˚ A, B, and D. None of the remaining options are correct. ✓ A. Cut through switches begin delivering the frame as soon as a destination address is 5. ® discovered. ® ˚ B. Store and forward switches receive the entire frame before forwarding, injecting additional latency but examining it for errors. C. Fragment free reads the first 64 bytes of the frame before delivering it, thus reducing collision errors and bad frame propagation. D. Full duplex does not apply in this scenario. ✓ C. Fragment free reads the first 64 bytes of the frame before delivering it, thus reducing 6. ® collision errors and bad frame propagation. ® ˚ A. Cut through switches begin delivering the frame as soon as a destination address is discovered. B. Store and forward switches receive the entire frame before forwarding it, thus injecting additional latency but examining it for errors. D. Full duplex does not apply in this scenario.
Self Test Answers
153
✓ B. Store and forward switches receive the entire frame before forwarding, injecting additional 7. ® latency but examining it for errors. This allows devices of different speeds/duplex settings to communicate over the same switch. ® ˚ A. Cut through switches begin delivering the frame as soon as a destination address is discovered. C. Fragment free reads the first 64 bytes of the frame before delivering it, thus reducing collision errors and bad frame propagation. D. Full duplex does not apply in this scenario.
Switch Design Considerations ✓ A, D, and E. Hosts A and B are connected to a hub, putting them both in the same 8. ® collision domain. Hosts C and D have individual links to the switch, putting them in different collision domains. Hosts A, B, C, and D are all in the same VLAN, putting them all in the same broadcast domain. ® ˚ B, C, and F. Hosts on a hub are in the same collision domain. C. Each host connected to a switch is in its own collision domain. F. A VLAN is designed to create a broadcast domain. ✓ B and C. Each switch port represents a separate collision domain. Switches do not split 9. ® broadcast domains. ® ˚ A and D. These are incorrect choices. ✓ B and C. Hosts do not directly connect to core or distribution layer switches. 10. ® ® ˚ A. Access switches provide direct access to users. D and E. These are switch modes, not design layers. ✓ A and B. Hosts A, B, C, and D are all in VLAN 1, putting them all within the same 11. ® broadcast domain. ® ˚ C and D. Hosts F, G, and H are in VLAN 2, putting them in different broadcast domains. E. This is not a true statement. ✓ A. Hosts A and B are connected to a hub; therefore, each device receives every message 12. ® from the other, regardless of the address. Once the switch receives the frame, it forwards it to Host E’s port only. ® ˚ B and C. The switch forwards the frame to only Host E’s port, based on the CAM table entry. D. Host B will also receive the message since it is connected to the same hub as Host A. It will not process it, however. E. This is not a true statement. ✓ E. Host F is in a different VLAN; therefore, the switch will not deliver the frame. 13. ® ® ˚ A, B, C, and D. These are incorrect choices. ✓ D. Solid amber in STAT mode indicates a port has been placed in a blocking state by the 14. ® Spanning Tree Protocol, as designed. ® ˚ A. All ports should NOT appear amber in STAT mode. B. Ports CAN be amber in STAT mode. When STP is doing its job, a blocking state port prevents routing loops. C. Ports in a forwarding state are green.
This page intentionally left blank
6 Routing Essentials and IP Addressing
CERTIFICATION OBJECTIVES 6.01
Routing Fundamentals
6.02
An Introduction to IP Addressing
✓ Q&A
Copyright © 2008 by The McGraw-Hill Companies. Click here for terms of use.
Two-Minute Drill Self Test
156
Chapter 6:
Routing Essentials and IP Addressing
D
ata requests are destined for one of two locations—either for a resource inside your network, or for a resource outside your network. Switches do a wonderful job of moving data around inside the network, but they can’t move anything outside the network. In this chapter, we’ll concentrate on what it takes to get data out of your network by discussing and examining the fundamentals and concepts of routing. To understand routing, we’ll first cover routing logic and data flow, followed by a basic discussion on routed and routing protocols. The next section describes how network boundaries are defined with an introduction to IP addressing. Lastly, we’ll take a look at some network layer utilities and their functions.
CERTIFICATION OBJECTIVE 6.01
Routing Fundamentals The basic fundamentals of routing revolve around network traffic destined for a foreign address. In other words, the destination device is not in the same network as the requesting system. LAN devices are not intended for this function—they only know about addresses inside the network. For clarification (continuing with the post office example we’ve used thus far), suppose you write a letter to a friend who lives in a different city. The letter is addressed with a name, street address, city, and ZIP code. It would be ridiculous to assume your local postal clerk will fire up his trusty postal wagon and hand deliver the message. In part, because it would be horribly inefficient and slow, but also because your postal clerk simply doesn’t know where your friend lives. The postal clerk’s job is to deliver messages on his route—in a neighborhood he knows about. Imagine how difficult his job would be if he were required to know the location of every address on the planet. When the clerk receives a message that isn’t intended for his neighborhood, he doesn’t know what to do with it. So, he takes it to someone who does—the post office. In this example, the clerk is acting like your LAN devices. They recognize specific MAC addresses (like the name, street, and city on the front of an envelope), but if it’s not inside their network (neighborhood) the message can’t be delivered. To deliver it, the devices send the message a location within their network (your local post office) that is capable of finding the correct route to the end destination. In other words, to get a message out of your network, you need a physical address inside your network to deliver it to. Once the message has a starting point, routing logic begins.
Routing Fundamentals
157
Routing Logic and Data Flow As stated earlier, before routing logic even comes into play, the data must be received by the router. After the data is received, the router makes a determination as to routing and proceeds to the next step—encapsulating the packet for delivery in the new network. Examining data flow and routing logic is most easily accomplished by considering an example and watching the data flow between two systems. See Figure 6-1 for an overview of this example.
FIGURE 6-1
PC3 195.250.5.200
PC4 195.250.5.200
A routing logic example
Serial 0: 195.170.5.1 Ethernet 0: 195.250.5.1
Serial 1
Serial 1 RTR1
RTR4
RTR3
RTR2
Ethernet 0: 195.100.5.1
Serial 1 Serial 0: 195.200.5.2
Serial 0: 195.150.5.2
PC2 195.100.5.200
PC1 195.100.5.100
158
Chapter 6:
Routing Essentials and IP Addressing
In our example, PC1 composes a message for PC4. PC1 then passes the message through the TCP/IP stack and, at the Internet layer, the IP address 195.250.5.200 is placed in the IP header. The packet is then passed to the Network Access layer, at which point a physical address must be determined for the address assigned in the Internet layer. The PC looks at the destination address and quickly determines that the packet is not intended for any device on this network by comparing it to its own (195.100.5.100 and 195.250.5.200 are not on the same network). PC1 then encapsulates the packet and places the default gateway MAC address in the header. The frame, appearing in Figure 6-2, is then sent out the port, and the switch merrily passes it on to the router. You may be asking yourself, “So how does the sending system find these addresses (IP and MAC) to build the frame with?” The answer has to do with two protocols: DNS and ARP. DNS (Domain Name System) resolves an IP address for a fully qualified domain name. In our example, suppose PC1 was attempting to surf a web page hosted by PC4. As the request is passed through the layers, it pauses at layer 3 while a separate DNS request is sent out. The DNS request queries for the IP address of the system hosting the web site that PC1 is searching for. When it gets its answer, DNS returns the IP and it is added to the frame. ARP (Address Resolution Protocol) then kicks in to resolve a MAC address for the IP address it now knows. Your system now has the IP address of PC4 and the MAC address of a system inside your network (your router’s physical address) to deliver the message to. There are actually a wide variety of methods to find the IP address of the end destination. Your PC checks its hosts file first, then its local DNS cache, before ever sending a request packet. Some systems, and networks, also use WINS (Windows Internet Name Service) to resolve IP addresses, while others provide different means. Lastly, ARP isn’t used on every message sent.The MAC address matching the IP address is stored in a cache on your machine, known as the ARP table. If the IP to MAC pairing is in the table, your machine does not need to send an ARP message. When the router port (195.100.5.1) receives the frame, it first checks the MAC address to verify the frame was intended for it. Next, the router checks
FIGURE 6-2
Frame 1
Source: Preamble PC1 MAC Address
Destination: Source: Router Port 195.100.5.100 MAC Address
Destination: 195.250.5.200
Data
F C S
Routing Fundamentals
159
the FCS field and, if the frame is verified, the header and FCS are removed. The destination IP address from the remaining packet header is then compared to a route table within the router. If there is no route in the table to which the packet can be sent, it is discarded. If there is a route in the table, the router then has to encapsulate the packet for the next network and send it out the appropriate port. The relevant route tables are listed in Table 6-1. In our example, Router 1 (RTR1) examines its route table and finds an entry for the target network. The entry tells the router that, to get to network 195.250.5.0, send the packet out the interface named Serial 1. Next, in another exceedingly important item, the table provides the address of the next router on the pathway: 195.150.5.2. This is such an important step because devices on any LAN can only receive messages intended for something on that LAN. The next hop address gives RTR1 an address on the next network link to forward the packet to. RTR1 performs an ARP request to find the next hop’s physical address, and then, in the last action step, encapsulates the packet based on the layer-2 technology used on the 195.150.5.0 network. This process is repeated for each router until the packet is finally delivered to the recipient station. In review, the steps a router takes are: 1. Verify the frame is addressed for the router port on which it was received, and that the FCS field is correct.
TABLE 6-1
Route Table Sample
RTR1 Route Table Destination Network
Out (Interface)
Next Hop (IP Address)
195.250.5.0
Serial 1
195.150.5.2
Destination Network
Out (Interface)
Next Hop (IP Address)
195.250.5.0
Serial 1
195.170.5.1
Destination Network
Out (Interface)
Next Hop (IP Address)
195.250.5.0
Serial 1
195.200.5.2
Destination Network
Out (Interface)
Next Hop (IP Address)
195.250.5.0
Ethernet 0
N/A
RTR2 Route Table
RTR3 Route Table
RTR4 Route Table
160
Chapter 6:
Routing Essentials and IP Addressing
2. Remove the frame header and trailer, and compare the destination layer-3 address in the packet header to the route table. 3. If the address does not match an entry, discard the packet. If it does match an entry, forward the packet to the appropriate interface for delivery. 4. Encapsulate the packet based on the layer-2 technology on the interface and apply the correct Physical layer address to deliver the new frame to the next hop address.
You must be very familiar with routing logic and the steps routers take when receiving a packet for delivery. Scenario-based exam questions will be
much easier to tackle if you know the steps described earlier and understand the basics of route tables.
Finally, we have one last, but extremely important, note on route tables and routing logic left to cover. As you’ll learn later in this chapter (and book), network addresses are defined by the number of bits in the network portion of the IP address. When a route is placed in a route table, the prefix tells the router how many bits to match between the packet’s destination address and the entry in the route table. A prefix appears as a “/” followed by a number. The number corresponds to the number of bits in the network portion of the address (IP addressing, subnets, and prefix numbers are covered in greater detail later in this chapter). The entry with the most matching bits always wins. For example, suppose three packets arrive at a router for delivery, addressed 10.5.1.1, 10.5.15.20, and 10.5.1.100. As these packets arrive, the router compares them to its route table entries, which are 10.5.1.1 /32 – Serial 0, 10.5.0.0 /20 – Serial 1, and 10.5.0.0 /23 – Serial 2. At first glance, it seems very confusing, but not when you look at the addresses as bits instead of decimals. One packet—10.5.1.1—is relatively easy to route because there is an entry in the route table that says, “If all 32 bits match these numbers ‘10.5.1.1,’ send it out interface S0.” The other two packets need to be taken down to bits to decide which interface will receive them. The bits for both addresses look like this: 10.5.15.20 = 00001010. 00000101. 00001111. 00010100 10.5.1.100 = 00001010. 00000101. 00000001. 01101000
Routing Fundamentals
161
The route table entries state the following: 10.5.0.0 /20 = If the first 20 bits equate to 00001010. 00000101. 0000, send the packet out interface S1. 10.5.0.0 /23 = If the first 23 bits equate to 00001010. 00000101. 0000000, send the packet out interface S2. An examination of the bits for both addresses shows that the 10.5.1.100 address has more bits in common with the 10.5.0.0 /23 route entry; therefore, it will be routed out interface S2. The 10.5.15.20 address does not match up as well with the same route entry, because it differs at the 21st bit (the route table entry is looking for a zero in that position, based on the prefix noted). The most bits it matches up with is to the 20th position, which matches the route table entry 10.5.0.0 /20.
The concept of matching the greatest number of bits in the route table to determine the correct interface on which to send the message is an integral part of the exam. You must be very familiar with how to do this. Many times, relying on just the decimal values will quickly become
overly confusing. Your best bet is to take the addresses to bits and note which address matches the largest amount of bits from left to right.There is no easy way to do this—you simply must practice, practice, and practice some more.
To correctly determine which interface a router is going to use for a particular packet, you must first decide to never look at decimals again. It’s such an important concept that I’m breaking the unwritten rule about writing it in first person to ensure you, CCENT candidate, understand this point clearly. If you wish to be a successful networking professional, and pass the CCENT exam, from this point forward you can never look at numbers in an IP address again. You will ALWAYS and ONLY look at the bits. Numbers will confuse and frustrate your efforts, but bits never lie. Yes, it takes longer—because you’ll have a lot of translating and math to do—but if you take the time for conversion and look at the bits instead of the decimals, it’s impossible to miss test questions. Math operations on translating decimal IP addresses to binary are covered in Chapter 7. When faced with a challenge like this (determining which route table entry will be used), look at the address like a router looks at it—in bits. First, translate the
162
Chapter 6:
Routing Essentials and IP Addressing
route entry to bits and count over the correct number of bits based on the prefix listed. Next, translate your address to bits and then line them up underneath. The entry with the most bits matching from left to right will be used. Another important entry you’ll see in a route table is the default route. The default route basically gives the router a place to send packets that it doesn’t have a clue about. For example, if your router has one port to the Internet, you might configure route entries for inside your network, then tell the router—through a default route—to send all other requests (in other words, all packets with routes not listed in the route table) to the Internet. Default routes must be manually added to the route table, and are covered in Chapter 10.
Routed and Routing Protocols The routing logic covered above relies on two separate, but equally important, thought processes. The first revolves around network definition—just how does a router know where one network ends and another begins? The second centers on the route table itself—how does the router learn which routes to put in its table? The first question can be answered with a discussion on routed protocols, and the second on routing protocols. To learn what routed protocols are and how they function, first consider the protocols and addressing used in layer 2—where routing does not exist. Ethernet uses MAC addressing in its frames to send messages. As stated before, MAC addressing is a flat model, meaning devices communicating using a physical MAC address must know, or have a way of knowing, the exact physical address of the intended recipient. Simply put, with a flat model, each device must know the address of every other device. Considering the billions of systems on the Internet, it’s easy to see why a flat model simply won’t work. A hierarchical model using logical addressing, however, provides a much better solution. Logical addressing actually provides two things within every single address—an address for an individual host and the network on which the host resides. In other words, when a layer-3 device receives a packet with a logical address, it uses the network portion of the address to route to the destination network, and the host portion to find the individual system on that network. By splitting the address between network and host, devices can use the logical address much like the ZIP code on a letter, quickly making hierarchical routing decisions along the way.
Routing Fundamentals
163
Routed protocols provide a method for a packet to be sent outside the sending device’s network because they make use of logical addresses. In short, they are simply those protocols that can be routed. A hierarchical logical addressing model provides a way to determine where networks begin and where they end, and routed protocols include these addresses in their packet headers. Routed protocol examples include IP, IPX, DECnet, and AppleTalk.
Be sure you know what routed protocols are and do, and are familiar with some examples of them. IP, IPX, AppleTalk, and DECnet all provide a
means to address both the host and the network to which the host belongs. In short, remember that routed protocols use logical addresses.
While routed protocols and logical addressing define network boundaries and allow for packets to be routed, the question of how route tables are built and maintained within routers remains to be answered. The two main methods of building route tables are statically and dynamically. Static routing simply means routes are manually entered into the route table. With static routing, administrators add and delete routes as needed. The benefits of static routing include: ■ Less overhead on the router’s CPU
There is no need to compute routes for the table if they are manually entered and maintained.
■ Less bandwidth usage on the network
No route advertisements need to be
sent from router to router. ■ Security
If routes can only be added or deleted manually by an administrator, there is less chance the route table can be poisoned by an outside influence.
Obviously, though, this method has its disadvantages. If route tables are statically built and maintained, any change to an existing network causes problems. In other words, routers will continue to forward traffic to a network that is down because the manually maintained route tables tell them to. If the administrator does not have a thorough understanding of the network, or is slow to react to network changes, network traffic can be disrupted for long periods of time. Therefore, static routing is not recommended, or even feasible, for large networks.
164
Chapter 6:
Routing Essentials and IP Addressing
Dynamic routing, on the other hand, is an excellent choice for large networks. In dynamic routing, routers learn about network routes and update their tables automatically. New network routes are added, outages are dropped or rerouted, and changes are updated on-the-fly, based on how a particular routing protocol functions. Routing protocols define how route tables are built, and are characterized by the methods used to exchange routing information between routers, the metrics used to determine routes, and the amount of time it takes for the network to converge. The two major categories of routing protocols are distance vector and link state. Regardless of which type of protocol is used, oftentimes a router will receive two (or more) routes to the same network. Quite common, due to the redundancy built into most networks, multiple route updates to the same network are ranked using two main methods: administrative distance or metric comparison. The administrative distance (AD) is a term and mechanism used on Cisco routers to rank routes according to how they were learned—the lower the administrative distance, the better the route. For example, a route learned from the RIP routing protocol has an AD of 120, while a route learned from OSPF would Remember the benefits have an AD of 110. If both route updates were and disadvantages of static routing, and for the same network ID, the router would put commit Table 6-2 to memory. Be sure the OSPF learned route in the table since Cisco to remember that the lower the AD, the trusts OSPF updates more than RIP updates. better the route. Administrative distances (listed in Table 6-2) should be committed to memory. If two updates are received by the router to the same network, and both have the same AD, then the router turns to metrics to determine the best path. The router
TABLE 6-2
Administrative Distances
Route Type
Administrative Distance
Directly Connected Network
0
Static Route
1
EIGRP
90
IGRP
100
OSPF
110
IS-IS
115
RIP (and RIPv2)
120
Unknown
255
Routing Fundamentals
165
will compare both updates and choose the best path to put in the route table based on whatever metric the routing protocol uses. Some routing protocols only use one metric, while others combine many metrics into their decision process. Examples of metrics include hop count, bandwidth, and reliability.
Distance Vector Routing Protocols Routers using distance vector protocols exchange information only with their directly connected neighbor routers—in other words, distance vector protocols only talk to routers they are directly connected to. Distance vector protocols exchange their entire route tables on a regular timed basis, regardless of whether any changes occur or not, and this information is exchanged as a network broadcast message. These protocols use only hop count as a metric—in a distance vector router, if two routes to the same destination are found, the router adds only the one with the shortest hop count to the destination. Distance vector routing protocols are very easy to implement, and work well on small networks; however, they are not recommended for large networks due to the concept of “routing by rumor.” (See Figure 6-3 for more information.) Routing by rumor is so named because distance vector routers do not learn about routes from the router “owning” the network. Rather, they learn about it from some other router’s table. In Figure 6-3, router A learns about the routes on
FIGURE 6-3
Message to RTR B: Network 172.21.0.0 is no longer available.
Distance vector routing
RTR A
RTR B
RTR C
RTR D 172.18.0.0
172.16.0.0
172.17.0.0
172.19.0.0
172.20.0.0
172.21.0.0
166
Chapter 6:
Routing Essentials and IP Addressing
router C because router B told him about it. If changes occur on router C’s end of the network, router A won’t know about it until router B sends him an update. Since route tables in distance vector are exchanged on a regular timed basis (every 30 seconds), if the change occurs just after an update is sent to router B, it could be quite a while before router A learns of the change. Additionally, router C won’t necessarily update router B as soon as the change occurs—it will wait to send the update on the next timed update cycle. Between these two problems, convergence time (the time it takes a network to respond to a network change) on a distance vector network is greatly slowed. Examples of distance vector routing protocols include RIP, Ripv2, and IGRP.
Link State Routing Protocols The second major category of routing protocols is link state. Link state protocols are considerably better choices than distance vector for a couple of reasons. First, link state routers do not waste bandwidth by sending the entire route table back and forth. Instead, link state protocols only send updates when a route changes, and these updates are sent multicast, not broadcast. These updates are known as, surprisingly enough, link state advertisements (LSAs). As soon as a network drops or is added, the router sends LSAs to all routers within the area. Each router then makes the appropriate update to its table, and sends an acknowledgment of receipt—something distance vector routers do not do. This brings us to the second major advantage link state protocols have over distance vector: convergence time. Link state networks converge much faster than a distance vector network— sometimes within just a few seconds! Since routers hear about route updates almost as soon as they occur, and hear it directly from the router who “owns” the network, convergence is very fast. Link state protocols are also capable of using many different metrics in determining routes. For clarification, consider Figure 6-4. A message received by RTR 1 headed to network 192.168.5.0 has two possible pathways—out Serial 0 or Serial 1. The pathway from Serial 0 to the network goes through only two routers (hop count of 2), but each link in the chain is only 56 Kbps. The pathway from Serial 1 to the network goes through three routers (hop count of 3), but each link along the chain is T1 (1.544 Mbps) or better. If the network is using distance vector routing, and RTR 1 receives a message intended for network 192.168.5.0, it always sends the message out interface Serial 0 due to hop count—two hops are less than three; therefore, it’s a better route. However, the speeds of each link actually make the Serial 1 pathway a better choice. Link state protocols would take this into account and the message would be sent out Serial 1, reaching the intended recipient faster.
Routing Fundamentals
167
FIGURE 6-4
A link state route example
RTR 1
S0
56Kbps
S1
1.544 Mbps
RTR 2
56Kbps
RTR 3
1.544 Mbps
RTR 4
RTR 4 1.544 Mbps
192.168.5.0
RTR 5
Examples of link state protocols include OSPF and IS-IS.
You must be able to compare and contrast the characteristics of distance vector and link state protocols, as well as identify examples of each. Distance vector protocols use hop count as a metric, converge slowly, and exchange
their entire route tables on timed intervals only to their directly connected neighbors. Link state protocols use several different metrics (including bandwidth), converge very quickly, and send LSAs throughout the network as soon as a route changes.
Routing protocols allow routers to dynamically advertise and learn about routes, as well as determine which are the most efficient routes to an end destination. Distance vector protocols require less router CPU processing cycles, but do not work
168
Chapter 6:
Routing Essentials and IP Addressing
well on larger networks, and do not acknowledge routing updates. Link state protocols are more memory- and CPU-intensive, but converge much faster, and only send updates when a network change occurs. More information on routing protocols, and configuration steps concerning them, will be covered later in Chapter 10. There is a third routing protocol type, known as a Hybrid. EIGRP acts like a distance vector protocol, but takes advantage of some link state characteristics as well. CertCam
A multimedia demonstration comparing Distance Vector to Link State protocols can be found on the CD accompanying this book.
CERTIFICATION OBJECTIVE 6.02
An Introduction to IP Addressing The most common routed protocol in networking today, Internet Protocol (IP), is part of the TCP/IP suite and is, by far, the most important area of study for a potential CCENT candidate. As stated in the previous section, routed protocols provide a means to address both the individual system and the network to which it is a part. IP will be covered throughout the remainder of this book; however, this section is dedicated to introducing basic IP address concepts and understanding how they define network boundaries. In these pages, we’ll cover IP address construction, classes of IP addresses, and the concept of public and private addressing.
IP Address Construction Though most entry-level networking technicians are probably familiar with how an IP address looks, they may not know how it’s actually put together. Typically, IP addresses are displayed in dotted decimal notation, and appear as four numbers separated by dots. This is helpful to us since people generally can remember and work with numbers. However, IP addresses aren’t actually made up of numbers. They are made up of bits that happen to add up to the numbers displayed in the dotted decimal format. Each number of an IP address is made up of eight individual bits, and the number values that can be created by these eight bits range from 0 to 255.
An Introduction to IP Addressing
169
Sooner or later, you’ll come across an IP address that doesn’t look anything like what we’re discussing here.The focus of this section—as well as the book and CCENT exam—is IP version 4 (IPv4). IP version 6 (IPv6) is the newest version of IP addressing and will soon become a part of your networking experience. For now, you’ll see and work with IPv4, more so than any other routed protocol. Keep in mind, too, that the exam concentrates on it. For example, consider the address 10.1.2.3. In binary, this address is actually 00001010.00000001.00000010.00000011. Each decimal number is made up of 8 bits, known as an octet, and each octet is referred to by the portion of the address it makes up. The bits creating the number 10 belong to the first octet, while the bits creating the numbers 1, 2, and 3 are in the second, third, and fourth octets, respectively. Additionally, the bits within an IP address are further divided into two sections—the network portion and the host portion. The network bits are used to identify the network the message is intended for, and the host bits are used to identify the individual host on the network. Of the 32 bits available, at least eight of them must belong to the network portion, while at least 2 must belong to the host portion. In the preceding example, if the first eight bits belong to the network portion, then the message would be for the computer addressed “1.2.3” on the “10” network. All computers belonging to this network must have an IP address that begins with 10, and their host bits must not be the same as any other system on the network. For example, 10.1.2.4, 10.1.2.5, and 10.200.50.8 are all on the same network. A computer addressed 11.1.2.3 would not be on the same network because the network bits don’t match. See Figure 6-5 for more clarification. A key concept for CCENT candidates, as well as for networkers in general, is simple: if the network bits on two addresses do not match, then the two messages are intended for two separate networks. This may seem like an obvious statement, but
Network Bits
FIGURE 6-5
IP addresses: The network bits
Host Bits
10.1.2.4
: 00001010.
00000001. 00000010. 00000100
10.1.2.5
: 00001010.
00000001. 00000010. 00000101
10.200.50.8 : 00001010.
11001000. 00110010. 00001000
11.1.2.3
00000001. 00000010. 00000011
: 00001011.
170
Chapter 6:
Routing Essentials and IP Addressing
it’s only obvious when the network bits happen to fall on a dot. In other words, if 8, 16, or 24 bits belong to the network portion, it’s easy to tell because the numbers simply look different. However, what if there were nine bits in the network portion? Consider the following example for a little more clarity on the subject. Imagine there are two devices—one addressed for 10.200.15.1 and one addressed for 10.12.15.1. At first glance, it may appear that these two systems belong to the same network, but the question that must first be answered is, do the same number of bits in both addresses belong to the network portion? If both systems use only the first eight bits, then yes, both would be in the same network. However, what if both systems used the first ten bits? If you examined the first ten bits of both addresses, they are different, meaning they’re both in different networks—or subnets. See the top portion of Figure 6-6 for more information. Lastly, the host bits within a 32-bit IP address can represent two separate items: a host address and a broadcast address. A host address is simply a device within the network, and as long as at least one bit is turned on (1) the address is useable on the network. Many times, though, it’s imperative that a message be sent to every device on the network. In this instance, if all host bits are turned on, the message is sent to every device on the network. If all host bits are set to 1’s, the address is known as a broadcast address. Conversely, if all host bits are set to 0’s, the address represents the network. For example, if the network portion of the address 10.1.2.3 took up only the first octet, the network address would be 10.0.0.0 (all host bits set to 0’s) while the broadcast address would be 10.255.255.255 (all host bits set to 1’s). Refer to the bottom half of Figure 6-6 to see how the bits line up for each address.
FIGURE 6-6
IP addresses: Comparing network bits
Comparing Network Bits Network Bits
Host Bits
10.200.15.1 : 00001010. 11
001000. 00000010. 00000100
10.12.15.1
001100. 00000010. 00000101
: 00001010. 00
Network ID and Broadcast Address Bits Network Bits Host Bits Network ID : 00001010.
00000000. 00000000. 00000000 = 10.0.0.0
10.12.15.1
11111111. 11111111. 11111111 = 10.255.255.255
: 00001010.
An Introduction to IP Addressing
It is absolutely essential that you thoroughly understand the concepts in this section. Review the construction of IP addresses and be sure you understand network versus host bits. If the network bits match, then the systems are on the same network. Make sure you understand how host bits determine the type of address: if
171
all host bits are set to 0’s (network address), all set to 1’s (broadcast address), or anything in between (useable addresses for hosts on the network). Lastly, and very importantly, remember that IP addresses are actually made of BITS, not numbers… If you just look at numbers, you’ll miss questions on the test.
IP Address Classes With 32 bits to manipulate into different combinations, IPv4 provides for 4,294,967,296 possible unique addresses. Initially, this seemed like plenty of address space, but organizing such a large pool of possible addresses still remained to be figured out. The entire concept of routing is based on the same principle, discussed several times in this book, as the ZIP code system used by the post office. Therefore, some organization in assigning IP addresses to businesses and ISP’s is essential—if there were no organization and addresses were simply handed out at random, routing would break down. The answer, at least at first, was to divide the IP address space into logical easy-to-recognize assigned classes and to have a central authority track and assign address allocation. In RFC 791, the IP address space was divided into three classes, with each one providing space for a particular need. Throughout the years, several entities (such as ICANN) have controlled the allocation of these classes based on need and availability. Class A addresses were to be handed out for large networks, Class B networks went to intermediate organizations, and Class C addresses were for smaller networks. The organization of addresses into classes followed a very logical—if not practical in the long run—method. The logic behind the decision is listed in Table 6-3. Class A addresses were assigned to allow for very large networks. Large networks would need an extraordinary amount of host addresses, so the decision was made to allocate only the first octet to the requesting organization. For example, suppose a government entity requested a Class A address. ICANN would assign the first eight bits, leaving the last 24 up to the network owner to assign as host addresses.
172
Chapter 6:
Routing Essentials and IP Addressing
TABLE 6-3
IP Address Classes
Class Network Bits Host Bits
Available Host Addresses Per Network
Intended Use
24
A
First 8 bits
Last 24 bits
16, 777, 214 (2 –2) Large Networks (ISPs, and so on)
B
First 16 bits
Last 16 bits
65,534 (216–2) 8
Intermediate Networks
C
First 24 bits
Last 8 bits
D
At least 8
Depends on # N/A of network bits
Reserved for Multicast
E
At least 8
Depends on # N/A of network bits
Reserved for Experimental Use
254 (2 –2)
Small Networks
If the address assigned was the 9 network, 9.0.0.0, the owner could not change the first eight bits, but could manipulate the last 24 to assign individual host addresses. Every computer in the network would begin with the number 9 in the first octet (hosts could be addressed 9.0.0.1 through 9.255.255.254). The same logic applies for Class B and C networks, only with different numbers of network bits assigned. If an organization received a Class B network, ICANN would assign the first two octets, leaving the last two for hosts. If it were a Class C network, the first three octets would be assigned, leaving only the last one for hosts. For example, an assignment of the Class B network 188.77.0.0, leaves 188.77.0.1 through 188.77.255.254 as possible host addresses for the administrator to assign. So long as a computer’s address begins with 188.77 in the first two octets, it would belong to the network. A Class C example, 195.95.100.0, would leave only the last octet—195.95.100.1 through 195.95.100.254—available for hosts. You may notice in Table 6-3 that the formula for finding out how many host addresses are available includes a “–2.” Why not just 2n?, you may ask. Remember from our previous discussion that host bits can be all 0’s, all 1’s, or anything in between. All 0’s indicates the network address, while all 1’s indicates the broadcast address.Therefore, out of every grouping of host bits, two addresses cannot be used—the network and broadcast addresses. After developing the logic behind classes, the task of actually dividing up the IP address space became paramount. It could have been done in several ways, but the agreement reached in RFC 791 won out. This agreement stated that the arrangement of the first octet determined to which class an address belonged.
An Introduction to IP Addressing
173
Since the first octet began with 00000000 and ended with 11111111, it seemed logical that some definable pattern in the arrangement of those bits could be used to satisfy the end goal. If you follow the arrangements of bits to represent decimals, you discover a repeatable pattern that makes dividing the address space easy. The first arrangement of bits is 00000000, followed by 00000001, 00000010, 00000011, and so on. This pattern repeats until you have 01111111, making an easily definable range. In other words, if the first bit of an IP address is 0, the address is in Class A. Class A addresses range from 1 (00000001) to 127 (01111111). The next two classes were just as easy to create. Following the pattern, the next available number looks like this in binary: 10000000. Instead of the address starting with a 0, Class B addresses start with a 10. Filling in the range, you get 10000000– 10111111.Therefore, the decimal range for a Class B address is 128–191. Class C addresses begin with 110, and range from 11000000–11011111, which equates to 192–223. The number ranges for IP address classes are listed in Table 6-4. Note: You’ll notice the range for Class A does not include 0 or 127.These address ranges are reserved and cannot be allocated for public use; therefore, they are not listed in the valid range shown here. Additionally, the default subnet masks are listed for reference here only—subnetting and subnet masks will be covered in Chapter 7.
The information in Table 6-3 and Table 6-4 should be committed to memory.You need to be able to identify which class an IP address is in based on the
TABLE 6-4
IP Address Class Ranges
Class A
Leading Bits
first octet number, as well as to define the number of hosts available, number ranges, default subnet masks, and leading bits for all classes on the exam.
First Octet Range Hosts per Network Default Subnet Mask
0
1–126
16,777,214
B
10
128–191
65,534
C
110
192–223
254
255.0.0.0 255.255.0.0 255.255.255.0
174
Chapter 6:
Routing Essentials and IP Addressing
IP Address Technologies While this arrangement of IP addressing seems entirely logical, simple, and useable, it does have many inherent flaws. For instance, suppose you have a small network of 300 users. If you went to ICANN looking for address space, you would have to purchase a Class B—a Class C (254 useable addresses) simply wouldn’t provide enough addresses. This would satisfy your needs; however, 65,234 addresses would be wasted. You only needed and used 300, but the other 65,234 addresses still belong to your network and, effectively, cannot be used by anyone else. Obviously, this problem—along with reserving ranges for specific uses—rapidly saw IP address space deplete. Several technologies were developed at the outset (and along the way) to help remedy this problem. Technologies include subnetting, Network Address Translation (NAT), Classless Inter-Domain Routing (CIDR), and IP version 6. It has been said the original developers of internetworking and IP didn’t have any idea how large and ubiquitous it would become. Want proof? Consider the reserved address 127.0.0.1—commonly referred to as the loopback address. The loopback address was built into every TCP/IP-enabled device to test the TCP/IP binding to the NIC. In other words, an entire Class A address range was set aside, wasting 16,777,213 addresses, so we could ping ourselves. Subnetting basically allows an administrator to simply borrow host bits to create smaller networks (called subnets) out of one larger address range. For one example, consider a business needing two separate small networks, with between 20 and 30 users on each. In this instance, even though one Class C would provide plenty of addresses, you’d still need to purchase two separate network ranges. This would waste address space, add confusion, and make for additional route advertisements, slowing down the system as a whole. With subnetting, however, an administrator can purchase one Class C and simply tell the router, “Instead of paying attention to only the first 24 bits, now pay attention to the first 26 bits and count them all as network bits.” In Figure 6-7, the Class C address 200.200.200.0 is being subnetted to create two new subnets. Notice how the original network/host boundary is simply moved over by two bits. In the bottom half of the figure, the administrator then simply changes those bit values to create two different networks (subnets) for use in his design—200.200.200.128 and 200.200.200.64. By taking two bits from the host range and counting them as network bits, the administrator can create two new subnets, and assign hosts to either. As long as the two new network bits match (for instance, they are both 10 on one network
An Introduction to IP Addressing
FIGURE 6-7
Before Subnetting: 200.200.200.0
175
Network Bits: Host Bits: 11001000. 11001000. 11001000. 00000000
A subnet sample Original dividing line was here. After Subnetting:
Network Bits: Host Bits: 11001000. 11001000. 11001000. 00 000000 Dividing line has been moved to here.
New Subnets Created:
Network Bits:
Host Bits:
200.200.200.64
11001000. 11001000. 11001000. 01 000000
200.200.200.128
11001000. 11001000. 11001000. 10 000000
and 01 on the other) in the address, then the address belongs to the same network. Change either of the two bits, and you’re in a new subnet. Figure 6-8 shows the network after subnetting, with each subnet assigned appropriately. By manipulating the newly available network bits, the administrator can conserve IP address space, reduce route advertisements, and save a lot of money in the process! Subnetting is covered in much greater detail later in the book. FIGURE 6-8
A subnet example
Network ID: 200.200.200.64
Internet
Network ID: 200.200.200.128
176
Chapter 6:
Routing Essentials and IP Addressing
Lastly, two terms are associated with subnetting: classful and classless. Classful refers to the treatment of every IP address within the class system discussed earlier. In other words, only the default subnet masks and classes are used. Classless refers to the use of subnetting to define network IDs. For example, in classful routing, the address 17.5.4.3 would automatically belong to the 17.0.0.0 network, based on what we know about Class A addresses and their default subnet masks. However, in classless routing, we would need the subnet mask, along with the IP address, to determine which network the system was on. Routing protocols that are considered to be classful do not recognize subnets, while those that are classless can use subnetting.
Subnetting is covered later in the book; however, the details in this section deserve attention and memorization. Be sure you understand the concept of simply borrowing bits from the host field and assigning them to the network field to create subnets. Each subnet has a unique set of bits that
identifies it—all hosts on that subnet will have the same matching network and subnet bits. Lastly, and quite obviously, borrowing bits from the host field increases the number of networks (subnets) you can have, but reduces the number of hosts allowed on each.
Another technology in place to help stem the tide of depleting IP address space is private addressing and Network Address Translation. The idea for private addressing was simple: business and home networks don’t necessarily need public IP addresses for every device in their network. Private addresses were created to allow administrators to create subnets and assign host addresses inside their enterprise networks without wasting public address space. Private addresses are not routed through border routers to the Internet. In other words, devices with private IP addresses cannot connect directly to the Internet, and computers outside the local network cannot connect directly to a device with a private IP. Additionally, multiple businesses can use the same private IP address range since their networks will never be routed out to the Internet. Private addresses also provide additional security for hosts on your network. Since the addresses are not routed outside the network, no one from the Internet can access the systems from the outside—any return messages from an attempt to connect would simply be dropped at the border router. RFC 1918 created private address ranges within each IP address class for internal networks. The private IP address ranges are listed in Table 6-5.
An Introduction to IP Addressing
TABLE 6-5
Private IP Address Ranges
Network Class
Private Address Range
A
10.0.0.0
B
172.16.0.0 through 172.31.0.0
C
192.168.0.0 through 192.168.255.0
177
Another address you might recognize is the Automatic Private Internet Protocol Addressing (APIPA) range. Created through a different RFC than the other ranges (RFC 3300 as opposed to RFC 1918), APIPA addresses (169.254.0.0) are used on a variety of different operating systems to automatically assign IP addresses in the event a DHCP server cannot be found. The idea is that, without a DHCP server, all systems booting in the network would randomly choose an address in the same subnet (169.254.0.0/24). APIPA addresses can also be used as a troubleshooting indicator, having become a tell-tale sign that something is wrong between the PC and the DHCP server. Using private addressing inside the enterprise network does help conserve IP address space, but it’s only half the story. A technology is available that permits the use of private addressing while simultaneously allowing devices in your network to connect to the Internet. Network Address Translation (NAT) is a service that runs on a router, firewall, or server, and is used to translate private IP addresses into useable public IP addresses. NAT maps private IP addresses to public addresses and keeps track of sessions, allowing networkers to use one public IP address to represent many private addresses behind it. NAT can be implemented in several methods, but the basic concept behind it is relatively simple to understand. As shown in Figure 6-9, a system inside the network initiates a request for a web page on the Internet. The request is sent to the default gateway (router) where it is intercepted by NAT. NAT maps the internal private IP address to a public IP address, records the session, and sends the request out using the public address. When the answer is returned, NAT sends the message to the internal client. This not only hides the internal network from the Internet, but allows multiple internal systems to use a single external IP address. NAT can be implemented statically or dynamically, and can use a single public address or a pool of addresses. In static NAT, mappings from private to public are manually defined in a list created and maintained by the administrator, something which is also known as one-to-one. In dynamic NAT, the administrator assigns a
178
Chapter 6:
Routing Essentials and IP Addressing
FIGURE 6-9
P: Sr 199 c P .5 or 5.8 Sr t: .5, cI 45 D P: 34 es Sr 220 4, t I c P .1 D P: 5 es 2 or .1 t P 20 t: 2.7 80 7 or .15 , ,D D t: .12 80 .7 es est 7 t P IP or : 1 t: 9 45 9.5 3 4 5. 4 8.5
Web Server: 220.15.12.77
NAT, Running on the Router, Presents a Single Public Address: 199.55.8.5
Sr cI
Network Address Translation
Src IP: 220.15.12.77, Dest IP: 172.16.10.5 Src Port: 80, Dest Port: 45344
Src IP: 172.16.10.5, Dest IP: 220.15.12.77 Src Port: 45344, Dest Port: 80
Private Address Inside: 172.16.10.5
single address, or a pool of addresses, and the NAT service takes care of mapping as requests come in. Dynamic NAT is also known as many-to-one and can be implemented in two different methods. In one method, standard dynamic NAT, message requests are handled dynamically, but only one at a time. As a request comes in and is mapped to a public IP address, no other internal machine can use that address until the initial request has been fulfilled and the address is freed for use. The second method—Port Address Translation (PAT)—also keeps track of the port numbers in the session request.
Be sure to memorize the private IP address ranges and know their basic characteristics. Remember, private addresses cannot be routed out of your
network, and systems with a private address cannot be accessed from outside the network.
An Introduction to IP Addressing
NAT and PAT configuration will be covered later, but for now make sure you understand the basics of the technology. NAT allows privately addressed systems inside your network to access
179
the public Internet, and (if so configured) vice versa. It also provides additional security by masking the true source of Internet requests.
This allows multiple systems to use the same public IP address at the same time. NAT and PAT configuration on routers is covered later in Chapters 9 and 10. The third technology in place to mitigate against IP address depletion is Classless Inter-Domain Routing (CIDR). In short, CIDR eliminates the old class system of IP address allocation and provides two important advantages. The first is the ability to acquire and use only the amount of IP addresses needed, and the second is to represent multiple subnets with a single route advertisement. CIDR representation is often used in place of subnet masks in displaying and referring to networks within a subnetted environment. For example, the default subnet mask for the Class B address 135.17.0.0 is 255.255.0.0. In CIDR, this same advertisement can be sent and referred to as 135.17.0.0 /16. The number after the “/” refers to the number of bits belonging to the network portion of the address. In modern networking, both subnet masks and CIDR notation are used interchangeably. The last technology in place to mitigate against IP address depletion is IP version 6. IPv6 is not commonly seen in today’s networks, but its implementation is all but inevitable. While IPv4 addresses are 32 bits in length and have four octets, IPv6 addresses are 128 bits long and have 16 octets. IPv6 addresses are displayed in hex digits separated by colons—for example 0000:0000:0000:0000: FFFF:FFFF:AABB:0102. The additional bits provide for an unbelievable amount of addresses (over 1038), as well as several additional benefits (Quality of Service features, a higher degree of security, and so on). IPv6 addressing is not covered heavily on the exam; however, you should be able to compare basic features of both IPv4 and IPv6.
180
Chapter 6:
Routing Essentials and IP Addressing
INSIDE THE EXAM Routing Fundamentals Many CCENT questions on routing logic and fundamentals will be simultaneously simple and confusing. To ensure you’re prepared, be sure you can re-create the steps a router takes when receiving a packet for delivery, and be prepared for several questions concerning the function of the route table. Pay particular attention to the concept of the largest prefix match. The exam will also require you to identify and describe routed and routing protocols. Be prepared to compare and contrast each.
An Introduction to IP Addressing You must be very well versed in IP address construction for the exam. Remember that, even though they are displayed in dotted decimal format, IP addresses are actually 32 bits, divided into octets and separated by dots. Each octet can be arranged to display numbers from 0 to 255. IP addresses have two subsections—the
network portion and the host portion. If all host bits are set to 0’s, the address shows the network ID. If all host bits are set to 1’s, the address is the broadcast address for the subnet. Any combination of host bits in between is a valid address for the network. Several questions will concentrate on these three options. Be prepared to not only identify classful addressing but to apply the information within a scenario or simulation question. Be sure you understand how many octets are available on each class for host addresses, and be prepared to identify and use each class’s private address range. While not heavily tested on the exam, you should be able to identify IP address depletion technologies and describe their basic function. Be sure to review and understand basic NAT and PAT functions and purposes. Lastly, make sure you can recognize and identify IPv6 characteristics.
CERTIFICATION SUMMARY The steps a router takes when receiving a packet for delivery are: Check the FCS, discard the old frame header, and verify the destination IP address against the route table. If there is a match, create a new frame header and trailer for the packet, and send it out the appropriate port. If there is no match, discard the packet. You must also be prepared for several questions concerning the function of the route table. Remember, if there is no entry in the route table, the packet is dropped. If there is an
Certification Summary
181
entry in the route table, the router will forward the packet out the interface with the most matching bits. Routed protocols contain logical addresses and can be routed to an end destination. Examples include IP, IPX, DECnet, and AppleTalk. Routing protocols define how route tables are built and how routers share information with one another. Static routing requires manual updates and has several advantages and disadvantages, while dynamic routing uses routing protocols. Distance vector routing protocols use only hop count as a metric and work well on small networks. Examples include RIP, RIPv2, and IGRP. Link state routing protocols converge much faster, use a variety of metrics in determining route entries, and send LSAs when network outages and changes occur. Examples include OSPF and IS-IS. IP addressing is probably one of the most tested areas of study on the exam. Familiarity with the concepts in this chapter is essential to success on the exam. Remember and study IP address construction: displayed in dotted decimal format, IP addresses are actually 32 bits, divided into octets and separated by dots. Each octet can be arranged to display numbers from 0 to 255. IP addresses have two subsections—the network portion and the host portion. If all host bits are set to 0’s, the address shows the network ID. If all host bits are set to 1’s, the address is the broadcast address for the subnet. Any combination of host bits in between is a valid address for the network. Several questions will concentrate on these three options. The CCENT exam will require you to identify IP address classes, as well as the private ranges within each class. Class A addresses begin with 1–126 and each network can host over 16 million addresses. Class A’s have a default subnet mask of 255.0.0.0 and the private address range is 10.0.0.0. Class B addresses begin with 128–191 and each network can host over 65,000 addresses. Class B’s have a default subnet mask of 255.255.0.0, and the private address range is 172.16–31.0.0. Class C addresses begin with 192–223 and each network can host 254 addresses. Class C’s have a default subnet mask of 255.255.255.0 and the private address range is 192.168.0–255.0. Technologies to combat IP address depletion include subnetting, NAT, CIDR, and IPv6. Subnetting allows an administrator to borrow host bits to create smaller networks (called subnets) out of one larger address range. Classful refers to the treatment of every IP address within the class system discussed earlier. In other words, only the default subnet masks and classes are used. Classless refers to the use of subnetting to define network IDs. Routing protocols that are considered to be classful do not recognize subnets, while those that are classless can recognize subnetting.
182
Chapter 6:
Routing Essentials and IP Addressing
You should be very familiar with fundamentals regarding private addressing: devices with private IP addresses cannot connect directly to the Internet; computers outside the local network cannot connect directly to a device with a private IP; multiple businesses can use the same private IP address range; and private addressing and NAT provide additional security for hosts on your network. Network Address Translation (NAT) is a service used to translate private IP addresses into useable public IP addresses. NAT maps private IP addresses to public addresses and keeps track of sessions, allowing networkers to use one public IP address to represent many private addresses behind it. PAT adds the port numbers to the session track, allowing better security and permitting multiple systems to connect simultaneously. CIDR eliminates the old class system of IP address allocation and provides two important advantages. The first is the ability to acquire and use only the amount of IP addresses needed, and the second is to represent multiple subnets with a single route advertisement. CIDR representation is often used in place of subnet masks in displaying and referring to networks within a subnetted environment. The number after the “/” refers to the number of bits belonging to the network portion of the address. In modern networking, both subnet masks and CIDR notation are used interchangeably. IPv6 addresses are 128 bits long and have 16 octets. IPv6 addresses are displayed in hex digits separated by colons—for example, 0000:0000:0000:0000:FFFF:FFFF: AABB:0102. The additional bits provide for over 1038 addresses, as well as several additional benefits (Quality of Service features, and so on).
Two-Minute Drill
✓
183
TWO-MINUTE DRILL Routing Fundamentals ❑ To determine which interface to send an incoming message out, the router
compares the destination IP address to its route table. If there is no match, the packet is discarded. If there is a match, the route table entry matching the most number of bits from left to right when compared with the address is used to route the packet. ❑ When a message is received by a router, it checks the FCS field and discards
the header and trailer. The destination IP address in the packet header is then examined and compared against the route table. The packet is then reframed and sent out the appropriate port. ❑ Routed protocols are used to transport data to end systems due to the hierar-
chical, logical addressing found in their header. Examples are IP, IPX, DECnet, and AppleTalk. ❑ Static routing requires the administrator to add and remove route table entries
manually. Its advantages include less router CPU overhead, less bandwidth usage on the network, and better security. Its disadvantage is very slow convergence— network outages have to be manually updated in all route tables. ❑ Routing protocols define how route tables are built, which metrics are used to
determine routes, and how routers communicate with each other. ❑ Distance vector routing protocols use hop count as their only metric and
trade their entire route table on a timed repeating basis to their directly connected neighbor. “Routing by rumor” makes for long convergence times. Examples include RIP, RIPv2, and IGRP. ❑ Link state routing protocols use a variety of metrics to compare routes and only
send LSAs when a network change occurs. Convergence is much faster with a link state protocol, and they are generally better choices for large networks. Examples include OSPF and IS-IS.
An Introduction to IP Addressing ❑ IPv4 addresses are displayed in dotted decimal notation, but are actually
made up of 32 bits. Each 8-bit section is referred to as an octet, and numbers can range from 0 to 255. IP addresses have two sides—the network portion and the host portion.
184
Chapter 6:
Routing Essentials and IP Addressing
❑ If all host bits are set to 0’s, the address is the network ID. If all host bits are
set to 1’s, the address is the broadcast address for the network. Any other combination of host bits creates a useable host address on the network. ❑ Class A addresses are identified in the first octet by numbers ranging from 1
to 126. Class A’s assign only the first octet, leaving the last three for host bits, and can support 16,777,214 hosts per network. The default subnet mask is 255.0.0.0. ❑ Class B addresses are identified in the first octet by numbers ranging from
128 to 191. Class B’s assign the first two octets, leaving the last two for host bits, and can support 65,534 hosts per network. The default subnet mask is 255.255.0.0. ❑ Class C addresses are identified in the first octet by numbers ranging from
192 to 223. Class C’s assign the first three octets, leaving the last octet for host bits, and can support 254 hosts per network. The default subnet mask is 255.255.255.0. ❑ Public addresses can be accessed from any system on the Internet. Private
addresses are used inside a network (intranet) and require NAT to access outside, public resources. The private address ranges are 10.0.0.0, 172.16-31.0.0, and 192.168.0-255.0. ❑ Network Address Translation (NAT) is a service that maps private IP ad-
dresses to public addresses and keeps track of sessions. NAT allows many private IP addresses to be hidden behind one or several public addresses. Port Address Translation (PAT) also keeps track of the port numbers in the session request. This allows multiple systems to use the same public IP address at the same time ❑ IPv6 is the next generation of IP addressing. IPv6 addresses are 128 bits long
with 16 octets, and are displayed as hex digits separated by colons.
Self Test
185
SELF TEST The following Self Test questions will help you measure your understanding of the material presented in this chapter. Read all the choices carefully since there may be more than one correct answer. Choose all the correct answers for each question.
Routing Fundamentals 1. Which of the following is/are true regarding router operation? A. Routers work at layer 3 only. B. Routers work at layers 1, 2, and 3 to accomplish their tasks. C. Routers only examine layer-3 addresses. D. Routers must examine the layer-2 address to accept the frame first, and then afterward will look at the layer-3 address. 2. True/False: The destination device is separated from the sending device by four routers. The largest PDU that makes it intact across all four routers is the original frame. A. True B. False 3. Which of the following is/are true regarding route tables? A. The next hop address is irrelevant to router operation. B. The next hop address is used to find an address for the new layer-2 frame header. C. The next hop address is used to accept routing updates only. D. If there is no entry for the packet’s destination network address, the packet will be forwarded out the closest matching interface. E. If there is no entry for the packet’s destination network address, the packet will be discarded. 4. A router receives a message addressed 172.16.15.75. The relevant route table entries are 172.16.0.0 /20 – Serial 0, 172.16.0.0 /23 – Ethernet 0, and 172.16.15.64 /26 – Ethernet 1. Which interface will the router forward the packet to? A. Serial 0. B. Serial 1. C. Ethernet 0. D. Ethernet 1. E. None of the above. The packet will be dropped.
186
Chapter 6:
Routing Essentials and IP Addressing
5. Which of the following is/are considered routed protocols? A. RIP B. IP C. OSPF D. DECnet E. IS-IS 6. Which of the following is NOT an advantage of static routing? A. Less overhead on router CPU B. Less bandwidth usage on the network C. More bandwidth usage on the network D. Greater security 7. Which of the following is/are considered to be a distance vector protocol? A. RIP B. RIPv2 C. IGRP D. EIGRP E. OSPF 8. Which of the following is/are considered to be a link state protocol? A. RIP B. RIPv2 C. IGRP D. EIGRP E. OSPF 9. Link state routing protocols have which of the following characteristics? A. They use hop count as a metric to determine routes. B. They use multiple metrics to determine routes. C. They exchange routing information only with their directly connected neighbor routers. D. They exchange routing information directly from other routers throughout the network.
Self Test
187
An Introduction to IP Addressing 10. PC1 has an IP address of 10.1.1.5, and PC2 has an IP address of 10.1.2.5. Which of the following statements is true regarding these two systems? A. If classful addressing is used, both PCs always belong to the same network ID. B. If classful addressing is used, both PCs do not belong to the same network ID. C. If classless addressing is allowed, both PCs may be on the same network ID. D. If classless addressing is allowed, both PCs are never on the same network ID. 11. You are examining a network ID of 172.16.1.0 /24. Which of the following is a useable host address on this network? A. 176.16.1.1 B. 172.16.1.254 C. 172.16.1.0 D. 172.16.1.255 12. What is the valid number range for the first octet of a Class B network? A. 0–126. B. 127–191 C. 128–191 D. 128–192 E. 192–223 13. PC1 has an IP address of 172.16.12.5. PC2 is on a separate network subnet. Assuming there is no subnetting (that is, only classful addressing is used), which of the following addresses could PC2 use? A. 172.16.250.5 B. 172.17.12.5 C. 172.16.0.1 D. 220.220.200.255 E. 8.255.255.0 14. How many hosts can be served on a Class B network? A. 16,777,214 B. 65,534 C. 32,766 D. 254
188
Chapter 6:
Routing Essentials and IP Addressing
15. You have enabled PAT on an exterior router, using a single public IP address: 220.220.220.5. Three requests come from internal clients headed to public Internet sites. The requests are listed here: PC1 – Source IP: 172.16.5.1, source port 10000, destination port 80 PC2 – Source IP: 172.16.5.2, source port 10001, destination port 80 PC3 – Source IP: 172.16.5.3, source port 8888, destination port 80 The first response to the router from the Internet contains the following information: Source/Destination IP: 88.55.6.3 / 220.220.220.5 Source / Destination Port: 80 / 10001 To which PC will PAT send the response? A. PC1. B. PC2. C. PC3. D. None. PAT will not relay responses back to the network.
Self Test Answers
189
SELF TEST ANSWERS Routing Fundamentals ✓ B and D. All devices must work at the Physical layer, and the router must also examine 1. ® the layer-2 address to determine if the frame is intended for it or not. After the frame’s physical address is verified, the router moves up to layer 3 and examines the IP address. ® ˚ A and C. When a device is said to work at a given layer, it means the device works at all layers up to that level. Routers work at layer 3; therefore, they perform functions at layers 1 through 3. ✓ B. Frame headers and trailers are removed and discarded at each router, then rebuilt for the 2. ® next link in the chain. ® ˚ A. The statement is false. ✓ B and D. When the router makes a decision as to which interface to send a message out, 3. ® it performs an ARP to determine the Physical layer address for the new frame. If there is no matching entry in the route table, packets are discarded. ® ˚ A, C, and E. Next hop addresses are used by routers to determine the address for the new frame and are not used solely for routing updates. Packets with no matching entry in the route table are discarded, not forwarded. ✓ D. If you translate 172.16.15.75 into binary, it matches 26 bits in the last route table entry, 4. ® as opposed to only 20 in the first two. ® ˚ A, B, C, and E. Since the address bits match more of the last route entry, it will be chosen over the first two. The packet will not be dropped because there is a route table entry for it. ✓ B and D. IP and DECnet are routed protocols since they both contain logical addresses in 5. ® their headers. ® ˚ A, C, and E. RIP, OSPF, and IS-IS are all routing protocols. ✓ C. Static routing does not use routing updates; therefore, there is less traffic on the network, 6. ® not more. ® ˚ A, B, and D. All of these choices are true regarding static routing. ✓ A, B, and C. RIP, RIPv2, and IGRP are all distance vector protocols. 7. ® ® ˚ D and E. EIGRP and OSPF are considered link state protocols. ✓ D and E. EIGRP and OSPF are considered link state protocols. 8. ® ® ˚ A, B, and C. RIP, RIPv2, and IGRP are all distance vector protocols. ✓ B and D. Link state protocols use multiple metrics in determining and ranking routes. 9. ® LSAs are sent directly to all routers within the network, not just to directly connected neighbor routers. ® ˚ A and C. These are untrue statements.
190
Chapter 6:
Routing Essentials and IP Addressing
An Introduction to IP Addressing ✓ A and C. Classful addressing means the addresses always stay within their class. Since both 10. ® addresses begin with 10, they are Class A addresses in the same network. If classless addressing is allowed, the class can be subnetted. If the 10.0.0.0 is properly subnetted, both devices could be on the same network ® ˚ B and D. These are untrue statements. Classful addressing places both devices on the same network (10.0.0.0), and subnetting could allow both to be on the same network. ✓ A and B. This network has only the last octet available for host bits. As long as they are 11. ® not all 1’s or all 0’s, the address is a valid host address. ® ˚ C and D. 172.16.1.0 has all host bits turned off (network ID), while 172.16.1.255 has all host bits turned on (broadcast address). ✓ C. The first octet of a Class B address falls in the 128–191 range. 12. ® ® ˚ A, B, D, and E. These are not valid ranges for Class B addresses. ✓ B and E. If the network bits are different, then the address is a valid choice. 13. ® ® ˚ A and C. Both of these addresses have the same network bits in common with PC1’s address, therefore they cannot be on a separate network. D. 200.220.200.255 is indeed on a separate network, but it is a broadcast address and cannot be assigned to PC2 (all host bits are turned on in the Class C address). ✓ B. Class B networks can host 65,534 addresses. 14. ® ® ˚ A. This is the number of addresses hosted by a Class A network. C. This choice does not match any IP address class. D. This is the number of addresses hosted by a Class C network. ✓ B. This request will go to PC2 since the destination port matches PC2’s original request. 15. ® ® ˚ A and C. The destination port does not match PC1’s, nor PC3’s, request. D. This is a false statement.
7 IP Address Subnetting
CERTIFICATION OBJECTIVES 7.01
Foundation Skills
✓
7.02
Subnet Essentials
Q&A
7.03
Subnet Masks
Copyright © 2008 by The McGraw-Hill Companies. Click here for terms of use.
Two-Minute Drill Self Test
192
Chapter 7:
IP Address Subnetting
F
undamental routing and IP address characteristics were introduced and discussed in Chapter 6; however, only a broad overview on the subject of subnetting was given. Considering subnetting is one of the most heavily tested areas of study for a CCENT candidate, this chapter is dedicated to subnet definitions and tasks. We’ll start with an overview of some basic foundational skills, followed by a brief definition of subnets and a discussion on why they are needed. Lastly, we’ll cover subnet creation, application, and tasks.
CERTIFICATION OBJECTIVE 7.01
Foundation Skills Before you delve into what subnet masks are and how they are used on a network, some basic skills must first be mastered. After all, you certainly wouldn’t ask someone to take apart a car engine without first teaching them how to use the tools needed to loosen or tighten its nuts and bolts. So in this section, we don’t spend a lot of time on subnets, per se, but rather on the nuts and bolts behind the subnet mask.
Binary Math Sometimes the word “foundational” (or “fundamental”) gets overused, and as a result simply doesn’t carry as much meaning. In this particular case, though, the word could not be more apropos. Binary math is an absolutely essential skill that you MUST learn—not only to pass the CCENT exam, but to succeed in a networking career of any kind. When you consider that networked computers communicate in binary, it becomes obvious why you need to be very skilled in this particular operation. You’ll need to know three major tasks in detail about binary math: converting binary to decimal, converting decimal to binary, and determining the number of combinations a specific number of binary digits provides. While binary math seems very confusing to some people, it’s actually very much like what you learned in grade school. Decimal numbering is unbelievably easy but, if you try real hard, you can make grade school numbering difficult, too. The trick is to see the mechanics behind both numbering systems, apply simple logic, and view them using common sense.
Foundation Skills
193
You probably now take for granted that a decimal number is simply a number: When you look at the number 255, for instance, you just know that it’s two hundred and fifty-five. In reality though, it is a value from a base 10 system. Decimal numbers are arranged in columns, and we learned in school that the numeric value in each column represents a 10x equivalent. For example, the number 255 actually means two hundreds (2 × 102) + five tens (5 × 101) + 5 ones (5 × 100): 200 + 50 + 5. In short, to compute a decimal number, you simply multiply whatever value appears in a position by 10 (the base) raised to the appropriate power, and then add them up at the end. Binary math works exactly the same way, except the base number is 2, not 10, and the position values can only be 1 (on) or 0 (off). Binary numbers are displayed in columns, just like decimal numbers—and, just like decimals, each position in a binary number has more “value” than those positions to the right. For instance, to continue the earlier decimal example, 50 is more valuable than five, because the “5” value in that position is raised by 101. In comparison, within the binary number 11, the “1” on the left holds more value because it is raised by 21. Binary place values are displayed in Table 7-1. To calculate the decimal equivalent of a binary number, you simply do the same thing you did in grade school, replacing the base value 10 with 2: 1. Multiply the value in the rightmost position by 1 (20). 2. Move one position to the left and multiply that value by 2 (21). 3. Move one position to the left and multiply that value by 4 (22). 4. Repeat for each position entry, incrementing the exponent by one each time and multiplying. 5. Add all the values together. The result will be the decimal equivalent. For example, let’s translate the binary number 11001101 to its decimal equivalent. As shown in Table 7-2, if you follow the preceding steps and place the values in their appropriate places, the answer is relatively easy.
TABLE 7-1
Binary Place Values
Base Position
27
26
25
24
23
22
21
20
Decimal Value
128
64
32
16
8
4
2
1
194
Chapter 7:
TABLE 7-2
A Binary Example
IP Address Subnetting
Base Position
27
26
25
24
23
22
21
20
Decimal Value
128
64
32
16
8
4
2
1
Binary Number
1
1
0
0
1
1
0
1
Decimal Equivalent
128 +
64 +
0+
0+
8+
4+
0+
1
= 205
The rightmost value was turned on, as were the third, fourth, seventh, and eighth positions. By adding the values in each of those positions, the decimal equivalent of 11001101 is 205. This same process works regardless of how many digits display in the binary stream. In other words, binary doesn’t display a number in 8-bit sectors only. Binary numbers can have as little as one digit, and up to an infinite number. For every position added to the left, simply double the value—the 9th place value would be 256, the 10th 512, the 11th 1024, and so on. For example, the decimal equivalent of the binary number 1100 is 12 (8 + 4 + 0 + 0), and the binary number 100000001 would be 257 (256 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1).
Review this section on binary math and practice, practice, practice. You simply cannot pass the CCENT exam without a solid understanding of binary numbering.
Before you know it, you will recognize binary numbering very quickly.The better you are with binary math and conversion, the better you will do on the test.
Going from binary to decimal is only one side of the equation—moving from decimal to binary is just as important a skill. However, moving from decimal to binary is also very simple. To convert a decimal to binary: 1. Determine the highest bit position that is equal to, or lower than, your target and turn it on. 2. Subtract the bit value from the original number and compare it to the next position to the right. 3. If the remainder is larger than the value in this position, turn the bit on and repeat step 2. If it is lower, turn the bit to 0 and move one position to the right. 4. Repeat this process until the remainder is 0. As soon as the remainder hits 0, turn all remaining bits off.
Foundation Skills
TABLE 7-3
Decimal to Binary—Step 1
195
29
28
27
26
25
24
23
22
21
20
512
256
128
64
32
16
8
4
2
1
1
To see this in action, let’s convert the decimal number 578 into binary. First, the highest bit value that is equal to, or lower than, 578 is the 10th position (29). Turning it on and drawing out the bits, we start with the numbers shown in Table 7-3. In step 2, we subtract 512 from 578, leaving a remainder of 66. Moving on to step 3, we compare 66 to the next value to the right: 256. Since 256 is larger than 66, we turn that position off, and move one position to the right. At this stage, we get that shown in Table 7-4. We repeat the process for each place value. Compare 66 to the position and if the position value is higher, turn it to zero and repeat. If it is lower, turn it to 1, subtract the value from 66 and repeat. Going through each remaining position, we find: ■ 128 is larger, so it is set to 0. ■ 64 is smaller, so set it to 1, subtract 64 from 66 (leaving a remainder of 2),
and move to the right. ■ 32, 16, 8, and 4 are all larger than 2, so set them to 0’s. ■ 2 is equal to 2, so set this position to 1 and subtract 2 from 2, leaving a
remainder of 0. Turning all the remaining bits off, we finally are left with our answer: The binary equivalent of decimal 578 equals 1001000010 (as shown in Table 7-5). The last pure binary math skill to learn is determining the number of combinations a specific number of binary digits provides. The easiest answer to this question is to provide the following, very basic, formula: the total number of combinations available is equal to 2n, where n is the number of bits given. For example, suppose you have only one bit. The total number of combinations is 2 (21): 0 or 1. Two bit positions provide four (22) different combinations: 00, 01, 10, and 11. TABLE 7-4
Decimal to Binary—Step 2
29
28
27
26
25
24
23
22
21
20
512
256
128
64
32
16
8
4
2
1
1
0
196
Chapter 7:
TABLE 7-5
Decimal to Binary—Final Step
IP Address Subnetting
29
28
27
26
25
24
23
22
21
20
512
256
128
64
32
16
8
4
2
1
1
0
0
1
0
0
0
0
1
0
Three positions provide eight (23) combinations: 000, 001, 010, 011, 100, 101, 110, and 111. This process moves on and on as the number of available bits increases, doubling with each additional bit. If you list the combinations in columnar format, as with Figure 7-1, the pattern becomes fairly clear. The available combinations per bits available, up to 12, are listed in Table 7-6. One confusing thing about binary—especially in regards to subnetting—is comparing the decimal value of each position with the actual number of combinations available. For example, the first bit position has a decimal value of 1, but has two combinations: 0 and 1.The second bit position has a decimal value of 2, but has four combinations: 00, 01, 10, and 11. Be sure you do not get the bit position value confused with the number of combinations it provides.
FIGURE 7-1
128 64 32 16 8 4 2 1 0
Bit patterns
1 0 0 0 1 1 0
When counting in binary, always start to the right and move to the left, alternating 0 and 1. You’ll quickly notice a pattern evolving in the bit columns.
1 1 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1
This column alternates 0 to 1 This column alternates 00 to 11 This column alternates 0000 to 1111
Foundation Skills
TABLE 7-6
Bit Combination Values
Number of Bits 1
2
3
4
5
6
7
8
9
10
Number of Combinations
4
8
16
32
64
128
256
512
1024 2048 4096
2
11
197
12
Boolean AND Operations Another binary skill is the recognition of Boolean operations in regards to IP addressing. Boolean operations are an integral part of computing at every level. In the world of binary math skills for IP subnetting, though, we’re most interested in the Boolean AND operation. Every Boolean operation has two inputs and one output. A Boolean AND takes two inputs, compares them, and comes out with an output like that in Table 7-7. Just as with binary numbering, if you try real hard, you can easily overcomplicate all Boolean operations, and the AND is no exception. However, keeping things simple works very well, and there is no reason to overcomplicate this operation. In short, a Boolean AND simply multiplies the values. Anything multiplied by zero is zero, and anything multiplied by one is itself. Whenever you perform a Boolean AND on any two binary inputs, simply multiply them. As you’ll see, this operation comes into play later when comparing a subnet mask to an IP address. To perform this operation, you simply place the IP address bits above the subnet bits and perform a Boolean AND on each pair. The result is the network ID. For example, an AND performed on the address 172.16.5.1 with a subnet mask of 255.255.255.0 is displayed in Figure 7-2.
INPUTS
TABLE 7-7
Boolean AND Operations
OUTPUT
0
0
0
0
1
0
1
0
0
1
1
1
198
Chapter 7:
IP Address Subnetting
172.16.5.19 : 10101100. 00010000. 00000101. 00010011 255.255.255.0 : 11111111. 11111111. 11111111. 00000000 Boolean AND result : 10101100. 00010000. 00000101. 00000000
FIGURE 7-2
A Boolean AND operation
This operation, 0 x 1, came out to 0
This operation, 1 x 1, came out to 1
EXERCISE 7-1 Binary Math Skills This exercise will help reinforce basic binary math and Boolean AND concepts. 1. Convert the IP address 172.16.99.15 to its binary equivalent. First, remembering that each number is a combination of eight bits, create four, eight-bit tables displaying the place values. Each table should look like this: 128
64
32
16
8
4
2
1
Next, place each table under its corresponding number, and convert the decimal to binary in each by following the steps from the text. For the first octet, 172, the highest bit position equal to or lower than 172 is 128, so we turn that bit on. Subtracting 128 from 172, we have a remainder of 44. The next bit position, 64, is larger than 44, so we turn it off. The table now looks like this: 128
64
1
0
32
16
8
4
2
1
The next bit position, 32, is less than 44, so we turn it on, subtract 32 from 44, and are left with a remainder of 12. Repeating the same process again, 16 is turned off (larger than 12) and 8 is turned on. Subtracting 8 from 12, we get a remainder of 4, which is equivalent to the next bit position. After subtracting, we have a remainder of 0, so all remaining bits are turned off. The table now looks like this: 128
64
32
16
8
4
2
1
1
0
1
0
1
1
0
0
Subnet Essentials
199
Repeat the same steps for each number, and the 32 bits of the IP address will show: 10101100.00010000.01100011.00001111. 2. A computer’s IP address and subnet mask are 132.25.43.16 and 255.255.240.0, respectively. Perform a Boolean AND between the two to determine which network ID the PC belongs to. Remember, Boolean ANDing is simply multiplication. First, convert both the IP address and subnet mask to binary, using the previous steps, then place the IP address immediately above the subnet mask, matching up the bits. It should look something like this: IP Address : 10000100. 00011001. 00101011. 00010000 Subnet Mask : 11111111. 11111111. 11110000. 00000000
Start at the leftmost bit and multiply the pair, carrying the value down. In this case, 1 × 1 = 1. Following this procedure for each bit pair, your result should look like this: IP Address : 10000100. 00011001. 00101011. 00010000 Subnet Mask : 11111111. 11111111. 11110000. 00000000 Network ID
: 10000100. 00011001. 00100000. 00000000
Convert the result, 10000100.00011001.00100000.00000000, to decimal, and the network ID to which the computer belongs will be 132.25.32.0.
CERTIFICATION OBJECTIVE 7.02
Subnet Essentials Mastering the basic math skills for subnetting is a good first step, but it’s also important to understand why subnetting is needed in the first place. Knowing why you do it makes learning the “how” easy. In this section, we’ll cover the various tasks you’ll be expected to perform while subnetting—both on the exam and in your day-to-day duties as a networker—starting with an explanation of why we need subnetting in the first place.
200
Chapter 7:
IP Address Subnetting
As an example, Figure 7-3 shows a simple network, connecting a small business to the Internet. Without subnetting, an administrator would need to purchase four separate public IP address ranges—and one of them would have to be a Class B (Network 1 needs 300 addresses, and a Class C can’t support that). Obviously, this would result in an incredible cost and an unbelievable amount of wasted space—especially when you consider one of those networks (Network 2) only needs two addresses! Subnetting lets us provide for our needs while conserving address space, reducing route advertisements, containing broadcast domain growth, and supplying low-level security.
Subnet Definition and Construction As covered earlier, an IP address is made up of two parts: the network portion and the host portion. What has not been covered in detail is what actually defines where the line is drawn between network and host bits. In other words, by itself an IP address only provides the address to one, and only one, system—it needs something else to define where the network bits end and where the host bits begin. The subnet mask, combined with an IP address, provides this information to routers and hosts. A subnet mask is made up of a consecutive series of 1’s from left to right. Considering network bits follow from left to right, this construction pattern makes perfect sense. When a router examines a subnet mask and an IP address, it stops counting bits as soon as it sees the first 0, and therefore knows when to stop paying FIGURE 7-3
300 Hosts
A network diagram 1 151 Hosts
3
50 Hosts
4
2
Subnet Essentials
201
attention to bits. Since subnet masks are always a series of 1’s from left to right, the decimals corresponding to the bit pattern are unique. The values in Table 7-8 are the only values that can possibly be displayed as part of a subnet mask.
Commit Table 7-8 to memory. Not only will you see questions on identifying useable subnet masks, but knowing the bit values in depth will allow
you to quickly apply and answer questions. Time is your biggest enemy on the exam, and memorizing these values gives you an advantage.
In classful addressing, it’s very easy to tell which bits are network and which ones are hosts, because each class has its own default subnet mask. The default subnet mask for Class A, B, and C networks is 255.0.0.0, 255.255.0.0, and 255.255.255.0, respectively. A quick check of Table 7-8 reveals 255 as the largest number you can create within an octet, by turning all the bits in the octet on (1). For example, a Class A default subnet mask of 255.0.0.0 actually reads 11111111.00000000.00000000.00000000. This, in effect, tells the router to pay attention to the first eight bits, and ignore the rest—they’re host bits. In short, default subnet masks always draw the line on octet boundaries.
TABLE 7-8
Subnet Mask Octet Values
Subnet Decimal Value
Bit Alignment
0
00000000
128
10000000
192
11000000
224
11100000
240
11110000
248
11111000
252
11111100
254
11111110
255
11111111
202
Chapter 7:
IP Address Subnetting
However, subnet masks are not restricted to the octet boundary. Take a look at Table 7-8 once again and you’ll notice the subnet values only fall on octet boundaries in two instances: 0 and 255. Every other subnet entry ends somewhere in the middle. This indicates a very important concept of subnetting: you can borrow as few or as many bits as necessary to satisfy any need. The steps for borrowing bits and creating subnet masks are covered in the next section.
Subnet Mask Creation Steps A subnet is nothing more than a smaller portion of a larger address space treated as its own separate network, and is created by borrowing bits originally assigned to the host portion of an address and reassigning them. Subnet masks are created, too, for the express purpose of reassigning these bits, and they can be created in all sorts of ways. Thankfully, the method discussed here contains steps that are simple and easy to follow. The five steps to create a subnet mask are: 1. Determine the network class. 2. Determine how many bits are needed to comply with the scenario (subnets versus hosts required). 3. Count off the bits and draw the line. 4. Turn the bits to the left of the line on (1’s). 5. Convert the binary number to decimal—the result is the subnet mask. The first step in our process is to determine the network class. Remembering what was already covered in Chapter 6 about IP address classes, we know each class has a predetermined default subnet mask, and that default mask tells us which bits we must work with. In other words, by determining the network class, we know which octets are already part of the network portion, as well as how many bits we have available to work with. Whatever the network class is, just remember that you can’t mess with those bits that are already assigned. Knowing this gives us a starting point—a line from which to move. While this method for creating subnet masks is simple, tried and true, and works for many students, it is not the only method. Every class and book on subnetting has a different take on it and every student learns it their own way. A good idea, both for this exam and for your day-to-day duties, is to use a subnet calculator to check your work, and to practice, practice, and practice some more!
Subnet Essentials
203
Two tasks are actually involved in step 2. First, determine whether the scenario calls for subnets or hosts, then determine how many bits are needed to answer the question. The reason you need to define whether you’re searching for subnets or hosts is that the formula for figuring out the number of bits you need differs for each. Remember, you’re borrowing (and leaving) bits from the host field to reassign to the network side. Therefore, the more bits you borrow, the more subnets you can create, but the number of hosts that can be supported on each subnet decreases! If the scenario calls for creating subnets, the formula is simple: 2n => the number you need, where n is the number of bits. If the scenario calls for supporting hosts, the formula used to determine the number of bits you need is 2n – 2 => the number you need, where n is the number of bits. For example, suppose you have a scenario that calls for creating 15 subnets. Plugging this into the formula, 2n => 15, we find you would need 4 bits. However, if the scenario called for creating subnets capable of supporting 15 hosts each, we would get a different answer. Plugging this into the formula, we have 2n – 2 => 15, and you would need to leave at least 5 bits in the host field. The numbers of bits required to comply with a subnetting scenario are listed in Table 7-9. At this point in every subnetting class, most students ask the same question: “Why subtract 2 from the number when the question asks for hosts?” The answer has to do with something we’ve already learned. Remember there were three arrangements of host bits discussed earlier: all 0’s, all 1’s, and any arrangement in between. If the host bits are all turned off (0’s), the address is the network ID; if they are all turned on (1’s), this is the broadcast address; and any combination in between is a viable address. The reason, then, that 2 is subtracted from the formula is quite evident:
TABLE 7-9
Number of Bits Required
With __ Bits
You Can Create __ Subnets
Or Support __ Hosts
1
2
0
2
4
2
3
8
6
4
16
14
5
32
30
6
64
62
7
128
126
8
256
254
204
Chapter 7:
IP Address Subnetting
you cannot assign the network ID nor the broadcast address to a host. No matter how many bits are left in the host field, those two combinations must be reserved.
Commit Tables 7-8 and 7-9 to memory and remember how to calculate the number of bits needed for both hosts and subnets. Keep in mind that if you have
more bits to work with, the numbers simply double (9 bits provides 512 subnets, or 510 hosts, and so on).
Lastly, there is one final note on step 2 that is very important. When calculating the number of bits needed to create subnets, sometimes the formula is not 2n, but the same as the formula for the hosts: 2n – 2 => the number you need. This is due to the concept of the zero subnet and the broadcast subnet. The zero subnet is the first open subnet, created with the first combination of bits available (all 0’s), while the broadcast subnet is the last subnet available, created by the final combination of bits (all 1’s). The problem with using either is best described with an example. Suppose you have a private network address of 192.168.1.0 and are tasked with subnetting it in half. To do so, you borrow one bit and create two subnets; one with the subnet bit set to 0, and the other set to 1. After applying the subnet mask, you find the first subnet ID has the same address structure as the original classful network ID: 192.168.1.00000000 before subnetting; and 192.168.1.0000000 after subnetting. The broadcast address of the second subnet presents the same problem: 192.168.1.11111111 before subnetting looks the same as the broadcast address 192.168.1.11111111 after subnetting. Not too long ago, these two subnets simply weren’t used, to avoid confusion. However, on most modern networks and routers, subnet zero and the broadcast address are useable. Unless otherwise indicated on the exam or by your network design, use 2n when calculating the number of bits required for subnets.
On the exam and on the job, use 2n when: using a classless routing protocol (RIPv2, OSPF, or EIGRP), the ip subnet zero is configured on the router(s), Variable Length Subnet
Masking (VLSM) is used, or unless otherwise indicated. Use 2n – 2 when: using a classful routing protocol (RIP or IGRP), or when no ip subnet-zero is configured on the router(s).
Subnet Essentials
205
After step 2, the rest of the creation process is a snap. In step 3, simply draw a line based on the number of bits determined in step 2. If you’re creating subnets, count from left to right. If creating hosts, then from right to left. For example’s sake, assume you needed to borrow three bits to create subnets with. Since network bits always run from left to right, count over three bits and draw the line, as shown here: xxx|xxxxx. If you need to leave three bits to support hosts with, count from right to left and draw the line: xxxxx|xxx. The last two steps are also straightforward. In step 4, turn all bits to the left of the line to 1’s (and all bits to the right of the line to 0’s), and then in step 5 you simply add them up. Continuing with the examples, if you borrowed three bits to create subnets, the octet would appear as 111|00000. The decimal equivalent (step 5) would then be 224. If you left three bits to support hosts, the octet would appear as 11111|000, with the decimal equivalent being 248. To further clarify the subnet mask creation steps, let’s consider an example. Suppose you are given the network ID 177.15.0.0 and are asked to generate a subnet mask creating at least 17 subnets. The steps to create this subnet mask are: 1. Determine the network class: 177.15.0.0 falls in the Class B range (128–191). The default subnet mask is 255.255.0.0, leaving the last two octets available. 2. Determine how many bits are needed to comply with the scenario: The scenario is asking to create subnets, so the formula used is 2n => 17. The number of bits needed is five, which will create up to 32 subnets. Four bits is too few, only creating up to 16 subnets. 3. Count off the bits and draw the line: Since we are creating subnets, count from the left (starting where the default subnet mask ends) and draw the line. The default subnet mask was 255.255.0.0, so our new line would be 11111111.11111111.xxxxx|xxx.xxxxxxxx (where the X’s represent the bits we have available to us). 4. Turn the bits to the left of the line on (1’s), and the result will be 11111111.11111111.11111|000.00000000. 5. Convert the binary to decimal: 255.255.248.0. The subnet mask of 255.255.248.0 for the Class B address 177.15.0.0 will create up to 32 subnets, complying with the scenario constraints. By using 5 of the available 16 bits to create subnets, we find 11 bits are left in the host field. So, how many hosts will each of these 32 subnets support? The answer can be found in the formula discussed earlier: (2n – 2). Plugging the 11 bits into the equation (211 – 2), we find each subnet can support up to 2046 hosts.
206
Chapter 7:
IP Address Subnetting
Practice, practice, practice creating subnet masks for any given scenario, changing out the network class, and the amount of subnets/hosts required. Many questions on the exam will ask you to identify the correct subnet mask for a given situation. Many others will try to
confuse you, providing an answer that states “None of the above” or “Cannot comply with the scenario.” Always check to verify that the subnets you create can support the number of hosts the scenario calls for. Use 2n – 2 for hosts, and 2n for subnets, when verifying your numbers.
CERTIFICATION OBJECTIVE 7.03
Subnet Masks Subnet masks provide a means to separate network bits from host bits in an IP address, and the steps for creating a subnet mask are relatively easy. The CCENT exam also covers many other tasks involving subnet masks. This section examines each task, providing the steps and tips necessary to be successful on the exam.
Decoding Subnet Information Both on the exam and on the job, one of the most important skills a new networking professional needs to master is decoding information from an IP address or network range and a subnet mask pair. The relevant subnet information includes the subnet ID, the broadcast address, and the useable host range, as shown in Table 7-10.
TABLE 7-10
Subnet Information
Bit Values Subnet ID First Useable Address Last Useable Address Broadcast Address
Decimal Value
Subnet Masks
207
For example, on the exam, several questions will provide an IP address and subnet mask and ask which addresses can be assigned to a system on the same subnetwork as the original system. Learning how to decode the relevant information is the focus of this section and involves four very simple steps: 1. Perform a Boolean AND between the address and subnet mask to determine the subnet ID the address belongs to. 2. Determine the broadcast address by turning all host bits to 1’s. 3. Determine the first useable address by using the first available combination of host bits (rightmost bit turned on, all other bits turned off). 4. Determine the last useable address by using the last available combination of host bits (rightmost bit turned off, all others turned on). As with the subnet mask creation steps, decoding subnet information is best described with a scenario. Suppose you are given the IP address 199.58.7.37 and a subnet mask of 255.255.255.240. In step 1, you simply perform a Boolean AND to determine the subnet ID the address is on. In this case, the answer is: 199.58.7.37 : 11000111. 00111010. 00000111. 0010 0101 255.255.255.240 : 11111111. 11111111. 11111111. 1111 0000 Boolean AND result : 11000111. 00111010. 00000111. 0010 0000 Network Bits
Host Bits
Notice there are four host bits left in the subnet. Manipulating these bits allows us to answer the remaining portions of the question: Subnet ID First useable address Last useable address Broadcast address
: : : :
11000111. 00111010. 00000111. 0010 11000111. 00111010. 00000111. 0010 11000111. 00111010. 00000111. 0010 11000111. 00111010. 00000111. 0010 Network Bits: Must remain the same for each entry
0000 0001 1110 1111
Host Bits: Change for each entry
208
Chapter 7:
IP Address Subnetting
Filling the information in, the chart looks like Table 7-11.
Ensure you are very familiar with decoding the subnet ID, broadcast address, and useable address
range. Practice filling in the table for various combinations of IP addresses and subnet masks.
Applying Subnet Masks Up to this point, each section has dealt with a single entity—either creating a single subnet mask to fit a given scenario, or decoding subnet information from an IP address and subnet mask pair. However, the entire point of creating a subnet mask is to divide the larger address space into smaller networks and to apply them within the design. This section deals with creating a subnet mask for a given situation, and then applying it to a network. Creating the subnet mask defines the bits available for subnets and hosts, and the arrangement of these subnet bits uniquely defines each subnet. So long as the bits to the left of the line match, all addresses belong to that subnet—change a single bit and you’ve moved to a new subnet. Additionally, the subnets created are referred to by their position in a range. The first subnet is created with the first combination of subnet bits (all 0’s). The second is created with the next combination available, and so on and so on all the way to the last (all 1’s). CCENT questions will sometimes not only ask you to decode subnet information for a subnet, but they’ll ask for the information from a specific subnet within a range. To calculate and apply a subnet mask to an enterprise network, first create the subnet mask, then manipulate the subnet bits one at a time. For each subnet created, fill in the information as shown in Table 7-11. Manipulating the subnet bits to create subnets works exactly like the manipulation of host bits to create unique
TABLE 7-11
Decoded Subnet Information
Bit Values
Decimal Value
11000111. 00111010. 00000111. 0010 0000
199.58.7.32
First Useable Address 11000111. 00111010. 00000111. 0010 0001
199.58.7.33
Last Useable Address 11000111. 00111010. 00000111. 0010 1110
199.58.7.46
Broadcast Address
199.58.7.47
Subnet ID
11000111. 00111010. 00000111. 0010 1111
Subnet Masks
209
addresses for systems—turn on the rightmost bit first, then alternate to the left, filling in the combinations as you go. For clarification, let’s consider an example (see Figure 7-4). You are provided with an IP network address of 199.100.100.0 and are asked to subnet the address range accordingly. First, follow the steps to create the subnet mask: 1. Determine the network class: 199.100.100.0 falls in the Class C range. The default subnet mask is 255.255.255.0, leaving the last octet available. 2. Determine how many bits are needed to comply with the scenario. Examining the diagram, the scenario calls for at least three subnets. Using 2n, we need at least two bits to create subnets with. This leaves six bits for the host field, which should be enough for the scenario—the largest network calls for 50 hosts, and six bits will support 62 hosts (26 – 2 = 62) 3. Count off the bits and draw the line. Since we are creating subnets, count from the left (starting where the default subnet mask ends) and draw the line. The default subnet mask was 255.255.255.0, so our new line would be 11111111.11111111.11111111. xx | xxxxxx. 4. Turn the bits to the left of the line on (1’s). The result will be 11111111.11111111.11111111.11 | 000000. 5. Convert the binary to decimal: 255.255.255.192.
FIGURE 7-4 37 Hosts
A subnet mask application network
15 Hosts
50 Hosts
210
Chapter 7:
IP Address Subnetting
Next, examine the available subnet bits. You cannot touch any of the first three octets, and have only the remaining two borrowed subnet bits to manipulate. The four combinations of these bits are 00, 01, 10, and 11. Applying these combinations to the subnet bits and leaving all host bits set to 0’s, we arrive at the four subnets we can create, shown in Figure 7-5. All that’s left is to apply the steps to decode relevant information for each subnet. The bit values and decimal equivalents are shown in Table 7-12. To see the subnets in action, refer to Figure 7-6.
Make sure you can identify information relative to each individual subnet. For example, you may be asked to
identify the useable address range of the third subnet, or the broadcast address for the zero subnet.
Subnetting Tips Lastly in this chapter, while subnet tasks are relatively easy once the mechanics are understood, they are time-consuming, and the CCENT exam simply doesn’t provide a lot of time for experimentation and math. The purpose of this section is to provide a few tips to help speed things up. As mentioned before, time is the biggest enemy on the exam, and anything you can use to speed up your efforts is welcome. Briefly covered earlier, CIDR introduced the concept of prefix use instead of subnet masks. A prefix is a forward slash, followed by the number of bits that belong to the network portion, and understanding their relationship to subnet masks is vital.
FIGURE 7-5
Subnets
First Subnet Second Subnet Third Subnet Fourth Subnet
: : : :
11000111. 01100100. 01100100. 00 11000111. 00111010. 00000111. 01 11000111. 00111010. 00000111. 10 11000111. 00111010. 00000111. 11 Original Network Bits: Must remain the same for each entry
000000 000000 000000 000000
Host Bits: Set to 0’s
Subnet Bits: Each change is a new network
Subnet Masks
Bit Values
Decimal Value
First Subnet ID
11000111. 01100100. 01100100. 00 000000
199.100.100.0
First Address
11000111. 01100100. 01100100. 00 000001
199.100.100.1
Last Address
11000111. 01100100. 01100100. 00 111110
199.100.100.62
Broadcast Address Second Subnet ID
11000111. 01100100. 01100100. 00 111111
199.100.100.63
11000111. 01100100. 01100100. 01 000000
199.100.100.64
First Address
11000111. 01100100. 01100100. 01 000001
199.100.100.65
Last Address
11000111. 01100100. 01100100. 01 111110
199.100.100.126
Broadcast Address Third Subnet ID
11000111. 01100100. 01100100. 01 111111
199.100.100.127
11000111. 01100100. 01100100. 10 000000
199.100.100.128
First Address
11000111. 01100100. 01100100. 10 000001
199.100.100.129
Last Address
11000111. 01100100. 01100100. 10 111110
199.100.100.190
Broadcast Address Fourth Subnet ID
11000111. 01100100. 01100100. 10 111111
199.100.100.191
11000111. 01100100. 01100100. 11 000000
199.100.100.192
First Address
11000111. 01100100. 01100100. 11 000001
199.100.100.193
Last Address
11000111. 01100100. 01100100. 11 111110
199.100.100.254
Broadcast Address
11000111. 01100100. 01100100. 11 111111
199.100.100.255
TABLE 7-12
Applying Subnet Masks
FIGURE 7-6
Subnets in action
211
37 Hosts Possible Addresses: 199.100.100.1 – 199.100.100.62 Broadcast Address: 199.100.100.63 199.100.100.0
15 Hosts Possible Addresses: 199.100.100.65 – 199.100.100.126 Broadcast Address: 199.100.100.127 199.100.100.64
50 Hosts Possible Addresses: 199.100.100.129 – 199.100.100.190 Broadcast Address: 199.100.100.191 199.100.100.128
212
Chapter 7:
IP Address Subnetting
A subnet mask of 255.192.0.0, for instance, would have a prefix listing of /10: the eight bits in the first octet, combined with the two bits (128 and 64) from the second octet. The reverse should be just as readily apparent. A prefix of /26 is equivalent to 255.255.255.192: the first three octets combined with the first two of the fourth translate to the subnet mask listed. Whether listed as a subnet mask or as a prefix, both indicate the same thing: the number of bits belonging to the network portion of the address. Examples of prefix listings and subnet mask comparisons are shown in Table 7-13.
Memorizing prefix matches to subnet masks is a very good idea and can help out quite a bit, especially on
scenario-type questions. So, be sure to understand how prefixes and subnet masks match up.
Another tip, in order to conserve what time you have on the exam, is to take advantage of the “easy” sections of the subnet mask and concentrate your efforts on the portion of the IP address and subnet mask that is more difficult. Suppose you have an IP address of 188.58.67.12 with a subnet mask of 255.255.240.0. To find the network ID, a Boolean AND is performed between the two, with the resulting bits providing the answer. However, the subnet mask numbers of 255 and 0 are easy—a 255 means all the bits in the octet above are part of the network ID, while a 0 means all the bits in the octet above can be ignored.
TABLE 7-13
Subnet Mask and Prefix Comparison
Subnet Mask
Prefix
255.0.0.0
/8
255.128.0.0
/9
255.255.0.0
/16
255.255.192.0
/18
255.255.240.0
/20
255.255.255.0
/24
255.255.255.192
/26
255.255.255.252
/30
Subnet Masks
213
How does this help on the exam? Instead of wasting time with the “easy octets,” you only need to concentrate on the odd octet—in this case, the 240 octet. In the preceding example, you don’t need to waste time doing a Boolean AND on the first, second, or fourth octets since the 255 and the 0 tell you their status already—188 and 58 are in the network portion, 12 is not. This leaves only the third octet requiring math operations—67 in the IP address and 240 in the subnet mask. A final tip on applying subnet masks and speeding up your efforts has to do with something called the magic number. The magic number refers to the place value on the octet where the subnet mask line is drawn. Each subnet created will be a multiple of that number, greatly simplifying the time needed to decode information. For instance, in the preceding example, the subnet line was drawn after the 26th bit, providing two bits with which to create subnets. Looking at the place values, the line is drawn on the bit position equating to 64: 128 64 | 32 16 8 4 2 1. Therefore, all subnets will be a multiple of 64: 0, 64, 128, 192. This shortcut works no matter where the line is drawn. Suppose, for instance, your subnet mask number was 252. Extrapolating the number across an octet, we find the line is drawn on the sixth bit, valued at 4: 128 64 32 16 8 4 | 2 1. All subnets created using this mask will be multiples of 4: 0, 4, 8, 12, 16, and so on. Using the magic number can also help find the broadcast address and useable address ranges very quickly. The broadcast address for any subnet is the last combination of host bits available before moving to a new subnet. Meaning, of course, it is the decimal number immediately preceding the next subnet ID. Consider, for example, the Class C address 192.168.1.0 subnetted with a mask of 255.255.255.252. After applying the steps already covered, the magic number is determined to be 4, as shown in Figure 7-7. The subnets that can be created are multiples of 4, and the first four are listed here: 192.168.1.0, 192.168.1.4, 192.168.1.8, and 192.168.1.12. To find the broadcast address of the third octet, just remember that it is the last address in this subnet— one before the next subnet ID: 192.168.1.11. After filling in the information in Table 7-14, the principle becomes readily apparent. Subnet Mask 252 draws the line here
FIGURE 7-7
The magic number
192.168.1. 255.255.255.
128 X 1
64 X 1
32 X 1
16 X 1
8 X 1
4 X 1
2 X 0
Magic Number
1 X 0
214
Chapter 7:
TABLE 7-14
A Magic Number Sample
IP Address Subnetting
Subnet ID
First Address
Last Address
Broadcast Address
192.168.1.0
192.168.1.1
192.168.1.2
192.168.1.3
192.168.1.4
192.168.1.5
192.168.1.6
192.168.1.7
192.168.1.8
192.168.1.9
192.168.1.10
192.168.1.11
192.168.1.12
192.168.1.13
192.168.1.14
192.168.1.15
...
...
...
...
192.168.1.252
192.168.1.253
192.168.1.254
192.168.1.255
The magic number is only a tip if it helps you on the exam. If this, or any other tip, doesn’t help, then stick with the bits—they never lie. Remember, all subnets created will be a multiple of the
magic number. Be familiar with Tables 7-13 and 7-14, and be prepared to see several questions on the exam regarding this section.
EXERCISE 7-2 Decoding and Applying Subnet Information These last exercises show how to decode what type of address is displayed, as well as how to apply subnetting to a scenario. 1. You are given the following address: 199.162.13.63 /29. Which type of address is this? What is the network ID, broadcast address, and useable host address range for this subnet? First, examine the prefix and note where the network bits end. Five bits have been borrowed from the fourth octet to create subnets with (the equivalent subnet mask would be 255.255.255.248). Since the first three octets are already part of the network ID (making use of the tip on “easy” subnet numbers, we know all octets with a 255 use all their bits in the network field), we can concentrate on the last octet.
Subnet Masks
215
By performing a Boolean AND, described in an earlier exercise, we find the subnet this particular address is on to be 199.162.13.56: Subnet Boundary Classful Boundary IP Address : 11000111. 10100010. 00001101. 00111 111 Subnet Mask : 11111111. 11111111. 11111111. 11111 000 Network ID
: 11000111. 10100010. 00001101. 00111 000 Subnet Bits Magic Number
Additionally, we see the magic number is 8, and only three bits are left in the host field. Since all host bits are set to 1’s in the original address, this must be the broadcast address for the “56” subnet. Another quick way to tell would be to use the magic number to see all subnets and derive the information from there. Since the magic number is 8, all subnets will be a multiple of 8: 199.162.13.0, 199.162.13.8, 199.162.13.16, …199.162.13.56, 199.162.13.64, and so on. Since the next subnet after 56 is 64, the decimal number immediately before that—63—would be the broadcast address for the 56 network. 2. You are provided a Class A address of 17.0.0.0. Your new network will have 87 subnets, and each subnet must be capable of supporting at least 2000 hosts each. Can the address space be subnetted to adequately fulfill the requirement? Which subnet mask will you use? What is the relevant information for the fifth subnet? First, we need to answer whether the address space will support the requirement. A Class A has the first octet set, providing the last three (24 bits) for hosts. Needing 87 subnets and no mention of restrictions on subnet zero, we can use 2n => 87 to determine the number of subnet bits we need to borrow from these bits. Working the formula, we find seven bits (27 = 128) will work, leaving 17 bits for hosts on each subnet. Since 217 is a much larger number than 2000 (the number of hosts each subnet is required to support), the address space will suffice. Next, to determine the subnet mask, go through the five steps discussed earlier. We’ve already determined the network class and found how many bits we need to borrow (steps 1 and 2). In step 3, we count off the bits. Since we are creating subnets, we count from the left, starting immediately after the first subnet and draw
216
Chapter 7:
IP Address Subnetting
the line seven bits over. Following steps 4 and 5, we turn on the bits to the left and add everything up. Our subnet mask will be 255.254.0.0: Step 3: Seven bits from this line in this direction XXXXXXXX. XXXXXXX X.XXXXXXXX. XXXXXXXX Classful Bits Subnet Bits
Host Bits
Step 4: 11111111. 1111111 0.00000000. 00000000 255 . 254 . 0 . 0 Subnet Mask Line
Finally, to answer the last portion of the question, we’ll make use of the magic number. Looking at where the subnet line is drawn, we find the magic number is 2. Since all subnets will be multiples of two, we simply go to the fifth subnet: 17.0.0.0, 17.2.0.0, 17.4.0.0, 17.6.0.0, and the fifth subnet, 17.8.0.0. Filling in the table from our previous example, we find the relevant information displayed for the fifth subnet (see Table 7-15). 3. You are provided with a Class C address of 199.54.12.0. Your new network will have 17 subnets, and each subnet must be capable of supporting at least 20 hosts each. Can the address space be subnetted to adequately fulfill the requirement? Which subnet mask will you use? What is the relevant information for the fifth subnet? First, we need to determine whether the address space will support the requirement. A Class C has the first three octets set, providing only the last—eight bits—for hosts. Needing 17 subnets and no mention of restrictions on subnet zero, we can use 2n => 17 to determine the number of subnet bits we need to borrow from these bits. Working the formula, we find we need to borrow five bits (25 = 32), leaving three bits for hosts on each subnet. Since 23 (8) is a smaller number than 20 (the number of hosts each subnet is required to support), the address space will not suffice. TABLE 7-15
The Subnet Exercise Answer
Subnet ID
First Host Address
Broadcast Last Host Address Address
17.8.0.0
17.8.0.1
17.8.255.254
17.8.255.255
Subnet Masks
217
INSIDE THE EXAM Foundation Skills The biggest challenge with binary math questions, and scenarios requiring binary skills, is not the math itself but the time allotted. Binary math is fairly easy, but it can take a lot of time. The best way to prepare for the exam is to practice binary conversion as much as possible, and simply memorize common combinations and tips. Be sure you know the place values for each position in an octet, remembering that every bit added doubles the total amount of combinations (for example, adding a ninth bit moves the combinations from 256 to a total of 512). Practice manipulating bits up to an octet range. If you convert decimal 1 through 7 to “see” the bits, the pattern will become evident; with 1’s moving from right to left in a repeating pattern.
Subnet Essentials Remember what a subnet mask is designed to do: define the network portion of an IP address through the Boolean AND process. The series of 1’s from left to right can only create a specific range of numbers: 0, 128, 192, 224, 240, 248, 252, 254, or 255. Also, remember the default subnet masks for Class A, B, and C are 255.0.0.0, 255.255.0.0, and 255.255.255.0, respectively. The default masks provide a starting point for subnetting by determining which octets are already parts of the network portion, as well as how many bits are left to work with.
Practice creating and applying subnet masks, as well as decoding relevant information from an IP address and subnet pair. This cannot be stressed enough: if you are not very comfortable with subnetting, you simply will not pass the exam. Review this section and practice as much as possible for the exam. You cannot practice enough on this topic. Remember, if the scenario calls for creating subnets, the formula is simple: 2n => the number you need, where n is the number of bits. If the scenario calls for supporting hosts, the formula used to determine the number of bits you need is 2n – 2 => the number you need, where n is the number of bits. Review and commit to memory Tables 7-1, 7-8, and 7-9, and practice subnetting often before challenging the exam. Lastly in this section, keep in mind that all subnets are numbered in order of their appearance in the bit order. The zero subnet (all subnet bits set to 0) is first, followed by the second subnet (all 0’s with the rightmost subnet bit turned on), and so on. The process ends with the broadcast subnet as the last subnet, created by the final combination of bits (all 1’s). If you are using a classful routing protocol, or the no ip subnet zero command is configured, you cannot use either of these subnets (hence, the 2n – 2). (Continued)
218
Chapter 7:
IP Address Subnetting
INSIDE THE EXAM Subnet Tasks The exam will have several questions that require applying a subnet mask to a scenario. Practice decoding relevant information— subnet ID, the broadcast address, and the useable host range—from IP address range and subnet mask pairs. The four steps for doing so are simple: perform a Boolean AND between the address and subnet mask to determine the subnet ID the address belongs to; determine the broadcast address by turning all host bits to 1’s; determine the first useable address by using the first available combination of host
bits (rightmost bit turned on; all other bits turned off); determine the last useable address by using the last available combination of host bits (rightmost bit turned off; all others turned on). Finally, try to use the subnetting tips available. Memorize and practice prefix to subnet mask comparison. Remember when subnetting that you only need to Boolean AND the subnet octets that are NOT 0 or 255, and also that the magic number can make long scenario questions easier to deal with.
CERTIFICATION SUMMARY Basic binary math skills are essential to your success. Make sure you have plenty of practice converting from binary to decimal and from decimal to binary—especially within an octet (eight-bit) range. Additionally, be sure you understand the number of combinations you can achieve given a specific number of bits (2n) as well as how bits are manipulated to achieve these combinations: Start with the rightmost bit turned off, then on for the first two combinations (0 and 1), and repeat with each position to the left (00, 01, 10, 11, for example). Boolean AND operations use two inputs and only provide a 1 when both inputs are also 1. In short, the answer equates to basic multiplication—anything multiplied by 0 is a 0. Boolean ANDing is used by routers and hosts to determine the network portion of an IP address. If any of the bits in the network portion don’t match, the address is for a different subnet. The subnet mask is a 32-bit binary number, made up of a series of 1’s from left to right. It is used to determine which portion of an IP address belongs to the network. The only numbers that can possibly be part of a subnet mask are 0, 128, 192, 224, 240, 248, 252, 254, and 255. The default subnet masks for Class A, B, and C are
Certification Summary
219
255.0.0.0, 255.255.0.0, and 255.255.255.0, respectively. By determining the network class, we know which octets are already part of the network portion, as well as how many bits we have available to work with. The five steps to create a subnet mask are: 1) determine the network class; 2) determine how many bits are needed to comply with the scenario (subnets versus hosts required); 3) count off the bits and draw the line; 4) turn the bits to the left of the line on (1’s); and 5) convert the binary number to decimal—the result will be the subnet mask. In step 2, if the scenario calls for creating subnets, the formula is simple: 2n => the number you need, where n is the number of bits. If the scenario calls for supporting hosts, the formula used to determine the number of bits you need is 2n – 2 => the number you need, where n is the number of bits. Review and commit to memory Tables 7-1, 7-8, and 7-9, and practice subnetting often before taking the exam. Remember, the zero subnet is the first open subnet, created with the first combination of bits available (all 0’s), while the broadcast subnet is the last subnet available, created by the final combination of bits (all 1’s). If you are using a classful routing protocol, or the no ip subnet zero command is configured, you cannot use either of these subnets (hence, the 2n – 2). Many CCENT questions and scenarios will be based on decoding information from an IP address or network range and a subnet mask pair. The relevant subnet information includes the subnet ID, the broadcast address, and the useable host range. Be prepared to decode information to compare to alternatives—for example, to determine whether a given IP address belongs to the same subnet as another host. The four steps to decode the relevant information are: 1) perform a Boolean AND between the address and subnet mask to determine the subnet ID the address belongs to; 2) determine the broadcast address by turning all host bits to 1’s; 3) determine the first useable address by using the first available combination of host bits (rightmost bit turned on; all other bits turned off); and 4) determine the last useable address by using the last available combination of host bits (rightmost bit turned off; all others turned on). To calculate and apply a subnet mask to an enterprise network, first create the subnet mask, then manipulate the subnet bits one at a time (all the host bits will always be zeroes when determining a subnet ID). Manipulating the subnet bits to create subnets works exactly like the manipulation of host bits to create unique addresses for systems—turn on the rightmost bit first, and then alternate to the left, filling in the combinations as you go. A prefix is a forward slash, followed by the number of bits that belong to the network portion, and understanding their relationship to subnet masks is vital. Be sure you can easily match a prefix to a matching subnet mask. Lastly, don’t forget to take advantage of the easy subnet numbers (0 and 255) and the magic number when subnetting.
220
Chapter 7:
✓
IP Address Subnetting
TWO-MINUTE DRILL Foundation Skills ❑ Binary numbering works exactly like decimal numbering, except the base
is 2 (not 10) and digits can only be on (1) or off (0). Place value doubles as each position is moved from right to left. Within an eight-bit octet, the place values are 128, 64, 32, 16, 8, 4, 2, and 1. ❑ To calculate the decimal equivalent of a binary number, follow these simple
steps: 1) Multiply the value in the rightmost position by 1 (20). 2) Move one position to the left and multiply that value by 2 (21). 3) Move one position to the left and multiply that value by 4 (22). 4) Repeat for each position entry, incrementing the exponent by one each time and multiplying. 5) Add all the values together. The result will be the decimal equivalent. ❑ Binary numbers can have as little as one digit, up to an infinite number. For
every position added to the left, simply double the value—the ninth place value would be 256, the tenth 512, the eleventh 1024, and so on. ❑ To convert a decimal to binary, follow these simple steps: 1) Determine the
highest bit position that is equal to, or lower than, your target and then turn it on. 2) Subtract the bit value from the original number and compare it to the next position to the right. 3) If the remainder is larger than the value in this position, turn the bit on and repeat step 2. If it is lower, turn the bit to 0 and move one position to the right. 4) Repeat this process until the remainder is 0. As soon as the remainder hits 0, turn all remaining bits off. ❑ The total number of combinations available for a given number of binary
digits is equal to 2n, where n is the number of bits given. ❑ A Boolean AND takes two inputs, compares them, and comes out with an
output based on the comparison: if the two inputs are both 1’s, the output is a 1, but if either (or both) is a 0, then the output is a zero. Boolean AND is used to match a subnet mask to an IP address—the output is the network ID.
Subnet Essentials ❑ A subnet mask is made up of a consecutive series of 1’s from left to right and is
used to define where the network bits end and where the host bits begin within an IP address. When a router examines a subnet mask and an IP address, it stops counting bits as soon as it sees the first 0.
Two-Minute Drill
221
❑ The only decimal values allowed within a subnet mask are 0, 128, 192, 224,
240, 248, 252, 254, and 255. ❑ The default subnet mask for Class A, B, and C networks is 255.0.0.0,
255.255.0.0, and 255.255.255.0, respectively. In classful addressing, the line is always drawn on octet boundaries; however, subnet masks are not restricted to the octet boundary: you can borrow as few or as many bits as you need to satisfy any need. ❑ The five steps to create a subnet mask are the following. 1) Determine the
network class. 2) Determine how many bits are needed to comply with the scenario (subnets versus hosts required). 3) Count off the bits and draw the line. 4) Turn the bits to the left of the line on (1’s). 5) Convert the binary number to decimal. The result will be the subnet mask. (Always check to verify that the subnets you create can support the number of hosts the scenario calls for.) ❑ If the scenario calls for creating subnets, the formula is simple: 2n => the
number you need, where n is the number of bits. If the scenario calls for supporting hosts, the formula used to determine the number of bits you need is 2n – 2 => the number you need, where n is the number of bits. ❑ Due to the concept of the zero subnet and the broadcast subnet, sometimes
the formula is not 2n, but the same as the formula for hosts: 2n – 2 => the number you need. The zero subnet is the first open subnet, created with the first combination of bits available (all 0’s), while the broadcast subnet is the last subnet available, created by the final combination of bits (all 1’s). ❑ On the exam and on the job, use 2n when: using a classless routing protocol
(RIPv2, OSPF, or EIGRP); the ip subnet zero is configured on the router(s); Variable Length Subnet Masking (VLSM) is used; or unless otherwise indicated. Use 2n – 2 when using a classful routing protocol (RIP or IGRP), or when no ip subnet zero is configured on the router(s).
Subnet Masks ❑ The relevant subnet information that can be decoded from an IP address
range and a subnet mask includes the subnet ID, the broadcast address, and the useable host range. ❑ To decode the relevant information involves the following steps. 1) Perform a
Boolean AND between the address and subnet mask to determine the subnet
222
Chapter 7:
IP Address Subnetting
ID the address belongs to. 2) Determine the broadcast address by turning all host bits to 1’s. 3) Determine the first useable address by using the first available combination of host bits (rightmost bit turned on; all other bits turned off). 4) Determine the last useable address by using the last available combination of host bits (rightmost bit turned off; all others turned on). ❑ Subnets created are referred to by their position in a range. The first subnet is
created with the first combination of subnet bits (all 0’s). The second is created with the next combination available, and so on and so on all the way to the last (all 1’s). To calculate and apply a subnet mask to an enterprise network, first create the subnet mask, then manipulate the subnet bits one at a time. ❑ A prefix is a forward slash, followed by the number of bits that belong to the
network portion, and understanding their relationship to subnet masks is vital. ❑ To conserve time, take advantage of the “easy” sections of the subnet mask
and concentrate your efforts on the portion of the IP address and subnet mask that is more difficult. The subnet mask numbers of 255 and 0 are easy—a 255 means all the bits in the octet above are part of the network ID, while a 0 means all the bits in the octet above can be ignored. ❑ The magic number refers to the place value on the octet where the subnet
mask line is drawn. Each subnet created will be a multiple of that number, greatly simplifying the time needed to decode information. Using the magic number can also help find the broadcast address and useable address ranges very quickly. The broadcast address for any subnet is the last combination of host bits available before moving to a new subnet.
Self Test
223
SELF TEST The following Self Test questions will help you measure your understanding of the material presented in this chapter. Read all the choices carefully since there may be more than one correct answer. Choose all the correct answers for each question.
Foundation Skills 1. What is the binary equivalent of the decimal number 235? A. 11011011 B. 10101011 C. 11101010 D. 11101011 2. How many binary digits are needed to create 1024 combinations? A. 8 B. 9 C. 10 D. 11 3. What is the binary equivalent for the decimal number 122? A. 01111010 B. 01111011 C. 10111010 D. 10111011 4. What is the decimal equivalent for the binary number 10011011? A. 153 B. 155 C. 183 D. 185 5. What is the decimal equivalent for the binary octets 01101111.11100011.11110000.11111110? A. 112.227.240.254 B. 111.226.240.254 C. 111.227.242.254 D. 111.227.240.254
224
Chapter 7:
IP Address Subnetting
6. When performing a Boolean AND between the octets 10010111 and 11111000, what is the outcome? A. 00000111 B. 11111000 C. 10011000 D. 10010000
Subnet Essentials 7. Which of the following are valid subnet masks for a Class B address space? A. 255.254.0.0 B. 255.255.0.0 C. 255.255.245.0 D. 255.255.254.0 E. 255.255.192.224 8. Your network design calls for 17 subnets supporting at least 35 hosts each. Your company provides the 135.72.0.0 address space. Which subnet mask would you create to satisfy the requirement? A. 255.255.252.0 B. 255.255.254.0 C. 255.255.248.0 D. 255.255.240.0 9. A customer asks you to create a subnet mask for their network, making sure address space is conserved as much as possible. Each subnet must support at least 12 hosts, and the address space given is 199.16.7.0. Which of the following answers best fits the customer’s needs? A. 255.255.255.248, creating 14 subnets and providing 14 hosts per subnet B. 255.255.255.240, creating 14 subnets and providing 14 hosts per subnet C. 255.255.255.240, creating 16 subnets and providing 14 hosts per subnet D. 255.255.255.224, creating eight subnets and providing 30 hosts per subnet 10. You are subnetting the Class B address space 187.77.0.0 on a RIPv1 network. You need to create at least 16 subnets. Which subnet mask best complies with the scenario needs? A. 255.255.224.0 B. 255.255.240.0 C. 255.255.248.0 D. 255.255.252.0
Self Test
225
11. Using a Class C address space of 199.88.77.0, you are asked to create a subnet mask for the new network design. Each subnet must be capable of supporting at least 20 hosts. Which subnet mask best complies with the request, and how many subnets can be created? A. 255.255.255.192, creating four subnets B. 255.255.255.224, creating eight subnets C. 255.255.255.240, creating 16 subnets D. 255.255.255.248, creating 32 subnets
Subnet Masks 12. You have subnetted a Class B address space of 137.99.0.0 using a subnet mask of 255.255.252.0. What is the broadcast address of the third subnet in your design? A. 137.99.12.255 B. 137.99.15.255 C. 137.99.8.255 D. 137.99.11.255 13. You have subnetted a Class A address space of 17.0.0.0 using a subnet mask of 255.248.0.0. Which of the following addresses are useable host addresses for the second subnet? A. 17.0.8.255 B. 17.0.14.255 C. 17.0.11.255 D. 17.0.15.255 E. 17.0.19.255 14. You have subnetted a Class C address space of 220.55.66.0 using a subnet mask of 255.255.255.192. What is the useable address range for the first subnet? A. 220.55.66.0 through 220.55.66.63 B. 220.55.66.0 through 220.55.66.62 C. 220.55.66.1 through 220.55.66.63 D. 220.55.66.1 through 220.55.66.62 15. A host on a subnet has an IP address of 125.35.88.7 and a subnet mask of 255.255.240.0. What is the broadcast address for the subnet the host belongs to? A. 125.35.88.255 B. 125.35.94.255 C. 125.35.95.255 D. 125.35.255.255
226
Chapter 7:
IP Address Subnetting
SELF TEST ANSWERS Foundation Skills ✓ D. 11101011 is the correct answer. Following the steps at the beginning of the chapter, the bit 1. ® positions turned on would be 128+64+32+0+8+0+2+1. ® ˚ A. 11011011 is equivalent to 219. B. 10101011 equates to 171. C. 11101010 equates to 234. ✓ C. Ten binary digits provide 1024 combinations (210 = 1024). 2. ® ® ˚ A. Eight binary digits provide 256 combinations (28 = 256). B. Nine binary digits provide 512 combinations (29 = 512). D. Eleven binary digits provide 2048 combinations (211 = 2048). ✓ A. 01111010 equates to 122: 0 + 64 + 32 + 16 + 8 + 0 + 2 + 0 = 122. 3. ® ® ˚ B, C, and D. These answers do not match the decimal number 122. ✓ B. 10011011 equates to 155: 128 + 0 + 0 + 16 + 8 + 0 + 2 + 1 = 155. 4. ® ® ˚ A, C, and D. The binary equivalent of each of these answers does not match the decimal number 155. ✓ D. 01101111.11100011.11110000.11111110 equates to 111.227.240.254: 0 + 64 + 32 + 0 + 5. ® 8 + 4 + 2 + 1 = 111, 128 + 64 + 32 + 0 + 0 + 0 + 2 + 1 = 227, 128 + 64 + 32 + 16 + 0 + 0 + 0 + 0 = 240, 128 + 64 + 32 + 16 + 8 + 4 + 2 + 0 = 254. ® ˚ A, B, and C. These answers do not match. ✓ D. When performing a Boolean AND between both octets, put one above the other and 6. ® simply multiply each pair. The result is 10010000. ® ˚ A, B, and C. These answers do not match the Boolean AND result.
Subnet Essentials ✓ B and D. 255.255.0.0 is the default subnet mask for a Class B address space, and 7. ® 255.255.254.0 is a valid subnet mask. ® ˚ A. 255.254.0.0 will not work because it is smaller than the default mask for a Class B. C. 255.255.245.0 will not work because 245 is not allowed (it is not a consecutive series of 1’s) within a subnet mask. E. 255.255.192.224 is incorrect because the subnet mask must always be a series of consecutive 1’s from left to right. ✓ C. Following the five steps to create a subnet mask, 255.255.248.0 is the correct choice. 8. ® The Class B address space has a default mask of 255.255.0.0, and we need to borrow five bits to accomplish the task (2n => # subnets needed, and 25 complies). Counting from left to right, starting with the 17th bit (due to the default mask), the line is drawn after the 21st bit. Setting
Self Test Answers
227
all bits to 1 on the left of the line, we have 11111111.11111111.11111000.00000000, which equates to 255.255.248.0. ® ˚ A, B, and D. These choices are incorrect and do not comply with the scenario needs. ✓ C. 255.255.255.240 is the best choice, providing the best “subnets needed to hosts 9. ® supported” range. The 240 mask creates 16 subnets, leaving four bits for up to 14 hosts. ® ˚ A. 255.255.255.248 would not work since it only leaves three bits for hosts (six hosts on each subnet). B. 255.255.255.240 is the correct mask, but it creates 16 (2n) subnets, not 14. D. 255.255.255.224 would work in the scenario, creating enough subnets and supporting enough clients; however, it wastes quite a few addresses. The scenario called for only 12 hosts per subnet, and conserving address space as much as possible. Therefore, only four bits (14 hosts) are needed in the host field, not five (30 hosts). ✓ C. Because the network uses a classful routing protocol (RIPv1), you cannot use the zero 10. ® subnet or the broadcast subnet. Therefore, the formula for determining the number of bits to borrow becomes 2n – 2 => the number needed, and not 2n. Needing to borrow five bits puts the subnet mask at 255.255.248.0. ® ˚ A. 255.255.224.0 will not create enough subnets. B. 255.255.240.0 will not create enough subnets (cannot use the zero or broadcast subnet here). D. 255.255.252.0 will create too many subnets. ✓ B. To support at least 20 hosts per subnet, you must leave at least 5 bits (2n – 2 => hosts 11. ® supported), meaning you can only borrow three bits to create subnets with. With three bits, you can create eight subnets, with each subnet supporting up to 30 hosts. 255.255.255.224 is the correct subnet mask. ® ˚ A. 255.255.255.192 will create four subnets, but leaves too many bits in the host field (six). C and D. Neither choice leaves enough bits in the host field to comply with the scenario.
Subnet Masks ✓ D. The 255.255.252.0 subnet mask for 137.99.0.0 borrows six bits from the host field. The 12. ® third combination of these bits equates to the “8” subnet (000000|xx is the first, 000001|xx is the second, and 000010|xx is the third, where the x’s represent the two host bits in the third octet). To find the broadcast address, all host bits must be set to 1’s: 000010|11.11111111. This equates to 137.99.11.255. ® ˚ A. Since all host bits are NOT set to 1’s, 137.99.12.255 is simply a host address on the fourth subnet (000011|00.11111111). B. 137.99.15.255 is the broadcast address for the fourth subnet (000011|11.11111111). C. Since all host bits are NOT set to 1’s, 137.99.8.255 is a host address on the third octet (000010|00.11111111).
228
Chapter 7:
IP Address Subnetting
✓ A, B, and C. The magic number created by the 255.248.0.0 subnet mask is 8 (in the second 13. ® octet). The second subnet is 17.8.0.0, with a useable range of 17.8.0.1 through 17.15.254. ® ˚ D and E. 17.0.15.255 and 17.0.19.255 do not fall within the useable range. ✓ D. The subnet mask of 255.255.255.192 borrows the first two bits from the last octet. 14. ® The first subnet is the zero subnet, and the second is the 220.55.66.64 subnet. The relevant information regarding the first subnet is the subnet ID (220.55.66.0), the useable range (220.55.66.1 through 220.55.66.62), and the broadcast address (220.55.66.63). ® ˚ A, B, and C. These choices do not fall within the useable range. ✓ C. A Boolean AND between the IP address 125.35.88.7 and the subnet mask of 15. ® 255.255.240.0 shows the subnet ID as 125.35.80.0. Turning on all the remaining host bits, we have 125.35.01011111.11111111, which equates to 125.35.95.255. ® ˚ A, B, and D. These choices do not reflect the broadcast address of the proper subnet ID.
8 Interfacing with Cisco Devices
CERTIFICATION OBJECTIVES 8.01
The IOS and Configuration Files
8.02
The CLI
✓ Q&A
Copyright © 2008 by The McGraw-Hill Companies. Click here for terms of use.
Two-Minute Drill Self Test
230
Chapter 8:
Interfacing with Cisco Devices
U
p to now, most of this book has explored general networking concepts, which are applicable whether you are taking a Cisco exam or learning basic networking for any job in information technology (IT). In this chapter, though, we finally get Cisco-centric. We’ll cover some basics on Cisco devices, briefly describing device characteristics, and define the differences between the device’s operating system and its configuration files. The chapter will conclude with a discussion of the methods used to access and update configuration files, including structure and syntax.
CERTIFICATION OBJECTIVE 8.01
The IOS and Configuration Files A Cisco router or switch is, for all intents and purposes, a computer. Granted, it’s a very specialized computer, performing very specific functions, but it’s a computer nonetheless. Like every computer, these devices have a CPU, both temporary (active) memory and long-term storage areas, expansion bays, and a variety of chipsets to accomplish their tasks. The methods for accessing and managing these devices are somewhat different than the point-and-click GUI method used on most Windows machines, but the thought process remains the same. Additionally, just like with a computer, these devices follow a specific boot process when power is applied. So, before covering the IOS and configuration files, it’s important you learn the boot process for Cisco devices.
The Boot Process Before the boot process can be fully understood, it’s helpful to know the memory locations that play a role in it. Whether it be a Cisco switch or a router, a Cisco device has four major areas of memory: RAM, Flash, ROM, and NVRAM. Random access memory (RAM) is used on a switch or router exactly as on a computer—for working storage—and is volatile in nature, clearing as soon as the device is rebooted or loses power. Flash memory is a permanent storage location (on a chip or removable card) and is used to store operating system images. Read-only memory (ROM) is another permanent memory location within the switch or router that holds
The IOS and Configuration Files
231
a bootstrap program. The bootstrap program is loaded immediately after power on self test (POST) at power up and finds the proper operating system image to load. Finally, non-volatile RAM (NVRAM) is another permanent storage location within the device that holds the configuration file used when the device is powered on. Table 8-1 summarizes this information.
Commit Table 8-1 to memory. Know what “lives” in each storage location, as well as the steps taken to load
and execute the IOS and configuration files. You will definitely be asked about it on the exam.
As covered earlier in Chapter 5, Cisco switches follow a specific boot process at power up. Routers follow much the same process, but a few key differences exist. The steps a router takes to boot can be seen in Figure 8-1. After the POST, the router checks ROM and loads the bootstrap program into RAM and executes it. The bootstrap program’s job is to find a bootable IOS and load it into memory. After the operating system is loaded and running, bootstrap hands over control to it. Taking a small step back, one very important function within the boot process that warrants more discussion is the selection of an IOS from which to boot. When your home PC boots up, it runs a POST, and then follows a prescribed path to search for a bootable partition. Your BIOS settings might prescribe, for example, that the system check the CD drive for a bootable partition first, before checking the hard drive. Once a bootable partition is found, the operating system (OS) loads into memory, and you begin accessing the system, running applications and functions. Cisco devices boot in much the same method, but instead of configuring BIOS settings to determine the boot order, Cisco devices use something called a configuration register and the boot system command.
TABLE 8-1
Cisco Device Memory Locations
Memory Location
RAM
Flash
Purpose
Running configuration
IOS image(s) Bootstrap and Startup ROMMON OS configuration
ROM
NVRAM
232
Chapter 8:
FIGURE 8-1
The router boot process
Interfacing with Cisco Devices
POST
ROM: Load bootstrap into RAM and execute Check ROM for IOS Check TFTP for IOS Check Flash for IOS
RAM Bootstrap Bootstrap searches for an IOS to boot
IOS
Find startup configuration in NVRAM Find startup configuration from TFTP Find startup configuration from Console
IOS now needs a configuration file
Running Configuration
The configuration register setting is a hexadecimal number that tells the device where to look for an IOS image to load. It appears as a four-digit number, starting with 210 and ending with a hex digit ranging from 0 to F. The last hex digit in the series determines where the device looks for an IOS. If the last digit is a 0, the system ignores Flash memory and boots directly into a barebones operating system known as ROMMON. If it is set to 1, the system will boot using the first IOS found in Flash memory. Finally, if it is set to anything else, the system will again look in Flash for an IOS to boot from, but it will take into account the boot system command. The boot system command is placed in the router’s configuration file and will instruct the router where to look for its IOS image. Typically, you will want the router to boot from Flash memory using the entry: boot system flash. By default, the configuration register is set to 2102, which tells the device to check for boot system commands. If they do not exist, the system boots the first IOS found in Flash memory. Another important setting to remember is 0x2142. This configuration register functions the same way as the default, loading the first IOS found in Flash memory. However, it does not load a configuration file; instead, the device enters the System Configuration dialog, otherwise known as setup. 0x2142 is most often used during password recovery.
The IOS and Configuration Files
233
If you happen to see the boot: cannot open “flash:” error message during a boot, it means a boot system command has been entered incorrectly. Check the spelling on the filename referenced by the command—a single letter, period, or dash out of place will point to a file that simply isn’t present in Flash! If no boot system command exists, the system simply uses the first IOS copied into Flash. The system keeps track of the order that files were copied into memory via an incrementing number, so the IOS file with the lowest number is considered first. However, if multiple boot system commands exist, it will attempt each one, in order, until a suitable IOS is found. The syntax for the command is boot system location filename IPaddress. Examples of the boot system command are summarized in Table 8-2.
Commit to memory the three configuration register settings (0, 1, and 2, or above) and their meaning. Remember, the configuration register is set by the config-register command and,
by default, is set to 2102. Configuration register 2142 is used during password recovery. Be sure to memorize the proper syntax for the boot system command as well as its application.
Note: More information on setting the configuration register and using the boot system command will be covered in Chapter 10. Assuming an appropriate IOS image is located and installed, the IOS next searches for a configuration file to load and run. If a configuration file exists, a copy will be stored in NVRAM. The file’s name is startup-config, and it contains all the settings previously configured and saved on the router by the administrator. If the file does not exist, the IOS will load a file called setup, which, amazingly enough,
TABLE 8-2
Boot System Commands
Command
Application
boot system flash
Boot the first IOS file found in Flash.
boot system flash filename Boot the IOS named filename from Flash. boot system tftp filename 172.16.1.5
Boot the IOS named filename from the tftp server addressed 172.16.1.5.
234
Chapter 8:
Interfacing with Cisco Devices
runs a step-by-step setup program for the administrator. More information on IOS options, setup, and the configuration file will be covered later. Finally, regarding the boot process, one other “operating system” should be considered. Have you ever turned on your PC only to find the dreaded “blue screen of death”? Have you ever come across a system that just simply wouldn’t boot, or locked up so often it was virtually non-useable? Most of us have, and many times these systems need to be reloaded from scratch with a new operating system. Sometimes, it seems, operating systems or their storage locations simply corrupt and need to be replaced. As a computer itself, a router is no different. Sometimes the Flash memory holding the IOS image gets corrupted, or a bad copy of the IOS image is placed into Flash. In either case, it would certainly be nice to have an option to replace or repair the image installation. Thankfully, Cisco designed that very option with something called the ROM Monitor. ROMMON OS is a barebones basic operating system kept in ROM memory. Administrators can manipulate the configuration register setting to boot into this operating system for repair purposes, or during password recovery. ROMMON does not allow very much usability, and is only to be used in emergency circumstances. Booting into ROMMON allows administrators to copy new images into memory, recover from passwords, and reset configuration register settings.
ROMMON is used for password recovery and emergency IOS restore operations, and resides in ROM. To boot into ROMMON, the configuration register setting must
have a boot field of “0”. Lastly, older routers used a version of this known as Boot ROM (or RxBoot—boot helper). This older version is not used on newer routers.
The Cisco IOS Configuring and accessing the router is very important, but we first need to cover the basics of what the operating system is, where you can find it, and how to gather information about it. Obviously the commands and many of the activities listed in this section cannot be accomplished until the router or switch is installed and properly configured, which we don’t cover until Chapters 9 and 10. However, it is vital to cover the IOS and its relevant information first, even if it means going over
The IOS and Configuration Files
235
a command or two you cannot use until later. In other words, you need to know what the IOS is and how to manage it before you learn the configuration steps necessary to get it working. Depending on the IOS version installed, services and features differ from router to router. Some versions, for instance, may provide better debug functions, command sets, or compatibility features than others. If you find yourself searching for a command that doesn’t seem to be available, or attempting a service that doesn’t seem to work, check your IOS version number—you may simply need to load a newer IOS version. Cisco’s operating system, the IOS, works much like any other operating system on any other computer. It recognizes inputs, provides output, and keeps track of peripheral devices and bus settings. Additionally, the IOS provides the framework for security and management configuration settings. Operating systems for computers are fairly easy to distinguish—Windows XP is obviously different from Windows 2000 Professional or Windows 95, for instance. Just as Microsoft releases new operating systems from time to time, Cisco’s Internetwork Operating System (IOS) has gone through several upgrades and stages; however, it’s a little more difficult to tell them apart. When a new IOS is released, it’s not given a new name, but rather a new version number. The naming convention for each new version of the Cisco IOS provides quite a bit of information. Each portion of the name signifies specific information, as shown in Figure 8-2. After the router is up and running, the command show version can be used to check the version number your router is using. A sample output, with key information highlighted, is provided here: classRTR1#show version Cisco IOS Software, 2801 Software (C2801-IPBASE-M), Version 12.4(1c), RELEASE SOFTWARE (fc1) Technical Support: http://www.cisco.com/techsupport
FIGURE 8-2
The IOS naming convention
c2801-ipbase-mz.124-1c.bin
Feature Set Hardware Platform
Version and Release
File Format
236
Chapter 8:
Interfacing with Cisco Devices
Copyright (c) 1986-2005 by Cisco Systems, Inc. Compiled Wed 26-Oct-05 08:42 by evmiller ROM: System Bootstrap, Version 12.4(13r)T, RELEASE SOFTWARE (fc1) classRTR1 uptime is 1 minute System returned to ROM by power-on System image file is "flash:c2801-ipbase-mz.124-1c.bin" Cisco 2801 (revision 7.0) with 114688K/16384K bytes of memory. Processor board ID FTX1120Z0T9 2 FastEthernet interfaces DRAM configuration is 64 bits wide with parity disabled. 191K bytes of NVRAM. 62720K bytes of ATA CompactFlash (Read/Write) Configuration register is 0x2102
The show version command holds a lot of information about your router. The IOS version number, as well as the bootstrap version number, is listed here. Loads of information about the system boot procedure is also listed, including system uptime (since last power off), the reason and time for the last reload of the IOS, and the source of the current IOS. This command output also displays information about the system itself: the amount of RAM, the interfaces available, and the amount of NVRAM and Flash memory available. Finally, the configuration register setting is also displayed.
Know what information can be gathered from a show version command output. Go over the sample output provided and make sure you
can pick out the relevant information, especially keying on the configuration register, the IOS version, and the latest reload information.
You can upgrade your IOS version by copying a new version into Flash (assuming you have room for it), and then reloading the router to boot into the new version. Additionally, you can easily copy your existing IOS to a separate storage location, for disaster recovery purposes. To place the existing IOS into a remote storage location, or to grab a new version for Flash memory, simply use the copy source destination command in conjunction with an accessible TFTP server, where source and destination refer to the storage location, and sometimes the name, of the file you wish to copy.
The IOS and Configuration Files
237
Backing up your IOS image, or loading a new image to the router, is relatively simple, provided you understand a couple of basics regarding TFTP. TFTP is very picky and will only transfer the exact file you specify—one letter or character misspelled and it’s all over. Additionally, TFTP allows no directory browsing—if you wish to pull a file from the TFTP server, you must know the exact syntax of its name. So, before running the copy command, use the show flash command to see the filenames contained in Flash memory. Your IOS file will end in “.bin” and contain a long string of characters that look something like this: c2801-ipbase-mz.124-1c.bin. Once you know the name of the IOS image to back up, simply type the command copy flash tftp. The router will prompt you for the name of the file you wish to TFTP to the server. You can either type the name in or simply cut and paste by selecting the name from the show flash command earlier. Next, you input the IP address of the TFTP server and the destination filename (note that it does NOT have to be the same as the original, although it’s best to leave it that way). As the file copies, a series of exclamation marks (!) will display its progress. A sample output from this process is listed here: classRTR1#show flash -#- --length-- -----date/time------ path 1 13932728 May 18 2007 13:20:58 +00:00 c2801-ipbase-mz.124-1c.bin <<<<..Output Truncated ..>>>> 9 416354 May 18 2007 13:41:04 +00:00 sslclient-win-1.1.3.173.pkg 39768064 bytes available (24244224 bytes used) classRTR1#copy flash tftp Source filename []? c2801-ipbase-mz.124-1c.bin Address or name of remote host []? 172.16.1.6 Destination filename [c2801-ipbase-mz.124-1c.bin]? !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!! <<<<..Output Truncated ..>>>> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!! 13932728 bytes copied in 39.980 secs (348492 bytes/sec)
To load a new IOS image to the router, simply follow the process in reverse. This time, the command syntax is copy tftp flash. The router will first prompt for the TFTP IP address, and then ask for the name of the file you wish to import. Be sure the name is typed or pasted exactly as it appears on the TFTP server. If you are copying a file with the same name as one already existing in Flash, the router will ask if you wish to delete the original file. Once again, exclamation marks (!) will indicate the progress.
238
Chapter 8:
Interfacing with Cisco Devices
Familiarize yourself with backing up IOS images as well as copying new images to the router. Remember the show flash command not only displays the files located in Flash, but also shows
the amount of memory available.The copy source destination command lets you copy IOS and configuration files from one location to another, both inside and outside of the router.
Moving IOS and configuration files to and from a router or switch can be done with TFTP or FTP. In modern networks concerned with security, FTP is the preferred choice. On the exam, you’re much more likely to be asked about TFTP, though.
Configuration Files Having the operating system on the router or switch is only half the battle—you need a configuration file to tell the IOS how to operate! While your computer loads an operating system and then waits for your input, Cisco devices load an operating system and a configuration file. While the operating system provides the framework for system interaction and the overall functions the device is capable of performing, the configuration file provides the specifics needed to get the job done. For example, the operating system provides a method to recognize the device is a router with Ethernet and serial ports, but the configuration file provides the addresses and security settings for those interfaces. The configuration file provides settings on everything from interface addresses and communications specifics to passwords and protocol specifics. Configuration files are called by the IOS after bootup, and their settings are loaded into memory. Cisco devices actually have two configuration files—the startup configuration and the running configuration. The startup configuration, known as startup-config, is the configuration the router or switch pulls from NVRAM at boot. All configuration information placed into the startup-config remains, even when the router or switch loses power. The purpose of the startup-config is simple and obvious—without it, administrators would have to retype all configuration information every time the device powered off! In other words, changes are not made to the startup-config. You can copy a new configuration file in its place, but once the file is copied into NVRAM, it remains the same.
The IOS and Configuration Files
239
The only time a Cisco device does not start with the startup-config file is when no startup-config exists in the first place, or if it is told to ignore the startup configuration. For example, when you first purchase a new switch or router, it has no configuration on it. Administrators may also decide, for a variety of reasons, to delete the startupconfig file altogether and start from scratch. To delete the startup-config file, administrators can use the erase nvram command (older versions of this command include write erase and erase startup-config). After deleting the startupconfig, the administrator needs to either power cycle the device or issue the reload command. If no startup-config exists, the device will default into Setup mode, asking a variety of questions to lead the administrator through configuring the device. Administrators can also enter Setup mode by typing the command setup from Privileged mode. Setup mode prompts with simple questions, asking for a response on a given configuration item. The answer can be typed in or, by simply pressing ENTER, the administrator can accept the default values, displayed in brackets ([]). While this is a simple process, setup does not allow you to go backward—once a configuration option has been entered, you cannot go back to it. Therefore, if you make a mistake during setup, use CTRL-C to abort and then restart the script. After setup finishes, and all configuration options have been entered, the system will display the configuration being created. At this point, the configuration is neither applied nor saved. It is simply waiting for a decision from the administrator. After the display, the user has three options. Choosing option 0 deletes the setup configuration and returns the user to Privileged mode. Option 1 returns to the beginning of the setup script. Finally, option 2 saves the configuration file into NVRAM and RAM (effectively activating it), returning the user to Privileged mode. More on setup and other configuration options will be covered later in the book. Another built-in setup script for Cisco routers and switches is auto secure. This script runs much like Setup mode, but only concentrates on the security settings for the device—such as enabling a built-in software firewall and disabling unnecessary services on the device. Only available on newer models, auto secure is started by typing auto secure in Privileged mode. On the other hand, all changes to the configuration of a router or switch are done to the running configuration, known as the running-config. The runningconfig actively runs in RAM and starts out exactly the same as the startup-config. Remember, a copy of the startup-config is loaded into RAM at boot—once loaded and activated, it becomes the running configuration. Even though they start exactly
240
Chapter 8:
Interfacing with Cisco Devices
the same, the running configuration and the startup configuration do not necessarily hold the same settings 100 percent of the time. Any changes to the configuration are done to the running-config, and those changes go into effect the moment the administrator makes the change. To ensure the changes remain after power off, you must first copy the running-config over the existing startup-config. The command to do this, amazingly enough, is copy running-configuration startup-configuration.
Be sure you understand the differences between the startup configuration file and the running configuration file. Also, remember changes
made to the running configuration go into effect immediately, and to save the changes you must issue the copy runningconfiguration startup-configuration.
Just as the running-config can be copied to startup-config to save settings, other configuration files can be copied into RAM, and the running-config can be backed up in multiple locations. Remember the copy source destination command? Both running and startup configuration files can be copied to Flash memory, RAM, or an off-device location—such as a TFTP or FTP server, or to a simple text file on a laptop. For example, the running configuration might be copied to a TFTP server for backup purposes using the copy running-config tftp command. A configuration file sitting on a TFTP server may be copied into NVRAM by using the copy tftp nvram command. An important note to keep track of here is the treatment of the file currently resting in the target memory area. Anytime a configuration file is copied into NVRAM (startup-config), the file currently in NVRAM is overwritten. However, this is not true with anything copied into RAM. If a configuration file is copied to RAM (running-config) the file is merged with the file already in RAM. In the merge process, the IOS updates commands in RAM that are different than the incoming file, and adds any new commands found in the new file. However it does not eliminate any commands from the file in RAM that it does not find in the source file. For example, suppose a source file has a command to change the IP address of interface Fast Ethernet 0/0, but does not have any banner commands, while the running configuration of the device does have a banner. When the file is copied into RAM, the IOS will update the interface’s IP address, but will not eliminate
The IOS and Configuration Files
241
the banner command—even though the source file does not have a single banner command in it. In other words, the source file merges with the running config instead of simply overwriting it. Lastly, both configuration files can be known and addressed within commands by more than one method. startup-config and running-config are their most commonly referred to names, but Remember, anything they are also known by other names. Startupcopied to running-config is merged to the config can also be referred to within commands file.The running config is not overwritten! by nvram: or by nvram:startup-config, while running-config can also be referred to as system:running-config. Much more information on updating and managing the startup and running configurations on switches and routers will be covered in subsequent chapters. Battle-hardened Cisco networkers are always looking for shortcuts to get the job done. Less keystrokes typed means more time for sugary snacks. For example, the command write mem can be used to copy the running-config to the startup-config. It’s a lot shorter than the copy running-config startup-config command and, I suppose, “cooler,” too. As a matter of fact, due to the auto complete help function, you can truncate this command to simply wr—thus, copying the configuration by using only two letters! According to Cisco, however, newer IOS versions will stop supporting this command soon.
Access Methods Knowing configuration files hold the settings necessary for the router or switch to function, and that the running configuration is updated by an administrator in real time, an obvious question is raised: How are these changes made to the configuration file? On Cisco devices, the configuration files can be accessed locally or remotely, and using command-line or web-based methods. This section introduces the various methods and features of accessing Cisco devices. The information covered in this introduction will provide the bedrock of information needed for success in later chapters, and in your day-to-day administration. Administrators can access Cisco configuration files in three main ways. First, the administrator can connect directly to the console port on the router or switch. Because it requires local access to the router, only allowing this type of access to the
242
Chapter 8:
Interfacing with Cisco Devices
configuration files is probably the most secure access method available. To access the router or switch using the console port, the administrator connects a rollover cable between a DB-9 connector affixed to a PC’s serial port and the console port on the switch or router. A rollover cable maps pin 1 to pin 8, pin 2 to pin 7, and so on, “rolling over” one end of the cable to the other. The RJ45 connector on one end plugs directly into the console port on the device, while the other plugs into the RJ45 side of the DB-9 connector. The connection for local console access is depicted in Figure 8-3. Once this physical connection is made, the administrator can use a terminal emulation program, such as HyperTerminal or Terra Term, to type in configuration changes. When setting up any terminal emulation program on a console connection, the emulator must be configured properly on the computer’s serial port. The default console settings on a switch or router are: ■ 9600 bits/second ■ No hardware flow control ■ 8-bit ASCII ■ No stop bits ■ 1 parity bit
When using HyperTerminal, Terra Term, or any other emulator, once you attempt to connect over the console port, the system will prompt for the correct communications settings. If you’re using HyperTerminal for the connection, you can simply press the Restore Defaults button to set these. The default console settings in HyperTerminal are displayed in Figure 8-4. Once the communications settings are in place, the emulator allows access to the device.
FIGURE 8-3 Console port
A console connection Rollover cable
DB-9 connector
The IOS and Configuration Files
243
FIGURE 8-4
The default console terminal settings
CertCam
A multimedia demonstration on configuring HyperTerminal for console connections can be found on the CD accompanying this book. While many terminal emulation programs exist, HyperTerminal is probably the most common—due mainly to the fact it is built in to most Windows operating systems. Additionally, HyperTerminal appears most often on the exam.Terra Term can be downloaded for free from www.ayera.com and allows for remote SSH access as well. Either works just as well as the other and is purely a matter of personal preference. Administrators can also access Cisco devices remotely, through telnet or SSH access. A telnet or SSH session between the administrator’s PC and the router or switch provides the same functionality as a console connection. The benefit is that the administrator can access configuration files without local access to the device, from any location inside or outside the network. The drawback, obviously, is security—allowing remote access through any method opens a security concern for your network. If remote access to devices is a necessity, the device must be configured to allow this access, and SSH should be used in place of telnet as much as possible. Telnet runs over port 23 and sends all information in clear text, while SSH uses port 22 and encrypts the session. Lastly, Cisco routers and switches can be updated using web-based access. A graphical user interface (GUI) can be accessed over a web browser using Cisco Router and Security Device Manager (SDM) or Cisco Device Manager (CDM).
244
Chapter 8:
Interfacing with Cisco Devices
Know the different methods of accessing Cisco devices. Local access is the most secure, requiring physical access to the device, and using a rollover cable with a DB-9 connector to the serial port of your laptop. Memorize the default settings required for emulator access over
the console.The benefit of using SSH over telnet in configuring routers or switches remotely is that it encrypts the session, preventing sniffers from stealing passwords, and so on. Finally, web access to configure the devices can be found in SDM (router) and CDM (switch).
SDM is used for router access and configuration, while CDM is used for switches. SDM must be loaded and enabled on the router before use, and provides a simple means to update almost anything you can imagine on the router. More information on accessing and using SDM will be covered in Chapter 10. SDM is addressed in more detail than CDM in this book because it’s covered on the exam. SDM is generally already loaded on most new routers. If you need to install it, though, check www.cisco.com for instructions on how to proceed. After installation, SDM provides a quick and easy way to configure devices. It will infuriate you at first with a lot of prompts and security checks, but once it’s set up, it’s a true time (and sanity) saver.
EXERCISE 8-1 Router Connection Methods—HyperTerminal and Telnet This exercise demonstrates the proper steps needed to establish a connection with a Cisco device—both locally, using the console port, and remotely, using telnet. The local portion of this exercise obviously requires physical access to a router (or switch), along with a cable and a properly equipped system. If you do not have access to all of these, you can still view the configuration by skipping the physical installation of the cable and simply opening and configuring HyperTerminal, as depicted in steps 1 through 4. All other steps in this exercise can be accomplished using the Boson’s NetSim simulator. You can find a picture of the network diagram for Boson’s NetSim simulator in the Introduction of this book. After starting up the simulator, click on the LabNavigator button. Next, double-click on Exercise 7-1 and
The IOS and Configuration Files
245
click on the Load Lab button. You can then simply click the 2600-1 router to see the connection, as depicted in steps 5 through 11. 1. After connecting the rollover cable to the console port, and ensuring the DB-9 connector is attached to the serial port of the Windows PC, power on the router. On the PC, choose Start | All Programs | Accessories | Communications | HyperTerminal, as shown in Figure 8-5. 2. Type in Cisco as the name of the connection in the Connection Description dialog box and then click the OK button (see Figure 8-6). 3. Choose COM1 from the drop-down in the Connect To dialog box, and then click OK (see Figure 8-7). 4. Click the Restore Defaults button in the COM1 Properties dialog box (see Figure 8-8). Notice the communications parameters default to those required by Cisco console ports. Click OK. 5. HyperTerminal now opens, displaying the connection to the router (see Figure 8-9). You can now log in to the router, and configuration commands can be entered. Log in using the username Bob and the password CCENT. To enter Privileged mode, type the command enable and press ENTER. Next, type the command show version and press ENTER. FIGURE 8-5
Starting HyperTerminal
246
Chapter 8:
FIGURE 8-6
The Connection Description dialog box
FIGURE 8-7
The Connect To dialog box
FIGURE 8-8
The COM1 Properties dialog box
Interfacing with Cisco Devices
The IOS and Configuration Files
FIGURE 8-9
247
HyperTerminal
6. To leave Privileged mode, type disable and press ENTER, then type exit and press ENTER to exit out of the CLI completely. Close HyperTerminal by clicking the red X at the top right of the window. When asked about disconnecting, click Yes. 7. HyperTerminal will ask if you would like to save the current settings. To avoid setting up the communications parameters again, choose Yes. HyperTerminal saves the connection as Cisco, and places it in the menu group HyperTerminal.
248
Chapter 8:
Interfacing with Cisco Devices
FIGURE 8-10
The HyperTerminal group
8. Access the saved setting by choosing Start | All Programs | Accessories | Communications. Notice that a new group named HyperTerminal appears within the Communications group (see Figure 8-10). When you highlight the HyperTerminal group, Cisco appears. Click Cisco, and HyperTerminal opens with the saved communications parameters. Press ENTER and you can log in to the router again. Note: You can also copy the icon directly to the desktop, for even faster access. Choose Start | All Programs | Accessories | Communications. Select the HyperTerminal group and right-click the saved Cisco settings. Choose Send To…, and then Desktop (create shortcut).The shortcut icon appears on the desktop. Simply double-clicking it will open HyperTerminal, preconfigured for access.
9. To connect to a router using telnet access, choose Start | Run. Type cmd (for command prompt) and press ENTER. 10. In the command prompt, type telnet IPAddress, using the IP address of the router. Provide the same userid and password as before. The prompt changes to the user exec level prompt, letting you know you are in the router. 11. Type enable to move to Privileged mode, and then type show version. To exit, type disable (leaving Privileged mode) and exit (to leave the CLI).
The CLI
249
CERTIFICATION OBJECTIVE 8.02
The CLI Regardless of the access method used, configuration is done by interacting with the IOS and configuration files. Using SDM, this is more or less a point-and-click interface. However, if you connect via the console or remotely (telnet or SSH), interaction with Cisco devices is accomplished through the command-line interface (CLI). The CLI allows administrators to access the IOS and configuration files using a series of commands to accomplish the configuration goal. Much like any other access functionality, the CLI has rules, syntax, and help functions, and these characteristics should be learned before attempting any device configuration.
CLI Modes The CLI is divided into three main modes: User, Privileged, and Configuration. User mode is the first mode a user has contact with after accessing the device. Only basic commands can be used here, and no configuration of the device in any way is allowed. Users in this mode can view configuration settings (using the show command), but cannot change them nor reboot or restart the system. User mode, also known as User EXEC mode, appears immediately after the console or telnet (SSH) session is established, and its prompt is a “>”. The > symbol appears immediately after the router or switch name, as configured by the administrator, and is a quick way for users to tell which mode they’re in. Privileged mode provides many additional options to the user, and is accessed when the user types in the command enable. After entering Privileged mode, also known as Privileged EXEC mode or Enable mode, the prompt changes to a “#” sign. A user in Privileged mode can view system information, restart the system, or enter Configuration mode. Because of its additional abilities, access to Privileged mode is restricted and generally protected via a password. To leave Privileged mode and go back to User mode, use the disable command. The last mode, Configuration mode, allows users to modify the running configuration files on the device. Configuration mode is accessed by the command configure terminal, typed by users already in Privileged mode, and has a wide variety of submodes. Initially, Configuration mode is in Global Configuration mode.
250
Chapter 8:
Interfacing with Cisco Devices
However, as the administrator moves through the configuration file (changing settings on lines, interfaces, and router settings), the configuration submode changes. Each submode is accessed by typing in a particular command, and each has its own prompt. Users start in Global Configuration mode, and commands here affect the entire device. These settings include things such as the device hostname and whether a particular banner will be used or not. From Global Configuration Mode, the user can enter other, more specific areas by typing in the appropriate command. For instance, the command to enter Interface Configuration mode is interface type number, where the type and number arguments point to the individual interface to be configured. Commands issued in this mode only affect this one interface. The command to enter Line Configuration mode is line type number, where type identifies the line type and the number defines which line to configure. Again, these commands do not affect anything on the router other than the line that was specified to enter the Configuration mode. Users do not need to return to Global Configuration mode to move between submodes—simply typing the appropriate command takes you directly from one submode to another. To exit out of a submode back to Global Configuration mode, type the command exit. Obviously, all this moving around between Global, Interface, and Line Configuration modes can get very confusing. Thankfully, the prompt helps identify where you’re at in the configuration. The prompt always appears as the name of the device, followed by a word in parentheses with a pound sign at the end. The word in parentheses refers to the area on the device that is actually being configured. In Global mode, the word is simply config. In Interface mode, the word changes to config-if. In Line mode, it appears as config-line. For clarification, consider the following example. On a router named RTR1, initially upon entering Configuration mode the prompt appears as RTR1(config)#, indicating Global Configuration mode. After assigning a hostname and making other changes that affect the router globally, the administrator decides to change an IP address on the first Ethernet interface. Typing in the command interface fastEthernet0/0, the mode changes to Interface mode, with the prompt now displaying as RTR1 (config-if)#. After configuring the IP address, the administrator decides to update the telnet lines on the device. By typing the command line vty 0 4, the administrator can now update telnet settings, and the prompt changes to RTR1(config-line)#. One last characteristic of CLI modes needs careful consideration before moving forward—how to exit out of a particular mode, and where exiting that mode leaves you within the CLI. For the most part, to exit out of any mode you simply type
The CLI
251
the command exit. When you exit a sub-configuration mode, it takes you back to Global Configuration mode. For example, if you were in Interface Configuration mode (with a command prompt of RTR1(config-if)#) and typed exit, you would return to Global Configuration mode (displaying a command prompt of RTR1(config)# ). If you’re confused about where you are in the configuration, you can use several exit commands until you reach Privileged mode, or simply issue the command end or use the keystroke combination CTRL-Z to exit Configuration mode altogether.
You must have a solid understanding of each mode. Know how each mode is accessed (such as using enable for Privileged access, and configure terminal for Configuration mode) and how to exit from each one (by typing exit or pressing CTRL-C for each configuration mode, or entering disable for Privileged mode). Additionally, pay very close attention to the prompt displayed.
Many times exam writers will attempt to trick you by providing the correct command, but the wrong prompt. For example, you set an IP address on an interface, not globally—therefore, the prompt should be RTR1(config-if)#. Exam questions may change the wording within the parentheses, or even get so granular as to change the # to a > in an effort to trip you up, so memorizing Table 8-3 will help a lot.
Obviously, the CLI can be very confusing. However, knowing the purpose and prompt for each mode makes things a little easier to understand. Simply keep in mind that the prompt displays your location within the CLI, and exit takes you back one level. Table 8-3 summarizes the CLI configuration modes. One frustrating thing about CLI prompts comes into play on large routers or switches with multiple interfaces and lines. Notice that the prompt for a line or interface does not provide any information about which line or interface you’re configuring. For example, configuring interface Ethernet 0 or Serial 0 would show the same prompt: (config-if). A helpful hint when configuring large devices is to perform the configuration offline on a text editor, and then upload later when done. You can also keep track along the way using a notepad and a pencil, but be very careful!
252
Chapter 8:
TABLE 8-3
CLI Modes
Interfacing with Cisco Devices
CLI Mode
Prompt
Entry Command
Exit Command
User EXEC
Hostname>
None—immediately after establishing emulator connection
exit or CTRL-C
Privileged EXEC
Hostname#
enable (from User mode)
disable
Global Config
Hostname (config)#
configure terminal
exit or CTRL-C
Interface Config
Hostname (config-if)#
interface type number (from anywhere
Hostname (config-line)#
line type number
Line Config
Router Config
Hostname protocol (from Global (config-router)# Configuration mode)
(from Privileged mode)
exit or CTRL-C
within config mode) (from anywhere within config mode)
exit or CTRL-C
router routing
exit or CTRL-C
CLI Help Features The CLI is command-driven, meaning a prompt awaits user input. In other words, much like the old DOS days, pictures simply aren’t there to help, and syntax in typing in commands is paramount. Thankfully, the interface has lots of help features built in. Help features within the CLI include the question mark (?), the autocomplete function (TAB), command history, shortcut keys, and error indicators. Literally thousands of command combinations lay within the CLI, and each command can have a number of parameter combinations along with it. New users need to know which commands are even available to them before they can begin to decide how to proceed, not to mention the parameters for each command. Within the CLI, this is the function of the question mark. Typing a question mark from anywhere within the CLI displays every command, or command parameter, available from that particular mode and prompt. If there are more commands than there is screen space to display them, the commands scroll across the screen, ending with a - - More - - entry. Pressing the SPACEBAR scrolls through the remainder of the command options one page at a time, while pressing ENTER displays one line at a time. To exit out of the display, press CTRL-C. A very important note here, though, is that the display only shows the commands from that particular location—a user in User mode, for instance, would not see the commands available in Privileged mode, and a user configuring an interface would
The CLI
253
only see interface commands, not global configuration commands. Additionally, the question mark does not provide the full syntax of the command, only the command itself. To see all the parameters of the command, type the command first, a space, and then a question mark. As the commands scroll up to fill the page, you can press the SPACEBAR to see the next page of options. The question mark help feature is a brilliant display of human intellectualism and engineering, but it does have one uniquely aggravating feature. Every other command in the CLI requires that you press ENTER to activate it. When you press the question mark, however, it immediately begins displaying command options—you don’t have to press ENTER after pressing the “?”.This can sometimes get annoying since the display of commands will stop after you press ENTER. Just keep in mind that the “?” is instantaneous in its response. Additionally, after all the options display, the CLI presents the command as you previously typed it, awaiting a parameter.The idea is it would save time by not requiring you to retype the command. Unfortunately, many people simply start typing the command in again, entering it twice on the same line. Just remember to pause and view the screen before typing anything! For additional clarity, consider an example. Suppose an administrator wanted to set the time on a router to 9:00 A.M., but is unfamiliar with the command syntax to do so. Using the question mark, the commands to do so are readily displayed: classRTR1#? Exec commands: access-enable Create a temporary Access-List entry ///Output truncated /// clear Reset functions clock Manage the system clock classRTR1#clock ? read-calendar Read the hardware calendar into the clock set Set the time and date update-calendar Update the hardware calendar from the clock classRTR1#clock set ? hh:mm:ss Current Time classRTR1#clock set 13:58:22 ? <1-31> Day of the month MONTH Month of the year classRTR1#clock set 13:58:22 4 DEC ? <1993-2035> Year classRTR1#clock set 13:58:22 4 DEC 2007
254
Chapter 8:
Interfacing with Cisco Devices
Notice in the preceding example code that the question mark only displays the information for the area where it was entered. The options for the clock command include read calendar, and set and update calendar, and a short description of each sub-command’s purpose follows. Additionally, after pressing the “?”, the options will display and the CLI will take you right back to the command. In other words, after pressing “?” following the command clock, the options will display, and the CLI will present the command again, waiting for your input: classRTR1#clock ? set update-calendar classRTR1#clock set
Set the time and date Update the hardware calendar from the clock
While the question mark is a fantastic help feature within the CLI, auto complete is just as valuable. Being a command-driven interactive system, the CLI demands perfection. You can’t just get part of the command right, it has to be typed exactly. The auto complete function helps with this problem in two ways: allowing truncated command entry and use of the TAB key. Eliminating the need to remember the full syntax of most commands, auto complete allows administrators to use truncated versions of commands, instead of requiring the full command to be entered. For example, the command to enter Global Configuration mode from Privileged mode, as covered earlier, is configure terminal. Because of auto complete, however, an administrator can simply type conf t to execute the command. Auto complete only needs enough characters to determine which command the administrator is actually attempting to use. If you do not supply enough characters for it to differentiate which command you wish to enter, though, it won’t work. For instance, refer to the preceding example in setting the clock time on a router. At the first prompt, typing in cl would not give the CLI enough information since there are at least two commands that start with “cl” – clear and clock. However, you could type clo and the CLI would know exactly which command you’re referring to, thanks to auto complete. For another example, instead of typing copy running-configuration startup-configuration, you could simply type copy run start. Using auto complete saves a lot of time in switch and router configuration updates. The second auto complete function that helps administrators is the TAB key. If you are unsure of the proper syntax on a particular command, simply type in the first portion of the command and press the TAB key—auto complete then fills in the appropriate syntax for you! Especially when learning your way around the CLI, this
The CLI
255
feature is unbelievably helpful. The use of TAB in learning command syntax is shown in the following: classRTR1#? Exec commands:| access-enable Create a temporary Access-List entry access-profile Apply user-profile to interface access-template Create a temporary Access-List entry archive manage archive files auto Exec level Automation bfe For manual emergency modes setting //// Output Truncated //// RTR1#a //// 1) Typed 'a' and pressed TAB... RTR1#a //// 2) CLI returned 'a' because more commands start with a... classRTR1#ac //// 3) Typed 'ac' and pressed TAB... classRTR1#access//// 4) CLI returned as much of the command as it could resolve... classRTR1#access-e //// 5) Typed 'access-e' and pressed TAB... classRTR1#access-enable//// 6) CLI returned the full command, finally having enough unique characters to determine the command
The CLI also stores recently entered commands into a history buffer, for quick recall and use. By default, the history buffer stores ten commands. Administrators configuring a device can move up and down the command history by using the up and down arrow keys. After scrolling through to find the command, administrators can edit it before reissuing (by pressing ENTER). For example, when configuring an access list, the first portion of the command (access-list #) always remains the same. Using the history function, an administrator could simply press the up arrow after entering a command and edit the second half of the command, avoiding having to re-type the first portion over and over again. Both on the exam and in day-to-day administration, using the history buffer can greatly speed things up.
You will need to know every method of CLI help referenced. Be sure to memorize all the keyboard shortcuts and be able to recognize screenshots of the question mark, auto complete, and
TAB functions. Be careful, though: the simulation questions on the exam may not allow any of the help functions, meaning you will need to memorize the exact syntax of all commands.
256
Chapter 8:
Interfacing with Cisco Devices
In another help function available, the CLI provides several keyboard shortcuts. Keyboard shortcuts really work in conjunction with the history buffer, and should be memorized not only for the exam, but also to speed up your administrative efforts. The relevant keyboard shortcuts are displayed in Table 8-4. Some administrators love keyboard shortcuts, while others despise them.Their use is, of course, a matter of personal preference. One interesting note on them, however, deals with the letters appearing after the CTRL keys.The letter indicates what the keystroke actually does: the “p” represents previous, “n” is for next, “b” is for back, and “f ” is for forward. Others include “a” (which is always first and indicates a move to the beginning), “e” (which stands for end), “r” (for redisplay), and “d” (for delete). Finally, what good would help functions be without an indicator of problems? The CLI not only immediately responds with an error message when an erroneous command is entered, but it also provides a carrot (^) indicating where in the command the syntax
TABLE 8-4
CLI Keyboard Shortcuts
Keyboard Shortcut
Result
Up arrow or CTRL-P
Displays the most recent command entered into the CLI. Pressing repeatedly goes back through history until all commands in the buffer have been displayed.
Down arrow or CTRL-N
Moves forward in the history buffer (from past to most recent). If you have moved past a command using the up arrow, this allows you to return.
Left arrow or CTRL-B
Moves the cursor back through the command without deleting characters.
Right arrow or CTRL-F
Moves the cursor forward through the command without deleting characters.
BACKSPACE
Moves the cursor backwards, deleting characters.
CTRL-A
Moves the cursor immediately to the beginning of the command.
CTRL-E
Moves the cursor immediately to the end of the command.
CTRL-R
Redisplays the command and all parameters.
CTRL-D
Deletes a single character.
ESC-B
Moves back an entire word.
ESC-F
Moves forward an entire word.
ESC-D
Deletes an entire word.
The CLI
257
went awry. Granted, this is sometimes as frustrating as it is helpful since the CLI does not provide any indication of what syntax or wording should be there; however, it does help narrow down possible causes of problems. In the following example, for instance, an administrator attempted to assign an IP address to an interface, but mistyped the command syntax. The carrot indicates where the command syntax failed: the last octet of the IP address was not entered. RTR1(config)#int serial 0/3/0 RTR1(config-if)#ip address 172.16.11 255.255.255.0 ^ % Invalid input detected at '^' marker. RTR1(config-if)#
CertCam
A multimedia demonstration on basic CLI help functions can be found on the CD accompanying this book.
EXERCISE 8-2 Basic CLI Usage This exercise demonstrates the use of CLI help functions, and provides practice for backing up configuration files to an external TFTP server. You’ll perform this lab using Boson’s NetSim simulator. You can find a picture of the network diagram for Boson’s NetSim simulator in the Introduction of this book. After starting up the simulator, click the LabNavigator button. Next, double-click Exercise 8-2 and then click the Load Lab button. This will load the appropriate configurations for the switch and host, providing the TFTP services needed. You will use the 2600-1 router for this exercise. 1. After establishing a connection, as described in Exercise 8-1, log in to the router using username Bob and password CCENT. Enter Privileged mode using the enable command. 2. Enter the command show running-config to see the running configuration on the router. As the display fills up the screen, - - More - - will show at the bottom. Press the ENTER key and the display will move forward by one line. Press the SPACEBAR to move forward an entire page. When the full configuration has been displayed, the prompt will reappear. 3. Type sh run and press ENTER. Auto complete has enough information to understand the truncated version of the command show running-config, and displays the configuration again. When - - More - - appears again, press CTRL-C to exit back to the prompt.
258
Chapter 8:
Interfacing with Cisco Devices
4. Type sh at the command prompt and then press TAB. Auto complete fills in the rest of the show command and awaits input. Type a single question mark - ? - to view all possible parameters for the show command. Note that all command options immediately begin scrolling down the screen for your review (there is no need for you to press ENTER after the question mark—the commands simply start scrolling immediately after the question mark is entered). You can scroll through the listing using the SPACEBAR and ENTER keys. 5. Type sh v? at the prompt. Auto complete and the ? together display all parameters for the show command that begin with the letter v. Type sh version to see the relevant information about this router’s IOS, NVRAM, and Flash. 6. Enter sh runing, purposefully misspelling the command. The CLI will show a carrot indicating a syntax error. classRTR1#sh runin ^ % Invalid input detected at '^' marker.
7. Enter the command copy run start. The running configuration is copied over the startup-config file stored in NVRAM. 8. Enter the command copy start TFTP to create a backup copy of the startup configuration. When prompted, enter the IP address of your TFTP server (192.168.1.11), and press ENTER to accept the default destination filename. A series of exclamation marks (!) notifies you of the progress. (Note: PC1 is acting as the TFTP server in this exercise. If you have access to your own equipment, or otherwise configure a simulator for this exercise, please remember to use the IP address of your TFTP server.) 9. Log out of the router and CLI session.
Comparing the Router and Switch CLI In a final note, this entire discussion on Cisco’s IOS and the CLI is intended as a bridge—an introduction to the features and functions you’ll find on any Cisco device. For exam purposes, and in your day-to-day administration, keep in mind that there are, obviously, differences in the CLI on a router and a switch. Since they are both different devices accomplishing different tasks, it makes perfect sense that some commands that apply on a switch cannot be used at all on a router. For instance, a command to create a VLAN is applicable for a switch, but makes no sense on a router. In other examples,
The CLI
259
the clock rate command on a router’s serial port cannot be used on a switch (since the switch does not even have serial connectors!), and the commands to implement routing protocols are intended, obviously, for a router and not a switch. Other examples include the show mac address-table command on a switch, versus the show ip route command on a router—neither makes sense on the other device.
All the tips and commands shown so far in this section apply to either device, but be prepared to differentiate between applicable commands for a specific
device. Most of these should be readily apparent—VLANs are only created on switches and the clock rate is only set on routers—but others can be fairly tricky.
Aside from the commands themselves, slight differences exist between the CLI on a router and a switch. For the most part, however, almost everything we’ve covered so far has been applicable to both devices. Some common features of the CLI of either device are: ■ The instances in which the device enters Setup mode and the procedures for
it are the same. ■ User and Privileged modes both appear, as well as the commands to enter and exit them (configure terminal, exit, disable, and end). ■ Configuration of passwords and remote connectivity security (SSH), as well as
common configuration settings—such as the device hostname and interface descriptions. ■ Certain interface designations—speed and duplex, as well as how to enable or disable the interface (shutdown or no shutdown). ■ All CLI help functions.
Examples of areas where the two devices differ in CLI and IOS are also apparent. The questions asked in Setup mode, the configuration of IP addresses, and the configuration options for various ports (AUX and serial) that appear on a router and not a switch are all examples of differences between the two. Again, most of these should be obvious and common sense. While comparing the two can be made tricky (and the exam will try to do so), pausing to think about the command or IOS function should make your answer very easy to find!
260
Chapter 8:
Interfacing with Cisco Devices
INSIDE THE EXAM The IOS and Configuration Files Lots more about the IOS and configuration files will be covered later. The purpose of this section is to introduce concepts about both that apply no matter what you are configuring. Test-wise, be sure you know the boot process and the storage locations within a router: RAM, ROM, NVRAM, and Flash. Memorize which files are stored in each location, and be able to differentiate between the two different configuration files: runningconfig and startup-config. Remember, if a startup-config does not exist, the router will boot into Setup mode. The barebones IOS known as ROMMON can be used to reset the configuration register. The running-config cannot be deleted; however, the startup-config can be deleted using several commands. After deleting the startup configuration, you must power cycle or use the reload command. Be sure you know the naming convention for IOS filenames, and practice the show version command. You will definitely be asked to decode information from the show version output. Additionally, be prepared to answer questions on backing up the IOS and configuration files to a TFTP server, and returning them to Flash or NVRAM, using the copy command. Access to the configuration files is either local via the console or remote, using telnet, SSH, or SDM/CDM. Local console
connections require a serial port, rollover cable, DB-9 connector, and a terminal emulator, such as HyperTerminal. Be sure to memorize the default settings for a session over the console port. Telnet runs over port 23 and is sent in clear text, while SSH runs on port 22 and is encrypted. SDM is the web-based interface used to access the router.
The CLI Be prepared to see numerous questions regarding the basic concepts of the CLI. Know the modes inside and out, and be prepared to identify them based on prompt and type of command entered. Also, definitely know what steps to take to exit out of a mode. Lastly, be very familiar with the help functions within the CLI. Remember the question mark shows all commands from the location where it is typed. Auto complete allows for truncated command entries, so long as enough characters have been entered to allow the CLI to determine a unique command from the list of available options. TAB can be used to complete the command’s syntax on the display in much the same way. Ten commands are stored by default in history, and keyboard shortcuts also provide for faster administration and configuration. Also, remember what the carrot is used for within the CLI—displaying the location of the error within the syntax.
Certification Summary
261
CERTIFICATION SUMMARY Cisco devices use the configuration register (set using the config-register command) and the boot system command to determine boot order, much like the BIOS settings on a PC. Random access memory (RAM) holds the runningconfig and is volatile in nature, clearing as soon as the device is rebooted or loses power. Flash memory is a permanent storage location, on a chip or removable card, used to store operating system images. Read-only memory (ROM) is another permanent memory location within the switch or router that holds a bootstrap program. Non-volatile RAM (NVRAM) is another permanent storage location within the device and holds the startup-config file. If the startup-config file does not exist, the IOS will load a file called setup, which runs a step-by-step setup program for the administrator. ROMMON is a barebones basic operating system kept in ROM memory that can be used if Flash is corrupted. Administrators can manipulate the configuration register setting to boot into this operating system for repair purposes, or during password recovery. To boot into ROMMON, the configuration register setting must have a boot field of “0”. The IOS recognizes inputs, provides output, keeps track of peripheral devices and bus settings, and provides the framework for security and management configuration settings. Each portion of the name for each new version of the Cisco IOS signifies specific information: hardware platform, feature set, file format, and version. The command show version can be used to check the version number your router is using, and displays information about the IOS version number, bootstrap version number, system uptime, reason and time for the last reload of the IOS, and the source of the current IOS. This command output also displays information about the amount of RAM, the interfaces available, and the amount of NVRAM and Flash memory available, as well as the configuration register setting. Backup IOS and configuration files are stored offline using the copy source destination command and, usually, TFTP. Cisco devices contain two configuration files: the startup configuration and the running configuration. The startup-config is the configuration the device pulls from NVRAM at boot. All configuration information placed into the startup-config remains, even when the router or switch loses power. The running-config actively runs in RAM. Any changes to the running-config go into effect the moment the administrator makes the change. To ensure the changes remain after power off, use copy running-configuration startup-configuration. Configuration files can be accessed locally or remotely, and using command-line or web-based methods. Connecting directly to the console port on the router or
262
Chapter 8:
Interfacing with Cisco Devices
switch requires a rollover cable, a DB-9 connector affixed to a computer’s serial port and the console port on the switch or router, and a terminal emulator program. The default console settings on a switch or router are 9600 bits/second, No hardware flow control, 8-bit ASCII, No stop bits, and 1 parity bit. A telnet or SSH session between the administrator’s PC and the router or switch provides the same functionality as a console connection. Telnet runs over port 23 and sends all information in clear text, while SSH uses port 22 and encrypts the session. SDM is used for web-based router access and configuration. The CLI is divided into three main modes: User, Privileged, and Configuration. User mode allows only basic commands (only viewing settings) and its prompt is a “>”. Privileged mode—aka Enable mode—offers many additional options to the user, and is accessed when the user types in the command enable. The prompt for Enable mode changes to a “#” sign. A user in Privileged mode can view system information, restart the system, or enter Configuration mode. To leave Privileged mode and go back to User mode, the command to use is disable. Configuration mode, also known as Global Configuration mode, allows users to modify the running configuration files on the device and is accessed with the command configure terminal. Users start in Global Configuration mode, and commands here affect the entire device. From Global Configuration, the user can enter other submodes for a specific configuration. The prompt always appears as the name of the device, followed by a word in parentheses with a pound sign at the end. The word in parentheses refers to the area on the device that is actually being configured. In Global mode, the word is simply config. In Interface mode, the word changes to config-if. In Line mode, it appears as config-line. To exit out of a submode back to Global Configuration mode, type the command exit. You can use several exit commands until you reach Privileged mode, or simply issue the command end or use the keystroke combination CTRL-Z to exit Configuration mode altogether. Typing a question mark from anywhere within the CLI displays every command, or command parameter, available from that particular mode and prompt. Eliminating the need to remember the full syntax of most commands, auto complete allows administrators to use truncated versions of commands, instead of requiring the full command to be entered. If you are unsure of the proper syntax on a particular command, simply type in the first portion of the command and press the TAB key. The CLI also stores recently entered commands into a history buffer, for quick recall and use. By default, the history buffer stores ten commands. Lastly, the CLI provides several keyboard shortcuts. Keyboard shortcuts really work in conjunction with the history buffer, and should be memorized for the exam.
Two-Minute Drill
✓
263
TWO-MINUTE DRILL The IOS and Configuration Files ❑ The configuration register and the boot system command control the boot
sequence for Cisco devices much like the BIOS does on computers. ❑ ROM holds the bootstrap program and the ROMMON basic OS. It is the
first memory area touched at bootup. ROMMON is only used when Flash memory is corrupted, the IOS files themselves are corrupted, or the administrator purposely changes the configuration register (for password reset). ❑ Flash memory, accessed second in the boot order, is permanent and holds the
IOS, while NVRAM is permanent and contains the startup configuration file. RAM is volatile in nature and holds the running configuration. ❑ The show version command displays the version number of the IOS
running on the device. It also displays the system uptime, the reasons for the last reload, the source of the current IOS, the amount of NVRAM and Flash memory, and the configuration register setting. ❑ To copy IOS and/or configuration files, use the command copy source destination. The source or destination can be the name of a file (running
configuration or startup configuration, for instance), a memory location (such as Flash), or an external storage server (TFTP). When using TFTP, the name syntax must be entered exactly. ❑ The show flash command displays all files located in Flash, as well as
available memory. ❑ All changes to the configuration on a Cisco device are made, in real time, to
the running configuration. To make changes permanent, the running configuration must be stored in NVRAM by issuing the command copy running-config startup-config. ❑ Access methods include local, via the console, and remote, via telnet, SSH,
or SDM. Console access requires a rollover cable, DB-9 connector, and a serial port on a system. A terminal emulator program can then be run to enter configuration commands. The communication parameters for this connection are 9600 bits per second (baud), No hardware flow control, 8-bit ASCII, No stop bits, and 1 parity bit.
264
Chapter 8:
Interfacing with Cisco Devices
❑ Telnet remote access is simple and runs over port 23, sending everything in
clear text. If security is a concern, SSH, running on port 22, encrypts the session. SDM is used to connect using a web browser.
The CLI ❑ The CLI has three main modes: User, Privileged, and Configuration. The
command to enter Privileged mode (aka EXEC mode) from the User mode is enable. Entering Privileged mode changes the prompt from a “>” to a “#”. To leave Privileged mode, use disable or exit. ❑ Enter Configuration mode from Privileged mode using the command configure terminal. Configuration starts in Global Configuration mode
and has several submodes. Each mode—Global, Interface, or Line—is identified by the prompt: (config) indicates Global, (config-if) indicates Interface, and (config-line) is Line. To exit any submode back to Global Configuration mode, use the command exit. CTRL-Z or the end command exits out of Configuration mode altogether. ❑ Help features within the CLI include the question mark (?), the autocom-
plete function (TAB), command history, shortcut keys, and error indicators. ❑ Entering a ? anywhere in the CLI displays all command or parameter possibil-
ities from that point. Prefacing the ? with a letter or series of letters displays all options beginning with the letter(s). ❑ Auto complete lets you truncate commands when configuring the device.
You need only provide enough characters to uniquely identify the command or parameter from other options. ❑ The TAB key automatically completes the remainder of the command syntax
when pressed. ❑ Ten commands are kept by default in the history buffer. History is accessed
by using the arrow keys (up and down keys scroll through the history). Other shortcut keys let administrators move through commands swiftly.
Self Test
265
SELF TEST The following Self Test questions will help you measure your understanding of the material presented in this chapter. Read all the choices carefully since there may be more than one correct answer. Choose all the correct answers for each question.
The IOS and Configuration Files 1. Cisco routers and switches use two configuration files. Where is the configuration file used at device bootup stored? A. RAM B. ROM C. Flash D. NVRAM 2. While configuring a Cisco router, you decide you want the device to boot from ROMMON, ignoring any IOS images in Flash memory. Which configuration register should be used? A. 2100 B. 2101 C. 2102 D. 2103 3. The configuration register on your switch is set to 0x2102, and you want the system to boot from the IOS image c2900-ipbase-mz.124-1c.bin stored on the TFTP server located at 172.17.5.5. Which boot system command should you use? A. boot system tftp 172.17.5.5 B. boot system c2900-ipbase-mz.124-1c.bin tftp 172.17.5.5 C. boot system tftp c2900-ipbase-mz.124-1c.bin 172.17.5.5 D. None of the above. The config register 2102 does not allow the use of boot system commands. 4. If a router does not have a startup configuration stored in NVRAM, what happens when it is booted? A. The system boots into ROMMON. B. The system boots directly into Privileged mode. C. The system boots into Setup mode, prompting the user for basic configuration information. D. Nothing. Without a startup configuration, the boot process cannot occur.
266
Chapter 8:
Interfacing with Cisco Devices
5. After configuring a switch and saving the configuration to startup-config, the administrator discovers an error has been made in the configuration. Which of the following command entries removes the saved configuration and boots the switch into Setup mode? A. erase nvram, followed by reload B. delete nvram, followed by reload C. erase startup-config, followed by restart D. delete startup-config, followed by restart 6. Which command displays the version number and filename of the IOS image running on the device? A. show running-config B. show startup-config C. show ios D. show version 7. Which command is used to create an offline backup copy of the IOS image named c2801ipbase-mz.124-1c.bin? A. copy c2801-ipbase-mz.124-1c.bin tftp B. copy tftp c2801-ipbase-mz.124-1c.bin C. copy tftp flash D. copy flash tftp 8. You have a laptop with a free serial port. Which of the following is/are necessary to establish a connection to the console port on a Cisco device? A. A terminal emulator application B. A straight-through cable C. A crossover cable D. A rollover cable E. A DB-9 connector 9. Which of the following is true regarding remote configuration access methods to a Cisco device? A. Telnet, using port 22, requires a login and is a secure access method. B. Telnet, using port 23, requires a login and is a secure access method. C. SSH, using port 23, encrypts all communication. D. SSH, using port 22, encrypts all communication.
Self Test
267
10. The current configuration on a router has an access list with the number 101 and no banner. You create a new empty configuration on a TFTP server, with only the banner command configured. A copy tftp run command is issued at the router. Which of the following correctly describes the outcome? A. Since the new configuration file is empty except for the banner command, the copy command will not function. B. Since the new configuration file is empty except for the banner command, the copy command will function, but the router will no longer function: its configuration file will be replaced with the empty one. C. The new configuration file will be merged with the current running configuration. The access list will be removed and the banner command will be added. D. The new configuration file will be merged with the current running configuration. The access list will remain and the banner command will be added.
The CLI 11. Which CLI modes let you use the show running-config command? A. User B. Privileged C. Global Configuration D. Setup E. All of the above 12. A network trainee asks for your assistance in configuring a switch. The prompt displayed is RTR1(config-line)# and the trainee wishes to return to Privileged mode. Which of the following actions would return the session to Privileged mode? A. Using keystroke combination ESC-Z B. Using keystroke combination CTRL-Z C. Typing exit and pressing ENTER D. Typing end and pressing ENTER 13. How many commands are held in the history buffer on a Cisco device by default? A. 10. B. 20. C. An unlimited number. The history buffer holds all configuration commands entered until a power cycle of the device. D. None. History must be enabled before storing commands.
268
Chapter 8:
Interfacing with Cisco Devices
14. An administrator is configuring a Cisco device and has pressed the up arrow three times, moving backward through the command history buffer. Which keystroke entry can be pressed to move forward in the buffer? A. Left arrow B. Down arrow C. CTRL-B D. CTRL-N 15. Which of the following commands copies the current configuration to the startup configuration? A. copy running-config startup-config B. copy running-config nvram C. copy run start D. copy system:running-config nvram:startup-config E. All of the above
Self Test Answers
269
SELF TEST ANSWERS The IOS and Configuration Files ✓ D. The startup configuration is used during the device bootup process and is stored in 1. ® NVRAM—a non-volatile storage location retaining all information after power off. ® ˚ A. RAM is volatile and is used to store the running configuration. B. ROM holds a bootstrap program and the ROMMON basic operating system. C. Flash memory holds a copy of the IOS. ✓ A. The config-register command is used to set the configuration register on a Cisco 2. ® device. If the configuration register is set to 0x2100, the system ignores Flash and boots directly into ROMMON. ® ˚ B. If the configuration register is set to 2101, the system boots the first IOS image found in Flash. C and D. If the configuration register is set to 2102 or higher, the system uses the boot system commands to determine where to boot. ✓ C. The correct syntax for this scenario is boot system tftp c2900-ipbase3. ® mz.124-1c.bin 172.17.5.5. ® ˚ A and B. These answers do not match the correct syntax. D. This is a false statement—the 2102 configuration register does allow for this operation. ✓ C. Setup mode prompts administrators, step by step, for basic configuration settings when 4. ® a startup configuration file cannot be found. ® ˚ A. The router will only boot into ROMMON when the IOS is corrupt or the configuration register is set to 2100—the presence of a startup configuration file is irrelevant to this process. B. A Cisco device never boots directly into Privileged mode. D. This is a false statement. ✓ A. erase nvram removes the startup-config file, while reload reboots the system. 5. ® ® ˚ B. delete nvram is not a CLI command. C and D. restart is not a CLI command. ✓ D. show version displays the version number, filename, amount of memory remaining 6. ® in NVRAM and RAM, the uptime, and the reason for the last reload. ® ˚ A, B, and C. These commands are not correct. ✓ D. The proper syntax for the copy command is copy source destination. The 7. ® command copy flash tftp immediately prompts the user for the TFTP server address and the name of the file to be copied. ® ˚ A, B, and C. The syntax of these commands is incorrect. ✓ A, D, and E. To use the console port, attach the DB-9 connector to the serial port of the 8. ® laptop, and then connect a rollover cable between the console port and the DB-9 connector. A terminal emulator application is needed to send configuration commands. ® ˚ B and C. These are the wrong cable types.
270
Chapter 8:
Interfacing with Cisco Devices
✓ D. SSH uses port 22 and encrypts the communication session. 9. ® ® ˚ A. Telnet does not use port 22. B. Telnet uses port 23, but is not considered a secure access method since all data is transmitted in clear text. C. SSH does not use port 23. ✓ D. Copying a configuration into RAM always results in a merge. Commands appearing in 10. ® the current configuration, but not in the new file, will remain. Commands appearing in the new file but not in the current configuration will be added. If a command appears in both, the new file command is the one chosen. ® ˚ A and B. Both these answers assume the running configuration is replaced by the new file. Copying into RAM merges files; it doesn’t replace them. C. When merging files, the new file does not remove commands that already exist in the current configuration.
The CLI ✓ A and B. You can run the show running-config command in both User and 11. ® Privileged (Enable) modes. ® ˚ C and D. The show running-config command is not available in these modes. E. This choice is incorrect. ✓ B and D. Both CTRL-Z and end break out of Configuration mode altogether. 12. ® ® ˚ A. ESC-Z is not a correct keystroke combination. C. Typing exit would only bring the user back one level—to Global Configuration mode. ✓ A. History holds ten commands in the buffer by default. 13. ® ® ˚ B. This is an incorrect number. C and D. These are false statements. ✓ B and D. Both the down arrow and CTRL-N will move you forward in the command history. 14. ® ® ˚ A and C. Neither command choice is correct. ✓ E. All of the commands will result in the running configuration being copied to the startup 15. ® configuration. ® ˚ A, B, C, and D. All are correct choices; therefore, “All of the above” is the correct option.
9 Cisco Switch Configuration
CERTIFICATION OBJECTIVES 9.01
About Cisco Switches
9.02
Initial Configuration
9.03
Securing the Configuration
9.04
✓ Q&A
Copyright © 2008 by The McGraw-Hill Companies. Click here for terms of use.
Interface Configuration Two-Minute Drill Self Test
272
Chapter 9:
Cisco Switch Configuration
I
know what you’re thinking, and it comes down to one small word: finally. Finally, after all the theory, all the background, all the endless discussion, acronyms, terms, tables, and figures, we’ve finally arrived at something a little more hands-on: a section that’s just a little more…tactile in nature. Yes, my friend, you’ve earned your way to where the rubber meets the proverbial road. You know what the network is, how it works, and what data packets look and act like during an information exchange. So, in this section, you finally get the chance to apply that knowledge and learn how to configure Cisco’s layer-2 device. This section is all about configuring the Cisco switch within a small standard network. We’ll start by discussing some basics on Cisco switches themselves, followed by a discussion about setup and initial configuration steps. We then wrap up the chapter by covering various troubleshooting methods and techniques to verify configuration operation and repair problems. This chapter is, of course, aimed at pointing out the important aspects of the configuration for your test, but it can also hopefully be used as a good guide for configuring your switches in a production environment.
CERTIFICATION OBJECTIVE 9.01
About Cisco Switches Believe it or not, Cisco is not the only company on the planet making switches! Ready for another shocker? Cisco makes more than one brand of switch as well! Obviously, since the CCENT is a Cisco-oriented exam, it would behoove you to know a little about the Cisco product line and some basics on differentiating between the various brands and usage. This section isn’t intended to turn you into a Cisco salesperson, but it will provide the basics for any exam question you may encounter on this test, and might even help you in future decisions as a network administrator.
Models Cisco has two major brands of switches, and several models within each brand. The first brand, Linksys, was designed mainly for home use. This is not to say Linksys switches cannot, will not, or should not be found on business networks—more
About Cisco Switches
273
than likely you will see one or two on a business network from time to time. Linksys switches forward traffic and provide the same bandwidth and performance benefits of any switch. However, Linksys switches were designed for a home user to simply open, plug in, and turn on. They were designed to handle a smaller network load and are, relatively speaking, a little easier to configure, but may not have all the features that other Cisco switches do. While it is important to know of Linksys switches and their usage, the CCENT exam does not cover their configuration. Considering that Linksys holds a remarkable 40 percent market share in the home wireless market, you’ve more than likely seen a blue-bordered Linksys device in someone’s home. Linksys switches are great devices and work well. Their configuration is simple, and they can be managed by a GUI interface and displayed and accessed through a simple web browser, much like SDM and CDM. If you see one on your business network, or hear someone asking to use one, don’t panic. It may turn out to be a good decision! The Catalyst brand, on the other hand, was created for larger enterprise-type networks. Catalyst switches provide a wide variety of functions available to the administrator, and come in a huge array of sizes and shapes, with each model having a series number assigned to it. The particular Catalyst switch you decide to purchase depends on both your needs and your pocketbook, and obviously each model may contain specific hardware and configuration options that simply aren’t available in other models. Generally speaking, the lower series numbers (such as 2960 and 3750) are used as access layer switches, while higher numbers (such as 4500 and 6500) move up into the distribution and core layers. You’ll probably recognize access layer switches easily, but larger, more complex switches may have a variety of large card slots for scalability and multiple interface types. The configuration examples used throughout this chapter are created on a Cisco Catalyst 2960 switch; however, they apply to any switch in the Catalyst family. For example, the numbering scheme used to configure a specific interface on a 2960 works the same on other Catalyst models. Interfaces on Catalyst switches are numbered x/y, with x being the card number and y being the individual interface on that card. The numbering always starts with 0 and increments from top to bottom for cards and from left to right for interfaces. A 2960 access switch only has one “card” of interfaces and, therefore, will always start interface numbering 0/y. From left to right on the switch, the first port would be numbered 0/1, the second 0/2, and so on.
274
Chapter 9:
Cisco Switch Configuration
If you ever get a chance to work with the higher-end switches, the numbering scheme can get even more confusing. Not only does the interface have a card and interface number on these larger switches, it can also have a sub-card number.The 8540 switch, for example, has around 13 card slots. Each card slot can contain a single line of interfaces, or can be broken up into sub-cards. In this instance, the numbering scheme would be x/s/y, where s would be the sub-card number. For instance, if you were looking (left to right) at the third interface on the second sub-card found on the third card (from the top), the interface number would be 2/1/2—the first 2 corresponds to the third card from the top, the 1 corresponds to the second sub-card, and the last 2 corresponds to the third interface on the sub-card.
Physical Characteristics The physical attributes of Linksys and Catalyst switches can vary widely. Linksys switches are generally smaller and have a blue border around them, while Catalyst switches are larger and provide a wider variety of interfaces, or ports, on the device. Since Catalyst switches are covered on the exam, we’ll focus our attention on their physical characteristics. The face of a Catalyst switch holds the same LEDs and features as those covered in Chapter 4. A Catalyst switch face holds a mode button and five system diagnostic LEDs (SYST, RPS, STAT, DUPLX, and SPEED), but no power on button. To turn the switch on or off, simply plug in the electrical cord or remove it. The switch face also contains connection interface ports for use in connecting to PCs, and may contain one or more uplink interfaces. The uplink interfaces can be the same duplex and speed as the connection interfaces, or a completely different physical uplink altogether. For example, on one switch the connection interfaces might be standard RJ45 10- to 100-Mbps ports, with an RJ45 uplink port capable of up to gigabit speeds. On another switch, the uplink port might even be an SC or ST fiber connector. The configuration and layout of the uplink ports and connection interfaces can vary greatly and depend on the model of Catalyst switch purchased. Lastly, each interface on the front of the switch has an individual LED, and each bank of interfaces has a label. The interface LED (off, green, or amber) indicates the status of the port itself (the meaning of each setting is listed in Table 5-2 in Chapter 5). The label indicates the speed at which the ports can be run. A label of 10/100, for example, signifies that the ports can run at 10baseT or 100baseTX Ethernet. A label of 10/100/1000 indicates the port can go up to gigabit speeds.
Initial Configuration
275
Cisco actually supports two operating systems for its switches: the IOS and the Catalyst Operating System.The IOS is the most familiar and can be found on almost every switch you encounter in day-to-day operations.The Catalyst Operating System, also known as Cat OS, is still made available on some of the higher-end switches, but is not covered on the exam.Two terms associated with this are hybrid and native. A hybrid switch supports both operating systems, while a native switch is an IOS-only device.
CERTIFICATION OBJECTIVE 9.02
Initial Configuration If you take a Catalyst switch out of the box, plug in the electrical cord, and connect systems to interfaces, it will work just fine. Catalyst switches have enough of a default configuration already installed to allow basic switching logic to perform without any intervention on the part of the administrator. Frames will be passed, the CAM table will be built, collision domains will be split, and 100 percent of bandwidth will be made available to each system directly connected. However, the default configuration settings do not account for other features commonly needed in a business network. VLANs, individual port settings, and security are all examples of configuration entries an administrator may wish for the switch. This section covers the configuration of the 2960 access layer switch in a typical business environment—from the initial steps through the more “advanced” settings an administrator may require.
Configuration questions may come in the form of multiple choice, or as part of a simulation. Pay very close
attention to the exact syntax of each command since the help functions may not be available on simulation questions.
The first step in configuring the switch is, obviously, accessing the CLI. In Chapter 8, we covered the various methods for connecting to a Cisco device for management purposes. Right out of the box, the only way to enter the CLI on a switch is to connect via the console port on the rear of the device, using the DB-9
276
Chapter 9:
Cisco Switch Configuration
connector, a rollover cable, the serial port on a computer, and some form of terminal emulator (such as HyperTerminal). After the physical connection is made, and the steps covered in Chapter 8 have been followed, the switch can be powered on.
Using the System Configuration Dialog As discussed previously, when no configuration file exists in NVRAM, the switch defaults to the System Configuration dialog, also known as Setup mode. Setup mode only allows for basic configuration settings and, for the most part, is not used by the majority of administrators. However, since it is addressed on the exam and many newer administrators use it for familiarity purposes, it warrants some discussion here. When the switch powers up, a variety of information is displayed. As the operating system loads, a series of #’s will display across the screen, followed by the name of the IOS file loaded into memory. Afterward, the IOS version is displayed, as well as information gathered from POST (Base Ethernet MAC address, part numbers, model numbers, and serial numbers). Finally, a prompt appears, asking if you would like to enter setup. Answering “yes” puts you into Setup mode (a “no” provides a User mode prompt): Would you like to enter the initial configuration dialog? [yes/ no]: yes At any point you may enter a question mark '?' for help. Use ctrl-c to abort configuration dialog at any prompt. Default settings are in square brackets '[]'. Basic management setup configures only enough connectivity for management of the system, extended setup will ask you to configure each interface on the system Would you like to enter basic management setup? [yes/no]:
At this point, the system is in setup mode; however, two different methods can be used for setup. In the first, Basic management setup, the system only prompts for the most basic of settings. In the second, Extended setup mode, the system will also prompt for the setting on each individual port. The only difference between the two options is that extended setup provides individualized interface configuration, while basic does not. Answering “yes” to the question provides the following output: Configuring global parameters: Enter host name [Switch]: SW1 /// Notice by default, the name is 'Switch' /// The enable secret is a password used to protect access to privileged EXEC and configuration modes. This password, after
Initial Configuration
277
entered, becomes encrypted in the configuration. Enter enable secret: CCENT The enable password is used when you do not specify an enable secret password, with some older software versions, and some boot images. Enter enable password: Cisco The virtual terminal password is used to protect access to the router over a network interface. Enter virtual terminal password: CCENT Configure SNMP Network Management? [no]: Current Interface Summary Any interface listed with OK? Value 'NO' does not have a valid configuration Interface IP Address OK? Method Status Protocol Vlan1 unassigned NO unset up up FastEthernet0/1 unassigned YES unset up up <<<< Output Truncated >>>>
Remember, you can enter Setup mode in two ways: first, if there is no configuration in NVRAM (startup configuration), and second, you can enter Setup mode at any time by entering the
command setup in Privileged mode. Within Setup, remember that default entries are surrounded by brackets, and extended setup provides configuration options for each interface, while basic does not.
In the preceding example, the hostname of the device was changed from the default (Switch) to SW1. Notice that settings providing a default require only a single press of the ENTER key. Other options set include a few passwords, and an opportunity to enable SNMP settings. A summary of the interfaces is then displayed, followed by three options: [0] Go to the IOS command prompt without saving this config. [1] Return back to the setup without saving this config. [2] Save this configuration to nvram and exit. Enter your selection [2]:
By default, pressing ENTER will result in the new configuration being saved. Entering a 0 dumps the configuration and provides a command prompt. An entry of 1 simply starts setup all over again.
278
Chapter 9:
Cisco Switch Configuration
Sometimes, for a fresh start on a switch, administrators will erase the startup configuration (using the erase startup-config command) and use the reload command to reboot the system. When doing so, the switch IOS will sometimes prompt you with a message stating, “System configuration has changed. Save?(yes/no)” Choosing “yes” copies the running configuration back into NVRAM as startup-config before rebooting. If your intent is to clear the configuration altogether, make sure you choose “no.” CertCam
A multimedia demonstration on the System Configuration Dialogue can be found on the CD accompanying this book.
Basic Configuration Options While the System Configuration dialog is a perfectly acceptable way to configure basic settings on a switch, it’s not the preferred method for configuration. More often than not, switches used in a production environment require more than just the basics. Therefore, since these settings must be made from the command line anyway, most administrators skip setup altogether and go directly to the command line. During a typical configuration, administrators will assign a hostname, create banners, apply security settings, configure access methods, and configure interfaces.
Hostnames and Banners Hostnames and banners are two of the basic settings administrators start out with. The hostname is simply a name that can be used to identify the switch within the prompt and is assigned, amazingly enough, using the hostname name command, where “name” is the hostname you wish to use for the device. Three types of banners can be configured: Message Of The Day (MOTD), Login, and Exec. The MOTD banner is shown before login, and is typically used for temporary messages of importance. The Login banner is displayed before every login as well, immediately following the MOTD. Its main purpose is to show permanent messages (such as “Unauthorized Access is Prohibited”). Finally, the Exec banner displays after login, and is intended for messages that should not be shared with unauthorized users. To configure a banner, use the command banner type delimiter <ENTER> message delimiter <ENTER>. The type parameter indicates MOTD, Exec, or Login (MOTD is the default entry). The delimiter is any character chosen to begin and end the message entry. An example of the hostname and banner commands in a basic configuration is shown next: Switch>enable Switch#configure terminal Switch (config)# hostname CCENTSwitch CCENTSwitch (config)# banner #
Initial Configuration
279
Enter TEXT message. End with character '#'. Welcome to CCENT Switch! Please prepare to login.. # CCENTSwitch (config)# banner login # Enter TEXT message. End with character '#'. Warning! Unauthorized Access is Prohibited! # CCENTSwitch (config)# banner exec 7 Enter TEXT message. End with character '7'. Greetings, authorized user! Remember to phone notify (555-1234) all configuration changes 7 CCENTSwitch (config)# end
Some items of interest from the previous code listing include the prompt and the banner command usage. Notice the prompt changes immediately as soon as the hostname command was issued. The first banner command did not make use of a type parameter and, therefore, defaulted to the MOTD. The banner exec 7 example at the end shows that you can use any character as a delimiter (in this case, a 7). A user logging in to this switch would see the MOTD first, followed by the login banner. After entering Exec mode, the last banner would be displayed, as shown next: CCENTSwitch con0 is now available Press RETURN to get started. Welcome to the CCENTSwitch! Please prepare to login.. Warning! Unauthorized Access is Prohibited! CCENTSwitch>enable Password: Greetings, authorized user! Remember to phone notify (555-1234) all configuration changes
Notice how the prompt changed from Switch to CCENTSwitch instantly? This is an important point for two reasons: first, you’ll need to know what the prompt will look like after entering a hostname command, and second, it demonstrates that configuration changes go into effect (on the running-config) immediately. Also, remember that, by default, the banner command sets the
MOTD and other banner types, and the delimiter can be any character you choose. Lastly, keep in mind that as soon as the delimiter character appears in the message, the banner stops. Questions on the exam will attempt to confuse you with delimiter use, throwing in characters you might not associate with a delimiter, like a period. Additionally, pay attention to the order in which the banners are displayed.
280
Chapter 9:
Cisco Switch Configuration
History and Logging Synchronous Two optional, yet common, configuration commands during the initial stages are history size and logging synchronous. As discussed in Chapter 8, the history buffer holds previous commands for recall, using the arrow keys or other keystroke combinations. By default, the buffer saves ten commands, and the contents of the entire buffer can be viewed using the show history command. The buffer size can be changed using the history size x command, where x is the size of the buffer. It’s important to note that this command is assigned on either the console or telnet/SSH line within the CLI. In other words, a user connecting over telnet would have the history buffer that was assigned to the telnet lines, while a user connecting over the console might have an entirely separate buffer size. If an administrator wants a different buffer size during a specific session, the Privileged mode command terminal history size x will set the buffer size for that single session only. For example, if the global command history size 15 was entered on the console, the buffer would save the last 15 commands for recall. If an administrator wanted to move that up to 20, he could enter the terminal history size 20 command and, during that session, would be able to recall the last 20 commands. The logging synchronous command is used for convenience and clarity’s sake. During any session over the console, all syslog messages are displayed in real time. In other words, sometimes right in the middle of typing in a command a syslog message might appear. For example, in Figure 9-1, the history size command was used to change the buffer to 15 for console connections. After pressing CTRL-Z to end the configuration, the user attempted to type show running-config. Notice the FIGURE 9-1
Console syslog messages
A Syslog message interrupts the show running-config command
Securing the Configuration
281
syslog message, notifying that the configuration has been changed from the console, displays right in the middle of the command. By default, syslog messages aren’t displayed on remote connections (telnet). If you wish to be bothered by these messages during a session, you’ll need to enter the terminal monitor and logging on commands. Obviously, this can be very confusing—not to mention aggravating—especially during long syntax-heavy command entries. To avoid this, the logging synchronous command can be entered on the console line to prevent syslog messages from displaying until they are called for. An example of the history and logging synchronous commands is shown next. Note that the auto complete help function is used for both the configure terminal and line console 0 commands. Switch#conf t Enter configuration commands, one per line. Switch(config)#line con 0 Switch(config-line)#history size 25 Switch(config-line)#logging synchronous
Be very familiar with the difference between the history size and terminal history size commands, as well as where they are applied—in Line Configuration mode, not Global Configuration mode. Additionally,
CertCam
End with CNTL/Z.
remember to view the entire contents of the buffer by using the command show history. Lastly, be sure to understand the usage of logging synchronous and its effect on syslog messages.
A multimedia demonstration on basic switch commands can be found on the CD accompanying this book.
CERTIFICATION OBJECTIVE 9.03
Securing the Configuration During an initial configuration, one of the most important steps is securing the settings. In modern networking, security is not an afterthought to be applied later, but a concern from the get-go, requiring attention and dedication. Common configuration
282
Chapter 9:
Cisco Switch Configuration
options for security include passwords, setting access method parameters, and interface security settings.
Passwords A variety of passwords must be configured during a CLI session. Usernames and passwords can be created to guard general access to the device. Passwords can also be applied to protect Privileged mode access, regardless of the access method (console, telnet, or SSH), using the enable and enable secret passwords. Additionally, passwords can be assigned to protect each individual access line as well. Regardless of the password assigned, it’s important to note that passwords and authentication only work if a login is required in the first place. This may seem like an obvious statement—and it is—but there are instances where its applicability makes perfect sense, and the combination of requiring a login and setting a password become frustrating. For example, to require a login on any line, the command login is issued on that line’s configuration prompt. However, if you configure the line to force a login, but do not specify a password, users attempting to log in will receive an error message stating, “Password required, but none set.” On the other hand, assigning a password, using the password command, but not requiring a login is a waste of character space and typing—for obvious reasons.
Pay close attention to the login and login local settings on questions and simulations on the exam.The login command requires that a password be set, and uses the password defined on the line configuration prompt.The login
local command uses the username/ password pairs defined elsewhere in the global configuration. Lastly, the presence— or absence—of login can be the answer you’re looking for!
Finally, the login command can be applied in two ways. First, it can mean, “Use the password assigned specifically to this line, as defined in the configuration.” In this instance, the password assigned to the line applies for every connection made on that line, no matter which user attempts to connect. In other words, there is one password, known by all users, allowing access to the devices. The second method involves the command login local, which means, “Before granting access, use the username and password pairs defined elsewhere in the configuration.” In this instance, a unique username and password pair is defined for each user. Connecting to the line, the user would have to provide a username and password matching the
Securing the Configuration
283
pair in order to proceed. Additionally, various permissions can be assigned to each of these usernames, providing granularity of access for security-minded administrators. If the decision is made to add usernames and passwords, users accessing the device would first be required to authenticate before even receiving a User mode prompt. To create a username and password, issue the command username name password password. For example, the command username CCENT_User1 password Cisco would create a username of CCENT_User1 with a password of Cisco. To force the use of local username and password combinations for authentication, enter the command login local on the line. For example, the following code requires that the person attempting to connect to the device over the console to know the username is Bob, with a password of Cisco, while those connecting via telnet would simply need to know the password Telnet. Switch# configure terminal Enter configuration commands, one per line. Switch(config)# username Bob password Cisco Switch(config)# line console 0 Switch(config-line)# login local Switch(config-line)# line vty 0 4 Switch(config-line)# password Telnet Switch(config-line)# login
End with CNTL/Z.
After closing the session in the console and reconnecting, you can see the username and password being enforced: User Access Verification Username: Bob Password: Switch>
After protecting access to the device by assigning passwords to individual access lines, two other passwords can be used to protect the CLI itself. Both Enable mode passwords force a user to cite a password to move from User mode to Privileged mode (aka, Enable mode). The first is known as the enable password, and is set using the Global Configuration command enable password password. The second is known as the enable secret and is set using the Global Configuration command enable secret password. As always, to remove either command from the configuration, you simply use the “no” version of each: no enable password or no enable secret. Either can be used to protect Privileged mode access; however, the enable secret is a considerably better choice. Note: You can assign an unencrypted version of the enable secret by adding the “0” parameter before the password (enable secret 0 password). By default, the parameter is set to 5 (for MD5 hash). A “0” setting tells the switch not to run a hash on the password.
284
Chapter 9:
Cisco Switch Configuration
Security-wise, cracking the passwords on a Cisco device is not very difficult, and there are several freely downloadable tools to help do just that. On the job, it’s much more important to control access to the configuration in the first place. We’re not saying you should forgo passwords; just don’t rely on them alone for security. Protect the switch with good physical security, and assign strong console and SSH connection options. Otherwise, you might as well e-mail the passwords to a bulletin board. The simple enable password is displayed in the configuration as a clear-text string. The enable secret, however, is stored in the configuration as a hidden MD5 hash. Obviously, this provides additional security by hiding the actual password from observers of the configuration file. It’s important to note that the password is not actually encrypted. Rather, the switch performs a mathematical function (the MD5 hash) on the password and stores the result in the configuration file. Additionally, if both the enable password and enable secret are entered into the configuration, the switch will always use the enable secret. For these reasons, most administrators forgo the enable password command, using only enable secret. All passwords—with the notable exception of the enable secret—are displayed in the configuration in clear text. You can choose to hide the passwords from plain sight by issuing the Global Configuration command service passwordencryption. This command will deter casual snooping of the passwords, but it is a very weak encryption and is easily breakable. If you issue the service password-encryption command, all passwords are immediately encrypted, and displayed as such within the configuration. If you issue a no service password-encryption command, the passwords will still be displayed in their encrypted form. However, once you change a password, the clear text version will appear.
Be very familiar with all aspects of passwords: how they are set and enforced, how they appear within a configuration (both before and after a service password-encryption
CertCam
command), and how they are encrypted (or hashed). Pay particular attention to the interplay between the enable password and enable secret, as well as the difference between login and login local.
A multimedia demonstration on basic CLI security steps can be found on the CD accompanying this book.
Securing the Configuration
285
exec-timeout Passwords and good physical security work well for securing access methods; however, regardless of whether the session is established locally over the console or remotely using telnet, an additional thought regarding passwords and access should come to mind: An inactive session should not be left open indefinitely. By default, an inactive open session disconnects automatically after five minutes. This can be changed using the exec-timeout x y command, where x is the number of minutes and y is the number of seconds. Entering the command exec-timeout 0 0 ensures that the switch will never time out the session, regardless of activity. Oftentimes, security and usability are at opposite ends of the spectrum, and the exec-timeout command is no exception. Administrators don’t like their sessions timing out on them while they’re troubleshooting or configuring, and will configure the exec-timeout 0 0 command to prevent just that. However, it’s a horrible security practice. If you see it in your configuration, replace the command with something a little more stringent.
EXERCISE 9-1 Basic Switch Configuration This exercise demonstrates the steps an administrator would take during an initial, basic configuration on a Catalyst 2960 switch. You’ll perform this lab using Boson’s NetSim simulator. This exercise has you configure a Catalyst 2960 switch from scratch. After powering on the device, you’ll skip Setup mode and begin entering configuration commands manually. We’ll configure hostname, banners, and password settings. You can find a picture of the network diagram for Boson’s NetSim simulator in the Introduction of this book. After starting up the simulator, click the LabNavigator button. Next, double-click Exercise 9-1 and then click the Load Lab button. 1. Power on the 2960-1 switch, choose “No” when asked to start Setup, and move to Global Configuration mode. a. At the top of the simulator in the menu bar, click the eSwitches icon and choose 2960-1. b. When the prompt asks you if you’d like to enter the System Configuration dialog, reply “no.” c. At the User prompt, enter Privileged EXEC mode by typing enable. d. Enter Global Configuration mode by typing configure terminal.
286
Chapter 9:
Cisco Switch Configuration
2. Configure the hostname, MOTD, and login banners. a. Enter hostname CCENTSwitch. b. Notice the prompt immediately changes to reflect the new hostname. Type banner MOTD # and press ENTER, and then type This is the Message of the Day! # and press ENTER. c. Type banner login # and press ENTER, and then type This is the login banner! # and press ENTER. 3. Configure the enable password of “Cisco” and an enable secret of “CCENT”. Assign a password (Cisco) to the vty (telnet) lines. Add a username of Bob with a password of CCENT, and force console users to access with the username and password pair. a. Type enable password Cisco and press ENTER, and then type enable secret CCENT and press ENTER. b. Type line vty 0 15 and press ENTER to enter Line Configuration mode on the telnet lines, and then enter the password and login requirements by typing password Cisco and pressing ENTER. c. Type login and press ENTER. d. Type exit and press ENTER to drop back to Global Configuration mode, then enter username Bob password CCENT and press ENTER to create the pair. e. Type line console 0 and press ENTER to enter Line Configuration mode for the console, and then force the use of usernames and passwords by typing login local and pressing ENTER. 4. Exit out of the configuration to verify the entries. a. Type end and press ENTER, or use CTRL-Z to exit back to Privileged mode. b. Type show running-config and then press ENTER. c. Press the SPACEBAR to move through the configuration. Notice the commands you have entered. Also note all passwords displayed in clear text, with the exception of the enable secret. 5. Configure password encryption and verify. a. Type configure terminal and press ENTER to enter Global Configuration mode again. b. Type service password-encryption and press ENTER, and then exit back to Privileged mode using CTRL-Z. c. Type show running-config and press ENTER. d. Press the SPACEBAR to move through the configuration. Notice all passwords are now displayed in encrypted format.
Securing the Configuration
287
6. Save your configuration. a. Type copy run start and press ENTER to save the configuration to NVRAM. b. Accept the default name by pressing ENTER again. c. Verify your saved configuration by typing show startup-config and pressing ENTER. Press the SPACEBAR to move through the configuration.
Configuring SSH Access methods to the switch include local and remote options. As covered earlier, telnet provides a very easy way to access the device remotely, and configuring access is relatively easy using the login and password command. However, telnet sends all information—including the defined username and password—in clear text, presenting an obvious security problem. A better option, should the decision be made to allow remote access in the first place, is to configure and use SSH. SSH runs over port 22 (telnet uses port 23), and encrypts the communications path between both systems. Unlike telnet, which can provide access using only a password, SSH works on a client-server basis, and requires a username and a password. This username and password combination can be stored locally on the switch, or on a separate server—referred to as an Authentication, Authorization, and Accounting (AAA) server. The easiest, and most common, application is configuring local usernames and passwords. Before getting frustrated attempting to install SSH on your production Catalyst switch, keep a couple of things in mind. Remember, SSH support is a feature, like anything else.Therefore, you must ensure your switch (or router) IOS supports it. Check for “k9” or “k8” somewhere in the IOS filename (show version), then check for the filename ending in “.bin” about halfway down the display. Another, perhaps easier, method to check for SSH support is to simply press the question mark (?) at a Global Configuration mode prompt. If the command crypto does not appear, your IOS won’t support SSH. Configuring SSH is fairly simple, but requires setting several configuration options on the switch. First, and obviously, usernames and passwords must be created. Second, the vty lines—those access lines set aside for remote CLI access— must be configured using the login local command and the transport input telnet ssh command. By default, all vty lines accept telnet, and this command is needed to allow SSH access. Optionally, you can omit the telnet parameter, which forces remote sessions to use SSH; telnet connections are no longer accepted.
288
Chapter 9:
Cisco Switch Configuration
The third and fourth steps are necessary for the generation of the SSH public and private keys. SSH uses these keys to encrypt the communications process. Once they are created, the private key stays on the switch while a copy of the public key must be placed on any client device connecting to the switch. To create the keys, a domain name must be created. In the third step, the ip domain-name name.extension (where name is the domain name and extension is the threeletter DNS extension) command defines a DNS domain name for the device. In the fourth step, the crypto key generate rsa command actually creates the public and private keys required for SSH to work (using the hostname and domain name). For example, the following code demonstrates the steps required to set up SSH on a switch, using the domain name of sample.com.
Be very familiar with the steps for setting up SSH.They do not necessarily need to be followed in any particular order (for example, you could create the usernames last), but they must all be completed for SSH to work. Pay close attention to the syntax and use of
the transport input telnet ssh command. Remember that omitting the telnet parameter results in the switch allowing SSH access ONLY—furthering your security. Lastly, be sure to remember how to view your public key.
CCENTSwitch# configure terminal CCENTSwitch (config)# username Bob password Barker CCENTSwitch (config)# username Cindy password Cisco CCENTSwitch (config)# line vty 0 15 CCENTSwitch (config-line)# login local CCENTSwitch (config-line)# transport input telnet ssh CCENTSwitch (config-line)# exit CCENTSwitch (config)# ip domain-name sample.com CCENTSwitch (config)# crypto key generate rsa The name for the keys will be: CCENTSwitch.sample.com Choose the size of the key modulus in the range of 360 to 2048 for your General Purpose Keys. Choosing a key modulus greater than 512 may take a few minutes. How many bits in the modulus [512]: 1024 % Generating 1024 bit RSA keys …[OK] 00:05:14: %SSH-5-ENABLED: SSH 1.99 has been enabled CCENTSwitch (config)# end
Securing the Configuration
289
After SSH is enabled and the keys are created, you can view the public key using the command show crypto key mypubkey rsa. The resulting display will show lines of code that make up the key. Each client connecting to the switch will need a copy of this key; the copy can either be added to the client beforehand or handed out by the switch when the client connects. Several SSH client software packages can be installed on client laptops for using SSH. Putty is a free, and rather popular, application that provides SSH client services.To connect, open Putty (or whatever client you have installed), and connect to the switch, using the IP address or hostname. You’ll be prompted for a username and password. Once logged in, the public key will be delivered and voilà!
EXERCISE 9-2 SSH Configuration This exercise demonstrates the steps an administrator would take to configure SSH access for the switch. You’ll perform this lab using Boson’s NetSim simulator. After powering on the device, you’ll log in using the username and password defined in Exercise 9-1. After entering configuration mode, you’ll add another username and password pair, as well as a domain name for the device. You’ll then force local authentication and SSH access on the vty lines. You can find a picture of the network diagram for Boson’s NetSim simulator in the Introduction of this book. After starting up the simulator, click the LabNavigator button. Next, double-click Exercise 9-1 and then click the Load Lab button. 1. Power on the 2960-1 switch and enter Global Configuration mode. a. At the top of the simulator in the menu bar, click the eSwitches icon and choose 2960-1. b. Log in by typing Bob and CCENT as the username and password. c. Type enable and then press ENTER, followed by entering CCENT as the password. d. Enter Global Configuration mode by typing configure terminal, and then press ENTER. 2. Create a second username (Cindy) and password (Cisco) pair, and then add a domain name of sample.com for the switch. a. Type username Cindy password Cisco, and then press ENTER. b. Create the domain name by typing ip domain-name sample.com, and then press ENTER.
290
Chapter 9:
Cisco Switch Configuration
3. Force login local and SSH on all vty lines. a. Type line vty 0 15, and then press ENTER to enter Line Configuration mode for the telnet lines. Then type login local and press ENTER to force local authentication. b. Type transport input ssh and then press ENTER to force SSH use. 4. Create the keys needed for SSH use. a. Type exit, and then press ENTER to drop back to Global Configuration mode. Afterward, type crypto key generate rsa, and press ENTER to create the keys. b. Enter 1024 for the key size. c. After the keys have been generated, use CTRL-Z to exit back to Privileged mode. 5. Verify SSH configuration. a. Type show running-config, and then press ENTER. b. Press the SPACEBAR to move through the configuration, taking note of the configuration commands you just entered. c. Type show crypto key mypubkey rsa and then press ENTER to view the public key, verifying creation. 6. Save the configuration. a. Type copy run start and then press ENTER to save the configuration to NVRAM. b. Accept the default name by pressing ENTER again. c. Verify your saved configuration by typing show startup-config and pressing ENTER. d. Press the SPACEBAR to move through the configuration.
CERTIFICATION OBJECTIVE 9.04
Interface Configuration Once the basic configuration and security parameters have been set, it’s time to turn your attention to other configuration options. The switch may or may not need an IP address, interfaces may need speed, duplex and VLAN settings enabled, and ports
Interface Configuration
291
(active or inactive) may require additional security. The settings are all, of course, optional. However, in a production environment, most are used (not to mention heavily tested!).
VLAN1 and the Switch IP Address For the second time in this chapter, I can guess what you’re thinking: “Hey, wait a minute! You said switches work at layer 2. Why would I need to install an IP address on a layer-2 device?” Excellent question, with a correspondingly excellent answer: If you wish to use applications that make use of layer 3 to manage and access the switch, such as telnet, SNMP, and CDM, the switch needs an IP address. In other words, if you want to use telnet or SSH to connect remotely to the switch, there must be a unique IP address for the application to connect to. Much like configuring the TCP/IP properties on a PC, assigning an IP address can be done two ways: statically or dynamically. If you are assigning a static address, the switch will require an IP address, a subnet mask, and a default gateway (you can also optionally configure a DNS server as well). Also, much like configuring a PC, you’ll need to tell the switch which interface to use. Typically, you should use a special virtual interface, created specifically for this purpose, known as the VLAN 1 interface. The VLAN 1 interface provides a single IP address for the default VLAN to which every interface belongs: VLAN 1. In short, this virtual interface was created specifically to act as the Ethernet port for the switch as a whole. By default, the VLAN 1 interface does not have an IP address and is disabled. To use it, you must assign the appropriate TCP/IP options and enable the interface with the command no shutdown. The following code demonstrates how to assign an IP address to the VLAN 1 interface. CCENTSwitch# configure terminal CCENTSwitch (config)# interface vlan 1 CCENTSwitch (config-if)# ip address 192.168.1.5 255.255.255.0 CCENTSwitch (config-if)# no shutdown %05:15:12: %LINK-3-UPDOWN: Interface Vlan 1, changed state to up %05:15:13: %LINEPROTO-5_UPDOWN: Line protocol on Interface Vlan1, changed state to up CCENTSwitch (config-if)# exit CCENTSwitch (config)# ip default-gateway 192.168.1.1
Notice that the IP address and subnet mask are assigned on the Interface configuration prompt for VLAN 1, while the default gateway address is configured from the Global Configuration prompt. The no shutdown command is used to enable the interface and is, of course, entered on the interface configuration prompt for Vlan1. Should you choose to disable the interface, use the shutdown command.
292
Chapter 9:
Cisco Switch Configuration
It’s a relatively simple task, but be sure you know how to assign a management IP address to the switch using the Vlan1 interface. Pay close attention to the syntax of each command, as well as the configuration mode on which it is entered.
Lastly, don’t forget Vlan1 is disabled by default. For the IP address to do any good at all, whether assigned statically or via DHCP, you’ll need to enable the interface with the no shutdown command.
If your network is using DHCP for IP address assignment, you can simply tell the switch to pull an address automatically from the DHCP server. The preceding steps still apply and are the same, with only two changes. First, instead of using ip address address subnetmask, use the ip address dhcp command. Second, do not configure the ip default-gateway command (the DHCP server will supply the correct gateway). On a final note, the show command can be used to verify proper IP address and VLAN 1 interface settings. Viewing the IP address is different depending on the method in which it was configured. If you statically assign the address, you can use the show running-config command to see the address within the configuration. However, if the address is dynamically assigned using DHCP, you must use the show dhcp lease command. Lastly, a show interface vlan 1 command will display the IP address as well as the state of the interface. If all is well, the interface will display the message “VLAN 1 is up, line protocol is up.” If the no shutdown command has not been entered, it will display the text “Administratively down.”
Know how to verify IP address assignment within the switch. Also, remember “administratively down”
indicates the interface needs the no shutdown command assigned in order to function.
Speed, Duplex, and Descriptions While interfaces on a Catalyst switch do not need any additional configuration to work (they pass traffic right out of the box), sometimes administrators manually assign speed and duplex settings, as well as define a description on “important” ports.
Interface Configuration
293
Interfaces on a Catalyst switch are, by default, configured to autonegotiate speed and duplex with the device connecting through the port. However, it’s occasionally a good idea to manually set these options. Additionally, adding a description can help in troubleshooting and during installation. The commands used to configure interfaces are duplex {auto | full | half}, speed {10 | 100 | 1000 | auto}, and description text. Each command is entered individually on each port. For one or two interfaces this isn’t a problem, but many times you’ll wish to apply certain configuration options to an entire range of ports on the switch. For this, you can use the interface range type port-range command. Use of these commands is demonstrated in the following code. CCENTSwitch#configure terminal Enter configuration commands, one per line. End with CNTL/Z. CCENTSwitch(config)#interface FastEthernet 0/1 CCENTSwitch(config-if)#duplex full CCENTSwitch(config-if)#speed 100 CCENTSwitch(config-if)#description File Server port CCENTSwitch(config-if)#exit CCENTSwitch(config)#interface range FastEthernet 0/5 - 10 CCENTSwitch(config-if-range)#description Connection ports to users CCENTSwitch(config-if-range)#^Z
In this example, we set the speed and duplex on our first port (FastEthernet 0/1) and added a description (File Server port). After exiting the Interface Configuration mode on the first port, the interface range FastEthernet 0/5 - 10 command was used to assign a description to ports 5–10. We could have individually gone to each interface prompt and assigned them, but you can see how the range provides a much quicker way of getting things done. After all your interface settings are entered, use the show interfaces status command to verify: CCENTSwitch#show interfaces Port Name Status Fa0/1 File Server port Fa0/2 Fa0/3 Fa0/4 Fa0/5 Connection ports Fa0/6 Connection ports ////Output Truncated //// Fa0/10 Connection ports Fa0/11 Fa0/12 ////Output Truncated ////
status Vlan Duplex notconnect 1 notconnect 1 notconnect 1 notconnect 1 notconnect 1 notconnect 1 notconnect notconnect connected
1 1 1
Speed full auto auto auto auto auto
Type 100 auto auto auto auto auto
10/100BaseTX 10/100BaseTX 10/100BaseTX 10/100BaseTX 10/100BaseTX 10/100BaseTX
auto auto a-full
auto auto a-100
10/100BaseTX 10/100BaseTX 10/100BaseTX
294
Chapter 9:
Cisco Switch Configuration
Take note of several items in this output. First, notice the difference between FastEthernet 0/1, which we manually adjusted settings for, and FastEthernet 0/2, which was left with the defaults. The “auto” on interface 2 indicates the port is not in use and is awaiting an autonegotiation with a connecting system, while interface 1 shows the manually defined settings—even without a device connected to it! Ports 5 through 10 reflect the description assigned by the interface range FastEthernet 0/5 - 10 command, although the description is truncated due to space. Finally, port 12 displays an active interface. A system has connected to the interface and the switch has autonegotiated full duplex at 100 Mbps (the “a-” indicates autonegotiation).
Familiarize yourself with the interface configuration commands listed here, and make sure you know how
to decipher information gleaned from a show interfaces status command.
VLAN Configuration In Chapter 8, we covered the basics of VLANs—what they are, what they do, and why you would use them. Surprisingly, creating a VLAN is relatively simple. First, a determination needs to be made as to which role within the VLAN world the interface will fill. An interface can be configured to send and receive traffic within a single VLAN, or it can be set to send and receive traffic for multiple VLANs. The single VLAN setup is most common and is the focus of the CCENT exam (working within multiple VLANs is known as VLAN trunking, and is covered in (McGraw-Hill’s CCNA Cisco Certified Network Associate Study Guide (640-802) book). Next, simply create a VLAN and then add interfaces to it. To create the VLAN, use the Global Configuration mode command vlan vlan-id, where vlan-id is a number between 2 and 1001. Optionally, you can also use the command name vlan-name, where vlan-name is a more descriptive text string for your VLAN. To add an interface to the newly created VLAN, use the switchport access vlan vlan-id command on each interface. Optionally, you can also use the switchport mode access command to ensure the interface does not attempt to go into trunking mode.
Interface Configuration
295
By default, VLANs are “named” VLANXXXX, where the XXXX is the number of the VLAN. Administrators frequently make use of the name vlan-name command to clear up any confusion. You may also have noticed the somewhat strange number range given for the creation of VLANs. VLAN 1 is reserved, of course, and VLANs 1002–1005 are used for token ring. For example’s sake, suppose you were charged with creating a new VLAN on your switch for accounting department employees. Each accounting department employee will use interfaces 5 through 10—the other interfaces will be available for “regular” network users. To demonstrate this process, the following code creates a new VLAN (numbered 50), with a descriptive name of “Accounting vlan,” and assigns interfaces 5 through 10. CCENTSwitch#configure terminal Enter configuration commands, one per line. End with CNTL/Z. CCENTSwitch(config)# vlan 50 CCENTSwitch(config-vlan)# name Accounting vlan CCENTSwitch(config-vlan)# exit CCENTSwitch(config)# interface range FastEthernet 0/5 – 10 CCENTSwitch(config-if)# switchport access vlan 50 CCENTSwitch(config-if)# switchport mode access CCENTSwitch(config-if)# end
To verify VLAN creation, use the show running-config or show vlan brief command. The running configuration will show interface membership in a VLAN on a per-interface basis, while the VLAN brief display shows all VLANs on the switch, as well as their interface ranges. Samples of both commands appear in the following: CCENTSwitch# show running-config ////Output Truncated //// interface Fast Ethernet0/5 switchport access vlan 50 switchport mode access interface Fast Ethernet0/6 switchport access vlan 50 switchport mode access ! CCENTSwitch# show vlan brief
296
VLAN
Chapter 9:
Cisco Switch Configuration
Name
Status
Ports
1
default
active
Fa0/1, Fa0/2, Fa0/3, Fa0/4, Fa0/11, Fa0/12, Fa0/13, Fa0/14, Fa0/15, Fa0/16, Fa0/17, <<