577 79 7MB
English Pages 752 Year 2009
Download at Boykma.Com
JUNOS Enterprise Switching
Download at Boykma.Com
Download at Boykma.Com
JUNOS Enterprise Switching
Harry Reynolds and Doug Marschke
Beijing • Cambridge • Farnham • Köln • Sebastopol • Taipei • Tokyo Download at Boykma.Com
JUNOS Enterprise Switching by Harry Reynolds and Doug Marschke Copyright © 2009 Harry Reynolds and Doug Marschke. All rights reserved. Printed in the United States of America. Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472. O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (http://my.safaribooksonline.com). For more information, contact our corporate/institutional sales department: 800-998-9938 or [email protected].
Editor: Mike Loukides Production Editor: Sarah Schneider Copyeditor: Audrey Doyle Proofreader: Sada Preisch
Indexer: Lucie Haskins Cover Designer: Karen Montgomery Interior Designer: David Futato Illustrator: Robert Romano
Printing History: July 2009:
First Edition.
O’Reilly and the O’Reilly logo are registered trademarks of O’Reilly Media, Inc. JUNOS Enterprise Switching, the image of a gorgeted bird of paradise, and related trade dress are trademarks of O’Reilly Media, Inc. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and O’Reilly Media, Inc. was aware of a trademark claim, the designations have been printed in caps or initial caps. While every precaution has been taken in the preparation of this book, the publisher and authors assume no responsibility for errors or omissions, or for damages resulting from the use of the information contained herein.
ISBN: 978-0-596-15397-7 [M] 1247252300
Download at Boykma.Com
Table of Contents
Foreword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii 1. LAN and Internetworking Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 What Is a Network? The OSI Model Network Types and Communication Modes So, Where Did We LANd? Ethernet Technologies A Brief Look Back Ethernet or 802.3, That Is the Question The MAC Layer Ethernet Standards Wrap-Up Ethernet Technology Summary The TCP/IP Suite Enter OSI Exit OSI, Enter IP The IP Stack, in a Nutshell Internet Protocol Summary LAN Interconnection Repeaters Bridges Routers LAN Interconnect Summary Conclusion Chapter Review Questions Chapter Review Answers
2 3 8 9 10 10 11 13 16 19 20 20 21 22 35 36 37 38 41 43 44 44 46
2. EX Platform Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 EX Hardware Overview The EX8200 Series
49 52 v Download at Boykma.Com
Separate Control and Forwarding: It’s a Good Thing EX Hardware: The Numbers EX Feature Support EX Hardware Summary EX Series Architecture The EX-PFE ASIC EX3200 Architecture EX4200 Architecture A Day in the Life of a Packet EX Series Architecture Summary JUNOS Software Overview JUNOS Software Summary CLI Overview J-Web and EZSetup CLI Operational Modes and General Features Configuration Mode The JUNOS CLI Summary Advanced CLI and Other Cool Stuff SOS Scheduled Commits and Wildcards Copying, Renaming, and Inserting Conclusion Chapter Review Questions Chapter Review Answers
55 57 61 64 64 64 65 66 68 72 73 75 76 76 78 85 98 99 99 102 103 104 105 106
3. Initial Configuration and Maintenance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 The Factory-Default Configuration and EZSetup Factory-Default Configuration EZSetup Factory-Default Configuration and EZSetup Summary Initial Configuration Using the CLI CLI Configuration Summary Secondary Configuration Customized User Accounts, Authentication, and Authorization Out of Band Network Remote Access Dynamic Host Configuration Protocol Secondary Configuration Summary EX Interfaces Permanent Interfaces Network Interfaces Interface Configuration EX Interface Configuration Examples
vi | Table of Contents Download at Boykma.Com
110 110 115 122 122 123 123 124 132 134 138 143 143 143 145 146 150
Interface Troubleshooting EX Interface Summary Basic Switch Maintenance Chassis Health Check Syslog SNMP NTP Rescue Configuration Password Recovery Switch Maintenance Summary Conclusion Chapter Review Questions Chapter Review Answers
156 167 167 168 170 176 179 182 183 187 187 188 189
4. EX Virtual Chassis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191 The EX Virtual Chassis Virtual Chassis Overview Virtual Chassis Design and Deployment Options Packet Flow in a Virtual Chassis Virtual Chassis Summary Configuration, Operation, and Maintenance Virtual Chassis Configuration Modes Virtual Chassis Configuration Virtual Chassis Operation and Maintenance Configuration, Operation, and Maintenance Summary Virtual Chassis Case Study Prepare for the Merge Configure VC Parameters Expand the VC with VCE Links Case Study Summary Conclusion Chapter Review Questions Chapter Review Answers
191 191 198 206 215 215 216 217 223 240 241 244 245 258 263 263 263 265
5. Virtual LANs and Trunking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267 Virtual LANs and Trunking Port Modes Tagging User Traffic The Native and Default VLANs Generic Attribute Registration Protocol VLAN and Trunking Summary EX to Catalyst VLAN Integration Default VLAN/Trunking Behavior
267 268 268 274 277 278 279 280
Table of Contents | vii Download at Boykma.Com
Define VLANs Add Native VLAN Support Getting Loopy with It VLAN Integration Summary Conclusion Chapter Review Questions Chapter Review Answers
287 305 309 314 314 314 316
6. Spanning Tree Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319 Feeling a Little Loopy Stupid Is As Stupid Does Loop Issue Summary Spanning Tree Protocol STP Basics Calculating and Maintaining the Spanning Tree Bridge Protocol Data Units BPDU Learning and Port States Protocol Timers Putting the Theory Together STP Issues STP Summary Rapid Spanning Tree Protocol New BPDU Definition and Function Interface Types and States RSTP Convergence Link Cost in RSTP Compatibility with STP Interoperability Between Juniper and Cisco RSTP Summary Spanning Tree Configuration Failures with Default Parameters Configuring RSTP Spanning Tree Configuration Summary Multiple Spanning Tree Protocol MSTP Configuration MSTP Summary Redundant Trunk Groups RTG Configuration RTG Summary Conclusion Chapter Review Questions Chapter Review Answers
viii | Table of Contents Download at Boykma.Com
319 320 321 322 322 326 328 330 332 334 336 338 338 338 339 341 346 347 347 350 350 360 361 368 369 372 377 377 378 381 381 381 383
7. Routing on the EX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385 EX Routing Overview What Is Routing? EX Routing Capabilities JUNOS Routing Concepts Summary of EX Routing Capabilities Inter-VLAN Routing A Router on a Stick Enter the Routed VLAN Interface Deploy an RVI Use VRRP with an RVI Restricting RVI Communications RVI Summary Static Routing Next Hop Types Route Attributes and Flags Floating Static Routes EX Static Routing Scenario Static Routing Summary RIP Routing RIP Overview RIP Deployment Scenario Verify RIP RIP Summary Conclusion Chapter Review Questions Chapter Review Answers
386 386 387 389 393 393 395 396 397 404 407 410 411 411 412 414 414 421 422 423 427 438 446 447 447 449
8. Routing Policy and Firewall Filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451 Routing Policy What Is Routing Policy, and When Do I Need One? Where and How Is Policy Applied? Policy Components Policy Match Criteria and Actions Route Filters Default Policies Testing and Monitoring Policy Policy Case Study Routing Policy Summary Firewall Filters Types of Filters Filter Term Processing Filter Match Conditions
451 452 452 456 458 460 465 466 470 477 477 478 480 480
Table of Contents | ix Download at Boykma.Com
Filter Actions Applying a Filter Transit Filter Case Study Case Study: Loopback Filters Policers Storm Control and Rate Limiting Filters and Policers Summary Conclusion Chapter Review Questions Chapter Review Answers
483 483 484 495 497 502 502 502 503 505
9. Port Security and Access Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 507 Layer 2 Security Overview EX Layer 2 Security Support MAC Limiting, DHCP, and ARP MAC Limiting DHCP Snooping and ARP Inspection MAC Limiting, DHCP, and ARP Summary IEEE 802.1X Port-Based Authentication Terminology and Basic Operation JUNOS 802.1X Feature Support Deploy and Verify 802.1X 802.1X Port-Based Authentication Summary Conclusion Chapter Review Questions Chapter Review Answers
507 508 509 515 522 530 530 530 535 538 555 555 555 557
10. IP Telephony . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 559 Deployment Scenarios QoS or CoS? Deployment Scenarios Summary Power over Ethernet JUNOS Support for PoE PoE Summary Link Layer Discovery Protocol JUNOS LLDP LLDP Summary LLDP with Media Endpoint Discovery LLDP-MED and JUNOS LLDP-MED Summary Voice VLAN Case Studies Without LLDP-MED Support
x | Table of Contents Download at Boykma.Com
559 560 564 564 565 567 568 570 572 573 574 577 577 578 579
With LLDP-MED Support Case Study Summary Conclusion Chapter Review Questions Chapter Review Answers
587 590 590 590 592
11. High Availability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 595 Hardware Redundancy Routing Engine Failover Default Failover Layer 2 Default Failover Layer 3 Graceful Routing Engine Switchover Graceful Restart Non-Stop Routing GRES, GR, NSR, Oh My! VRRP In-Service Software Upgrades Aggregated Ethernet LACP in Action JUNOS Configuration Bidirectional Forwarding Detection (BFD) High Availability Summary Conclusion Chapter Review Questions Chapter Review Answers
596 597 599 600 603 610 612 612 613 614 615 616 620 629 632 632 632 634
Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 637 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 699
Table of Contents | xi Download at Boykma.Com
Download at Boykma.Com
Foreword
Charles Darwin once said, “I have called this principle, by which each slight variation, if useful, is preserved, by the term of Natural Selection.” This principle of evolution applies to business as well as to nature. Individuals, companies, and industries evolve and compete with one another in preparation for the future. Back in 1998, a group of engineers decided to split from the mainstream and form a new company, Juniper Networks. That company has evolved to create and acquire many products over the last decade. While Darwin might have viewed this as an evolutionary step in products, we view it as a competitive step. Humankind differs from the rest of the animal kingdom not only because our instincts go beyond the primal survival urge (a.k.a. Darwin’s “survival of the fittest”), but also because of our intellect and capacity to improve. When one group splits off from another, it does not necessarily sound the death knell for the original group. More likely, the two groups will start taking steps to outdo one another. In other words, they compete. Those who are not directly involved in that competition can reap the benefits of the intellectual sparring. We have observed many such competitive moves within the routing industry over the years. Now, we are entering another such arena within the switching side of our industry.
Evolution of the Bridging World More than 20 years ago, Radia Perlman developed an interesting algorithm while working for Digital Equipment Corporation. At the time, it was meant to solve an irritating little problem brought on by the forced evolution of data networks. Although networking in 1985 was significantly different than it is today, it’s amazing how some of the basic building blocks have survived. This book discusses some of those building blocks, both historically and with reference to the present-day network infrastructure. For example, the Spanning Tree Protocol, which was based on Perlman’s algorithm, is like one of the amino acids from which today’s switching was created. (I’ve always despised biology, but it seems to fit here!) xiii Download at Boykma.Com
You’ll also learn how to improve on features we’ve always believed to be necessities “just because they are.” This book helps you understand the evolution—or stagnation—of networking to date, and then shows you how to see past it and unlock your networking potential in a few short steps.
What Is the Big Deal About Switching Anyway? Interestingly, Layer 2 networking in general, and Ethernet internetworking in particular, are technologies vastly overlooked by many people in the current networking world. Ethernet has become a commodity. We see many a WAN link today delivered as an “Ethernet handoff,” which tells the tale of how common and simple it has become. And with it has emerged a number of supporting technologies and design mediums. Many people see this area of networking as “voodoo magic.” That term implies it can be good as well as bad, but it doesn’t explain why! Without waxing philosophical or launching a religious debate in this foreword, I’ll leave it at this: you may learn things in this book that you knew only bits and pieces of before. As we expand our networks to include IP telephony, data centers, or really large Layer 2 networks, we should pay attention to the details of many technologies that we have taken for granted over the years. Even with as much Layer 2 experience as I have, serving as technical editor for this book has opened my eyes on several topics. It has spurred some entertaining debates, and perhaps it will do the same for you!
How This Book Will Help You (a.k.a. What’s in It for Me?) I don’t think better people could have been found to write this book. Doug and Harry not only have an incredible set of technical talents—which I’ve come to know over the years—but they also have a great sense of style. Although those virtues alone make them qualified, their track record of success in teaching, training, and consulting has also been put to use for your edification. Too many technical books jump off the Boring Board into the abyss of Techie Soup. While this book covers plenty of deep technical matters, I think you will find its approach refreshing and compelling. Now, I can’t guarantee that it will lead to any evolutionary process in your own life. But I can certainly say that after you read it, you’ll have some eye-opening conversations (at least with yourself!). This book will help you quickly acquire knowledge surrounding the topics presented, and it will add to your successful implementation of those technologies.
xiv | Foreword Download at Boykma.Com
One thing I’ve gained from being part of this book’s evolutionary process is the burning desire to dive in and get my hands on these switches to see what they can do. While that may not mean much to some of you, anyone who has perused my personal lab on the Internet should understand. Evolution is progress. The antithesis of that is Congress.... No, sorry, wrong dissertation. The antithesis of that is stagnancy. We should always strive to find new ways to improve our conditions. Whether you apply that to your personal life or to networking, it has the ring of truth. Darwin said, “In the long history of humankind (and animal kind, too) those who learned to collaborate and improvise most effectively have prevailed.” Let us go forth and collaborate on and improvise our internetworking. At the very least, as you go through this book and pay attention to the details, you’ll feel like Saturday Night Live’s Church Lady: “Well.... Isn’t that special!” —Scott Morris Four-time CCIE and JNCIE-M, and a Juniper Networks Certified Instructor June 1, 2009
Foreword | xv Download at Boykma.Com
Download at Boykma.Com
Preface
It wasn’t but a day or so after we finished JUNOS Enterprise Routing, the companion book to this one, that our editor started pressuring us to start writing again. Writing a book may seem easy on the surface; how hard could it have been to write some words on these pages? But in reality, writing a book is a time-consuming and collaborative effort that affects everyone close to you. Also, at the time of the request, the EX Series was a new product line, and although we had extensive experience in the switching space, we did not have many customer deployments of the EX Series switches. We were really impressed when the first EX units arrived for us to put in the rack that we reserved for this book. As JUNOS “experts,” we expected a lot, and we were impressed at the ease of configuration and stability that the JUNOS software provided to the EX. Although the performance and configuration of the EX switches are slightly different from those of a JUNOS router, the EX platform fit our needs, and hopefully it will fit yours, too. The world of Ethernet switching changed when Juniper Networks got involved. At the time of this writing, the EX Series switches are already making significant inroads into the enterprise marketplace. In this book, we have extended the same approach and writing style we used in JUNOS Enterprise Routing so that you, the reader, can have a set of books that work together. We did not write these books with the idea that you’d read one before the other, so some content overlap may exist. Most people will want to work up the OSI stack and read this book before the routing book; still, for many reasons, the routing book came out first, and we kept this in mind as we organized this book. This book does double duty. It is both a field guide and a certification study guide. Readers who are interested in attaining a Juniper Networks certification level are wise to note that we discuss and cover topics that are relevant to the official exams (hint, hint), and at the end of each chapter we provide a list of examination topics covered, as well as a series of review questions that allow you to test your comprehension. Since the EX does both switching and routing, you should be able to answer a majority of enterprise certification questions by reading and understanding the content of all of the chapters in both books. xvii Download at Boykma.Com
We wrote this book to serve as a field guide for any time you work on your EX. We present a lot of tutorials and samples, with lots of actual command output. We like to think that the detailed theoretical coverage we provide goes well beyond any certification exam, to give you something that can’t be tested: the ability to get things to work the right way the first time. When plan A fails, this material provides the steps needed to monitor network operation and quickly identify and resolve the root cause of malfunctions. We believe this level of coverage extends the life of both this book and its predecessor, far beyond any short-term certification goals. Some of our chapters tend to be on the longer side; we’re sorry about that. Or maybe we should say “You’re welcome” in keeping with the “more is better” philosophy. Just dog-ear the pages, write notes in the margins, and perhaps even update the topology illustrations with something more akin to your own fiefdom. We hope you’ll make this copy your own.
What Is JUNOS Enterprise Switching? The idea of switched networks is definitely not a new concept. LANs and Ethernet networks have been around since the 1970s, and some of you reading this book may actually remember the days of vampire taps and Thicknet cabling! Like the Atari 2600, those stories are great to relate and are actually quite amazing in their own technology light, but thankfully, technology advances. Now a LAN is synonymous with Ethernet; people know that if they plug their laptop’s network port into the wall, they will wind up on an Ethernet network. Switching had historically been a fairly simple process, which allowed bridges to outperform routers of the same era. After the MAC address table was built, a simple filtering and forwarding process was all that was needed. Intelligence and switches were never used in the same sentence. If forwarding intelligence was needed, it was slow, and it was often reserved for higher OSI layers. However, as technology improved, intelligence was no longer a compromise for speed. That was the premise of Juniper Networks’ “speed without compromise” routers that brought Juniper into the networking space against the big giant, Cisco—a dangerous place littered with the remnants of all the other companies that had failed before. Some may argue about how successful Juniper has been, but nobody can argue that Juniper will remain a player for many years to come, as evidenced by the large deployed base of its products and the much-loved JUNOS software that is its foundation. As technology evolved, so did Juniper, as did its historic focus on routing within service provider networks. Juniper set its sights squarely on the enterprise, a market that was still being dominated by Cisco, and it saw a place where it could leverage the experience and reliability of JUNOS. The first “Layer-2-aware” device that Juniper Networks released was the MX Series. Although it was well received, the MX platforms were targeted at service providers and were really seen as routers with dense Ethernet con-
xviii | Preface Download at Boykma.Com
nectivity but that also happened to offer some Layer 2 services. The first true Ethernet LAN switch is the EX Series, the basis of this book. Will Juniper displace Cisco in the enterprise switching market? Only time will tell. So far, the EX platforms have been well received in the industry (and don’t forget, they have JUNOS going for them). The purpose of this book is to provide details on the product’s capabilities, and to show examples of its deployment and operation in support of those features. This book is not designed to sell boxes, or to convince you to use one vendor over another. We believe that after reading the material you will be able to make an informed decision as to what products work best for your needs. In all probability, the Juniper EX was not even an option the last time you shopped for LAN switching gear. We think you will want to keep the EX in mind the next time. So, come join us in the exciting new world of enterprise switching and JUNOS on the new EX Series of high-performance LAN switches. With all the excitement in the air it seems like 1998 and the release of Juniper’s first router, the M40, all over again.
The Juniper Networks Technical Certification Program (JNTCP) This book is an official study guide for the JNTCP Enterprise tracks. For the most current information on Juniper Networks’ Enterprise certification tracks, visit the JNTCP website at http://www.juniper.net/certification. We’ve included lots of questions at the end of each chapter to help with your cert plans.
How to Use This Book We are assuming a certain level of knowledge from the reader. This is important because if you and the book don’t match that assumption level, you’ll feel off-track right from the get-go. So, we are assuming you have knowledge of the following: Basic networking This book is about LANs and LAN interconnection. The introduction chapter provides a good overview of networks, TCP/IP, and LAN interconnection. However, it’s assumed that the reader has basic familiarity with data communications and LANs; otherwise, it may be a fast ride. Computers What can we say? We assume the reader owns at least one and is familiar with some of its networking operations, such as web browser use.
What’s in This Book? The ultimate purpose of this book is to be the single most complete source for working knowledge related to Juniper Networks enterprise switching on the EX platform. Although you won’t find much focus on actual packet formats and fields, topics for which Preface | xix Download at Boykma.Com
there is already plentiful coverage on the Internet and in bookstores, you will find information on how to effectively deploy JUNOS switching technology in your network. Here’s a short summary of the chapters and what you’ll find inside: Chapter 1, LAN and Internetworking Overview Here you will find a detailed, condensed, and somewhat irreverent breakdown of how we got to where we are; the popularity of Ethernet, TCP/IP, and the demise of OSI; and basic LAN interconnect terminology and concepts. Nothing earthshattering, but all good information and things we think you should be familiar with before jumping into the more specific chapters that follow. Chapter 2, EX Platform Overview This chapter details EX platform capabilities and options. This includes several day in the life of a frame processing examples designed to help you understand internal operations so that you can better appreciate the platform’s performance and capabilities. How many PoE ports are available? What uplink options are possible? What is the name of the management interface? Find out the answers to these questions, and many more, here. Chapter 3, Initial Configuration and Maintenance This chapter begins by examining the steps you need to take once you have your brand-new, shiny switch in your hands. It starts with a factory-default configuration and builds the initial configuration required for deployment. This includes any basic interface configuration that would be necessary. Chapter 4, EX Virtual Chassis The EX virtual chassis (VC) is an exciting and important capability that provides virtualization of a multichassis stack. This capability provides many performance and reliability enhancements, such as the support of redundant routing engines. Chapter 5, Virtual LANs and Trunking This chapter details the concept of VLAN tagging, and how to configure VLANs and trunking in a mixed JUNOS and IOS environment. Here we handle tricky things such as native versus default VLANs, and current best practices for multivendor interoperability. Chapter 6, Spanning Tree Protocol This chapter dives into the world of Spanning Tree Protocol (STP), providing first an overview of the protocol and then the implementation specifics. The original STP is examined as well as the updated standards for Rapid Spanning Tree Protocol (RSTP) and Multiple Spanning Tree Protocol (MSTP). Lastly, we describe Redundant Trunk Groups at the conclusion of the chapter. Chapter 7, Routing on the EX The EX is a switch that runs JUNOS, and can therefore route pretty darned well. This chapter details the Routed VLAN Interface construct and how to perform
xx | Preface Download at Boykma.Com
inter-VLAN routing on an EX. We also cover some basic JUNOS routing concepts along the way. Chapter 8, Routing Policy and Firewall Filters Routing policy and firewall filters are features that are on every box that runs JUNOS software and, quite honestly, are most often found on routers. However, they have their place on switches as well, and we cover them in this chapter. Those who have already read JUNOS Enterprise Routing can probably skim this chapter, as the policy is the same and only the firewall filters and policers are different on the switches. Chapter 9, Port Security and Access Control What good is a high-performance LAN if all it does is allow you to get hacked more quickly? This chapter details port-level security features such as MAC limits, DHCP snooping, and ARP inspection, in addition to support for IEEE 802.1X access control. Learn how to harden your switched network’s parameters here, and how to perform fault isolation when things do not go as planned. Chapter 10, IP Telephony In this day and age, IP telephony is the deployment normal, finally displacing the traditional PBX. This chapter looks at some of the tools that are now available for VoIP, such as Power over Ethernet and LLDP-MED. It contains case studies on solving problems when IP phones support these features, and when they do not. Chapter 11, High Availability The chapter provides an overview of the High Availability (HA) features offered on the EX Series at the time of this writing. These features include hardware redundancy, Graceful Routing Engine Switchover, Graceful Restart, Bidirectional Forwarding Detection, Virtual Router Redundancy Protocol, and aggregated Ethernet. In addition, you can also use this book to attain one of the Juniper Networks certification levels related to the Enterprise program. To that end, each chapter in the book includes a set of review questions and exam topics covered in the chapter, all of it designed to get you thinking about what you’ve just read and digested. If you’re not in the certification mode, the questions will provide a mechanism for critical thinking, potentially prompting you to locate other resources to further your knowledge.
Topology of This Book Figure P-1 displays the topology of the book that appears beginning in Chapter 2. It consists of six EX Series switches running JUNOS 9.1 (in a few cases, a newer software version is used for reasons that we explain in the related material), two Cisco 3550 switches running IOS Release 12.2(44)SE3, one J Series router, one Cisco 2600 router, some IP phones, and various hosts that are really just Cisco 2500 routers that are used to generate some pings.
Preface | xxi Download at Boykma.Com
The book uses both Layer 2 and Layer 3 topologies, but the physical connectivity stays the same. Also, Chapter 10 uses an additional Cisco switch, Cisco router, and IP phones. Similarly, Chapter 9 uses a different test bed and test topology due to the need for a supported client and authentication server. Once again, you might recognize that the devices’ hostnames relate to different distilled liquids. Recall that in the routing book, the names were based on brewed libations. As before, we chose the names due to their international appeal and preservation of the crops from which they are created.
Conventions Used in This Book The following typographical conventions are used in this book: Italic Indicates new terms, URLs, email addresses, filenames, file extensions, pathnames, directories, and Unix utilities Constant width
Indicates commands, options, switches, variables, attributes, keys, functions, types, classes, namespaces, methods, modules, properties, parameters, values, objects, events, event handlers, XML tags, HTML tags, macros, the contents of files, and the output from commands Constant width bold
Shows commands and other text that should be typed literally by the user Constant width italic
Shows text that should be replaced with user-supplied values This icon signifies a tip, suggestion, or general note.
This icon indicates a warning or caution.
xxii | Preface Download at Boykma.Com
Figure P-1. A typical Layer 2 topology
Preface | xxiii Download at Boykma.Com
Using Code Examples This book is here to help you get your job done. In general, you may use the code in this book in your own configuration and documentation. You do not need to contact us for permission unless you’re reproducing a significant portion of the material. For example, deploying a network based on actual configurations from this book does not require permission. Selling or distributing a CD-ROM of examples from this book does require permission. Answering a question by citing this book and quoting example code does not require permission. Incorporating a significant amount of sample configurations or operational output from this book into your product’s documentation does require permission. We appreciate, but do not require, attribution. An attribution usually includes the title, author, publisher, and ISBN. For example: “JUNOS Enterprise Switching, by Harry Reynolds and Doug Marschke. Copyright 2009 Harry Reynolds and Doug Marschke, 978-0-596-15397-7.” If you feel your use of code examples falls outside fair use or the permission given here, feel free to contact us at [email protected].
Safari® Books Online When you see a Safari® Books Online icon on the cover of your favorite technology book, that means the book is available online through the O’Reilly Network Safari Bookshelf. Safari offers a solution that’s better than e-books. It’s a virtual library that lets you easily search thousands of top tech books, cut and paste code samples, download chapters, and find quick answers when you need the most accurate, current information. Try it for free at http://my.safaribooksonline.com.
Comments and Questions Please address comments and questions concerning this book to the publisher: O’Reilly Media, Inc. 1005 Gravenstein Highway North Sebastopol, CA 95472 800-998-9938 (in the United States or Canada) 707-829-0515 (international or local) 707-829-0104 (fax) We have a web page for this book, where we list errata, examples, and any additional information. You can access this page at: http://www.oreilly.com/catalog/9780596153977
xxiv | Preface Download at Boykma.Com
or: http://www.proteus.net To comment or ask technical questions about this book, send email to: [email protected] For more information about our books, conferences, Resource Centers, and the O’Reilly Network, see our website at: http://www.oreilly.com
About Scott Morris, Lead Tech Reviewer Scott Morris is a four-time CCIE (#4713) and JNCIE-M (#153), as well as a Juniper Networks Certified Instructor (JNCI) for M Series and J Series routers. Scott is currently a senior instructor for Internetwork Expert, Inc., as well as a consultant for various service providers around the world. He has more than 23 years of experience in all aspects of the networking industry and often tech-reviews networking books for Cisco Press and McGraw-Hill. When not attending events around the globe, he is often at home with his lovely wife and two beautiful daughters. He hasn’t yet taught them binary, although that will likely happen. His home basement sports a four-rack networking lab that generates so much heat it requires its own air-conditioning unit—take a peek at http://smorris.uber-geek.net/lab.htm.
Acknowledgments The authors would like to gratefully and enthusiastically acknowledge the work of many professionals who assisted us in developing the material for this book. Although our names are printed on the book as authors, in reality no author works alone. There have been many people whose contributions have made this book possible and others who have assisted us with their technical accuracy, typographical excellence, and editorial inspiration. Many thanks are owed to the official technical editor of this material, Scott Morris. Despite our lack of planning, he was able to adjust to our schedule and return the chapters in a timely manner. He used his tremendous experience not only to fix technical errors, but also to encourage us to add topics we had overlooked. We would also like to acknowledge Juniper Networks in general, and in particular Chris Spain and Michael Banic, for the assistance provided on various fronts and for providing much of the gear we needed to write this book. We also would like to thank Proteus Networks for housing this gear at no cost in its data center, as well as Chris Heffner for providing gear support.
Preface | xxv Download at Boykma.Com
And last but not least, we give special thanks to Patrick Ames for his assistance and constant annoyance to keep the book going in the right direction. His thick skin after bouts of anger from the authors is legendary and much appreciated.
From Doug Marschke First, I would like to personally thank Harry Reynolds for all of his help and encouragement while writing this book. This is really his book, and I was just along for the ride. Despite my obvious missed deadlines, he was patient and did not yell at me too much throughout this process. Due to the timing of starting a new company and changing the face of my bar, this book was difficult not from lack of motivation but from lack of time. To that end, I must personally thank my business partners at Proteus Networks, Joe Soricelli and Chris Heffner, and my business partner in the Taco Shop at Underdogs, Nick Fasanella. They essentially picked up my slack as I devoted my time to completing this book. And finally, but most importantly, I must thank Becca Morris for her love and support that never seem to waver despite how much I mess up. The homemade brownies and cookies also helped to sugar-infuse my late nights, and they tasted really good.
From Harry Reynolds I would (again) like to thank my wife, Anita, and two lovely daughters, Christina and Marissa, for understanding and accommodating my desire to engage in this project. Also, special thanks to my manager at Juniper Networks, Sreedhevi Sankar, for her understanding and support. I really appreciate her willingness to accommodate the occasional glitch in my “day-job” schedule as needed to make this book happen. Also, thanks to the Juniper EX team, and to PLM, for providing us with gear and technical support during the effort.
xxvi | Preface Download at Boykma.Com
CHAPTER 1
LAN and Internetworking Overview
Over the years, the importance of data communication has closely paralleled that of computing. In fact, most individuals are completely unaware of just how often data communications networks affect and enable our daily lives. Network technologies are ubiquitous to the point where a modern car has more processing power than a 1960sera mainframe, along with several communications networks that control everything about the vehicle’s operation, from its chipped key ignition security, engine fuel/air mixture, and transmission shift points to the sensing and reporting of low tire pressure. The modern world is hooked on computing, and in this addiction data networks are like a drug in the sense that most PC users find their machines rather dull and bordering on boring when their Internet access is down. In fact, given the easy access we all have to nearly the sum of man’s knowledge (typically for free), the Internet and its World Wide Web make activities such as writing technology books seem rather old hat. But the amount of background information regarding general data communications concepts, local area network (LAN) technologies, and the TCP/IP protocol suite, which makes all of humankind’s knowledge available and easy to find, is still an invaluable library. It’s the library that enables the digital libraries. And so we start right here. The primary goal of this book is to document the application and use of Juniper Networks EX switches in a number of LAN and interoperation scenarios. The coverage has already jeopardized our editor’s budgeted page count, which leaves us little room given that we wrote this chapter last and we are a bit tired and in dire need of sunshine. Therefore, we make no attempt in this chapter to re-create the “complete history of networking and LAN technologies” wheel. Instead, this chapter’s goal is to provide an extremely targeted review of networking and LAN history, including internetworking principles related to LAN interconnect. Aside from an irreverent take on history for which the authors apologize beforehand (did we mention we saved this chapter for last?), what follows is also an extremely focused targeting of key principles that you should understand before moving on to the remainder of this book. 1 Download at Boykma.Com
There aren’t a lot of pages, but it’s a fun, informative, and action-packed ride; trust us, both you and the trees are better for it. The topics covered in this chapter include: • • • •
Networking and OSI overview Ethernet technologies The TCP/IP protocol suite LAN interconnection
What Is a Network? A network can be defined as two or more entities with something to say that is not already known to the intended recipients, and a channel or medium over which to convey this information. Simple enough, right? Network technologies, much like fashions, seem to flare in popularity and then quietly fade away in favor of the next thing. At one point in the dark past of networking, users were compelled to source their network gear from a single vendor, oftentimes the same vendor that provided the data processing equipment. This was due to a lack of open standards that resulted in vendor-proprietary solutions for both the hardware and networking protocols. Although good for the vendor, a single source for anything is generally bad for economics, and in some cases it can also hamper innovation and performance; after all, if a vendor has you locked into its solution, there may be little motivation for the vendor to spend money on research and development in an effort to improve the basic technology. Nope, users wanted to be able to select from best-of-breed solutions, ones that optimize on performance or price, while still enjoying end-to-end interoperability.
What Is a Protocol? The term protocol is bandied about all the time in this industry. The essence of a protocol is simply a mutually agreed upon set of rules and procedures that in turn govern the behavior of the participants to help ensure orderly operation. Thus, the English language is a protocol, as are the rules of Parliament. In both cases, a violation of protocol can cause confusion or malfunction. Data communications networks are based on layered protocols that provide a divideand-conquer approach to the daunting task of getting complex information from one source to some remote host over error-prone and unreliable communications paths, all the while providing authentication, authorization, and in some cases actual translation services to compensate for differences in local data representation.
Enter the Open Systems Interconnection (OSI) model, which we detail in the next section. 2 | Chapter 1: LAN and Internetworking Overview Download at Boykma.Com
The OSI Model The OSI model, and the International Organization for Standardization (ISO) suite of protocols that were originally based on the model, failed to see much adoption. As evidence, consider GOSIP. The Government Open Systems Interconnection Profile was first published in 1990, and essentially stated that all U.S. government communications networks must be OSI-compliant for consideration in networking bids. This was a big deal, and in theory it sounded the death knell for vendor-proprietary solutions. It was to include the U.S. Department of Defense’s (DoD) ARPANET (Advanced Research Projects Agency Network) protocols; e.g., TCP/IP, which at the time was the de facto multivendor interoperability solution. Given this level of backing, it is hard to understand how OSI/ISO could fail. The answers are multifaceted: The OSI protocols were slow to market/produced no products The best ideas in the world are not very useful if they have no tangible manifestation in reality. Many of the official OSI protocols were never fully implemented and most were never deployed in production networks. Ironically, the OSI layers that did have products tended to function at or below Layer 4, which is just where existing technologies (i.e., TCP/IP) already existed and could be used as models. Stated differently, TCP/IP has a Network layer (IP), and so did the OSI model; it was called Connectionless Network Service (CLNS). The TCP stack does not have a true Session or Presentation layer, and it’s in these very upper layers where it seems the ISO bit off more than it could shove into a Layer 3 packet, so to speak. The OSI protocols were overtly complex and suffered from a slow development velocity The OSI protocols attempted to go above and beyond existing network functionality. In effect, it was a protocol for the world’s current and future needs. This was a fine aspiration, but trying to solve every known or projected issue, all at once and in a worldwide forum, was just too hard. The resulting standards were too complicated or too incomplete to implement, especially when TCP/IP was already working. The IETF is too practical, and far, far too nimble The Internet Engineering Task Force (IETF), which produces Internet RFCs and drafts, uses a guiding principle known as “rough consensus and running code”. The ability to move forward with working solutions without being bogged down in international law and geopolitics means that IETF standards significantly outpace their international counterparts, and are typically backed by a working implementation to boot! In contrast, the ITU/CCITT, which produced key ISO standards such as X.25 and B-ISDN in I.361, would meet every four years to make updates and solve problems. In theory, the world was supposed to patiently await their collective wisdom; in reality, IP simply ran the whole process over and never looked back to see what that bump in the road even was. Basically, you could summarize all of these reasons as “The world already had a workable set of interoperability protocols known as TCP/IP, and the cost of waiting for
What Is a Network? | 3 Download at Boykma.Com
official standards, which in the end always seemed to lack parity with the latest IP offerings anyway, was simply too jagged a pill to swallow.” So, why are we (seemingly) wasting your invaluable time with a discussion of a grand failure? The answer is because although the OSI protocol stack itself failed, the related reference model lives on as a common way of expressing what role some networking device performs. The OSI model sought to partition the challenges of end-to-end communications among dissimilar machines into a layered approach, in which the protocol options, roles, and responsibilities for each layer were clearly defined. Figure 1-1 shows the venerable OSI model in all its seven-layer glory, along with some selected protocol options for each layer. Note that upper layers were the least well defined, and few saw any production network use.
Figure 1-1. The OSI Reference Model
Key points about the model are: • Each layer interacts with a peer layer, which may be at the end of the link or at the actual receiver. In practical context, this generally means that a given layer adds some protocol header, and maybe a trailer, which is then acted upon and removed by the remote peer layer. 4 | Chapter 1: LAN and Internetworking Overview Download at Boykma.Com
• Some layers have a link-level scope whereas others have an end-to-end scope. A communications path can contain numerous independent links, but no matter how far-flung its constituent links are, it relies on a single Transport layer entity that exists only in the endpoints. • Each layer provides a service to the layer above it, and receives services from the layers below. • There is general modularity that provides options and the ability to “mix and match” specific technologies at a given layer. The specifics of each layer are opaque to those above and below it, as only service semantics are defined between the layers. This means that any LAN technology could be used to provide Link layer services to the Network layer, and in fact the ISO Connectionless Network Layer Service (CNLS) Network layer protocol could operate over Token Ring (802.5), CSMA/CD (802.3), and even Token Bus (802.4).* It should be noted that each such LAN technology typically came with its one slew of Layer 1 options, such as coaxial cable, twinaxial cable, or unshielded twisted pair (UTP).
Layer functions As noted previously, a layered model works by using a divide-and-conquer approach, with each layer chipping in to do its part. The main function of each layer is as follows: Physical layer The Physical layer is where the bits meet the road, so to speak. All communications systems require one. Layer 1 places bits onto the transmission medium for transmit, and pulls them off for receipt. It cares not what those bits mean, but some Physical layers have framing and/or Forward Error Correction (FEC) that allows them to detect problems and in some cases act better than they really are. Bits are the Protocol Data Units (PDUs) sent at Layer 1. EIA-232, SONET, V.32bis modems, and 1000Base-T are examples of Layer 1 technologies. Link layer The Link layer deals with frames. It adds a header and trailer to frame upper-layer traffic, and generally provides link-by-link error detection. Some Link layers also provide error correction and multipoint addressing, as well as multiprotocol support through a type indication. Frames are the PDUs sent at Layer 2. Frame Relay and HDLC, as well as LAN MAC frames, are examples of Layer 2 technologies. Network layer The Network layer is the first end-to-end layer. It can be said that a Network layer packet passes pretty much as it was sent, all the way to the remote endpoint. The Network layer identifies endpoints (not the next Link layer hop), and may provide error detection/correction, protocol identification, fragmentation support, and a
* Note that IEEE 802.x standards are prefixed with an additional “8” when adopted by the relevant OSI entity, thus ISO 8802.3 is equivalent to IEEE 802.3.
What Is a Network? | 5 Download at Boykma.Com
Type of Service (ToS) indication. Packets (or datagrams) are the PDUs sent at Layer 3. IP is a Network layer, as is X.25. X.25 is technically a Layer 3 packet protocol. When used to support IP it functions more as a link between two entities. When sending IP over X.25 it can be said that there are two Network layers, but in this context IP is seen as the real Layer 3 as its endpoints may lie beyond the endpoints of the X.25 connection. Much of the same is true of other connection-oriented technologies, such as the Public Switched Telephone Network (PSTN) in analog form and its digital cousin, the Integrated Services Digital Network (ISDN).
Transport layer The Transport layer deals with end-to-end error control and the identification of the related application process through ports (sockets). This layer may also perform connection establishment, sequencing, flow control, and congestion avoidance. The term Service Data Unit (SDU) is often used to describe what is sent or received when dealing with Layer 4 or higher. In the TCP/IP model, segments are the PDUs sent at Layer 4. Session layer The Session layer deals with session establishment, synchronization, and recovery. Given that we are now in the realm of things that never really happened, it’s hard to say what this means. TCP/IP has no official Session layer, but protocols such as Fault-Tolerant Overlay Protocol (FTOP) have a user sign-in phase. Presentation layer The Presentation layer deals with application-specific semantics and syntax. In theory, this layer can convert to some machine- and application-independent format—say, ASN.1—upon transmission, and then back into the desired format upon reception. This is a pretty tough row to hoe, and seems much like a protocol converter in a layer. Again, there is no real example to give, other than that TCP/ IP does use ASN.1 or HTML/XML data formats to help promote communications between dissimilar machines. Application layer The Application layer is not the application. It’s the application’s interface or API into the communication’s stack. This is akin to a Windows or Unix socket in the TCP/IP context. Figure 1-2 illustrates key concepts regarding layered protocol operation.
6 | Chapter 1: LAN and Internetworking Overview Download at Boykma.Com
Figure 1-2. The OSI model and an internetwork
Figure 1-2 shows two communicating pieces of data terminal equipment (DTE) along with what appears to be a router-based form of interconnection, given the presence of Layer 3 in the intermediate nodes. The lower portion details generic layer interaction. Note that each layer communicates with a peer layer, which may be at the other end of the link, or at the far endpoint depending on the layer’s scope. Each layer accepts service requests from the layer above it, and in turn makes requests of the layer below. The Network layer is the first end-to-end layer. As such, it’s technology-independent, meaning the same Network layer packet that is sent is pretty much the one received (minus the obligatory Time to Live [TTL] decrement designed to protect against routing loops). In contrast, Layers 1 and 2 vary by network technology type. Stations that communicate directly (i.e., those that share a link) must use compatible network technology. Stated differently, if the DTE on the left is running 10Base-T and is using Ethernet v2 framing, the first hop data circuit-terminating equipment (DCE)/router must be compatible. It may operate at 100 Mbps, given that repeaters and bridges can adapt Ethernet speeds, but it must support IP in Ethernet v2 encapsulation for communications to succeed across that link. If the connection is direct, the speed and duplex as well as other physical parameters must also match. The link between the two What Is a Network? | 7 Download at Boykma.Com
routers is a different link, and therefore does not have to be compatible with either DTE, as this link is not used for direct DTE communications.
Network Types and Communication Modes There are many different kinds of network technologies and methods for communicating information among some set of stations. Generally speaking, a network is classified as being a wide area, local area, or metropolitan area technology (i.e., WAN, LAN, MAN). In some cases, the same technology can be used in all three environments. At one point this was the promise of ISDN, and then B-ISDN (ATM), but now it seems to be the domain of Ethernet, which holds more convergence promise than any other Link layer protocol. Simply put, a LAN describes a set of nodes that communicate over a high-speed shared medium in a geographically confined area. A WAN can span the globe, tends to operate at lower speeds, and is often point-to-point (P-to-P) rather than multiaccess. Some multipoint WAN technologies are still in use; chief among them are Frame Relay and, in less developed parts of the world, the old standby, X.25.
Communication modes The exchange of information between endpoints can occur in one of several ways: Point-to-point As its name implies, this mode involves two endpoints, one as a source and the other as the recipient. Many WAN technologies are P-to-P. Modern P-to-P technologies are full duplex (FD), which means that both ends can send and receive simultaneously. Multipoint Multipoint topologies are often associated with WANs. Historically, a multipoint technology describes a hub-and-spoke (sometimes called star) arrangement whereby a central site can send to all remote sites at the same time, but each remote site is allowed to send back only to the central site, à la IBM’s polled Synchronous Data Link Control (SDLC) protocol. Multipoint also refers to virtual circuit technologies such as Frame Relay and ATM that allow a single physical interface to be used to send to multiple destinations by using the correct circuit identifier (i.e., a Frame Relay DLCI or ATM VCI). Broadcast A broadcast network uses shared media or some replication function to allow a single transmission to be seen simultaneously by all attached receivers. LANs always operate in a broadcast manner, making this one of their defining characteristics. Note that the use of switches (bridges) or routers isolates the broadcast domain, a technique used for both performance and security reasons.
8 | Chapter 1: LAN and Internetworking Overview Download at Boykma.Com
Broadcast networks can operate in simplex, half-duplex (HD), or FD mode based on specifics. Non-Broadcast Multiple Access (NBMA) An NBMA network is a form of virtual-circuit-based topology that does not permit true broadcast, but by virtue of having a virtual circuit to every other endpoint, an NBMA network can emulate broadcast functionality by sending the same message multiple times over each of its locally defined virtual circuits. NBMA networks can operate in simplex, HD, or FD mode based on specifics. Practically all modern network technologies are now FD anyway, but some distribution systems are inherently simplex.
So, Where Did We LANd? After the dust settled on the past 40 years of data networking, we may be so bold as to say that a few key trends have emerged: • OSI is dead, and we can only hope it’s resting peacefully, as the chip—nay, PDU— that it bears upon its shoulder would make for one nasty ghost. • IP is the dominant convergence technology that serves as the basis for everything from interactive data to email to telemedicine, virtual reality, and even old-school services such as telephony and many television distribution systems. There appears to be no serious threat to this venerable workhorse on the near horizon, except maybe its younger sibling, IPv6, which is creeping into more and more networks each day. • Ethernet rules the LANs, and most MANs, and is also being seen in long-haul WANs as part of Layer 2 virtual private network (VPN) services (that typically ride over IP-enabled Multiprotocol Label Switching, or MPLS, networks), or as native Ethernet as part of a PBB or long-haul SONET/SDH transport. Ethernet keeps getting faster (40 Gigabit Ethernet is now available) and cheaper, and updates such as Operational Administration and Maintenance (OAM) continue to extend its reach by providing it with some SONET-like maintenance and alarm-reporting capabilities. Ethernet is built into every PC, and virtually all broadband access is based on this Ethernet connection, attaching it to the DSL or cable modem used to access the service. The next section focuses on modern Ethernet technologies as a primer for what is to come in the rest of this book. Today the term LAN switching is assumed to mean Ethernet. For those with a penchant for obscurity and a bit too much money and time on their hands, we hear you can find Token Ring Media Access Units (MAUs) on eBay at bargain basement prices these days; just be sure to get the high-speed 16 Mbps version. Running at 4 Mbps would look bad given that Ethernet made the 10 Mbps leap back in 1980, when the Digital Intel Xerox (DIX) consortium published the ESPEC
What Is a Network? | 9 Download at Boykma.Com
v1 specification. There was even a (very) short-lived 32 Mbps “FD” Token Ring MAU available.
Ethernet Technologies Ethernet has been around for so long, and is now so widely used, that a complete overview would easily fill its own book. The goal here is to stay concise and to convey only key points to clear up areas that are known to cause confusion.
A Brief Look Back The philosopher George Santayana one stated, “Those who do not remember their past are condemned to repeat their mistakes.” It is to him that we dedicate this section. Well, him and everyone else who fell prey to buying into now-obsolete market failures such as ATM, Token Ring, FDDI, Token Bus, ARCnet, TCNS, or SMDS. All sought to solve the needs of high-speed communications over a shared medium, and all are now only footnotes in history—a history that is penned by the victorious Ethernet. Ethernet v2 is a de facto standard first published by the Digital, Intel, and Xerox vendor alliance. It was based on a prototype satellite communications network called ALOHAnet. When Bob Metcalf later adapted the technology to run over coaxial cable in the early 1970s, the term Ether was used to pay homage to its original use of electromagnetic radiation through the vacuum of space, whereby the alleged media was the mythical luminiferous ether, a substance that the ancient Greeks believed conducted the planets through their orbits. When used for minicomputers, LANs were a novelty. Enter the IBM PC in the early 1980s, and suddenly LANs are a hot commodity. The official standards bodies could not stand by and watch a vendor consortium do all the work. As a result, the IEEE 802 committee was formed to standardize LANs. The committee initially met in February 1980, hence the 80-2 Committee. What was Ethernet became IEEE 802.3, which then branched off into various mediumspecific standards such as 10Base-5, 10Base-2, 10Base-T, 100Base-T, 1000Base-TX, and so on. In the IEEE terminology, the number represents the bit rate, the term Base indicates the baseband (digital) signaling (there is a 10Broad36 spec for analog use over cable), and the last value identifies a medium, either indirectly via maximum segment length or by type. For example, the “5” in 10Base-5 means 500-meter cable length, which in turn indicates a thick coaxial cable medium, whereas the “T” in 10Base-T stands for UTP. Despite the blessing by an official standards body, the irony is that the most common usage of Ethernet is, in fact, actually Ethernet v2 and not 802.3. The next section details the differences so that you can speak the truth when describing your network.
10 | Chapter 1: LAN and Internetworking Overview Download at Boykma.Com
Ethernet or 802.3, That Is the Question According to the OSI model, LANs operate at Layer 1 and Layer 2. Hence, they are considered a Link-layer technology. In addition, a LAN’s Link layer is broken into two parts, or sublayers: the Media Access Control (MAC) and Logical Link Control (LLC) components. The goal here was noble. LANs should be able to provide a common service and interface to the upper layer (the Network layer), regardless of the fact that each LAN technology has a unique MAC sublayer that functions to provide orderly access to the shared medium. This makes some sense, in that a collision is unique to Ethernet LANs, so why should the IP layer know or care at all about one, as the same IP is also run over Frame Relay, which is a collision-free technology. In contrast, Ethernet specifies only a MAC layer, as shown in Figure 1-3.
Figure 1-3. Ethernet versus 802.3
Although there is a notable difference in the MAC layer, given that Ethernet uses a Type code and 802.3 redefines the field as a Length value, the real answer to the proverbial question of Ethernet or 802.3 lies in the absence, or presence, of the Length field and 802.2/LLC. If the frame has a Type field, it’s Ethernet, plain and simple. No magic is needed to differentiate between these two frame types because Type codes are selected to not conflict with valid IEEE Length values. Thus, any value less than 0 × 0600 is interpreted as a Length, and a value greater than 0 × 05DC is seen as an EtherType. In case you are doing the conversion, 0 × 05DC in hex symbolizes 1,500 Ethernet Technologies | 11 Download at Boykma.Com
bytes in decimal. The need to preserve this compatibility with Ethernet is one reason the IEEE 802.3 standard was never updated to support jumbo frames, which are frames larger than 1,500 bytes. An Ethernet frame identifies the upper layer protocol using an EtherType, where the value 0 × 0800 indicates IP. Because there is no length indication padding, which is needed for Ethernet as the smallest amount of user data that can be sent is 46 bytes, it has to be performed by the upper layers. This interlayer dependency, though long since accommodated by IP stacks, was seen as an egregious violation of the principle of layer independence. As such, the IEEE opted for a Length field at the MAC layer. This meant the MAC layer could now do its own padding, which is cool and all, but there was still a need to identify what the heck was in the frame. Enter LLC, which, from a practical perspective, pretty much functions to replicate Type code functionality, except now using three bytes rather than two, and you get to use fancy-sounding terms such as Service Access Point (SAP), which in the end simply identifies the upper layer. Note that another form of LLC is defined, LLC type 2, that provides a connection-oriented, reliable traffic exchange à la the connection-oriented balanced exchange procedures defined in Link Access Procedure, Balanced (LAPB). LAPB is used at Layer 2 of the X.25 model; in LANs, LLC type 2 uses a Set Asynchronous Balanced Mode Extended (SABME) initiation command to set up extended mode (modulus 128) sequencing, however. This LLC mode was used only in Token Ring/Bus networks, and then typically only for protocols such as the Systems Network Architecture (SNA) protocol. Need we say more? A third type of LLC, type 3, was never implemented. It provided a connectionless mode with acknowledgments. We already stated that IP is the Network layer protocol of choice in the modern world. Yes, there are standards that define how an IP datagram can be encapsulated in Ethernet, 802.3/LLC, or 802.3 with LLC, combined with the official standards-supported method of escape back to the use of an EtherType via the Subnetwork Access layer Protocol (SNAP), which, as indicated, accommodates the use of the original EtherType codes, except now conveniently buried within a SNAP header, which itself is embedded within an LLC header. Talk about wheels within wheels.... Although this is good to know, it must be stressed that Juniper Networks switching and routing gear running JUNOS supports only Ethernet-based encapsulations for IP. JUNOS is known to interoperate with all networking gear of consequence, and is found in most large IP networks and in the backbones of virtually all Tier 1 service providers. It would seem that lack of support for IP over IEEE 802.3 is not an issue for anyone, and this is the point that is made. Ironically, the only thing that uses 802.3 encapsulation in JUNOS is Intermediate System to Intermediate System Level 1 (IS-IS), which is an OSI-based routing protocol that was originally intended to support OSI’s CLNS routing. The irony is that for most JUNOS gear, actual CLNS routing is not supported; IS-IS is used to build, and this is the rub, IP routing tables! I’m not sure why, but I can’t help but smirk as I write this, being both an IP bigot and not myopic enough to fail to see the bold IP writing on the wall, so to speak. 12 | Chapter 1: LAN and Internetworking Overview Download at Boykma.Com
These days the practical truth is that IEEE 802.3 defines updates to the Physical layer standards and capabilities, and IP makes use of the faster speeds while choosing the relative comfort of an Ethernet-based frame; the fiber-optic medium or wire cares not one bit about the Type or Length field, so all is well. Unless you are specifically discussing LLC and the use of SAP, or MAC layer padding, the two terms are pretty much interchangeable, and are often used that way. This near synonymous nature is what often leads to confusion about the true differences, however.
The MAC Layer There are many physical varieties of Ethernet, but generally speaking they all share the same MAC frame format and protocol. This is one of Ethernet’s greatest strengths. Its specification was based on bit times, not rates, making it easy to ramp up the speed (typically by an order of magnitude), while leaving the rest untouched. It is worth noting here that the MAC we refer to is the entire Media Access Control layer of networking. A MAC address, which we all know and love, is merely a portion of this. All media have both PHY (physical) and MAC characteristics. The Ethernet MAC defines frame structure as well as the CSMA/CD shared media access procedure. There are a few MAC characteristics that bear some extra attention, so let’s get cracking.
CSMA/CD In its original form, Ethernet was based on a shared (not switched as is now the norm) medium and the use of a single baseband bit rate. This meant that only one node could actively use the cable at any time. Rather than bother with passing tokens or other shenanigans, Ethernet’s inventors opted for an opportunistic-based MAC called Carrier Sense Multiple Access with Collision Detection, or CSMA/CD. Sounds fancy, but humans do this all the time. We, after all, also share a medium and emit sound energy in the same band, which means there really should be only one person speaking at any time for maximum productivity. In CSMA/CD, a station that wants to speak first listens to sense whether another station is active. If so, it waits. This is the Carrier Sense part. As quiet for one is quiet for all, there is nothing to prevent multiple stations from seizing the opportunity (a case of carpe medium, to use yet another pun), and this would be the Multiple Access part. When this occurs all the messages are corrupted, so the stations involved should detect the collision so that they can start an exponentially increasing back-off timer and try again later. The Ethernet MAC algorithm can be summarized as “It’s nice to share, and if you have something to say don’t wait for an invitation; if at first you don’t succeed, try and try again, 16 consecutive times, and then give up,” as there is likely a cable fault (unterminated) that is causing the station’s own energy to reflect back (as a standing wave), which in turn activates the collision detection circuitry at every transmission attempt.
Ethernet Technologies | 13 Download at Boykma.Com
Opportunistic Versus Deterministic MAC Token-passing proponents were always fond of raising the fact that, in theory, an Ethernet LAN could fail to convey any useful information due to repeated occurrences of collisions, which simply waste bandwidth and time. This is true, in theory, much like there is a certain probability that a pot of water will freeze over a flame. Yes, it could happen, but no, it never has. By specification, an Ethernet LAN is permitted no more than 1,024 MAC entities. Each time there is a consecutive collision, a station picks a wait time, at random, from a pool that increases exponentially, until it hits 1,024 (the number of permitted nodes), and then truncates at 1,024 for counts 11–15. Although it’s true that some forms of Ethernet can have collisions, and that collisions result in resource waste, there has never been a confirmed case of a properly functioning Ethernet, with the supported number of MAC entities (1,024), ever having 16 consecutive collisions. Further, studies have shown that, on average, the time needed to successfully access the medium is lower for Ethernet than for a Token Ring LAN, where the latter wastes resources waiting around for the next token on an otherwise idle LAN. Stated differently, with Ethernet you might have to wait, whereas with Token Ring you know you have to wait, but when it’s your turn access is guaranteed. Think of taking the freeway versus taking a train or plane for a 50-mile trip. The freeway may be congested, slowing your progress; or it may not be, but you are allowed to enter the flow as soon as you can wedge your car in. A plane, on the other hand, generally leaves at some fixed time, one that I have always found myself waiting for (and all too often, even that fixed time was less than deterministic, in my humble opinion). So, I would choose the opportunistic system any day, and this choice is paralleled in LAN technology with the demise of all things token-based. The widespread use of FD Ethernet, enabled by switches, has eliminated the potential for collisions, which simply made a good thing all the better.
The shift away from shared media. The shift away from shared coax, to a hub-and-spoke (star-based) topology that was based on twisted pair, was a monumental point for Ethernet. Although no one could have imagined it at the time, advances in technology would shift these multiport repeaters into a bridging or switching role. Unlike a repeater, both of these devices terminate collision domains. Because a UTP link can have only two stations (P-to-P), and because of a separate transit and receive pair (or frequency), there was no reason to run HD anymore. This is significant, because in addition to doubling potential throughput by allowing simultaneous send and receive this also eliminated the potential for collisions. The ability to use preexisting UTP, a medium originally intended for analog telephone use at 20 KHz, to build a high-performance and highly survivable LAN was too much for the market to resist. Not having to deal with buying and installing coaxial cable was advantage enough. However, the shift to P-to-P links also eliminated the single point 14 | Chapter 1: LAN and Internetworking Overview Download at Boykma.Com
of failure associated with shared media. In theory, one cable break with Thick Ethernet, or one jabbering station that won’t shut up, could bring down the entire LAN. Now the repeater or switch port simply partitions to isolate the malfunctioning link/node to prevent such network-wide disruption. The shift from a bus to a star topology was followed closely by a bump in speed from 10 Mbps to 100 Mbps via the 100Base-TX standard. Ethernet has been the dominant LAN ever since, and is now, for all intents and practical purposes, the only LAN the world appears to need, or want, for that matter.
MAC addressing One part of the MAC layer specification is the shared media access method; the other is the frame structure. An important part of the MAC frame is the MAC address. Ethernet LANs use a 48-bit-long MAC address that is non-hierarchical or flat. Figure 1-4 details the structure of a MAC address. The Most Significant Byte (MSB) of the MAC address is sent first and is the high-order address octet.
Figure 1-4. MAC address structure
The MAC address contains flags to indicate whether it’s a group (multicast) or an individual (unicast) address, and whether the address is universally administered (via the IEEE) or is a locally assigned value. The broadcast address is a special form of multicast that uses all 1s to indicate it is intended for every station on the LAN. The network interface card (NIC) or Ethernet port’s burned-in address (BIA) is presumed to be globally unique by virtue of a managed vendor-ID space. Vendors apply for one or more blocks of MAC addresses, as identified by the first 24 bits, and are then responsible for distributing MAC chips with unique addresses using the remaining 24 bits.
Ethernet Technologies | 15 Download at Boykma.Com
The address space is said to be flat in that all 48 bits are needed to identify a station. There is no concept of information hiding or aggregation of multiple MACs into a single super MAC. A switch must know and learn (which means store) the complete 48-bit MAC address for every active station in the LAN. This is a significant point, as it impacts scalability. There is a reason that the worldwide Internet is not based on Layer 2 switching. No switch on Earth could learn and store a 48-bit address for every one of the more than 1.8 billion machines projected to form the Internet of 2010! (Source: http://www.clickz.com/stats/web_worldwide.) In contrast, routers operate at Layer 3, where the addresses that are used support hierarchical structuring. This allows a router to summarize (or hide) information, which in turn allows it to scale far beyond the scope of any Layer 2 device. Consider the common case of a single default route, which summarizes every possible IP address (more than 4 billion are possible) into a single table entry. A core router must be able to reach every host on the planet without relying on a default route. IP address hierarchy currently permits this feat with a table that contains only about 280,000 entries as this is written. Far better efficiency could be had if IP addresses were originally allocated in a manner that better accommodates summarization—a mistake that will, ostensibly, not be repeated with IPv6 address allocation.
Ethernet Standards Wrap-Up Ethernet technologies continue to evolve as speeds ramp up and new functionality, such as OAM, continues to breathe life into this venerable workhorse. Table 1-1 summarizes the characteristics of widely used Ethernet Physical layer standards. Table 1-1. Key Ethernet standards Standard
Speed/mode
Topology
Medium
Segment length
Comments
10Base-5 DIX 1980, 802.3 1983
10 Mbps/HD
Bus
Thick coax, RG-8/U
500 m
The original, vampire taps and all
10Base-2 802.3A 1985
10 Mbps/HD
Bus
Thin coax, RG-58
185 m
Bye-bye taps, hello BNC T connectors
FOIRL 802.3D 1987
10 Mbps/FD
Star
Two fibers
1,000 m
The beginning of starwired buses; P-to-P allows FD
10Base-T 802.3I 1990
10 Mbps/FD
Star
Two pairs Category 3 UTP or better
100 m
No more coax or expensive fiber media; the beginning of the end for other LANs
10Base-FL 802.3J, 1993
10 Mbps/FD
Star
Two multimode (MM) fibers, 62.5/125 μm
2,000 m
Updated FOIRL specification
16 | Chapter 1: LAN and Internetworking Overview Download at Boykma.Com
Standard
Speed/mode
Topology
Medium
Segment length
Comments
100Base-TX 802.3U, 1995
100 Mbps/FD
Star
Two pairs Category 5 UTP or better
100 m
So much for FDDI and its expensive optics
100Base-T4, 802.3U, 1995
100 Mbps/HD
Star
Four pairs Category 3 UTP or better
100 m
Uses eight wires, allows use of installed CAT-3 for 100 Mbps
100Base-T2, 802.3Y, 1997
100 Mbps/FD
Star
Two pairs Category 3 UTP or better
100 m
So much for 100Base-T4; same speed on half as many wires and FD
1000Base-LX, 802.3Z, 1998
1,000 Mbps (GE)/ FD
Star
Two single-mode (SM) fibers, 10 μm
5 KM/5,000 M
The first Gigabit Ethernet (GE) flavor
Two MM fibers, 62.5/125 μm
550 m
Two MM fibers, 62.5/125 μm, 50/100 μm
220 m
1000Base-SX, 802.3Z, 1998
1,000 Mbps (GE)/ FD
Star
1000Base-LH (SX) (nonstandard)
1,000 Mbps (GE)
Star
Two SM fibers, 10 μm
10–70 km
Non-standard flavor of 1000Base-LX with better optics
1000Base-T, 802.3AB, 1999
1,000 Mbps (GE)/ FD
Star
Four pairs Category 5 UTP or better
100 m
GE over UTP copper, albeit using all eight wires with echo cancellation for FD
10GBase-R, 802.AE, 2002
10 Gbps (10 GE)/ FD
Star
LR, SM 9/125 μm
10 km
SR, MM 62.5/125 μm
26 m
First 10 GE over fiber, both long and short reach
10GBase-T, 802.3AN, 2006
10 Gbps (10 GE)/ FD
Star
Four pairs UTP
55–100 m
550 m
A popular fiber flavor with wide deployment
Had to happen; 10 GE on UTP, needs CAT-6a for max distance
Note that the wide variety of Physical layer media options for Gigabit Ethernet (GE) has resulted in the concept of Small Form-factor Pluggable (SFP) optics. The optics name is somewhat of a misnomer here, as copper-based SFPs are also available. Note that 10 GE SFPs are called XFPs, and provide the same function. Although none too cheap, the ability to mix and match switch or NIC ports to the physical layer du jour by simply inserting the desired module is a big advantage. XFP support is especially important with 10 GE, given that there are at least 10 different Physical layer standards specified! The original version of this technology was referred to as a GE Interface Converter (GBIC). The newer SFPs have been further reduced in size and are sometimes called mini GBICs.
Ethernet Technologies | 17 Download at Boykma.Com
Currently the IEEE is working on standards for the next Ethernet speed overhaul, specifically 40GbE and 100GbE.
A word on auto-negotiation Table 1-1 makes it clear that there is no shortage of Ethernet flavors to choose from. With so many options, finding the set of mutual capabilities that yields the highest performance between any two pairs of nodes can be daunting. Automatic selection of the best level of compatibility is the motivation behind auto-negotiation. The current best practice is to use auto-negotiation rather than to hardcode parameters. Over the years, the standards have matured enough to work reliably, and manually setting these parameters has been found to be error-prone. Figure 1-5 shows the operating mode priority, which always selects the best mode that is mutually supported, as well as a table showing the outcome for various combinations of Ethernet autonegotiation pairings. The key takeaway is that pairing one end set for auto-negotiation with another end that is hardcoded is almost always a bad thing. The result is often a duplex mismatch, which can be a very nasty thing, as in many cases the result is significantly diminished performance that may not be detected and therefore will be allowed to remain in place, causing long-term service degradation. The issue is that the HD end senses the remote end’s FD operation as a collision, resulting in needless back-offs and retransmission attempts. Auto-negotiation has been defined in several IEEE standards, and is optional for most flavors of Ethernet. The protocol was updated and made mandatory for 1000Base-T as part of the GE 802.3a specification. Auto-negotiation is mandatory for normal 1000Base-T operation due to the need to determine the Master/Slave timing role for each end’s Physical layer; this function is unique to 1000Base-T, and is determined during the auto-negotiation process.
18 | Chapter 1: LAN and Internetworking Overview Download at Boykma.Com
Figure 1-5. Ethernet auto-negotiation
Ethernet Technology Summary Ethernet won the LAN battle. Today when the three-letter acronym (TLA) LAN is used, you can bet it regards some flavor of that tireless workhorse known as Ethernet. Although there was a time when a LAN switch needed to support Ethernet and Token Ring/FDDI ports, that time has passed. Yes, it has passed much like the proverbial
Ethernet Technologies | 19 Download at Boykma.Com
token, on into that great sunset that awaits all mortal beings, be they LAN, WAN, or (hu)MAN (pun intended). Juniper Networks’ EX switches are Ethernet-based. The information in the next section prepares the reader for upcoming deployment labs, which by matter of modern practicality are strictly Ethernet-based.
The TCP/IP Suite Having arrived here, you likely agree that Ethernet technology is the bee’s knees, so to speak, and is the be-all and end-all of all your local area networking needs. You have installed your shiny new EX switch, and you now have all those network ports just waiting for something to do. And then it strikes you. All that revved-up LAN infrastructure is little more than a doorstop without upper-layer protocols to drive useful data over it. A LAN, with its Physical and Data Link layer services, provides you with a grand communications potential, but you can realize this potential only when there are applications written to operate over that technology. There was a time when users were forced to choose one proprietary protocol suite over another; or as needs often dictated, when they ran multiple protocol suites to serve various user communities. Netware and its IPX/SPX had great file and print sharing, while Banyan Vines had a really cool directory service. Unix workstations and servers typically supported engineering communities with their Network File System (NFS), remote r commands, and related TCP/IP-based networking support. And who can forget AppleTalk and its DDP, often used for the graphic artist, or IBM’s SNA/SAA, often found transporting the business’s accounting and financial applications. Oh, and then along came Microsoft with its NetBIOS/NetBUI-enabled Windows for Workgroups solutions, which often found their way into ad hoc networks when they were not trying to compete with Novell. In the typical case, this litany of protocols would run on a multiprotocol backbone in a “ships in the night” fashion, passing each other by and never even being aware of the close encounters. Few hosts were bilingual, so most user communities shared a cable and little else. Protocol converters (remember those?) and application gateways were big business when users in different communities needed to interoperate.
Enter OSI At one point, the grand saviors to this mess were—you guessed it—the OSI’s ISO models and related ITU/CCITT standards. The plan was to have the world switch to a standards-based open system, which would then promote wide-ranging connectivity and, just as important, would once and for all end all the multiprotocol babble the world of networking was mired in. Too bad OSI imploded.
20 | Chapter 1: LAN and Internetworking Overview Download at Boykma.Com
What was left was pretty much what folks started with, which is to say some level of international standards that were actually in use and were intended to form the foundation of the larger OSI solution. This left people with circuit technologies such as dialup modems, ISDN, and leased lines, and a few packet-based options such as LANs and X.25 for WAN use. There was one new thing, however, and that was the idea of what a widely adopted set of open standards could do. By replacing multiple stacks with one, costs could be reduced, support was simplified, and there was greater potential for interoperability. Given that the OSI model was similar to the preexisting TCP/IP suite, that TCP/IP was known to work, and that it in fact did more every day than OSI accomplished in its whole life, a candidate came into focus. The fact that TCP/IP was well understood and widely deployed, was already supported on most operating systems, and was generally made available for free caused that candidate to again stand out. Once the U.S. government’s mandate of using only OSI protocols was exempted in the case of IP, until such time that equivalent functionality was available in OSI protocols, the writing was clear. The world had its communications savior, and its name was Internet Protocol. Thus began the mantra of IP over everything, and everything over IP.
Exit OSI, Enter IP As we ranted earlier, while all the OSI work was moving forward at its own snail-like pace, the fine folks at the IETF, the entity that generates Internet RFCs and drafts, kept on doing what was needed to solve actual issues and to create new functionality in the TCP/IP suite of protocols. A number of factors added up in IP’s favor, including the following: • The open nature of TCP/IP made the technology and its related specifications freely available. In contrast, OSI specifications cost money, and so did the resulting products, of which there were few. • TCP/IP was derived from early work on the DoD’s ARPANET, which went online in 1969! It was one of the first routed/packet-switched protocols ever implemented. TCP/IP’s original purpose was to avoid issues with the connection-oriented services of the day, which had a tendency to be disrupted every time some battle happened and bombs tore up phone lines. The TCP stack was intended to provide robust and resilient communications in battlefield conditions, and was known to work in this regard with a long field-proven history. I mean, who doesn’t want his Internet surfing at Amazon or his iTunes downloading to be robust and reliable, despite the near-battlefield conditions that comprise a modern distributed denial of service (DDoS) attack on large portions of the Internet’s infrastructure? • Because the U.S. government contracts were historically based on TCP/IP, and then later when OSI was mandated by virtue of the exception, for lack of OSI functionality, all OSs and products of any consequence had TCP/IP protocol The TCP/IP Suite | 21 Download at Boykma.Com
support. If it was not already built in and simply waiting to be activated, you could certainly find a TCP stack for a given OS far more easily, and for far less money, than some OSI stack that would at best let you use a subset of the functionality on a far more limited set of machines. • Sir Timothy John Berners-Lee invented the World Wide Web (WWW) application, and suddenly every normal (non-computer-geek) person, and quite literally his or her mother, could see a use for the Internet that they would be willing to pay for. Things always seem to get real popular real quick whenever there’s money to be made. • As much as this dates me, I can remember the pre-WWW Internet. There was FTP from a command line, and there were command-line search tools such as the FTP site indexer Archie, which in short time begat the updated (and Gopher-based) search capabilities of Jughead and, ultimately, Veronica. Yep, back in the day we would walk barefoot through the snow to our 2,400 bps dial-up modems, and we would be happy for the chance to use a command-line FTP client to download some plain-text copy of an RFC. Nope, we did not need images, fancy multimedia, a GUI point-and-click interface, or the ability to view the contents of our shopping carts. Nope, back in the day, when I went shopping I had an actual shopping cart in my hands, and I could look at its contents without any fancy click buttons (I say in my best cranky old-man voice). • After the web browser and HTTP/HTML, the Internet and its underlying TCP/IP enabler became “the WWW.” It still irks me to hear news reports of “The WWW is under attack due to ,” then in reality it’s the Internet that is being attacked and the stupid WWW application is but one of many that are affected. No one but us aged geeks seems to care that during these outages we’re unable to use the finger application to determine how many cans of soda are left in some science lab’s vending machine! The Internet is more than just the WWW. When the preceding points were factored, the choice was clear. The world already had a multivendor interoperable protocol, it was known to work, and money could now be made from it. TCP/IP became the de facto set of open standards while the official ones faded into that great night. Vive IP!
The IP Stack, in a Nutshell Once again we find ourselves broaching a subject that is extremely well documented, and found in numerous places. The wheel is not re-created here, as trees are far too valuable. Once again we try to stick to the facts and distill the most important and widely used set of protocols down to a few paragraphs. Wish me luck.... Figure 1-6 depicts the TCP/IP stack, along with some selected applications.
22 | Chapter 1: LAN and Internetworking Overview Download at Boykma.Com
Figure 1-6. The Internet Protocol stack
Figure 1-6 also shows the good old OSI model alongside the IP stack. After all, being able to compare non-OSI things to its well-delineated layers is about the only useful thing left of that grand effort.
The network that lies beneath As is so often the case, things begin in the physical realm, where the bits meet the media, so to speak. In the IP stack, both the Physical and the Link layers are combined into a single underlying Network layer. IP, which lives at Layer 3, is well shielded from the incredibly long list of supported technologies. For our purposes, we can place Ethernet technology here, allowing the Physical layer to be 10Base-2, GE over optical fiber, or whatever the current flavor of Ethernet happens to be. Likewise, the Link layer becomes CSMA/CD and the Ethernet MAC frame structure. For some flavors of Ethernet the MAC layer can dispense with collision detection (CD) and operate FD with no need for carrier sensing. In other modes both are still needed, as well as the binary exponential back-off algorithm used to recover from collisions. To help drive home the significance of layering and the beauty of layer independence, consider that in all of these cases the same IP entity operates in the same manner, albeit sending less, or more, as the physical link speed dictates. All the details are handled by the related layers, such that IP simply sees a datagram transmission and reception service.
ARP me, Amadeus Moving up, you next encounter Address Resolution Protocol (ARP). ARP is a critical component of IP’s independence from the underlying technology. Some technologies do not use link-level addressing, or are inherently P-to-P, and therefore do not require any dynamic binding of a destination IP address to a Link layer hardware address. In The TCP/IP Suite | 23 Download at Boykma.Com
these cases, ARP is simply not used. Multipoint links, such as a LAN, represent a different story, as shown in Figure 1-7.
Figure 1-7. IP and ARP—they taste great together
Figure 1-7 shows two IP stations that share an Ethernet link. At step 1, the user or her application specified an IP address as the destination for some session.† The IP layer forms the resulting packet, but before it can be handed to the MAC layer for transmission, the correct destination MAC address must be specified. IP looks for a match in its ARP cache, where recent responses are stored. Here, no match is located, forcing it to evoke ARP’s services, shown as step 2 in the figure. The ARP request is broadcast at the MAC layer to get around the “cart before the horse” issue of needing to talk to a station to learn its MAC address before you actually know its MAC address. In this example, the target is alive, and it sees the ARP request is intended for its local IP address. Its ARP reply contains its Ethernet MAC address, which completes the process. Usually this reply is sent as unicast back to the requester, but an unsolicited † In most cases, a Domain Name System (DNS) name is specified, but the result is an IP address, so we can skip the IP-to-domain name binding complexity for now.
24 | Chapter 1: LAN and Internetworking Overview Download at Boykma.Com
ARP reply can be broadcast to prepopulate ARP tables in what is known as Gratuitous ARP. Layer 3 to Layer 2 address resolution is a must when there are multiple possible destinations on a single medium. “Close” does not count in the networking world.
IP, freely Next up the chain is Internet Protocol (IP) itself. IP provides a datagram service to its upper layers. The term datagram implies a connectionless mode of operation and a resulting unreliable transport service. IP supports: • • • • • • • • •
Identification of source and destination network addresses A header checksum to detect corruption of its own header (not payload) A ToS (Type of Service) indication A precedence value to influence the probability of discard during congestion Fields to support and control fragmentation (and later reassembly) of large datagrams to accommodate dissimilar maximum transmission units (MTUs) A TTL field to limit effects of routing loops A Protocol field to identify the owner (the upper layer protocol) that is responsible for the datagram’s payload A Length field to accommodate padding, which is needed for Ethernet Options, which when present alter packet handling (i.e., source routing and record route)
A lot of functions, to be sure, but again note that IP does not provide connection setup, flow control, payload error detection, or a simple discard response (with no retransmission) in the event of IP header errors, or the inability to process for any reason (e.g., lack of buffers due to congestion). IP leaves those functions to the users of its service: the upper layers. Some applications—for example, broadcast media—may not care much about error correction as they are negatively impacted by any retransmission attempt, whereas other applications—say, e-commerce—will be quite concerned with error control, or at least one would hope. IP provides the same services to both and lets the upper layers sort things out. Note that some underlying network technologies—for example, X.25 or a Token Ring LAN running 802.2 LLC type 2—provide their own error detection and retransmissionbased correction, which is another good reason to leave IP streamlined and built for routing. X.25 was the only Layer 2 protocol to also offer error correction. At least until DOCSIS came along!
The TCP/IP Suite | 25 Download at Boykma.Com
When links are error-prone, relying on end-to-end retransmissions, as is the case with a protocol such as Frame Relay, it quickly results in extreme throughput degradation, even when only tens of such links are involved. For this reason, error-correcting Link layers are still used in support of IP when error-prone transmission links are used.
To carry the previous example of IP and underlying network technology independence a bit further, consider that an IP packet can easily cross tens of links between endpoints. Consider this traceroute from Juniper Networks headquarters in Sunnyvale, California, to the official government website for the Central Asian nation of Uzbekistan: bash-3.2$ traceroute www.gov.uz traceroute to www.gov.uz (195.158.5.137), 30 hops max, 40 byte packets 1 mrc2-core1-3.jnpr.net (172.24.28.2) 0.541 ms 0.517 ms 0.735 ms 2 172.24.19.33 (172.24.19.33) 0.447 ms 0.438 ms 0.421 ms 3 172.24.230.90 (172.24.230.90) 1.287 ms 1.274 ms 1.497 ms 4 ns-egress-fw-vrrp.jnpr.net (172.24.254.6) 1.213 ms 1.196 ms 1.403 ms 5 66.129.224.34 (66.129.224.34) 1.926 ms 1.911 ms 1.893 ms 6 POS2-1.GW5.SJC2.ALTER.NET (208.214.142.9) 1.873 ms 1.675 ms 1.659 ms 7 161.ATM4-0.XR2.SJC2.ALTER.NET (152.63.48.82) 2.325 ms 2.311 ms 2.293 ms 8 0.so-1-0-0.XL2.SJC2.ALTER.NET (152.63.56.141) 2.391 ms 2.376 ms 2.357 ms 9 0.ge-3-0-0.XT2.SCL2.ALTER.NET (152.63.49.110) 3.363 ms 3.324 ms 3.555 ms 10 sl-crs2-sj-0-1-0-1.sprintlink.net (144.232.9.1) 4.744 ms 4.733 ms 4.710 ms 11 sl-crs1-rly-0-4-2-0.sprintlink.net (144.232.20.187) 74.735 ms 70.007 ms 73.500 ms 12 sl-crs1-dc-0-8-0-0.sprintlink.net (144.232.19.213) 69.516 ms sl-crs1-dc-0-122-0.sprintlink.net (144.232.19.223) 69.208 ms sl-crs1-dc-0-8-0-0.sprintlink.net (144.232.19.213) 69.481 ms 13 sl-bb20-par-1-0-0.sprintlink.net (144.232.19.147) 159.589 ms 158.893 ms 159.475 ms 14 sl-bb21-fra-13-0-0.sprintlink.net (213.206.129.66) 159.159 ms 159.999 ms 159.981 ms 15 sl-gw10-fra-15-0-0.sprintlink.net (217.147.96.42) 174.860 ms 174.846 ms 174.828 ms 16 sl-MTU-I-278357-0.sprintlink.net (217.151.254.134) 160.784 ms 161.635 ms 160.751 ms 17 bor-cr01-po3.spb.stream-internet.net (195.34.53.101) 220.050 ms 220.278 ms 219.633 ms 18 m9-cr01-po4.msk.stream-internet.net (195.34.53.125) 210.818 ms 211.339 ms 210.590 ms 19 m9-cr02-po1.msk.stream-internet.net (195.34.59.54) 213.698 ms 213.475 ms 214.951 ms 20 synterra-m9.msk.stream-internet.net (195.34.38.38) 213.879 ms 213.869 ms 214.622 ms 21 83.229.225.243 (83.229.225.243) 230.080 ms 229.762 ms 229.750 ms 22 83.229.243.98 (83.229.243.98) 259.745 ms 260.105 ms 259.709 ms 23 195.69.188.148 (195.69.188.148) 282.930 ms 282.916 ms 283.508 ms 24 195.69.188.2 (195.69.188.2) 276.545 ms 276.534 ms 276.887 ms 25 84.54.64.66 (84.54.64.66) 277.306 ms 278.145 ms 278.347 ms 26 firewall.uzpak.uz (195.158.0.155) 283.783 ms 283.323 ms 282.876 ms 27 ta144-p86.uzpak.uz (195.158.10.181) 278.743 ms 276.536 ms 277.146 ms 28 195.158.4.42 (195.158.4.42) 276.802 ms 277.392 ms 276.766 ms 29 195.158.5.137 (195.158.5.137) 284.062 ms !X 284.042 ms !X 283.711 ms !X
26 | Chapter 1: LAN and Internetworking Overview Download at Boykma.Com
Here, the results show that a fair number of hops are needed to reach the target site. As an upside, the presence of .uz domains near the target indicates that at least the website resides in a faraway and exotic land, as opposed to being hosted in some Silicon Valley-based company. A key aspect of IP internetworking, and of routers in general, is that on each such link a completely different type of network and transmission technology can be used. The packet’s first hop might be over a modern LAN in sunny California, whereas a subsequent link may involve a jaunt in a Frame Relay frame transported via a trans-Atlantic SONET link that runs Point-to-Point Protocol (PPP). And later yet, as the IP packet nears its final hop and, likely, middle age, given that its TTL field has been decremented at each hop, the packet could jump into an X.25 packet, where it’s well protected for its arduous journey over an error-prone analog leased line the recipient uses for Internet access. In summary, IP is a lot like the U.S. postal service, or any non-registered mail system for that matter. Your envelope indicates who the letter is from and where it’s going, using hierarchical addressing that permits information hiding, whereby more and more of the address becomes significant as the letter winds its way to the destination. Here, all the stuff up to and including the street address is like the IP address, and the recipient’s name is like a protocol identifier. You can have multiple protocols at the same IP, just as multiple people can dwell at the same address. You can pay more for airmail, or save with bulk, which is a reasonable analogy to IP’s ToS indication. There is some weight/size limit, and if in excess of this limit the package may have to be split into smaller parts (fragmentation). Although no doubt diligent in the face of snow and all that, regular mail is a connectionless service that is only a best effort. You do not need permission to send someone a letter (no connection establishment), and simply dropping a letter in the mailbox is no guarantee that it will be delivered successfully, but in most cases it will. All of this sounds exactly like what IP does, except that IP deals with packets and not packages.
IP addressing IP addressing is a topic that is well covered in numerous other places. Technically, this being an Ethernet-based LAN switching book and all, it could be argued that anything above Layer 2 is beyond the scope of this book. Yes, this could be said. But to do so would ignore the truth that virtually all new networks are IP-based, and each day some multiprotocol LAN gets closer to pure IP nirvana as one more of its legacy protocols is decommissioned in favor of IP transport. As such, a thorough understanding of IP addressing is critical for anyone dealing with LAN switching in the modern context. So, the packet stops here, to use yet another poor pun, and we pause to take a very condensed tour of what matters in IP addressing. It’s only 32 bits. How bad can it be?
The TCP/IP Suite | 27 Download at Boykma.Com
Hierarchical. This is nothing but a fancy way of saying an IP address has more than one part. Here, we mean it has both a network and a host portion. This is significant, and to a large degree it is what allows a router to scale to a worldwide Internet while a bridge would melt under the “load” of all those MACs. The takeaway: routers route to networks, not hosts. The host portion of IP is of concern only to the last hop router when it attempts direct delivery. In fact, because routing is based on a longest match, it’s likely that remote routers are even ignoring parts of the network portion because of supernetting, which is also called route summarization. In the end, the router only needs to direct the packet out a sane interface, one that gets it one step closer to its destination on a path that is not a loop. You do not need to examine 30 bits of network address to do this; trust me. In fact, some non-core routers may use a default route, which is the ultimate in information hiding. The 0/0 route by definition says the router should try to match zero bits. Matching against nothing always succeeds, and is always the least specific match possible, but it’s a match nonetheless. Using a default means that in effect, the packet is routed not by virtue of matching its destination address particulars, but quite the opposite: by virtue of matching none. Hence a low-end router can still forward to each of the 4 billion possible IPv4 addresses with a single default route entry, along with its directly connected network. If the router has two egress interfaces, two default routes in the form of a 0/1 and a 128/1, each pointing to a different interface, of course, this provides pretty decent load balancing to all possible destination IPs. Not bad, huh? I’d like to see you do that with a bridge. Classless is the norm (or, how we learned to subnet). When first envisioned, IP addresses were class-based. Figure 1-8 shows the original IP address class breakdown along with a binary-to-hex-to-dotted decimal conversion example. Figure 1-8 has a lot of information, and all of it is important. The left side shows the original IP address class breakdown. The address class is determined by the setting of the high-order bits. For example, a Class B address always begins with a 10 pattern, as shown. Behind this plan was the perception that computers were special-purpose machines and that the Internet would remain an academic/military community, so the early Internet architects saw a need for a few very large networks (Class A), a good number of medium-size networks (Class B), and a larger number of small networks (Class C). The figure shows that for each class, there is some number of supported networks, and each such network in turn supports some number of host computers. The box on the upper right shows the net effect in the form of how many networks are available in each class (126 for Class A), along with how many hosts each such network class supports. The math is a function of 2 to the power of the address space (7 and 24 for Class A networks and hosts, respectively), and then subtracting 2 for the combinations of all 0s and all 1s, which are generally reserved for indicating this and all, respectively.
28 | Chapter 1: LAN and Internetworking Overview Download at Boykma.Com
Figure 1-8. “Classy” IP addressing
To be effective with IP addressing, you must understand binary, hexadecimal, and the more human-friendly dotted decimal format, as all are needed at various times when working with IP. Remember when working with hexadecimal that you break each byte into two nibbles of four bits each. The resulting values therefore range from 0 to 15, but in hex 10–15 are coded as the letters A–F, respectively. In contrast, when working on the decimal value, all eight bits of the byte are grouped to yield a value from 0 to 255. The dashed box on the lower right of the figure provides an example of this conversion process. This busy little box also shows the IP network byte order, which has the most significant bit of the MSB sent first, from left to right. Stated again, bit 0 is the most significant of the 32 bits that make up the IP address, and it’s the first bit sent. The loworder octet also shows a power-of-10 breakdown for each of the eight bits in the octet. In this example all are set to 0, hence the value shown in Figure 1-8. A setting of 11000000 codes (128 + 64), or 192, as it has the bits for both 128 and 64 set. In hex this would be a C, given that 1100 0000 codes (8 + 4) = 12. The class-based scheme was a fine plan, but as things worked out, classful addressing is far less than ideal. The updated IPv6 protocol has no such concept, and in all practicality, neither do modern IPv4 networks. The problem is basic inefficiency. It’s great that a single Class A network can support more than 16 million machines and all, but The TCP/IP Suite | 29 Download at Boykma.Com
that many machines on one logical subnet is preposterous (from a performance and reliability design perspective). Heck, even a single Class C, with its support for 254 hosts, is generally wasted in a routed environment. LAN-based routed networks tend to have tens, rather than hundreds, let alone thousands, of machines. In the end, what people wanted was more networks, each with fewer hosts. As noted, the issue is that a recipient of a single Class A network would be hard-pressed to go back to his regional numbering authority to ask for yet more network numbers, when it was shown that he was using only a small fraction of the host space available in the Class A allocation he already had. So, what does it mean that nearly the first command everyone enters on an IOS-based router is ip classless, which provides support for IP subnetting (and supernetting)? No such command is needed in JUNOS, so that’s one less command for you to type.
Classless IP routing simply means that for each IP address (prefix) there is an associated network mask. In contrast, with classful routing the address’s class is used to derive a presumed network mask. Having an explicit mask allows the user to define what portion of the 32-bit address identifies the network; once the network portion is known the remainder is considered to be host addresses. Subnetting is the process of extending the mask, making it longer so as to extend network numbering into the host field. Thus, more networks are gained, at the cost of fewer hosts on each network. Supernetting is the opposite, and creates fewer networks by reducing network mask length. Supernetting is an important concept behind Classless Inter-Domain Routing (CIDR), which is an effort to summarize networks into fewer routing entries, wherever possible. This is done to try to keep the size of Internet routing tables from growing at a pace that outstrips computer processing power, a real threat that at one point genuinely jeopardized global Internet stability! Figure 1-9 shows classless IP routing at work. An often misunderstood aspect of CIDR is the fact that different network masks are used, at different places, to route the same packet! The network mask does not have to be the same length, except for the collection of hosts that attach to the same logical IP subnet/network. As a result, a core router may use a default (class-based) network mask to direct traffic to a customer’s network attachment point. In Figure 1-9, a Class B address is assigned, resulting in a /16 mask, which is also represented in the pre-CIDR notation format of 255.255.0.0. Within the customer’s network, the single Class B address has been subnetted, in this example to provide some 254 additional subnets through a /24 (or 255.255.255.0) network mask.
30 | Chapter 1: LAN and Internetworking Overview Download at Boykma.Com
Figure 1-9. Subnetting and supernetting
Subnetting and supernetting are now old news in IP. Their widespread use is doing much to forestall the predicted demise of available IP addressing space, as well as the meltdown of core routers due to impractical routing table size, several times over.
VLSM and Discontiguous Subnets Variable Length Subnet Masking (VLSM) refers to the ability to assign network masks of varying lengths to different portions of a network to maximize the proverbial bang for the IP addressing buck. For example, /30s, /31s, or even /32s might be used on P-to-P links, whereas /26 might be assigned to a LAN. There is no magic here, as IP routers always route to the most specific, or longest, match. The key is in having a routing protocol that supports the conveyance of a network mask along with the IP prefix. Older protocols such as Routing Information Protocol (RIP) v1, or Cisco’s IGRP, lack this capability, which forces you to use the same mask length each time a given (major/class-based) address is assigned. This is because the lack of network masks in routing updates forces the local router to assume that major/classful prefixes that match a local address assignment must use the same mask length as that assigned to the interface on which it was received. When VLSM is used, these assumptions are not valid and routing problems can surface. Problems with discontiguous subnets are also related to routing protocols that do not convey a network mask. The issue is when some network address—say, a Class B 172.16—is subnetted on two routers that are separated by a link with a different major The TCP/IP Suite | 31 Download at Boykma.Com
network (not a 172.16) address. In this case, protocols that do not support a mask perform auto-summarization to the classful network, resulting in both ends sending and receiving the same 172.16/16 update. The result is the loss of subnet routing for the discontiguous subnets. Using a routing protocol such as Open Shortest Path First (OSPF), IS-IS, or RIP v2, solves both issues through inclusion of an explicit network mask along with each network prefix.
ICMP, the bad news protocol Moving up the stack in Figure 1-6 we next hit the Internet Control Message Protocol (ICMP). ICMP is classified as a sublayer. ICMP is an official part of IP, but is itself encapsulated inside IP and is therefore shown above it. ICMP is often used to report errors when handling IP datagrams, hence the not-so-funny title of this section. Common errors are Destination Unreachable, TTL Expired, Options Handling Issue, and Fragmentation Needed But Not Permitted. ICMP messages can also be used to provide information such as reporting a timestamp or the local link’s subnet mask. ICMP is the mechanism behind the echo request and response functionality affectionately referred to as ping.
UDP, multiplexing, and not much else User Datagram Protocol (UDP) provides a best-effort connectionless Transport layer service. Recall that Layer 4 is the first end-to-end layer, and is therefore processed only by the destination machine. Given that IP is also a best-effort protocol, it can be said that UDP does not add much in the way of reliability. UDP offers no error correction or flow control; it does provide error detection (with silent discard) against the UDP header and payload. UDP’s most important function is the notion of ports. The port abstract is similar to a Unix socket, and provides multiplexing among multiple processes that each share the same IP address. Recall that the IP layer’s Protocol field identified the owner of its payload, which may be UDP. IP then hands its payload to the UDP process, where the first step is error detection. If all is well, the UDP header is stripped and the destination port is used to direct the packet’s payload to the appropriate process. Port values below 1023 are standardized for use by well-known (server) processes. Clients pick their port at random, selecting some unused value in the ephemeral range of 1,024 to 65,535. In most cases, services that can use multiple transport protocols, that is, either TCP or UDP, use the same port values; the Protocol field at the IP layer ensures there is no ambiguity in such cases. The connectionless nature of UDP makes it well suited to point-to-multipoint applications (multicast) and short-lived transactional services such as DNS queries.
32 | Chapter 1: LAN and Internetworking Overview Download at Boykma.Com
TCP, a transport for all seasons Transmission Control Protocol (TCP) provides reliable, connection-oriented services. TCP supports ports for the same reasons as UDP, but in addition, TCP has: • Connection setup, maintenance, and teardown phases that ensure that both ends agree regarding connection state. Traffic can be sent only when connected. • Flow control, which prevents data loss due to lack of a buffer in the connection endpoints (not at the IP layer). • Error detection based on a header/payload checksum, as well as through sequenced exchanges. This provides detection for corrupted data, in addition to lost or duplicated data, the latter being conditions that often occur given the datagram operation of the underlying IP. • Retransmission-based error correction based on sophisticated congestion avoidance and recovery mechanisms that attempt to optimize communications among endpoints with greatly dissimilar processing capabilities, and to intelligently monitor and adapt to current end-to-end transmission delays. Given that everything from Layer 3 down is often switched in datagram fashion (connectionless), a method of operation that’s officially classified as unreliable, it’s obvious how important TCP is to the world. When data integrity matters, and when you need to move a lot of information, TCP is likely your protocol of choice. The connectionoriented nature of TCP means that in some cases, more traffic is sent to set up and tear down a connection than is actually sent over the connection, and that a given TCP connection can connect only two endpoints.
What’s this Internet thing for again, eh, sonny? In the IP suite, applications are found directly above the Transport layer; there is no discrete Presentation or Application layer, but some IP applications provide these types of services. Some applications—for example, ICMP, or OSPF routing—make direct use of IP. Other routing options, such as RIP and Border Gateway Protocol (BGP), make use of UDP or TCP, respectively. More end-user-focused applications such as Telnet allow terminal emulation, or file transfer via FTP. And then there is HTTP, the grand enabler of the modern Internet. Combined with the HTML specification, this is the only application that most people will ever use (to the extent that the Internet has become synonymous with the WWW, much to the irritation of this author). The Internet existed long before the WWW, and was quite useful to those with some level of .clue. The WWW allowed the great unwashed masses to rush in and make immediate productive and commercial use of the Internet. Although this killer app single-handedly ended the old geeks’ club that was the academic- and research-focused Internet, it also did a lot to boost router sales, which for me is reason enough to welcome HTTP into the IP suite.
The TCP/IP Suite | 33 Download at Boykma.Com
From email to telemedicine, e-commerce to games, you can bet your last packet there’s an IP application written to support it.
IP encapsulation example Figure 1-10 shows the TCP/IP stack at work, with an example of IP encapsulation within an Ethernet frame.
Figure 1-10. TCP/IP-over-Ethernet encapsulation example
This example begins with a TCP acknowledgment segment that needs to be sent. Although user data can be piggybacked onto such an ACK segment, this assumes that some user data is pending, and that’s obviously not always the case; the lack of user data does not exempt the TCP entity from having to ACK traffic received from the remote end. If we assume no TCP options (in many cases, options such as a maximum segment size or a timestamp are present), then a 20-byte TCP segment, the minimum size of its header, is passed to the IP layer. Along with the data are internal semantics (primitives in OSI-speak) that convey variables such as the destination IP address, and special ToS values, and so forth. The IP layer accepts its duty and builds the needed header. Again, assuming no options, that’s another 20 bytes, for a total of 40 when the TCP header is also factored. Ethernet has maintained the need for a minimum frame size, which relates to ensuring reliable collision detection as a function of a frame’s minimum transmission time versus the maximum allowed propagation delay; basically, the station should still be sending by the time its signal has propagated to the far end and any resulting collision has had time 34 | Chapter 1: LAN and Internetworking Overview Download at Boykma.Com
to make it back. The result is a need for four bytes of padding, which is added by IP and accounted for via the Length field. Any data outside the datagram’s total length is assumed to be padding and is discarded by the far end. As is so often the case, the PDU rolls downhill only to darken Ethernet’s door. The service request also tells Ethernet to set the Type field to 0x0800, IP’s EtherType, and in our case, we can assume a successful ARP cache hit so that the next hop’s MAC address is also passed along.
Direct Versus Indirect Delivery IP is all about routing. One of the most basic aspects of IP datagram forwarding is a routing decision in the form of whether the destination address is on the sending machine’s local subnet. If it is, direct delivery is performed and the ARP and subsequent packet are sent out over the interface with that direct route. When the target subnet does not match a local subnet, indirect delivery is needed. This simply means that one or more intermediate stations will need to forward the packet on the local station’s behalf. Forwarding other people’s traffic is what routers are all about, so here the next hop would be to a device with at least two network connections, and with a willingness to forward traffic between those interfaces—in other words, a router. Usually an end station uses a default route to direct all non-local traffic to its default gateway (router). From there the packet typically picks up more intelligent forwarding that is based on least-cost routes that are dynamically learned via routing protocols that operate between the routers. An important point about indirect delivery is that a packet that’s intended for a remote machine is sent to the MAC address of the local subnet’s default router. The router takes notice, strips the frame, and performs a longest-match lookup against the destination address, only to find that, alas, once again it’s not the intended recipient (routers get lonely, too). After stiffening its lip and decrementing the TTL, the same IP packet is then reframed and sent out of a different interface to the next forwarding hop, where the process repeats until either the packet arrives at the target host (in which case you have a /32 match, which is as long as it gets, baby), or the packet’s TTL expires and it’s ignominiously discarded, with nary but an ICMP (TTL expired) error message that suffices as its death knell.
Ethernet constructs its frame, populates the destination MAC and the Type field with the value provided by IP along with the service request, and goes about the dirty work of successfully placing the frame upon the wire. At the remote end, a reversal of this process occurs, ending with the remote TCP receiving its ACK and flushing its retransmit buffer of the related data, resting in what it knows is a job well done.
Internet Protocol Summary IPv4: it made the Internet what it is today, and what it will be tomorrow. It’s the OSI that worked, and it’s here to stay, so we deal with it. Each time the protocol is predicted to have met its natural limit, due to a lack of addresses, a need for class of service (CoS), The TCP/IP Suite | 35 Download at Boykma.Com
VPNs, encryptions, or something else, some bright engineers find a good workaround. For example, Network Address Translation/Port Address Translation (NAT/PAT) has done much to extend IP’s useful life by allowing use of a private network addressing space within a private network, which is then translated and effectively hidden behind a lesser number of real IP addresses. As another example, IP Security (IPSec) was originally planned to be inherent to IPv6 but was backported to its predecessor, providing one less compelling reason to change what is still working. With all of that said, IPv6 is making headway into today’s networks. Many mobile devices are IPv6-enabled, and believe it or not, we are heading into a world where we will be surrounded by IP-addressable entities, be it your refrigerator, washing machine, or cable TV box. IPv6, with its 128-bit addressing space, combined with what we learned from IPv4 address allocation mistakes, promises that future generations will be free from having to worry about the Internet running out of addresses every few years. This is good, as it seems they will have plenty more to worry about, but that is another story and one best not told here. IP is the convergence technology of choice in today’s networks. It rides over every type of transport, and if it can be digitized, it likely rides inside IP. IP over everything and everything over IP. Learn it. Live it. Love it.
LAN Interconnection Or: Repeaters, Bridges, and Routers, Oh My! This section focuses on terminology and technology surrounding modern LAN interconnection. Given the qualifier, you can safely presume there will be no discussion of Source Route Bridging (SRB), translational bridging, or multiprotocol routing. When you’re bridging in a purely Ethernet environment there is no need to translate, and SRB is but a part of the dark Token Ring past that surfaces only to haunt humanity in the occasional bad dream. Figure 1-11 shows the relationship of LAN interconnect devices to the OSI model. Once again the OSI model shows its remaining utility. One simple figure makes it clear that repeaters operate at Layer 1, bridges at Layer 2, and routers at Layer 3. This means that repeaters spit bits, bridges frames, and routers packets. You cannot get to a packet without first dealing with the frame in which it was encapsulated. Thus, Figure 1-11 shows that routers process the Link and Physical layers. However, unlike a repeater or bridge, a router terminates both in its bid to obtain access to the inner Network layer packets, which are reframed and sent on the egress link. Some key characteristics of each device are described in the following subsections.
36 | Chapter 1: LAN and Internetworking Overview Download at Boykma.Com
Figure 1-11. LAN interconnect and the OSI
Repeaters As noted, a repeater is a Physical layer device that regenerates the signal to compensate for transmission losses and distortion. There was a time when repeaters were very common, as bridges and routers had not yet been invented, or were very slow storeand-forward-style boxes that were expensive in terms of both money and performance impact. 10Base-T and its related hubs were initially multiport repeaters. Such a repeater was sometimes call a bus in a box, given that it extended the collision domain and provided no filtering. Besides extending distance, repeaters also improved reliability through their partitioning functions. This feature would logically disconnect a segment that had a continuous carrier, a condition that could otherwise lock out the entire LAN. Repeaters were associated with the handy 5 4 3 rule of thumb that indicates the maximum size of an Ethernet CD should consist of no more than five segments interconnected by four repeaters, of which only three of those segments can be multipoint; the remaining two are supposed to be repeater-only P-to-P links. These limits were intended to prevent issues with repeaters robbing bits from frames to the point where they would be deemed corrupted, and the added delays of longer transmission paths that impacted CD as a function of minimum transmission time. Repeaters propagate collisions, and therefore prevent FD operation.
LAN Interconnection | 37 Download at Boykma.Com
The widespread use, and therefore low cost, of Ethernet switching has made the repeater a thing of the past. Who wants a bus in a box when you can get a switch in a box for the same price?
Bridges A bridge is a device that operates at Layer 2 and provides a filtering and forwarding function. Historically, bridges were store and forward, which meant the entire frame had to be received before it could be processed; the result was high latency and low packets per second (pps) rates. Modern bridges operate in a cut-through mode, which means they can begin processing and even forwarding a frame while it’s still being received. At one point, the higher performance of cut-through was something to brag about, so vendors called such devices switches. Advances in silicon and design mean that now everything is switched, making the term switched somewhat ambiguous. Because routers and other devices can also operate in cut-through mode, it’s best to qualify such statements with the layer in question, as in “I have a Layer 3 switch” when referring to a router. Ethernet bridging is transparent. This means that end stations are not aware of the bridge, and therefore they take no special steps to go from their local segment to a remote one. The bridge listens to all traffic, learns the source MAC addresses, and then filters and forwards based on the destination MAC address. The result is that known unicast traffic is only sent out of the port that leads to that device. Other stations do not see this traffic, which allows them to make their own transmissions at the same time, thereby increasing overall throughput. Bridges used to be expensive; historically, they tended to offer only a few ports, and only some offered WAN interface support to offer remote bridging. Bridges terminate collision domains, which is what makes FD Ethernet, and remote bridging, possible. Because multiple stations can simultaneously transmit on different bridged segments, a bridge can also dramatically improve performance. In theory, a two-port bridge takes one big segment from 10 Mbps to two smaller ones, each with 10 Mbps.
Protocol-agnostic Bridges operate at Layer 2. A bridge can support Ethernet, or Token Ring, or both in some manner or another. There is no such thing as an IP bridge. IP is inside a frame, and bridges do not make it that far. In similar fashion, there is no such thing as an Ethernet router. Ethernet, with its flat MAC addressing, is not routable and never will be. Figure 1-12 shows a bridge in operation.
38 | Chapter 1: LAN and Internetworking Overview Download at Boykma.Com
Figure 1-12. Bridging
Key in Figure 1-12 is the conveyance of entire frames, based on a MAC address database. Note that the payload can be any Upper Layer Protocol (ULP) and is not processed or inspected in the act of bridging. Also of note is that being transparent, the end stations are not aware of the bridge. As such, all stations believe they are on the same network from a Layer 3 perspective. This is shown by virtue of the same IP network 192.168.0.0/24 appearing on both sides of the bridge.
Loops are bad, really, really bad Given that the bridge bases its forwarding decisions on the MAC address, and that unknown MACs are flooded, or sent over all links except the link on which the frame was received, there is a definite issue with redundant/parallel links in a bridge’s environment. If both links are forwarding, such flooded traffic repeatedly ping-pongs back and forth. This is bad enough at Layer 3, but given that Layer 2 has no TTL mechanism to limit the number of iterations, the entire Layer 2 network can crash as a result of a broadcast storm. Given the fatal result of a loop, it’s clear that transparent bridging, by its nature, must operate across a set of links that are known to be loop-free. To ensure that this was always the case a specific protocol known as Spanning Tree was invented. Spanning Tree Protocol (STP) operates between bridges and uses a number of parameters to LAN Interconnection | 39 Download at Boykma.Com
guarantee that only one forwarding path is operational between all endpoints (we cover STP in detail in Chapter 6). STP is optional, but most bridges use it. STP simply blocks redundant links. If there is no redundancy there is nothing for STP to do, and it’s therefore not needed. Bridge processing in detail. This section describes the basic operation of a transparent bridge. We cover most of these processing actions in more depth in subsequent chapters. Our goal here is to provide you with a big-picture overview to ensure that you keep sight of the forest despite all those trees. Listening An STP-capable bridge first listens to determine the presence of other STP entities, and to determine whether, based on their parameters, the local port should be blocked or should transition to the learning state. Blocking Based on the exchange of STP messages the port may be blocked. In the blocked state it does not learn, or forward. It continues to listen for STP messages to catch the case where a change in topology allows the local port to become unblocked. Learning After leaving the listening or blocking state, a bridge port spends some time cramming for its big test by learning as many MAC addresses as it can. Bridges learn by promiscuously monitoring all traffic, and inspecting the Source MAC (SMAC) of each frame it sees. The goal of the learning delay is to prevent the flooding that occurs when a bridge has to forward an unknown MAC address. Learning is an ongoing process, and is also used to catch MAC moves, which is when an SMAC is found to ingress on a different interface. Filtering and forwarding After building its MAC address table through promiscuous monitoring of all traffic, the bridge then filters and forwards traffic based on the Destination MAC (DMAC) address. The bridge inspects the DMAC of each frame it sees. When the DMAC is associated with a learned SMAC entry on the same port, the frame is filtered, as the target station should already have a copy. When the DMAC of the received frame is associated with a learned SMAC on a different port, the frame is forwarded out of that port only. When the DMAC is unknown, the bridge has to flood the frame, which is the act of sending a copy out of all ports, except the ingress. Ongoing flooding can impact network performance. The assumption is that as a result of the flood, the target station will reply, which then allows its SMAC to be learned so that subsequent traffic can be filtered and forwarded. This is often referred as transparent bridging. Books on bridging usually walk through the transparent bridging and source route bridging models. In today’s networks, switches generally implement transparent bridging, as source route bridging was usually reserved for Token Ring networks, which you will have a hard time finding these days.
40 | Chapter 1: LAN and Internetworking Overview Download at Boykma.Com
So much for the 80/20 rule. The rule of thumb used to be that a well-designed LAN had 80% of its traffic local to that segment/CD, and the other 20% switched to a remote location. The goal was to avoid the painful performance hit associated with bridges back in the day. A modern star-wired Ethernet uses a switch with P-to-P-oriented link types to form a star-wired LAN. The effect is a shift to a 0/100 rule, and the switched rather than repeated nature means that each station is offered dedicated throughput based on its access speed. Thus, a 24-port GE switch can, in theory, offer each attached device a dedicated FD GE transmission link, and the aggregate throughput of the switch could be 48 Gbps! (That’s 24 Gig × 2 for FD.) I’m not trying to sound cranky, but back before the Great War we were happy with a shared 10 Mbps of HD throughput, and that wasn’t even guaranteed, given that collisions could bring that to zero if a large number of stations were attached.
Routers Folks started shifting from repeaters to bridges as the technology matured. A few problems began to surface with large bridged internetworks. Some of these were: • No tolerance for loops and poor use of redundancy as only one path can be active. • No TTL mechanism, making loops fatal and causing a need for loop restriction. • No traceroute or ping. Troubleshooting a Layer 2 network is difficult, as things either work end to end, or they don’t. Transparency is great, until something is broken. • Not well suited to dissimilar network types/no fragmentation support. • No explicit CoS mechanism (until 802.1p), and then not finely grained. • No IP layer processing, and therefore no firewall filters or IP services such as IPSec or NAT. • Poor performance when there’s a lot of Broadcast, Unknown, or Multicast (BUM) traffic, flooded over all ports, much like a (slow) repeater. Routers operate at Layer 3 and were seen as a solution to the aforementioned issues. The fact that routers are specific to each Network layer protocol created the need for Multiprotocol Routing (MPR) when more than one Network layer protocol was in use. Some protocol stacks were unroutable, as they either had no network layer, or in the case of SNA were connection-oriented and therefore had endpoint addressing present only during connection setup. Figure 1-13 shows a router at work.
LAN Interconnection | 41 Download at Boykma.Com
Figure 1-13. Routing
Key in Figure 1-13 is the fact that the same network packet is passed through the router, and that the router attaches to different networks. The Link layer is used to get packets to and from the router; at ingress the frame is stripped, and at egress a new one is built. The IP packet is processed by the router, but that packet flows all the way to the endpoint. The only change at the IP layer is a decremented TTL field, and the resulting updated header checksum. Note that in the routed model the frame’s MAC layer always identifies a next hop on the local link. As a result, the frame on the first hop identifies the router’s MAC address, rather than that of the target station. ARP is not routable, and as such a station never attempts to ARP a remote destination. Note that if Figure 1-13 were based on bridges rather than routers, the two stations would be on the same network by definition. As such, the ARP exchange would pass through the bridge and operate end to end between the IP endpoints.
Multi-Protocol Routing As routers began to get faster, the benefits of routing began to take their toll on bridging. The mantra Route when you can, bridge when you must developed to show this sentiment. In some cases, you had to bridge due to lack of routing support for that protocol on that router, or because the protocol itself was unroutable. The trend was to keep unroutable protocols local, to provide workgroup types of connectivity, and to only route across the WAN for backbone connectivity. Although this required more work to configure and set up, routers simply had too many advantages over bridges when all was said and done, especially at a large scale or in complex types of connectivity. 42 | Chapter 1: LAN and Internetworking Overview Download at Boykma.Com
Routed Versus Routing There is often confusion between a routed protocol such as IP and a routing protocol such as RIP. The former involves packets that transit routers based on a longest match against their destination address. In contrast, the routing protocol populates the router’s routing table based on the dynamic exchange of routing protocol messages. Most IP routing protocols actually ride inside IP, but generally speaking they are not themselves routed in that they are sent only to the next neighboring router. Thus, a router uses its directly connected links to learn how to reach directly connected neighbors, and with this reachability a routing protocol then exchanges messages to convey knowledge about remote destinations. The routers select what they feel is the best path for each destination and install that entry in their routing table. You can still route IP without an IP routing protocol; you just need a single router such that everything is directly connected, or the administrative burden of trying to maintain full and logical connectivity using static routes.
One protocol to rule them all. MPR became a drag, and even more so with the addition of each new routable protocol to an existing backbone. Although technically feasible, the world’s shift to IP transport did not come quickly enough to spare some from the resulting torment. Can anyone remember running Cisco’s EIGRP to simultaneously support IP, IPCX, and DDP? Or how about the alternative that had you run IP RIP, IPX RIP, and AppleTalk’s RTMP simultaneously to achieve the same thing (three separate routing tables, one for each protocol)? The need to route AppleTalk is gone, and IBM’s SAA is now based on IP transport. Their respective applications live on, but they’re now provided via an IP infrastructure. The result is a renewed focus on all things IP, both in the routing and in the LAN switching fronts. The migration to an IP-based world has led to some interesting side effects, such as bridges that are IP-aware. Such a device can inspect the IP payload of certain traffic to perform a service, such as validating an ARP request based on a previous Dynamic Host Configuration Protocol (DHCP) exchange. Although a violation of the layer principle, such capabilities are common for devices that can process at both Layer 2 and Layer 3, such as is the case with the Juniper EXs. You should avoid the temptation to refer to such a device as an L Brouter, however. The world already went there once, and it wasn’t fun. Many set off on the quest to find the definitive definition of that mythical beast; most have yet to return.
LAN Interconnect Summary The modern state of LAN interconnect is all about IP routing over wide areas and Ethernet-based switching in the campus or workgroup. Most IP switches are also capable of IP routing. This gives you the freedom to bridge when you want and to route when you want, using the same device and in some cases the same interfaces. Talk LAN Interconnection | 43 Download at Boykma.Com
about the best of all worlds: high-performance switching with IP-enabled features in the workgroup, with a high-performance routed IP backbone for communications with remote groups.
Conclusion The world has a long history with LANs and the resulting desire to interconnect LANs over both local and remote areas. Many a failed technology is strewn along the roadside, but we seem to have arrived at a good place. IP is the internetworking protocol of choice. Ethernet is the LAN technology of choice. Bridging and routing allow you to interconnect at the Ethernet or IP layers, as your needs dictate. This section provided a review of Ethernet and IP technology, as well as that of LAN interconnect, with more than a bit of cranky commentary along the way as to how we got there. You should now be well prepared to launch into the remainder of this book, which is focused on the use of Juniper Networks’ EX LAN switches in a Layer 2 environment.
Chapter Review Questions 1. Which is true regarding 802.3? a. Uses a Length field and LLC b. Uses a Type field and LLC c. Does not use LLC d. Defines a Token Ring LAN 2. What is the first layer with end-to-end flow? a. Layer 1 b. Layer 2 c. Layer 3 d. Layer 4 3. True or False: a bridge extends a LAN’s collision domain. 4. What is the role of ARP? a. Permits Layer 2 and Layer 3 address independence b. Is used in Ethernet only c. ARP is not required in a bridged network d. All of the above
44 | Chapter 1: LAN and Internetworking Overview Download at Boykma.Com
5. How many networks and how many hosts can you address with a 200.0.0.0/30 address? a. 1/2 b. 2/2 c. 10/10 d. 200/200 6. What class is the IP address 128.69.0.0/24? a. Class B with a Class B mask b. Class B with a Class C mask c. Class A with a default mask d. Class C with a default mask 7. What type of media is common in a star-wired bus? a. Thick coax b. Thin coax c. UTP d. Fiber e. Both C and D 8. In the indirect delivery model, the source station sends an ARP for which of the following? a. The target host b. The next hop, which is a default gateway c. The next hop, which is a bridge d. None of the above; ARP is not needed for indirect communications 9. What protocol provides a reliable transfer service? a. IP b. ICMP c. UDP d. TCP 10. What type of error message does a bridge send when it needs to fragment but is unable to do so? a. An ICMP fragment needed error b. An ICMP destination unreachable error c. An IGMP fragment needed error d. None of the above; it does silent discard and cannot generate any errors
Chapter Review Questions | 45 Download at Boykma.Com
11. Which author wrote this chapter? a. Opinionated “Hot-Head Harry” b. Just-the-facts “Diplomatic Doug”
Chapter Review Answers 1. Answer: A. 802.3 LANs use both a length code to provide padding at the MAC layer, and LLC to identify the upper layer. 2. Answer: C. IP, a Network layer protocol, is the first with end-to-end scope. Although it is end to end, IP is acted upon at each routed hop. TCP, a Transport layer protocol, goes end to end and is generally processed only by the endpoints. 3. Answer: False. Unlike a repeater, a bridge terminates the CD. 4. Answer: A. ARP is used in all LANs and some WANs, as well. It’s needed because of the independence between Layer 2 and Layer 3. 5. Answer: B. The address provided is a network address, so only one network can be addressed as 200.0.0.0/30. On that network you can have a host 1 and a host 2, given there are two host bits to work with. The combinations of all 0s and all 1s are generally not permitted. You could use VLSM to further subnet—say, to a /32, which would yield two networks with the same number of hosts, assuming there is support for /31 addressing on that device. 6. Answer: B. The 128 in the high-order octet indicates that this is a Class B address. Such an address has a default network mask of /16 or 255.255.0.0. This is a subnetted Class B that is using a Class C mask. As the whole notion of classes is gone, it’s best to just say this is a prefix with a 24-bit mask. 7. Answer: E. Coax cable was rarely used P-to-P, and was a true multipoint bus. UTP and fiber mandate P-to-P-type links, on the other hand. 8. Answer: B. ARP is always used for IP over LANs. In indirect delivery, the next hop is the router/default gateway, so that is the MAC address that is resolved via ARP. 9. Answer: D. Of the others listed, only UDP is a Transport layer, and it provides best-effort service. 10. Answer: D. This is a trick question, perhaps. Ethernet bridges are transparent. If it were to send an error message, it might blow its cover. 11. Answer: A. Yes, it was Harry. But he is old enough to have formed such opinions, being one of the few who actually spent time learning OSI and writing classes on Token Ring. If anyone is interested, he can sell you all of his OSI and Token Ring/ SRB materials cheap.
46 | Chapter 1: LAN and Internetworking Overview Download at Boykma.Com
CHAPTER 2
EX Platform Overview
Juniper Networks’ long-awaited entry into the Ethernet switching market began on March 31, 2008, with the release of the EX3200 and EX4200 Ethernet switching platforms. To date, Juniper Networks has been notable for its wide range of highperformance IP routing platforms that share a common JUNOS Software code base. Although Juniper’s hardware and application-specific integrated circuit (ASIC) design prowess should not be underestimated, many consider JUNOS to be the real mojo behind the company’s success. JUNOS software has been field-tested and proven robust in the largest service provider networks on the planet. Add in its unique usability features and the benefits of a single code train and you can begin to understand why JUNOS enjoys such brand loyalty among its users. This chapter details the hardware design and general capability of the EX platforms, and introduces foundation concepts of JUNOS software and the associated commandline interface (CLI). A detailed discussion of Juniper’s routing platforms and IP routing in general is beyond the scope of this book. Readers interested in these topics can consult product documentation, training materials, or any of the numerous books published on the subject, including this book’s companion volume, JUNOS Enterprise Routing, by Doug Marschke and Harry Reynolds (O’Reilly). For information on general routing in a JUNOS software environment, check out the JNCIA-M, JNCIS-M, JNCIPM, and JNCIE-M study guides, which are currently available from Juniper Networks in PDF format as a free download at http://www.juniper.net/training/certification/books .html. To help put the EX product line into perspective, here is an overview of the current JUNOS-based routing and switching product lines: J Series routers to include the J2300, J2320, J2350, J4350, and J6350 The J Series routers are software-based platforms that offer predictable high performance and a variety of flexible interfaces that deliver secure, reliable network connectivity to remote, branch, and regional offices. M Series routers to include the M7i, M10i, M40e, M120, and M320 The M Series multiservice edge routing platforms provide advanced IP/Multiprotocol Label Switching (MPLS) edge routing services at scale. These ASIC-based 47 Download at Boykma.Com
platforms offer a wide range of interfaces and service capabilities with throughput ranging from 5 to 320 Gbps. T Series routers to include the T320, T640, TX Matrix, and T1600 The T Series core routing platforms offer ASIC-based forwarding performance, an extensible design, and numerous carrier-class reliability features. A single T640 can offer up to 320 Gbps of throughput (640 Gbps full duplex, or FD), and can be upgraded to a T1600 with 1.6 Tbps of capacity, or clustered as part of a TX matrix to scale up to 2.5 Tbps! MX Series Ethernet routers to include the MX240, MX480, and MX960 The MX platforms are focused on Ethernet-centric services within carrier networks. The MX960 offers up to 960 Gbps of switching and routing capacity with up to 480 Gigabit Ethernet ports and 48 ports of 10 Gigabit Ethernet per system. The EX3200, EX4200, and EX8200 series Ethernet switch portfolio from Juniper Networks represents a new era in networking. This family of high-performance, carrierclass networking solutions is designed to address evolving business requirements while enabling a secure, reliable network that’s ideal for today’s converged network deployments. EX technology supports low-cost fixed configurations, and grows as you need Virtual-Chassis options and a carrier-class Terabit Chassis model. The EX switches run the same JUNOS software train as found powering the world’s largest routing systems, and with that come the ease of use and reliability for which Juniper has become famous. As a general note, the term enterprise network is used to describe a network that serves the communication needs of its owner, rather than the needs of the network owner’s customers, such as is the case in a service provider’s network. Although it’s safe to assume that a typical service provider’s network is both large and complex, such assumptions prove troublesome in the case of the enterprise network. Here we could be dealing with scales that range from a PC and printer interconnected via local cabling, all the way to a multinational entity whose network may exceed the node count and general complexity of a Tier 1 service provider’s network.
Juniper currently positions the J Series and the M7i/M10i platforms as enterprise-level devices, but a large enterprise network could justify the performance of a T Series platform. In fact, the reverse is also true in that a traditional service provider network may find an appropriate need and use for platforms designated as low-end enterprise gear— for example, as part of a managed CPE service or in a performance monitoring or routeserver role. In a similar fashion, the new EX Series of switches, both in the smallest fixed configuration or as part of a large Virtual Chassis (VC), are expected to be found in both provider and enterprise networks alike. Given the ever-increasing popularity of all things Ethernet, and the seemingly endless need for increased connectivity and applications with larger bandwidth demands, the future seems bright for highperformance switching gear. 48 | Chapter 2: EX Platform Overview Download at Boykma.Com
So, whether you operate a modest enterprise or a gargantuan service provider network, the chances are good that sooner or later you will be exposed to Juniper’s routing and switching equipment, and likely on several different hardware platforms. The saving grace is that JUNOS software is pulled from a single train of code with a common feature base that is largely shared across all platforms. So, regardless of your actual hardware platform, there is a single version of software code to load, and perhaps more importantly, to learn. Having a single code train has lots of hidden benefits, such as stability, ease of expandability, and lower operational costs. Once you get used to a consistent set of features and configuration syntax across a multitude of platforms, it’s hard to go back. Especially when that single code base has more than 10 years of proven, rock-steady performance in the largest IP networks ever deployed. The topics covered in this chapter include: • • • • •
EX platform overview and general capabilities Hardware architecture and packet flow JUNOS software overview CLI overview Other cool CLI features and capabilities
EX Hardware Overview Juniper Networks entered the switching market with the release of the EX3200 and EX4200 platforms. Both switches offer up to forty-eight 10/100/1,000 Gigabit Ethernet ports and support for an optional 4× Gigabit Ethernet/2×10 Gigabit Ethernet uplink module. The EX3200 supports a field-replaceable power supply unit (PSU) and a fan tray with a single blower. You can also use an optional remote power supply (RPS) to provide redundant power. The EX3200 is typically deployed in the access layer or for small-scale LAN deployments, but still packs some serious forwarding performance: the 24-port models offer 88 Gbps of throughput and forward Layer 2 traffic at wire rate, on all ports, clocking in at a respectable 65 Mpps. The 48-port version bumps these numbers up to 136 Gbps and 101 Mpps! Figure 2-1 shows the EX3200 chassis front and rear panel connectors. The EX4200 platform adds carrier-class reliability and VC clustering capabilities, allowing it to scale up to 480 Gigabit Ethernet and twenty 10 Gigabit Ethernet ports, while consuming only 10 rack units (RUs) and providing the ease of management associated with a single network entity. Each standalone EX4200 supports redundant load-sharing PSUs and a multiblower fan module, both of which can be hot-swapped in the field. As with the EX3200, the remote PSU option is also supported on the EX4200.
EX Hardware Overview | 49 Download at Boykma.Com
Figure 2-1. The EX3200 chassis
When part of a VC, each chassis is linked by a virtual backplane that supports a ring topology that allows survival of single-backbone cable faults. The VC backbone can operate at up to 128 Gbps (64 Gbps FD). In addition to the standalone redundancy features, a VC configuration supports redundant routing engines (REs) with 1:N redundancy. This is because any EX4200 chassis in a VC can become a backup (and therefore could be elected as the master) RE, such that in a three-chassis VC there will be a master and a backup RE, as well as one chassis functioning as a Line Card (LC) that is awaiting its chance to become the backup RE, in the event of a failure of the current master or backup RE. When the platform redundancy and VC features are coupled with JUNOS software capabilities such as Graceful Routing Engine Switchover (GRES), In-Service Software Upgrades (ISSU), Graceful Restart (GR), and Non-Stop Routing (NSR), it’s easy to see that the availability of a VC (or redundant 8200 series) can approach “five 9s.” EX support for High Availability (HA) features in the JUNOS Software 9.2 release, along with general design principles, is detailed in Chapter 11. Complete details on EX VC technology are provided in Chapter 4.
50 | Chapter 2: EX Platform Overview Download at Boykma.Com
Several significant JUNOS HA features are not supported for EX switches in the 9.2 release. For example, NSR is not supported, and by extension neither is ISSU. Currently, EX HA software features include GR for Layer 3 routing protocols (Border Gateway Protocol [BGP], Open Shortest Path First [OSPF], and Intermediate System to Intermediate System [IS-IS]) only. GRES is supported in a VC or with an EX8000 series with redundant REs.
The EX4200 is often deployed in the distribution layer of large-scale LAN designs. In this capacity, it terminates multiple feeds from access layer switches and aggregates them onto high-speed uplinks for transmission into the core. The EX4200 provides the same wire-rate throughput and switching capacity as the EX3200, but also includes two 54 Gbps Virtual Chassis Port (VCP) ports for switching over a VC. When in a VC, each member switch is still capable of local switching at wire speed. The result is that a 10-member VC in which all traffic is locally switched provides a total switching capacity of 1.36 Tbps (10 × 136 Gbps), with an aggregate throughput of 1.01 billion packets per second! Figure 2-2 shows the EX4200 chassis front and rear panel connectors.
Figure 2-2. The EX4200 chassis
Both fixed-configuration switches offer high port density, full or partial Power over Ethernet (PoE), a rich set of Layer 2 bridging capabilities, robust IP routing, and hardware-based Layer 2/Layer 3 security features built into the base software license. When coupled with its industry-leading wire-rate forwarding performance and the proven EX Hardware Overview | 51 Download at Boykma.Com
track record of JUNOS software, it would seem that Juniper was serious about its entry into the Ethernet switching market. It’s worth noting that both the EX3200 and EX4200 chassis support the same uplink and PSU part numbers, which greatly simplifies sparing. It’s suggested that when PoE is used anywhere in the network, all spare PSUs should be sized according to the largest need. You can always install a 930-watt supply in a chassis that does not require that much power, with no ill effects. Later, when the failed supply is repaired, the highercapacity PSU can be returned to the spare pool. In contrast, inserting a power supply with insufficient wattage results in deactivation of PoE on as many ports as needed to remain within the switch’s available power budget. You can mix AC and DC PSUs on the EX4200. However, currently the DC PSU cannot provide power to PoE ports. This capability may change in the future and is based on the belief that DC power is typically used within a service provider’s network, or in data centers, where PoE for end-user devices is not generally required.
The EX8200 Series Not wanting to rest on its laurels, Juniper soon followed this one-two EX punch with the high-performance, fully redundant, chassis-based EX8200 series. The 8200 series represents some serious switching iron designed for the most intense data center and high-capacity backbone environments. The EX8200 is expected to ship with JUNOS Software 9.4. The 8208 offers eight 200 Gbps I/O slots in a 14-RU footprint, while the 8216 doubles that number in only 21 RUs of space. Note that in FD terms, each I/O slot represents 100 Gbps of FD capacity. As such, both models are 100 Gigabit Ethernet ready, with the EX8208 supporting 384/64 1 GE/10 GE ports and the EX8216 sporting up to 768/128 1 GE/10 GE ports. The 8200 series switches are normally deployed in the core of a large-scale LAN deployment. The 8200 series EX switches are based on a 1.2 GHz PowerPC platform and ship with 1 GB of flash memory that can be upgraded to 4 GB. Figure 2-3 shows the front of an EX8216 switch. The EX8208 has eight dedicated LC slots, two switch fabric/RE slots, and one switch fabric-only slot on the front panel. The EX8208 uses a single fan tray that provides sideto-side airflow, and six power supply bays located on the front of the chassis base. The base model ships with two PSUs, one switch fabric/RE module, and one fabric-only module. A fully redundant configuration adds a second switch fabric/RE module, and fully loads all six power supply bays. The EX8216 has 16 dedicated LC slots, 2 route engine slots on the front of the chassis, and 8 switch fabric slots at the rear of the chassis. The 8216 incorporates two fan trays (side-to-side airflow), and six power supply bays at the front base of the chassis.
52 | Chapter 2: EX Platform Overview Download at Boykma.Com
Figure 2-3. The EX8216 chassis
The EX8200 series switches offer fully redundant REs, switching fabric, power supplies, and cooling to maximize reliability and uptime. And, as already mentioned, all EX switching platforms run the same JUNOS software to provide consistent configuration and capabilities across the entire switching line, and given the single JUNOS software train, EX switches are also consistent with much of the routing line as well! In the initial offering, the EX8200 series does not provide PoE options. This is in keeping with its targeted market of data centers and service provider networks where PoE is typically not required. Future versions may support PoE as customer needs dictate. Figure 2-4 provides a typical campus network that is based on current best practices for both scalability and reliability.
EX Hardware Overview | 53 Download at Boykma.Com
Figure 2-4. Best practice campus design
54 | Chapter 2: EX Platform Overview Download at Boykma.Com
The important thing to notice in Figure 2-4 is the presence of three distinct network partitions in the form of access, distribution, and core. Within each partition, specific hardware and protocols are deployed to optimize performance and reliability, while also reducing costs. The access layer is often based on a Layer 2 solution using low-end switches with limited redundancy. Layer 2 access control, user authentication, flow-based rate limiting/ policing, and class of service (CoS) functionality are typically performed at the network edge. The distribution layer provides intra-access switching and aggregation of traffic into the core. Distribution devices often integrate Layer 2 and Layer 3 functionality, providing switching for the access layer and routing toward the core. This is a key point given that routed networks, although more complicated, have many advantages over a pure Layer 2 design; this design keeps the edge simple and adds Layer 3 complexities where maximum benefit is achieved. The distribution layer is typically tasked with Layer 3 security and services, that is, firewall filters and Network Address Translation (NAT), as well as CoS-aware high-speed switching between the access and core layers. The core layer is typically based on high-speed Layer 3 routing between distribution layer devices, and to external network attachments. In most designs, the core layer is not responsible for securing or policing individual flows, as these functions are best suited to edge layer devices. Core devices tend to act on aggregate bundles, or traffic classes, with regard to policing or CoS-related processing actions. Both the core and distribution layer devices need to have HA given their critical role in the network. Generally speaking, network HA is influenced by hardware and software reliability/redundancy within each node, and the presence of redundant network connections between these nodes.
Separate Control and Forwarding: It’s a Good Thing As with other Juniper Networks routers, EX platforms share the same design philosophy of a clean separation between the control and forwarding planes. Such a design provides protection from unanticipated loads in either plane, and also accommodates technology-specific solutions for the equally difficult but orthogonally opposed problems associated with running modern, complex signaling and routing protocols (control plane), while simultaneously forwarding and oftentimes touching (i.e., altering a packet’s CoS marking) large numbers of packets (data plane). EX platforms facilitate this divide in software through a mix of built-in rate limiting and access control lists (ACLs), an approach that has proven successful in the J Series product line. This virtual separation helps to ensure that devices continue to function and are reachable for corrective actions, even during abnormal levels of control or data plane activity, whether the result of a network malfunction or configuration error, or
EX Hardware Overview | 55 Download at Boykma.Com
due to an intentional denial of service (DoS) attack. Figure 2-5 shows the general design of Juniper Networks routers and switches.
Figure 2-5. The separation of control and forwarding
As with Juniper routing platforms, in the EX Series the control plane is instantiated by an RE running JUNOS software, while the forwarding plane is an ASIC-based entity referred to as the EX Packet Forwarding Engine (EX-PFE). Figure 2-5 shows how the RE runs JUNOS software, which provides the CLI and general management access and troubleshooting tools (ping, traceroute, etc.), and maintains the master copy of the routing/switching table, which is built through static configuration or by dynamic Layer 2/Layer 3 bridging/routing protocols. The RE also maintains and monitors the PFE, and keeps its copy of the routing/switching table current as network conditions change. Meanwhile, the PFE lives to forward frames (or packets when operating in Layer 3 mode) as fast as it can. It faithfully accepts the next hop forwarding instructions and performs the required binary searches to quickly locate the Media Access Control (MAC) address or longest-match IP address, so packets may be quickly dispatched toward their networking fate. In keeping with the “Performance Without Compromise” slogan touted for Juniper’s routers, the EX switches implement security and CoSrelated services in PFE hardware at wire speeds.
56 | Chapter 2: EX Platform Overview Download at Boykma.Com
This design means that the RE is never directly involved in packet forwarding (i.e., there is no process switching), which ensures that sufficient resources are available for actual control functions such as processing a Spanning Tree Protocol (STP) or OSPF routing update. Traffic that is received by the PFE, but that needs to be processed by the RE, is termed exception traffic, in that it must be sent to the RE for additional processing. Exception traffic is subjected to rate-limiting and access-control features that ensure that the RE and its communications link to the PFE are not overrun during periods of excessive exception traffic, such as might result from a DoS attack, or by unintended address learning churn resulting from a Layer 2 loop. As a practical example, consider the ability to issue the equivalent of a debug all command in a production network, without actually degrading transit and local processing performance! On some vendors’ gear, such a command could easily lead to additional network disruption stemming from the local device’s inability to maintain forwarding rates, given the added processing burden imposed by packet debug. Adding a new problem never makes troubleshooting the original issue any easier, and is why the user is often warned against using such debug commands in production routers. A tool that you cannot risk using due to unpredictable impact to network operation is a tool not worth owning. This situation does not arise on Juniper switches, which is what the separation of control and forwarding is all about, and why no such admonitions exist in the EX documentation regarding traceoptions, which is equivalent to debug in the JUNOS world. Just because you can does not mean you should. Best practice dictates that no device should be unnecessarily burdened with superfluous processing. Besides making sense, this helps to guard against the camel’s back syndrome, in which each added processing burden has no ill effect, until the camel’s back finally breaks, spilling packets all over the desert sand. Although you can trace all protocol activity in a production network given JUNOS safeguards and design characteristics, this does not mean you should leave such tracing in effect after it’s no longer needed. The rule of thumb here is to jump in, set up tracing, figure out what is wrong, fix it, confirm the fix, and then remove the now unneeded tracing.
EX Hardware: The Numbers The previous section provided a general description and overview of the EX switching line. This section summarizes the system feeds, speeds, and general capabilities of each EX model. We begin with Table 2-1, which details supported port types, counts, and related power draw with and without PoE for the EX3200 and EX4200 switches.
EX Hardware Overview | 57 Download at Boykma.Com
Table 2-1. EX3200 and EX4200 ports and power draw Switch
Ports
Port type
PoE ports
Max power (with PoE)
Uplink option
EX3200
24
10/100/1000Base-T
8
190 (320) W
4-port Gigabit Ethernet (GbE) (SFP) 2-port 10 GbE (XFP)
24
10/100/1000Base-T
24
190 (600) W
4-port GbE (SFP)
48
10/100/1000Base-T
8
190 (320) W
4-port GbE (SFP)
2-port 10 GbE (XFP) 2-port 10 GbE (XFP) 48
10/100/1000Base-T
48
190 (930) W
4-port GbE (SFP) 2-port 10 GbE (XFP)
EX4200
24
10/100/1000Base-T
8
190 (320) W
4-port GbE (SFP)
24
10/100/1000Base-T
24
190 (600) W
4-port GbE (SFP)
2-port 10 GbE (XFP) 2-port 10 GbE (XFP) 24
100Base-FX/ 1000Base-X
N/A
190 (no PoE)
4-port GbE (SFP)
48
10/100/1000Base-T
8
190 (320) W
4-port GbE (SFP)
48
10/100/1000Base-T
48
190 (930) W
4-port GbE (SFP)
2-port 10 GbE (XFP) 2-port 10 GbE (XFP) 2-port 10 GbE (XFP)
The key takeaway from Table 2-1 is that the EX3200 and EX4200 switches come in 24and 48-port varieties, and support either partial or full PoE. The number of PoE ports in turn determines the wattage demands placed on the power supply. Table 2-1 assumes a worst-case maximum PoE power draw of 15.4 watts per PoE port. The EX3200 and EX4200 support the same power supply options. However, the number of PoE ports is a fixed parameter that cannot be increased with a larger power supply. This means there is little point in permanently installing a 930-watt power supply in an eight-PoE port chassis, given that the additional power budget does not increase the number of PoE ports, which remains fixed at eight. EX switches disable PoE ports when the pool of available power is insufficient. This means that installing a smaller power supply in a full PoE chassis will reduce the total number of PoE-enabled ports.
The EX4200 has two rear-panel 64 Gbps (FD) VCP connectors used to form VC clusters with 128 Gbps of interchassis bandwidth. The EX4200 also offers an all-SFP-based (all
58 | Chapter 2: EX Platform Overview Download at Boykma.Com
Small Form-factor Pluggable-based) 100/1,000 Mbps Ethernet chassis option intended for environments with preexisting fiber, or when maximum distances are required. On the EX4200, the uplink module can also be used to form a VC over extended distances. Here are the performance details for supported optics: Gigabit Ethernet SFP • 1,000Base-T SFP (copper) • 100 FX: 1310 nm, 2 km • SX: 850 nm, 220 m on 62.5 μ FDDI-grade fiber; 550 m on 50 μ multimode fiber • LX: 1,310 nm, 550 m on multimode fiber; 10 km on single-mode fiber • LH: 1,550 nm, 70–80 km on single-mode fiber 10 Gigabit Ethernet Small Form-Factor Pluggable (XFP) • SR: 850 nm, 300 m reach • LR: 1310 nm, 10 km • ER: 1,550 nm, 40 km • ZR: 1,550 nm, 80 km As with other Juniper products, third-party optics modules should work, but these will not be supported in the event of problems. This is in contrast to some vendors that intentionally disable a port when their branded (and often highly priced) optics module is not correctly sensed. Table 2-2 details the port breakdown for the 8200 series switches. Table 2-2. EX8200 speeds and feeds Switch
200 Gbps slots
Module type
Max ports
Type
EX8208
8, 1.6 Tbps
48-port 10/100/1000Base-T
384
RJ-45 (copper)
48-port 100Base-FX/1000Base-X
384
SFP
8-port 10 GbE
64
SFP+
48-port 10/100/1000Base-T
768
RJ-45 (copper)
48-port 100Base-FX/1000Base-X
768
SFP
8-port 10 GbE
128
SFP+
EX8216
16, 3.2 Tbps
In the initial release, the EX8200 series does not provide PoE options, but this functionality may be added at a later time. Table 2-3 details hardware redundancy features for the EX switches and indicates whether a component is considered a Field Replaceable Unit (FRU). When FRU is not indicated, the entire chassis must be replaced or repaired to regain functionality.
EX Hardware Overview | 59 Download at Boykma.Com
Table 2-3. EX Series redundancy features Component
EX3200
EX4200
EX8200
RE
No.
Yes, when in a VC.
Yes, as an FRU.
Switch fabric
No.
Yes, when part of a VC. A VC ring can survive a single VC trunk failure.
Yes, N+1 supported as an FRU.
PSU
Yes, when remote PSU option is in effect. PSU is an FRU.
Yes, redundant hot-swappable PSUs as an FRU; also supports remote PSU option.
Yes, redundant hot-swappable PSUs as an FRU.
Fan
No. Single-blower fan tray is an FRU.
No, but FRU fan tray has three blowers and should survive failure of one blower up to ambient temperature of 40°C/104°F.
Yes, as an FRU. Each fan tray has three blowers.
Both the EX8208 and EX8216 can hold up to six AC power supplies. The EX8208 switch offers 3+3 redundancy at maximum power consumption, meaning that each of the three active PSUs can have a spare. The EX8216 offers 5+1 redundancy at maximum power consumption, which is to say that five active PSUs are backed up by a single spare unit. For all EX chassis types, the failure of a fan module will generate a chassis alarm, but does not result in operational impact until an excessive temperature threshold is reached. At this point, the switches will power themselves down to avoid ASIC damage. In the case of the 8200, the fan can operate at variable speeds, and will ramp up its speed in an effort to avoid an over-temp-induced shutdown.
Use the CLI to Monitor Environment Although we have not yet officially covered the CLI and its usage, it’s appropriate to point out that you can display the current chassis environment and the yellow/red alarm temperature thresholds using CLI commands, as shown here: lab@Rum> show chassis environment Class Item Power FPC 0 Power Supply 0 FPC 0 Power Supply 1 Temp FPC 0 CPU FPC 0 EX-PFE1 FPC 0 GEPHY Front Left FPC 0 GEPHY Front Right FPC 0 Uplink Conn Fans FPC 0 Fan 1
Status OK Absent OK OK OK OK OK OK
Measurement
39 degrees C / 102 degrees F 42 degrees C / 107 degrees F 29 degrees C / 84 degrees F 28 degrees C / 82 degrees F 29 degrees C / 84 degrees F Spinning at normal speed
lab@Rum> show chassis temperature-thresholds Fan speed Yellow alarm Item Normal High Normal Bad fan FPC 0 CPU 60 70 80 70 FPC 0 EX-PFE1 60 70 80 70 FPC 0 GEPHY Front Left 60 70 80 70 FPC 0 GEPHY Front Right 60 70 80 70 FPC 0 Uplink Conn 60 70 80 70
60 | Chapter 2: EX Platform Overview Download at Boykma.Com
Red alarm Normal Bad fan 95 85 95 85 95 85 95 85 95 85
Table 2-4 summarizes important hardware capabilities and general platform scaling limits. These numbers can change as the platforms evolve; it’s always best to check the latest documentation. Table 2-4. EX capabilities and scaling limits Feature
EX3200/EX4200 series
EX8200 series
Comment
Throughput/PPS
24 ports: 88 Gbps/65 Mpps
8208: 1.26 Tbps/960 Mpps
Wire rate on all ports, overbooking possible on VC trunk ports. Throughput cited for the 8200 series is based on 10 GE ports.
48 ports: 1.6 Gbps/101 Mpps
8216: 2.56 Tbps/1,920 Mpps Jumbo frames
Up to 9,216 bytes
Up to 9,216 bytes
Enabled per port.
Queues per scheduler
8
8
Queuing supported per port (not per Interface Logical Unit [ifl]. Policing can be used to shape at the virtual LAN (VLAN) level.
Port and VLAN/inet policers
512/512
1,024/1,024
Port/VLAN level and Internet family (Layer 3) policers to limit interface bandwidth; ingress only.
MAC address table
32,000
64,000
Stores learned MAC addresses.
IPv4 unicast/ multicast routes
16,000/2,000
512,000/256,000
Forwarding table entries for IPv4, routing table is limited by RAM.
IPv6 unicast/ multicast routes
4,000/512,000
128,000/64,000
Forwarding table entries for IPv6, routing table is limited by RAM.
Security ACLs
14,000
64,000
Firewall filters for Layer 2 or Layer 3.
Generic Routing Encapsulation (GRE) tunnels initiated/ terminated
2,000
2,000
Used for IP tunneling and remote port mirroring.
Port mirroring sessions
One local, one remote
Seven local, seven remote
Switched Port Analyzer (SPAN)-like function for wiretap/traffic analysis.
Processor/flash
600/1 GHz, 512/1 GB
1.2 GHz/1 GB (upgradeable to 4 GB)
PowerPC-based, processor-based.
LAG groups/ members
32/8, 64/8
256/12
On an EX4200 VC, a link aggregation group (LAG) can span member switches.
EX Feature Support As with all JUNOS software-based products, you can expect rapid feature velocity for the EX Series, based on the standard three-month JUNOS release cycle. The tables in this section characterize initial EX Series Layer 2 and Layer 3 feature support. You should always check the current software release documentation set for the latest in features and functionality.
EX Hardware Overview | 61 Download at Boykma.Com
Note that at the time of this writing, EX switches support a soft licensing model for advanced features, as described shortly. Licenses are sold per chassis, and only two licenses are required in a VC or redundant RE 8200 series system (i.e., a license is needed on both the active and backup REs, but not on LCs). The soft model results in warnings displayed/logged at commit time, and comments that a license is needed when viewing the related portion of the configuration. Despite the warnings, the licensed feature is expected to work with no restrictions, other than the side effects of your guilty conscience and lack of JTAC support on that feature, should any issues arise later. In the initial release, a single license is available that unlocks all licensed features.
Layer 2 features Table 2-5 summarizes base Layer 2 functionality currently supported by the EX Series. Subsequent chapters detail what all of this means, and provide configuration and troubleshooting examples. So, for now, consider this a heads-up as to what is coming down the road for you in this book. Table 2-5. Layer 2 base feature support Feature
EX platform
Comment
Spanning tree
All
Standard, multiple instance, and rapid STP supported (802.1D, 802.1s, 802.1w)
Redundant Trunk Group (RTG)
All
Provides primary/backup port redundancy with no STP
802.1Q
All
VLAN tagging, support for 4,094 user-assignable VLANs per EX-PFE
802.1X
All
Standards framework for Layer 2 access security; supports port, multi, and VLAN assignment modes
802.3ad, 802.3X flow control, and link aggregation maximum groups/members
3200, 4200, 8200
Link aggregation, dynamic via LACP or static: EX3200 32/8 EX4200 64/8 EX8200 64/12
Layer 2 multicast
All
Internet Group Management Protocol (IGMP) snooping support allows switches to reduce multicast flooding when there are no group members
Dynamic ARP inspection (DAI) and Dynamic Host Configuration Protocol (DHCP) snooping
All
Monitors DHCP exchanges to prevent spoofing, using this information to prevent Address Resolution Protocol (ARP) spoofing by enforcing DHCP IP-MAC binding to ARP exchanges
Generic VLAN Registration Protocol (GVRP)
All
Protocol used to manage VLAN across switches
LLDP, LLDP-MED
All
Link Layer Discovery Protocol, Media Endpoint Discovery; part of unified communication to auto-sense devices (e.g., IP phones)
62 | Chapter 2: EX Platform Overview Download at Boykma.Com
Layer 3 and general system features Table 2-6 summarizes general EX system capabilities and Layer 3 feature support. As before, subsequent chapters detail what all of this means, so for now consider this another heads-up. Note that some features are considered advanced and require a license for legitimate usage. Items marked with an * were not included in the initial 9.0 release. Many of the Layer 3 features are JUNOS-enabled, which helps to drive home a key benefit of the single code train model. Table 2-6. Layer 3 base and advanced feature support Feature
Platform
Base/advanced
Comment
Basic IPv4 routing: Static, RIP v1/v2, OSPF v2
All
Base
Significant routing support in base feature set
Policy-based routing*
All
Base
Leverages JUNOS policy and firewall to provide policy rather than longest-match DA-based routing
VRRP, BFD
All
Base
HA features
IPv4 multicast—IGMP, PIM SM, PIM DM
All
Base
Software (RE)-based tunnel services for Protocol Independent Multicast in Sparse mode (PIM SM) and Dense mode (PIM DM)Protocol Independent Multicast in Sparse mode (PIM SM encapsulation and de-encapsulation functions
Non-Stop Routing (NSR)*
EX4200 in a VC, EX8200 series
Base
Allows failover to a redundant RE with stateful protocol replication, no control or data plane disturbance
Graceful Restart (GR)
All
Base
Allows an RE reboot or routing daemon restart without incurring loss in the data plane; protocol sessions are disrupted
In-Service Software Updates (ISSU)*
EX4200 in a VC, EX8200
Base
Allows the upgrade of a dual RE machine without incurring a control or data plane hit; based on NSR functionality
Secure device management via J-Web, CLI
All
Base
SSH and OpenSSL support
Device management interface (DMI)
All
Base
Accommodates integration with third-party network management
Centralized management
All
Base
Leverages the Network and Security Manager product to centralize configuration management
BGP routing
All
Advanced
World-class BGP, on a switch!
IS-IS routing
All
Advanced
Not too common in today’s enterprise; IS-IS in support of IPv4 routing, not CNLS/CNLP (OSI)
MPLS*
All
Advanced
Not too common in today’s enterprise; traffic engineering support
IPv6 routing*
All
Advanced
Unicast and multicast support, OSPF v3/IS-IS
Enhanced GRE tunnel support*
All
Advanced
Support for more than seven GRE tunnels
EX Hardware Overview | 63 Download at Boykma.Com
EX Hardware Summary This section provided a general overview of the EX3200, EX4200, and EX8200 hardware and software capabilities. The EX3200 has limited hardware redundancy and does not support clustering in a VC. This makes it a good choice for access layer deployments in non-mission-critical environments. The EX4200 provides redundancy enhancements, most notably the ability to cluster up to 10 EX4200s into a single VC. A VC is highly reliable in that it supports redundant REs, PSUs, and VC switch fabric using a ring topology. The 8200 chassis-based switches offer redundant REs, switch fabric, PSUs, and in the case of the EX8216, redundant fan modules. The high-performance EX hardware is backed up with an impressive range of Layer 2 and Layer 3 base features, perhaps the best of which is the fact that EX hardware runs the venerable JUNOS software, which brings numerous reliability, performance, and stability advantages to the game. The next section explores the hardware architecture of the EX3200 and EX4200, and provides a packet walk-through showing the processing steps involved with packet switching/routing.
EX Series Architecture This section provides a high-level overview of typical EX Series platforms to prepare the reader for upcoming detailed discussions of packet flow in this chapter, as well as in Chapters 4 and 11.
The EX-PFE ASIC The heart of the EX platform is the EX-PFE ASIC. This Juniper-developed chip offers extreme network and VCP/fabric flexibility, which allows it to be used in a number of different modes within a particular switch model. As with other Juniper designs, this PFE mechanism can be replicated as needed to provide increased switch capacity through a multichip PFE complex. For example, an EX3200-24 is based on a single PFE ASIC, whereas the EX4200-48 uses three. Meanwhile, a single 8200 series LC uses four PFE chips to support 8 × 10 GE front panel ports, along with the necessary switch fabric connections. Each EX-PFE chip can forward more than 102 Mpps at wire rate, whether all Layer 2, all Layer 3, or any mix.
64 | Chapter 2: EX Platform Overview Download at Boykma.Com
EX-PFE effectively offers some 88 Gbps of switching/communications capacity, which can be carved up and delegated to 1 × GE, 10 × GE, or VCP/fabric ports as each hardware application requires. For example, each EX-PFE can provide 24 × 1 Gigabit ports + 2 VCP ports, or alternatively can provide 24 × 1 Gigabit + 1 × 10 Gigabit + 1 VCP port, or in yet another application, 2 × 10 Gigabit + 2 VCP ports. We highlight the flexibility of the EX-PFE ASIC in the next section, where you can see it operating in a number of the aforementioned modes.
EX3200 Architecture Our hardware architecture discussion begins with the EX3200 switch, as the rest of the EX Series shares many common aspects of its design. Figure 2-6 illustrates the primary processing stages of an EX3200-48. The bottom-left portion of Figure 2-6 shows where the CPU components are housed. The 8 MB boot flash gets the JUNOS kernel going so that the JUNOS image, which is stored on the 1 GB main flash, can load into and run from the 512 MB of RAM memory. The 600 MHz PowerPC-based CPU is protected by non-user-configurable ACL/rate limiting, and has interconnections to other components, such as the LCD status display and EX-PFE ASICs for control and communications purposes. The built-in and nonuser-alterable ACL function is provided by the JUNOS kernel and includes connection number and connection rate limits, in addition to traffic policers that ensure network control is not locked out during periods of protocol churn, or during a DoS attack that bombards the router with ping or other types of exception traffic. The EX3200 supports 512 MB of DRAM, and a rear panel USB that can be used to expand flash memory. None of the built-in memory is considered upgradeable, and is therefore not classified as an FRU. The CPU also drives the 1 Gbps em0 Out of Band (OoB) management interface, in addition to the EIA-232-based console. The 48-port EX3200 uses two EX-PFE chips in the arrangement shown; because the EX3200 does not support a VC, each EX-PFE chip is tasked with providing 24 × 1 GE, + 1 × 10 GE, + 1 fabric port. In contrast, the 24-port version of the EX3200 makes use of a single EX-PFE chip configured in a 24 × 1 GE + 2 × 10 GE arrangement.
EX Series Architecture | 65 Download at Boykma.Com
Figure 2-6. The EX3200-48 block diagram
In both the 24- and 48-port versions, the four highest-numbered Gigabit Ethernet ports (i.e., ge-0/0/20–ge-0/0/23 on the 24-port model) are shared between the corresponding network ports and the optional 4 × 1 GE uplink module. Built-in logic senses when a 4 × 1 GE uplink is installed and automatically disables the corresponding network interface ports. Use of the 2 × 10 GE uplink module option allows you to regain use of the high-order 4 GE ports. An EX3200-24 contains a single EX-PFE ASIC, and the EX3200-48 uses two PFE chips. As detailed in the next section, the EX4200s make use of an extra EX-PFE to eliminate this restriction. Figure 2-6 also shows the EX3200’s single PSU, which can be either AC or DC, in addition to support for an optional RPS.
EX4200 Architecture The hardware architecture of the VC-capable EX4200 is based on the same EX-PFE technology found in the lower-end EX3200, but using more PFE ASICs. The EX4200-24 uses two EX-PFEs (the 24-port EX3200 uses only one), and the EX4200-48 makes use of three PFE chips. The extra PFE capability is used to drive the EX4200’s rear-panel VCP ports, and allows simultaneous use of all uplink and front-panel GE ports. Figure 2-7 illustrates the major hardware components of an EX4200-48.
66 | Chapter 2: EX Platform Overview Download at Boykma.Com
Figure 2-7. The EX4200 architecture
The EX4200 shares many of the same design characteristics found on the EX3200, so the focus here is on the delta. The primary difference is the presence of three EX-PFEs, and how the work is divided among them. In this switch, each PFE provides some aspect of front-panel network connectivity, as well as some portion of the VCP/switch fabric functionality. For example, the first and last PFEs each drive one of the 24 × 1 GE arrays, and each provides one 64 Gbps (FD) VCP port for VC use. The first PFE also provides one of the 10 GE uplink ports. Meanwhile, the second PFE drives two switch fabric ports (128 Gbps FD), provides one 10 GE uplink module, and also drives the 4 × 1 GE uplink ports. Due to this arrangement, the 4 × 1 GE uplink ports and the highest-numbered 1 GE ports are no longer shared, and can therefore be used at the same time. The EX4200 is based on 1 GB of DRAM and a 1 GHz PowerPC processor. Like the EX3200, it’s equipped with 8 MB/1 GB of boot/main flash, as well as support for a rearpanel USB flash extension; the built-in memory is not upgradeable. Figure 2-7 also shows the EX4200’s support for redundant PSUs or an optional RPS.
EX Series Architecture | 67 Download at Boykma.Com
Front-panel LEDs EX switches provide two LEDs that indicate each port’s operational and traffic status. A complete description of each possible state is available at http://www.juniper.net/ techpubs/en_US/release-independent/junos/topics/reference/specifications/network-port -leds-ex-series.html. The LED to the left of the port indicates link status and link activity, and the LED to the right indicates the port’s administrative status, duplex mode, PoE status, and speed, depending on the LCD display mode. You use the Enter button on the LCD panel to toggle between the ADM, DPX, PoE, and SPD indicators. The default mode displays port speed using a specific number of blinks: One blink per second—10 Mbps Two blinks per second—100 Mbps Three blinks per second—1,000 Mbps
A Day in the Life of a Packet This section explores the main areas of EX-PFE processing as a frame (or packet) is received, processed, switched (or routed), and ultimately dispatched toward its final destination. The PFE processing steps vary based on whether the EX is operating in Layer 2 mode as a switch, or in Layer 3 mode as a router. Both modes are analyzed.
Layer 2 switching Figure 2-8 shows the processing stages for traffic received on an interface that is configured for Layer 2 operation. This is to say that a given logical unit is configured with family bridging rather than family inet. We begin with the reception of an Ethernet frame at step 1. This header extraction stage strips the frame’s header and writes the original packet into a shared-memory-based switch fabric. As with other Juniper PFE designs, transit traffic is written into the shared memory switch fabric once. As a result of the switching/routing process, that same frame may then be read from that memory location multiple times at egress, as needed for multicast replication functions. Meanwhile, what’s actually being processed in subsequent stages is a notification message, the essence of which is all that header good stuff, which in addition to Layer 2 also includes the Layer 3 IP/IPv6 header, as well as Layer 4 port info, assuming, of course, that IP is actually present in the frame. This information accommodates the various Layer 2/Layer 3 security checks, switching/ routing, and CoS functions that may occur in subsequent processing stages.
68 | Chapter 2: EX Platform Overview Download at Boykma.Com
Figure 2-8. EX-PFE Layer 2 switching
EX Series Architecture | 69 Download at Boykma.Com
The VLAN is extracted at step 2 by the VLAN classification stage. This is accomplished using an explicit header tag, the incoming interface index, or the source MAC address, depending on the operating mode of the logical interface. Each EX-PFE ASIC can index a total of 4,096 VLANs, but VLAN assignment is limited to 1 to 4,094 inclusive. This is because VLAN ID 0 is considered the untagged, or native, VLAN, whereas VLAN ID 4095 (0×FFF) is reserved for implementation-specific functions. Depending on the configuration and results of previous processing, the packet is now subjected to either a port or a VLAN-level firewall filter. These filters can match on a variety of Layer 2/Layer 3 fields for security, telemetry tracking (counting), policing, forwarding class assignment, and so forth. Layer 3-related firewall checks are performed in the Layer 3 processing stages, which we’ll discuss shortly. We cover firewall filters and security in detail in Chapter 9. Note that JUNOS firewall filter is analogous to ACL in Cisco terminology. Currently, each EX-PFE ASIC supports up to 2,000 port-level, 2,000 VLAN-level, and 1,000 router-based ACLs, for a total of 5,000 ingress ACL-related functions. Because these filters are executed in hardware, there is usually very little impact to forwarding rate with or without filtering actions in effect. Policing is supported only in the ingress direction on the EX platform. This applies to port-level, VLAN-level, and Layer 3 (IPv4) policers.
If the packet is not dropped during firewall processing, step 4 kicks in to subject the packet to an STP state check. In this case, transit traffic is dropped if the corresponding port is not found in the forwarding state. We provide details on STP operation in Chapter 6. Note that well-known MAC addresses, such as those used for STP control messages, are recognized as such and are redirected to the control plane as exception traffic when received on an STP-enabled port that is in a non-forwarding state. Step 5 deals with MAC address learning functions. Here the packet’s source MAC address is matched against the list of learned MACs by the bridging engine. If a match is found, the timeout is updated and the incoming interface is compared to the existing state (in case the MAC address has moved). The bridging function redirects the packet to the control plane for MAC learning when no entry is found, or when the interface association needs to be refreshed in the case of a MAC move. At step 5a, the packet’s destination MAC address is compared to the switches’ own MAC address; if a match is found the traffic is redirected to the Layer 3/Route stage, which is detailed next. Traffic that is not addressed to the switches’ MAC is subjected to the Layer 2 switching function, which begins our tale of output processing stages. Note that currently each EX-PFE chip can retain 24,000 learned MAC addresses. MAC addresses that have not been learned, or that had to be forgotten due to exhaustion of MAC learning table size or age-out, results in flooding of that traffic out all ports in the 70 | Chapter 2: EX Platform Overview Download at Boykma.Com
same bridging instance. The large number of MACs that can be learned by the EX-PFE prevents the inefficiencies of ongoing flooding due to insufficient MAC table size.
Output processing: Layer 2 switching The first step in the Layer 2 switching function’s output process is shown in step 6 of Figure 2-8. This stage replicates Layer 2 traffic that needs to be sent out multiple logical interfaces, such as is the case in a broadcast/multicast Destination MAC (DMAC) address, or for a unicast DMAC that has not yet been learned (e.g., a Source MAC [SMAC] address that has not been seen on that VLAN/bridging instance as the source of any traffic). In these cases, the rules of Layer 2 switching state that the frame must be flooded out to all ports that are in a forwarding state, except, of course, the port on which the packet arrived. Note that what is actually replicated here is a pointer to the copy of the packet that was written into memory way back at step 1. At step 7, the egress traffic is subjected to CoS processing, which includes queue selection (a total of eight queues are supported per port), priority scheduling, and drop prioritization. Note that per-VLAN (logical interface level) queuing is not supported. And, as you likely surmised, EX Series CoS is covered in detail in Chapter 10, but it’s covered much more broadly in our companion book, JUNOS Enterprise Routing. Step 8 of output processing involves marker rewrite, also known as header rewrite. This stage is often associated with Layer 3 functionality involving IP Precedence/DiffServ Type of Service (ToS) field remarking, but can also be used for Layer 2 rewrite involving the 802.1p priority bits. Step 9 provides Layer 2 egress firewall filter functionality. Currently, only VLAN-based (and router/Layer 3, as applicable) filter actions are supported at egress. Port-based egress filters are currently not supported, nor is egress policing of any type. A total of 2,000 egress filters (both Layer 2 VLAN-based and Layer 3) can be defined per EX-PFE chip. Layer 2 frames can be dropped, counted, or policed as they transit this stage. The final egress stage re-forms the Layer 2 frame, which may have had its header remarked at step 8; recalculates the CRC; and transmits the frame onto the medium. Note that as a result of the Layer 2 replication actions at step 6 (replication can also occur in the Layer 3 processing flow) there can be a one-to-many relationship between ingress and egress traffic.
Layer 3 routing Figure 2-9 details the processing stages for traffic that is subjected to Layer 3 processing. Layer 3 processing is performed on traffic received on a Layer 3-enabled logical interface, or for traffic received on a Layer 2 interface, but for which the destination MAC address matched the address owned by the switch. The example shown is based on the latter case, but the primary concepts and packet processing are similar for packets received on Layer 3 interfaces. Each EX-PFE supports up to 1,000 Layer 3 interfaces, which can operate as a native IP interface or as a Routed VLAN Interface (RVI). EX Series Architecture | 71 Download at Boykma.Com
Figure 2-9. EX-PFE Layer 3 processing stages
Things begin in Figure 2-9 at step 1, where the packet (well, technically, its header fields, along with some other magic sauce in the guise of a notification message) is subjected to router/Layer 3 firewall filters. These ACLs operate at the IP and Transport layers (TCP/UDP), and provide similar security, policy, ingress policing, and accounting functionality as those available at Layer 2. The actual route lookup is performed at step 2, unless, of course, the packet fails to pass muster and is dropped back at step 1. Here, a longest-match lookup is performed against the destination IP address to determine the outgoing interface/next hop or egress firewall action that should be performed. When the destination IP address represents a multicast group address, additional processing is done at step 3 to facilitate IP packet replication and selection of the list of outgoing interfaces to which copies of the packet should be sent. Packets whose longest match is against a locally owned IP address, or that were sent to a multicast group for which the local switch is an active member, are shunted out of the PFE for processing by the RE. These may be locally destined traffic, such as a ping or Telnet session, or a routing update, such as RIP or OSPF. At step 4, packets whose lookup resulted in a firewall filter next hop are so processed, or else they are handed back to the Layer 2 engine, where they’re subjected to Layer 2 egress processing and ultimately transmitted, assuming they are not dropped by the CoS stage or filtered by an egress Layer 2 filter action.
EX Series Architecture Summary This section provided a detailed description of the hardware capabilities of the EX3200, EX4200, and EX8200 series switches. The varying levels of redundancy and switching capacities, and the ability to grow a VC in an incremental manner as needs dictate, mean that virtually any organization can find an EX platform that meets its design needs. The next section shifts the focus from EX hardware to the JUNOS software that provides the brains for all that silicon brawn. Given that the same JUNOS software runs 72 | Chapter 2: EX Platform Overview Download at Boykma.Com
on all of the company’s J Series, MX Series, M Series, and T Series platforms, there could be worse things to learn.
JUNOS Software Overview To quote from JUNOS Enterprise Routing: JUNOS software is cool. It just is. The designers of JUNOS software put tremendous thought into making a stable, robust, and scalable operating system that would be a positive for the router. They were able to learn from previous vendors’ mistakes, and create an OS that other companies will forever use as their model.
JUNOS software is cool, and the fact that the same JUNOS software that runs on the EX platform runs on the largest router that Juniper makes, the TX Matrix, is really cool. JUNOS software is a modular operating system that promotes stability and reliability. The modularization is achieved through the use of software daemons that run in protected memory space. The stability stems from well-written and tested code; choosing a well-known, open source, and stable kernel of FreeBSD on which to build JUNOS did not hurt, of course. The kernel and its functions are normally not directly visible to the user, but many features of FreeBSD have been ported to the command line of JUNOS, and many that have not are still available, albeit at the shell prompt. The kernel supports the various user processes (daemons), maintains the forwarding table synchronization between the RE and the PFE, and provides interface-related routing functions such as performing ARP and installing local and direct routes in the routing table (RT). Riding on top of the kernel are the software processes that provide JUNOS services and the user interfaces needed to configure, monitor, and troubleshoot these services. These include the CLI, interface control, routing, address learning, and so forth. Figure 2-10 illustrates the modular architecture of JUNOS software, listing some of the user space processes that run on top of the kernel. Note that you can always obtain a complete list of these processes by issuing a show system processes command. You can also restart most daemon processes from the CLI using the restart command, as shown here: lab@Rum> restart ? Possible completions: 802.1x-protocol-daemon Port based Network Access Control adaptive-services Adaptive services process audit-process Audit process cfm Connectivity fault management process chassis-control Chassis control process chassis-manager Chassis Manager class-of-service Class-of-service process dhcp Dynamic Host Configuration Protocol process dynamic-flow-capture Dynamic flow capture service ecc-error-logging ECC parity errors logging process ethernet-link-fault-management Ethernet OAM Link-Fault-Management process
JUNOS Software Overview | 73 Download at Boykma.Com
ethernet-switching Ethernet Switching Process event-processing Event processing process firewall Firewall process general-authentication-service General authentication process gracefully Gracefully restart the process immediately Immediately restart (SIGKILL) the process interface-control Interface control process ip-demux Demux Interface Daemon ipsec-key-management IPSec Key Management daemon l2-learning Layer 2 address flooding and learning process lacp Link Aggregation Control Protocol process license-service Feature license management process link-management Link management process lldpd-service Link Layer Discovery Protocol mib-process Management Information Base II process mountd-service Service for NFS mounts requests mspd Multiservice Daemon nfsd-service Remote NFS server pgcp-service Packet gateway service process pgm Pragmatic General Multicast process ppp PPP process pppoe Point-to-Point Protocol over Ethernet process redundancy-interface-process Redundancy interface management process remote-operations Remote operations process routing Routing protocol process sdk-service SDK Service Daemon service-deployment Service Deployment System (SDX) process sflow-service Flow Sampling (Sflow) Daemon snmp Simple Network Management Protocol process soft Soft reset (SIGHUP) the process virtual-chassis-control Virtual Chassis Control Protocol vrrp Virtual Router Redundancy Protocol process web-management Web management process lab@Rum> restart
A description of each process’s function is beyond the scope of this book. You can find some additional information on JUNOS processes in the technical documentation at http://www.juniper.net/techpubs/software/nog/nog-baseline/frameset.htm. Note that a large chunk of the documentation is bundled with the software running on your switch. A later section demonstrates use of the embedded documentation. Each software process is fully independent, so a failure of one process does not affect the others. For example, Figure 2-10 shows how the Simple Network Management Protocol (SNMP) process pulls information from the interface, chassis, and routing processes. If the SNMP process fails for any reason, it affects only that process and not the others, and in most cases can be restarted and returned to service. This is a major shift from other routing vendors that operated monolithic code in which one change in the interface code could affect just about anything, seemingly without rhyme or reason.
74 | Chapter 2: EX Platform Overview Download at Boykma.Com
Figure 2-10. The JUNOS software architecture
As previously noted, the J Series, M Series, MX Series, and TX routing platforms all run JUNOS, which is built from a common code base. Note, however, that having the same code base is not the same as running the same binary image. The EX platforms run an EX-specific binary image that is built from the common JUNOS code base. Although some features are platform-dependent, JUNOS is JUNOS, and the general rule is a common configuration and operational mode syntax, and a high degree of feature parity across all platforms. The first time you need to upgrade the software on your EX switch, this point and its immediate benefits are driven home. There’s no need for a fancy feature calculator to (hopefully) find an image with the desired feature that actually runs on your hardware. Nope; just find the latest EX release (there are four major releases each year), download it, load it, and go play with the new feature. The major difference in the EX image versus the image running on, say, an M Series router, is the successful porting to a RISC-based PowerPC platform, and the inclusion of Layer 2-specific functions performed by the Ethernet switching daemon (eswd), such as Layer 2 address learning and STP. Inclusion of the LLDP daemon provides a Cisco Discovery Protocol (CDP)-like functionality, which also includes the LLDP-MED extensions used to support IP telephony devices.
JUNOS Software Summary This section provided an overview of the JUNOS software architecture, detailing how the modular software process runs atop a hardened BSD-based kernel on a variety of hardware platforms. The key takeaway here is the common JUNOS base that is shared across a huge portion of the company’s product line and that has been proven stable in the largest service provider networks for more than 10 years. JUNOS Software Overview | 75 Download at Boykma.Com
Although the EX may be the new platform on the block, it inherits the benefits and capabilities of the legendary JUNOS that happily runs some of the world’s largest routing systems in most of the world’s largest IP networks. And now, that same software sits on your desktop, in the form of that new EX switch that just arrived. Well, what are you waiting for? Are you chicken? C’mon, everyone’s doing it.... It’s time to get started with JUNOS software!
CLI Overview Hardcore engineers always prefer a CLI as opposed to a fancy-pants GUI web-based frontend thingy. The odd thing is that even novice users often quickly learn to prefer the JUNOS CLI, given that it’s one of the most user-friendly and feature-rich interfaces ever invented. The remainder of this chapter focuses on the CLI, but gives an honorable nod to some slick user-friendly features as well. Generally speaking, the GUI makes things so easy, as long as you know what you want and why it’s used, it’s a cinch to click your way through it. Using the CLI provides direct access to all of the features of JUNOS, and it takes much less time and page space than dealing with GUI screens. As such, biting a bit of the CLI bullet really is the best way to learn JUNOS.
J-Web and EZSetup When Juniper decided to reach into the Enterprise it understood that it would be encountering a new audience, one that is often familiar with the IOS CLI but in many cases may be brand new to networking, with little to no CLI experience. To address this concern, a web-based GUI interface was developed. The J-Web interface was first released on the J Series products, and was updated and enhanced to support the EX Series as well. Figure 2-11 shows the main screen for the EX J-Web interface. Yes, the J-Web interface is pretty slick. J-Web supports both HTTP and HTTPS protocols, provides clean operational status displays and configuration (which includes wizards that help get you up and running), and performs common maintenance functions such as software upgrades. The built-in DHCP server found in a factory-default configuration makes it easy to attach a PC for quick access to the web-based EZSetup feature. Once configured, J-Web provides ongoing configuration and system management capabilities, including really cool performance dashboard displays.
76 | Chapter 2: EX Platform Overview Download at Boykma.Com
Figure 2-11. The EX J-Web interface
EZSetup The EZSetup feature, as its name suggests, is designed to get a brand-new switch up and running by prompting for commonly needed configuration data (see Chapter 3 for more details on the EZSetup feature). The web version of EZSetup is presented when a factory-default configuration is in place. The EZSetup feature is also available via the CLI, but only when logged into a root shell, and again a true factory-default configuration must be in effect. After loading a factory-default configuration with the load factorydefault configuration mode command, you must assign a root password before you can commit (committing actually places the configuration into effect, as described later in this chapter). Once the modification is committed, the result is no longer a true factory-default configuration, which in turn blocks shell-based evocation and suppresses the J-Web prompt for the same.
CLI Overview | 77 Download at Boykma.Com
The following code shows EZSetup starting from a root shell on a true factory-default configuration: root@% ezsetup ***************************************************************************** * EZSetup wizard * * * * Use the EZSetup wizard to configure the identity of the switch. * * Once you complete EZSetup, the switch can be accessed over the network. * * * * To exit the EZSetup wizard press CTRL+C. * * * * In the wizard, default values are provided for some options. * * Press ENTER key to accept the default values. * * * * Prompts that contain [Optional] denotes that the option is not mandatory. * * Press ENTER key to ingore the option and continue. * * * ***************************************************************************** EZSetup Initializing..done. Initial Setup Configuration --------------------------Enter System hostname [Optional]:
CLI Operational Modes and General Features The CLI has two modes: operational and configuration. Operational mode is where you troubleshoot and monitor the router hardware and software, as well as its network connectivity and protocol operation. Configuration mode is where the actual configuration statements for interfaces, routing protocols, and everything else, for that matter, are specified. Every command that can be run in operational mode can also be used in configuration mode with the additional keyword run. For example, if the command show route is issued in operational mode, it can be issued as run show route in configuration mode. This is similar to IOS’s do command, except it works all the time and in all configuration mode contexts.
Operational mode When a non-root user first enters the router via Telnet, SSH, or direct console access, the user will see a login prompt. After entering the correct username and password, the user will be placed directly into operational mode. Operational mode is designated by the > (chevron) character at the router prompt of username@hostname. As shown in the following code, user lab logs into a switch called Rum: 78 | Chapter 2: EX Platform Overview Download at Boykma.Com
login: lab Password: --- JUNOS 9.0R2.10 built 2008-03-06 10:31:45 UTC lab@Rum>
An exception to being automatically placed into operational mode is when logging in as the root user. In this case, the user is placed directly into a shell (designated by the percent [%] sign) and must start the CLI process manually: Rum (ttyd0) login: root Password: --- JUNOS 9.0R2.10 built 2008-03-06 10:31:45 UTC root@Rum% cli root@Rum>
Most of the commands that you will run in operational mode are show commands, which allow you to gather information about the switches’ hardware, software, and general protocol operation. The ping, traceroute, telnet, and ssh utilities are also available in operational mode, as are clear commands that are used to reset counters, learn MAC/ARP entries, or reset protocol adjacencies. In addition, there are some very JUNOS-specific operational mode commands such as request, restart, and test. The request commands perform systemwide functions such as rebooting, upgrading, and shutting down the box. The restart commands are similar to the Unix-style kill commands, allowing you to restart various software processes. The test commands allow verification of saved configuration files, proactive testing of policies, and interface-related test functions that vary by hardware type. The restart commands should be used with caution! Network disruption can easily result from restarting the chassis control, routing, or switching processes, for example. Generally, you restart a process under guidance from technical support, when fault analysis indicates that the process is hung or generally misbehaving.
The next section examines some additional CLI features that you will not want to live without.
Command completion The command completion feature saves you lots of time and energy, and it provides syntax checking as you type. Gone are the days when you type a command on a line and after you press Enter the command is either invalid or not supported on that version of software. Any error or ambiguity will be detected early, and the switch will present a list of valid completions for the current command. You can disable command
CLI Overview | 79 Download at Boykma.Com
completion on a per-login basis by modifying the CLI environment with an operational mode set cli command: lab@Rum> set cli ? Possible completions: complete-on-space Set whether typing space completes current word directory Set working directory idle-timeout Set maximum idle time before login session ends prompt Set CLI command prompt string restart-on-upgrade Set whether CLI prompts to restart after software upgrade screen-length Set number of lines on screen screen-width Set number of characters on a line terminal Set terminal type timestamp Timestamp CLI output
But a good reason to do so has not yet been noted. You can evoke command completion by using either the space bar or the Tab key. Note that the Tab key also completes user-assigned variables such as interface names, IP addresses, firewall filters, and filenames. For example, you use the show configuration firewall command to view that portion of the configuration from an operational mode prompt. The example makes use of both space and tab completion for commands and variables, respectively, and also uses the family and filter switches to display a subset of the firewall stanza in the form of a specific filter named test_L3_filter: root@Rum> show configuration firewall family inet filter ? Possible completions:
Filter name test_L3_filter Filter name root@Rum> show configuration firewall family inet filter test_L3_filter
term 1 { from { protocol icmp; } then count icmp_counter; } term 2 { then accept; }
Notice that the space bar is used until a variable is reached, at which time the Tab key is used to auto-complete the user variable for the filter name of test_L3_filter. The example also shows the CLI’s context-sensitive help function, which is evoked with the ? key. The context-sensitive help function provides valid completions for both standard commands and user-defined variables. Pretty slick, eh? In the previous example, the syntax checker went word by word each time the space bar or Tab key was pressed, and the minimum characters were typed to avoid ambiguity. When a command is ambiguous, the CLI states the issue and lists the possible completions:
80 | Chapter 2: EX Platform Overview Download at Boykma.Com
root@Rum> show e ^ 'e' is ambiguous. Possible completions: esis ethernet-switching event-options root@Rum> show e
Show end system-to-intermediate system information Show Ethernet-switching information Show event-options information
Here, the command show e cannot be completed as typed, so the CLI prompts the user for further clarification as to which value, ethernet-switching or event-options, should be displayed. The CLI then repaints the ambiguous command, patiently awaiting disambiguation. Emacs keys. The CLI is based on Emacs-style keystrokes. This allows you to quickly position the cursor, or edit the command line, using keystroke shortcuts. Here are some useful Emacs keystrokes: Ctrl-b Moves the cursor back one character. The left arrow can also be used for this purpose when set to vt100. Ctrl-f Moves the cursor forward one character. The right arrow can also be used for this purpose when set to vt100. Ctrl-a Moves the cursor to the beginning of the command line. Ctrl-e Moves the cursor to the end of the command line. Ctrl-k Deletes all words from the cursor to the end of the line. Ctrl-w Deletes an entire word to the left of the cursor. Ctrl-x Deletes or clears the entire line. Ctrl-l Redraws the current line. Ctrl-p Scrolls backward through the previously typed commands. The up arrow can also be used for this purpose when set to vt100. Ctrl-n Scrolls forward through the previously typed commands. The down arrow can also be used for this purpose when set to vt100. Ctrl-r Searches the previous CLI history for a search string.
CLI Overview | 81 Download at Boykma.Com
Ctrl-u Erases the current line. As noted, when the terminal type is set to vt100, you can use the up and down/sideways arrow keys for previous/next command buffer recall and cursor positioning, respectively. The JUNOS CLI maintains a separate command history for operational versus configuration mode commands.
The pipe. Another important CLI feature is support for piping the output of any command, whether configuration or operational, to a set of processing functions such as count, match, and so forth. The actual arguments supported by the pipe (|) function are constrained based on the command’s context as either configuration or operational mode. In the following example, the operational mode show bgp summary command is shown being piped to the display function, but the only supported argument is xml. Again, this is because of the operational mode context: root@Rum> show bgp summary | display ? Possible completions: xml Show output as XML tags
The same general show command syntax is now issued in configuration mode context. And the result is a different set of options for the display argument: [edit] root@Rum# show | display ? Possible completions: changed Tag changes with junos:changed attribute (XML only) commit-scripts Show data after commit scripts have been applied detail Show configuration data detail inheritance Show inherited configuration data and source group omit Omit configuration statements with the 'omit' option set Show 'set' commands that create configuration xml Show output as XML tags
Note that the set argument is now available for the display function. By the way, the purpose of display set is to convert the curly-brace-delimited configuration into the sequence of set commands that created the configuration; this is a very useful pipe function. Note that the full configuration hierarchy is displayed for each set command displayed: [edit interfaces ge-0/0/4] lab@Rum# show | display set set interfaces ge-0/0/4 unit 0 family inet filter input test set interfaces ge-0/0/4 unit 0 family inet address 10.5.7.5/24 set interfaces ge-0/0/4 unit 0 family inet6
82 | Chapter 2: EX Platform Overview Download at Boykma.Com
[edit interfaces ge-0/0/4] lab@Rum#
The pipe command allows the display buffer to be massaged and displayed in various ways. The most common applications of the pipe function are detailed here: count
Count the output lines: root@Rum> show interfaces terse | count Count: 67 lines
display
Show additional data; for example, XML tags, set commands, or details about what the config means: [edit interfaces ge-0/0/4] lab@Rum# show | display detail ## ## Logical unit number ## range: 0 .. 16385 ## unit 0 { ## ## family: Protocol family ## constraint: Can't configure protocol family with encapsulation ppp-overether-over-atm-llc ## constraint: Can't configure protocol family with encapsulation ppp-overether ## ## ## inet: IPv4 parameters ## alias: inet4 ## constraint: family inet is not supported on encapsulation frame-relay-ppp ## . . .
except
Omit matching lines from the output: root@Rum> show interfaces terse | except geInterface Admin Link Proto Local Remote bme0 up up bme0.32768 up up inet 128.0.0.1/2 128.0.0.16/2 128.0.0.32/2 tnp 0x10 dsc up up gre up up ipip up up lo0 up up lo0.0 up up inet 10.10.1.5 --> 0/0 lsi up up me0 up down me0.0 up down
CLI Overview | 83 Download at Boykma.Com
mtun pimd pime tap vlan
up up up up up
up up up up up
find
Begin the output at the specified match: root@Rum> show interfaces ge-0/0/0 extensive | find alarm Active alarms : LINK Active defects : LINK MAC statistics: Receive Transmit Total octets 0 0 Total packets 0 0 Unicast packets 0 0 Broadcast packets 0 0 Multicast packets 0 0 CRC/Align errors 0 0 FIFO errors 0 0 MAC control frames 0 0 MAC pause frames 0 0 Oversized frames 0 Jabber frames 0 Fragment frames 0 VLAN tagged frames 0 Code violations 0 Filter statistics: Input packet count 0 . . .
match
Display only the lines matching the specified string: root@Rum> show log messages | match fail Mar 11 11:50:34 Rum chas[517]: cm_pid_get_process: stat of /proc/520 failed Mar 11 11:50:34 Rum chas[517]: failed SIGSTOP to pfem 520 - kill failed . . .
no-more
Do not paginate the output at a more prompt: root@Rum> arp: 0 0 0 0 0 0 0 0 0 0 0
show system statistics arp | no-more datagrams received ARP requests received ARP replys received resolution requests received unrestricted proxy requests received proxy requests proxy requests not proxied with bogus interface with incorrect length for non-IP protocol with unsupported op code
84 | Chapter 2: EX Platform Overview Download at Boykma.Com
0 with bad protocol address length . . .
save
Save the output to a file in the user’s home (or specified) directory: [edit] root@Rum# show interfaces | save rum_interfaces_config Wrote 157 lines of output to 'rum_interfaces_config'
Multiple pipe commands are treated as a logical AND, meaning the output must match both of the commands listed. Consider this example, which combines the count and match arguments to count how many interfaces are currently down: root@Rum> show interfaces terse | match down | count Count: 50 lines
Ouch, a lot of down interfaces, to be sure. Don’t be disheartened. It’s still early in the book. Here we show multiple incarnations of the same pipe argument type (match), to provide additional filtering. Here, matching messages must have both match criteria to pass the filter: root@Rum> show log messages | match fail | match kill Mar 11 11:50:34 Rum chas[517]: failed SIGSTOP to pfem 520 - kill failed Mar 11 11:50:34 Rum chas[517]: failed SIGCONT to pfem 520 - kill failed Mar 11 11:50:34 Rum chas[517]: failed SIGHUP to pfem 520 - kill failed Mar 11 13:30:12 Rum chas[516]: failed SIGSTOP to pfem 519 - kill failed . . .
Pipe commands are not limited to a logical AND, however, as a logical OR operation can also be performed. This is done by wrapping the string in quotation marks and using the OR operator. Here we parse the logfile for messages having either match term. Note that CLI-based matches are not case-sensitive: root@Rum> show log messages | match "(fail|error)" Mar 11 11:50:34 Rum chas[517]: PFELC:Error connecting master kernel,4294967295 Mar 11 11:50:34 Rum chas[517]: cm_pid_get_process: stat of /proc/520 failed Mar 11 11:50:34 Rum chas[517]: failed SIGSTOP to pfem 520 - kill failed Mar 11 11:50:34 Rum chas[517]: cm_pid_get_process: stat of /proc/520 failed Mar 11 11:50:34 Rum chas[517]: failed SIGCONT to pfem 520 - kill failed . . . .
Configuration Mode In the previous section, you were exposed to the CLI’s operational mode. To actually configure a JUNOS device, you must enter the CLI’s configuration mode by entering configure at the operational mode prompt. When in configuration mode, the router prompt changes to the hash (#) symbol, and the user’s position in the configuration hierarchy is displayed. Here, the top of the configuration is indicated by the [edit] prompt:
CLI Overview | 85 Download at Boykma.Com
root@Rum> configure Entering configuration mode [edit] root@Rum#
By default, multiple users can enter the router and make changes at the same time. To avoid any issues that may arise, you can use the configure exclusive or configure private option. The former allows only a single user to configure the router, and the latter allows multiple users to configure different pieces of the configuration simultaneously. The private mode grants users their own copy of the current candidate configuration, while ensuring that each user’s changes are unique. This means that only the changes made by a given user are activated when that user performs a commit. If two users attempt to make the same change, such as adding an IP address to the same interface, the change is rejected and both users must exit configuration mode and begin again to resolve the conflict. In contrast, with the exclusive option no other users can make changes to the configuration except the single user that entered configuration mode. In both the private and exclusive cases, the CLI forces the users to either commit or discard their changes to avoid database conflicts with another user, then enter configuration mode later: [edit] lab@Rum# quit The configuration has been changed but not committed warning: Auto rollback on exiting 'configure exclusive' Discard uncommitted changes? [yes,no] (yes) yes warning: discarding uncommitted changes Exiting configuration mode lab@Rum>
A normal configuration user can exit with unsaved changes; this is considered bad form as others may not know how to quickly determine the nature of the changes that were left in place (and were not yet activated with a commit): lab@Rum> configure Entering configuration mode [edit] lab@Rum# delete interfaces [edit] lab@Rum# quit The configuration has been changed but not committed Exit with uncommitted changes? [yes,no] (yes) yes Exiting configuration mode lab@Rum>
86 | Chapter 2: EX Platform Overview Download at Boykma.Com
While in configuration mode, the set command is used to place new values into the candidate configuration. For example, to enable a Telnet server on the box, use a set command: [edit] root@Rum# set system services telnet [edit] root@Rum#
A delete is the opposite of set, and it is used to remove portions of the configuration. delete acts on the most specific item specified; if you are not careful, you can remove more than you intended. Here, omission of the keyword telnet results in deletion of all statements at the [edit system services] hierarchy, which can be a far sight more than just Telnet! [edit] root@Rum# delete system services telnet [edit] root@Rum#
The JUNOS configuration is based on an object-oriented hierarchy. The top of the hierarchy is called edit, and each configuration stanza is placed in a corresponding subhierarchy. This is roughly analogous to a PC filesystem, in which C: is the root and C:\data is a directory under the root. The configuration hierarchies that live directly below [edit] can be viewed with a set ? command: [edit] root@Rum# set ? Possible completions: > access Network access configuration > access-profile Access profile for this instance > accounting-options Accounting data configuration > active-probe + apply-groups Groups from which to inherit configuration data > chassis Chassis configuration > class-of-service Class-of-service configuration > dialer > ethernet-switching-options Ethernet-switching configuration options > event-options Event processing configuration > firewall Define a firewall configuration > forwarding-options Configure options to control packet forwarding > groups Configuration groups > interfaces Interface configuration > multicast-snooping-options Multicast snooping option configuration > poe Power-over-Ethernet options > policy-options Routing policy option configuration > protocols Routing protocol configuration > routing-instances Routing instance configuration > routing-options Protocol-independent routing option configuration > security Security configuration
CLI Overview | 87 Download at Boykma.Com
> snmp > system > vlans [edit]
Simple Network Management Protocol configuration System parameters VLAN configuration
Entries beginning with a > have their own subhierarchies, and so on, and so forth. We will explore most of these hierarchies at some point in this book. Figure 2-12 shows a partial tree of the configuration hierarchy.
Figure 2-12. A portion of the JUNOS configuration hierarchy
Figure 2-12 shows the top of the hierarchy, edit, and some of the next-level hierarchies that lie directly below it, such as system, interfaces, and protocols. The system path is further expanded to show that it has sublevels, one of which, the services hierarchy, is in turn expanded to show some of the specific services available. The takeaway here is that a configuration-related command intended to alter a system service will have system services in its fully qualified command path, that is, the path needed when at the [edit] root. Although you do not need to memorize the tree structure, it is important to understand the hierarchical structure and how it relates to configuration mode commands. For example, the save command saves information from the current hierarchy down. Therefore, the outcome of a save command when issued at the [edit] hierarchy is far different from when it’s issued at a lower hierarchy, such as [edit protocols ospf area 0]. In the former case, the entire configuration is saved, whereas in the latter only the configuration relating to OSPF area 0 is saved. As mentioned previously, the delete command is the opposite of set. Usually the command is used to remove a single line, but it can be used to remove an entire hierarchy.
Be Careful Out There JUNOS provides the operator with a long length of rope. Use caution to make sure it does not hang you. For example, issuing a delete protocols, when you meant to delete 88 | Chapter 2: EX Platform Overview Download at Boykma.Com
only one interface from area 0 of OSPF—say, with a delete protocols ospf area 0 interface ge-0/0/0 command—does not result in any complaints, or even a sanity check in the form of an “are you sure, enter y/n” dialog. Nope, the whole protocols stanza is simply gone. Moving on to commit such a change could be disastrous. A similar condition is true when clearing protocol neighbors in operational mode, where a failure to identify which neighbor assumes you wish to clear them all. There’s not much more to be said, other than to be careful. And remember that commit confirmed and/or rollback 1 are good tricks to keep handy when making configuration changes, as both function to restore a previous configuration that, for whatever reason, is now deemed better than the current one. Note that if you experience a “mulligan moment” and have not yet committed the mistake, rollback 0 is what you need; this restores a fresh copy of the candidate configuration, which again matches the active configuration. Just be careful next time.
Navigating the configuration hierarchy Configuration commands such as set and delete can be issued from the top, or root level, using a fully qualified path. Alternatively, you can park at a configuration subhierarchy and issue relative commands. The edit command functions like a change directory (cd) command in that it allows you to position yourself at a lower hierarchy. Here, the edit function is used to park at the [edit system services] hierarchy: [edit] root@Rum# edit system services [edit system services] root@Rum# set web-management http
Note how the CLI banner changes to reflect the user’s new position in the hierarchy. A relative set web-management http statement is then issued to enable the HTTP web management service (J-Web). The results are confirmed with a show command, which again is relative to the current hierarchy: [edit system services] root@Rum# show telnet; web-management { http; }
Although using the edit command is not necessary, it does allow the user to issue shorter (relative) set statements, compared to issuing the same statements from the top level. Just like choosing a color for a new car, you can choose how you want to configure the router, as long as the desired result is achieved. In general terms, most users opt to park at a subhierarchy when many set commands are needed. Then again, more experienced users avail themselves of space completion and command recall, and can often issue multiple set statements quite rapidly; recall that Ctrl-w deletes the last
CLI Overview | 89 Download at Boykma.Com
word, so an up arrow/Ctrl-p followed by a Ctrl-w rapidly prepares the user to enter the next statement at the same hierarchy. Once you are in a certain directory, there are multiple ways to navigate the directory tree using the up, top, and exit commands. The up command moves you up one level in the directory tree or multiple levels if a numerical value is given after the command: [edit system services] root@Rum# up [edit system] root@Rum# edit services [edit system services] root@Rum# up 2 [edit] root@Rum#
You can use the top command at any hierarchy to move up to the root level of the configuration tree. This command has the added functionality of allowing multiple configuration statements after you issue the command, such as top edit or top set. Here the user moves from the [edit system services] hierarchy to the top, and then back down to the [edit protocols ospf area 0] hierarchy in one fell swoop: [edit system services] root@Rum# top edit protocols ospf area 0 [edit protocols ospf area 0.0.0.0] root@Rum#
It’s always nice to be able to see your work while you’re still working on it. It’s also nice to be able to focus only on the areas that happen to concern you at that moment. Use the show command to view all or just selected parts of the configuration. Here the operator uses show along with a description of which configuration hierarchy should be displayed: [edit] root@Rum# show system services telnet; web-management { http; } [edit] root@Rum# show interfaces ge-0/0/0 unit 0 { family ethernet-switching; }
Yes, the JUNOS CLI is cool. There, I said it again.
90 | Chapter 2: EX Platform Overview Download at Boykma.Com
This section introduced you to the configuration hierarchy and the basic commands used to alter a configuration by adding or deleting statements. The next section focuses on how to activate or deactivate those changes, as operational outcome should dictate.
Active and candidate configurations, commits, and rollbacks JUNOS uses a candidate configuration model, in which all changes are performed against a copy of the configuration that was current at the time the user entered configuration mode. As a result, the changes do not take effect until the candidate configuration is made active through a commit process. During this process, some sanity checking is performed against the candidate configuration. When problems are detected, one or more warnings may be displayed (while the new configuration is still activated), or a commit failure can occur. When a commit failure is declared, the candidate configuration is preserved and users are free to make additional edits to address the error so that they can try the commit again. In some cases, a new error may be displayed when the last error is corrected because the configuration parser is allowed to proceed further into the candidate configuration. Pay attention to any commit-time warnings printed on the terminal, and ensure that no warnings are being placed into the logfile (/var/log/messages) at the time of commit. This is especially true if things do not appear to be working as they should with a new configuration. JUNOS strives to be flexible and will permit some hardware-dependent configuration on a platform that is currently lacking the hardware needed for the feature to work. This is a feature, not a bug, and as such a warning may not occur on the user’s terminal, but often a log message is generated.
Here, a commit error is declared when a policer is applied in an output direction, which is not currently supported on the EX platform. Note the use of commit check, which performs only the sanity check and does not activate changes regardless of success: [edit] lab@Rum# commit check [edit interfaces ge-0/0/4 unit 0 family inet] 'filter' Referenced filter 'test' can not be used as policer not supported on egress [edit] 'interfaces' error parsing interfaces object error: configuration check-out failed
When a successful commit does occur, the candidate configuration becomes the active configuration, and the previous active configuration is archived into a file called juniper.conf.1.gz, which is a binary file compressed form. During this process, the previous juniper.conf.1.gz is renamed juniper.conf.2.gz, and so on, such that a total of the previous 50 (0–49) active configurations are retained on the switch. CLI Overview | 91 Download at Boykma.Com
The first of these is the current active configuration; it is called juniper.conf.gz and is stored along with the previous three configurations at /config. The remaining 46 previous configurations are stored at /var/db/config/. You access a previous configuration by issuing a rollback n command. In this case, the n refers to a rollback index, which can be 0 (restore current active config, that is, discard changes and start over) through 49. A rollback command causes the current candidate configuration to be replaced by the previous configuration identified, causing it to become the current candidate configuration. It must be stressed that the newly restored configuration is the candidate until you actually perform a commit. Thus, when you have just committed a configuration, and you realize a serious mistake was made, the quickest recovery mechanism is typically a configure, rollback 1, commit sequence, which assumes you left configuration mode after committing the mistake—say, by issuing a commit and-quit, which exits from configuration mode after a successful commit. As mentioned earlier, you can perform a commit check at any time to run the sanitycheck routine against the candidate configuration, without actually placing any changes into effect. One convenient use of this feature is to build some new configuration, in stages, without actually committing the new configuration until all changes are complete and you are in a maintenance window. For example, you enter configuration mode and load a saved configuration file to make some edits. Before wrapping up, you issue commit check to confirm there are no blatant errors, and then save the file for the next editing session. You then perform a rollback 0 to regain a fresh candidate configuration copy, and exit configuration mode with no warnings given that no changes were ever made. Commit confirmed. This section is for anyone who has ever been roused from sound slumber to go on-site to recover a box that can no longer be remotely contacted because of a configuration error. It’s equally for those who have experienced the sinking feeling of pressing the Enter key on such a configuration error, only to realize too late the error of your ways, as all contact is lost to an important piece of networking gear that happens to be located in another country! The confirmed option to the commit command requires that another commit be issued within some period of time, the default being 10 minutes. If no such commit is sensed, the box automatically performs a rollback 1, commit sequence, in effect activating the previous configuration. This process is demonstrated in the following code, where failure to commit within one minute results in automatic restoration (and activation) of the previous configuration: [edit] lab@Rum# set system host-name Mur [edit] lab@Rum# commit confirmed 1 commit confirmed will be automatically rolled back in 1 minutes unless confirmed commit complete
92 | Chapter 2: EX Platform Overview Download at Boykma.Com
lab@Rum# quit Exiting configuration mode # commit confirmed will be rolled back in 0 minutes . . . Broadcast Message from root@Rum (no tty) at 15:28 UTC... Commit was not confirmed; automatic rollback complete. lab@Rum> configure Entering configuration mode [edit] lab@Rum# show system host-name host-name Rum;
You have to disconnect and log back into the router to actually see a hostname change take effect with JUNOS software. In this example, the user does not disconnect, which explains why the system continues to display the old hostname.
Confirmed commits are a real lifesaver and should always be considered when performing remote operations. We just covered some very important JUNOS capabilities, so a bit of review is in order. When you enter configuration mode, a copy of the current configuration is forked off to become the candidate configuration. No changes in switch operation occur until you activate all changes in the candidate through the commit process, which activates the candidate configuration. At this time, the previous active configuration becomes accessible as rollback 1. At the second commit, the precious active configuration becomes rollback 1 and the previous rollback 1 becomes rollback 2, and so on. Figure 2-13 illustrates this process.
Figure 2-13. Commits, rollbacks, and saved configurations
CLI Overview | 93 Download at Boykma.Com
Using rollback 0, which overwrites the current candidate by recopying the active configuration, is a common case that is often missed by those new to JUNOS. As an example, imagine that user lab logs into a switch, makes a few changes, and then rudely logs out without committing the changes: lab@Rum> configure Entering configuration mode [edit] lab@Rum# set protocols rstp interface all edge [edit] lab@Rum# quit The configuration has been changed but not committed Exit with uncommitted changes? [yes,no] (yes) yes Exiting configuration mode lab@Rum> exit Rum (ttyu0) login:
Now, a new user logs into the router and upon entering configuration mode is warned of the stale changes: root@Rum% cli root@Rum> configure Entering configuration mode The configuration has been changed but not committed [edit] root@Rum#
Fortunately, JUNOS offers a few ways out of this predicament. In this example, the pipe function is used to quickly compare the candidate and active configurations. This allows the user to make an intelligent decision as to what she should do next: [edit] root@Rum# show | compare [edit protocols] + rstp { + interface all { + edge; + } + }
The output clearly shows the configuration delta, and makes it obvious that committing this change could have a significant impact on the network’s operation. Although you could parse the logs to determine who made the change, and attempt to track them down for clarity, you could also perform a rollback 0 to replace the adulterated candidate with a fresh copy of the active configuration:
94 | Chapter 2: EX Platform Overview Download at Boykma.Com
[edit] root@Rum# rollback 0 load complete [edit] root@Rum# show | compare [edit] root@Rum#
The (lack of) output shows the earlier change has been eliminated, leaving you free to make your edits without having to worry about unintended consequences stemming from someone else’s changes. Note that JUNOS is very flexible. You could have used the save command to save a copy of the candidate before you did the rollback so that the uncommitted changes would not be lost should someone later confess to having made them. Alternatively, you could mandate use of exclusive configurations, which, as noted previously, prevents users from exiting configuration mode with uncommitted changes in the first place.
Loading and saving configurations When in configuration mode, you use the save command to save all or part of a candidate configuration to local or network storage. To save an active rather than candidate configuration, issue a show configuration command and pipe the results to save when in operational mode, or perform a rollback 0 if in configuration mode to ensure that the active and candidate configurations are in sync. Recall that save begins from the current hierarchy. To save the entire candidate configuration, make sure you are positioned at the top of the configuration hierarchy. In the following example, only eight lines of the configuration are saved, and all are related to OSPF area 0: [edit protocols ospf area 0.0.0.0] lab@Rum# save test Wrote 8 lines of configuration to 'test'
In the next example, the addition of top ensures that the whole configuration is captured, resulting in 86 lines being written: [edit protocols ospf area 0.0.0.0] lab@Rum# top save test Wrote 86 lines of configuration to 'test' [edit protocols ospf area 0.0.0.0] lab@Rum#
Sometimes it is not desirable to save the entire configuration; to save some portion of a configuration, simply navigate into the desired hierarchy. For instance, if every router in your network has the same system login information, you may want to save only that portion to load into other routers later, so a save is issued at the [edit system login] hierarchy:
CLI Overview | 95 Download at Boykma.Com
[edit system login] lab@Rum# save only_system_login Wrote 12 lines of configuration to 'only_system_login'
The automatic system archival feature eliminates the need to manually save and then transfer your configuration files (using the file copy command); the feature can be set to archive upon each commit, or at preset intervals. The CLI’s help feature is used to display some of the archival options: lab@Rum# set system archival configuration ? Possible completions: + apply-groups Groups from which to inherit configuration data + apply-groups-except Don't inherit configuration data from these groups > archive-sites List of archive destinations transfer-interval Frequency at which file transfer happens (minutes) transfer-on-commit Transfer after each commit
As with the save command in general, configuration snapshots can be transferred to a remote FTP or secure copy (SCP) server based on the URL details specified under the archival-sites hierarchy. The configuration shown here results in an FTP-based transfer at each commit. The switch will authenticate to the server as user ftp with password ftp, and the file will be uploaded to the /config/junos/Rum directory: archival { configuration { transfer-on-commit; archive-sites { "ftp://ftp:[email protected]/config/junos/Rum"; }
Here, a manual load and network-based file copy operation is demonstrated. Note the use of run for the operational mode file command: [edit] lab@Rum# save rum_base_config Wrote 124 lines of configuration to 'rum_base_config' [edit] lab@Rum# run file copy rum_base_config ftp://instructor:[email protected]/juniper/rum_config ftp://instructor:[email protected]/junip100% of 2386 B 1803 kBps [edit] lab@Rum#
The load command is the opposite of save. There are several important variations of this command; all require that you issue a commit before the change is placed into effect: [edit] lab@Rum# load ? Possible completions: factory-default merge override patch
Override existing configuration with factory default Merge contents with existing configuration Override existing configuration Load patch file into configuration
96 | Chapter 2: EX Platform Overview Download at Boykma.Com
replace set update [edit]
Replace configuration data Execute set of commands on existing configuration Update existing configuration
Most of the load options support an argument to control where the information that is loaded actually comes from (e.g., a terminal buffer, a local file, or a network resource). Use the override option to completely replace the current candidate configuration with another one. Here, the contents of a file called junos_is_cool, which is located in the user’s home directory, overrides the current candidate: [edit] lab@Rum# load override junos_is_cool load complete
Use the merge option when you wish to add to, rather than replace, the candidate configuration. For instance, here you add the system login configuration that was saved previously to the current candidate, rather than replace it: [edit] lab@Rum# load merge only_system_login load complete
Using a terminal buffer to cut and paste configuration data between boxes can be a real timesaver. There are several ways to cut and paste into a JUNOS configuration. The most common method is to use the terminal option to paste updated configuration data. The terminal data can override, or merge, with the existing candidate, as desired: lab@Rum# load merge terminal [Type ^D at a new line to end input] system { services { ftp; ssh; telnet; } } ^D load complete
Although quite useful, this method can take some practice. The proper number of levels and braces must always be present to avoid an error, because the terminal command assumes the entire top-level hierarchy is known and all delimiting braces are present. This is shown in the following code, where the user is at the edit hierarchy and is trying to paste in data that relates to the [edit systems services] hierarchy. The problem is that the loaded data is missing the system portion of the hierarchy, resulting in errors: [edit] lab@Rum# load merge terminal [Type ^D at a new line to end input] services { ftp; terminal:2:(7) syntax error: ftp
CLI Overview | 97 Download at Boykma.Com
[edit services] 'ftp;' syntax error ssh; telnet; } [edit] 'services' warning: statement has no contents; ignored load complete (1 errors)
It’s times like these that using the relative switch saves the day. In this case, you first navigate to the desired configuration hierarchy, and then load the data, which is now understood to be relative to the current working location in the configuration: [edit] lab@Rum# edit system [edit system] lab@Rum# load merge terminal relative [Type ^D at a new line to end input] services { ftp; ssh; telnet; } ^D load complete
In summary, load override is used when you want to do a wholesale configuration file swap, and load merge adds the new information to the existing configuration. By using the update or replace option you can further control which portions of a configuration will be added to or replaced, respectively. Yet another option is to load a series of set commands, as they would have been typed in configuration mode with the load set option: lab@Rum# load set terminal [Type ^D at a new line to end input] set system services ftp set system services ssh set system services telnet ^D load complete
Recall that a configuration mode show command (or a show configuration from operational mode) can have the results piped to set, to generate the set statements.
The JUNOS CLI Summary This section introduced you to the JUNOS software CLI, and gave an honorable nod to the GUI-based J-Web interface, for those so inclined.
98 | Chapter 2: EX Platform Overview Download at Boykma.Com
If you are new to Juniper, you have to admit its CLI is pretty slick, with features such as space-based command completion, tab-based variable completion, context-sensitive help, candidate configurations with basic sanity checking, rollbacks, confirmed commits… the list just goes on and on. The next section builds on this foundation with a look at additional CLI and JUNOS functionality.
Advanced CLI and Other Cool Stuff There are lots of other fantastic configuration options that can be used, and an explanation of all of them would require another book. The JUNOS documentation contains many timesaving tips, and JUNOS Cookbook by Aviva Garrett (O’Reilly) is a great resource, too. To whet your appetite, here are three JUNOS software CLI tips.
SOS If JUNOS is causing you problems, just ask it for help. You can do this in a few ways. Most people are instinctively aware of the option to use the question mark (?) to display possible command completions: [edit] lab@Rum# set protocols Possible completions:
+ apply-groups + apply-groups-except bridge-priority disable forward-delay hello-time > interface max-age > traceoptions | [edit] lab@Rum# set protocols
rstp ? Execute this command Groups from which to inherit configuration data Don't inherit configuration data from these groups Priority of the bridge (in increments of 4k - 0,4k,8k,..60k) Disable STP Time spent in listening or learning state (4..30 seconds) Time interval between configuration BPDUs (1..10 seconds) Maximum age of received protocol bpdu (6..40 seconds) Tracing options for debugging protocol operation Pipe through a command rstp
Note that the > character indicates a directory that contains subdirectories, and the + indicates a command that takes multiple arguments; no symbol means the command takes a single argument or is in fact the end statement of a command. The help command is a secret resource of which few are aware. Sometimes a small piece of a command is remembered but not the full statement; help apropos can aid in finding the remaining syntax by searching through large portions of the JUNOS documentation for string matches. For example, let’s see whether we can jog our memory on forward-delay: [edit] lab@Rum# help apropos forward-delay
Advanced CLI and Other Cool Stuff | 99 Download at Boykma.Com
set logical-routers protocols stp forward-delay Time spent in listening or learning state set logical-routers protocols rstp forward-delay Time spent in listening or learning state set logical-routers protocols mstp forward-delay Time spent in listening or learning state set logical-routers protocols vstp forward-delay Time spent in listening or learning state set protocols stp forward-delay Time spent in listening or learning state set protocols rstp forward-delay Time spent in listening or learning state set protocols mstp forward-delay Time spent in listening or learning state set protocols vstp forward-delay Time spent in listening or learning state
Here, the results remind us that this is an STP parameter controlling time spent listening and learning, and we also see at which configuration hierarchies the statement can be applied. Even more information can be provided by issuing the help topic or help reference command. The former will display general usage guidelines for that command: [edit] lab@Rum# help topic stp ? Possible completions: bridge-priority Priority to become root bridge or LAN's designated bridge configuration-name MSTP region name recorded in MSTP BPDUs cost Link cost for determining designated bridge and port edge Interface is edge port until BPDU is received extended-system-id Bridge identifier for different routing instances force-version Spanning tree version is original IEEE 803.1D STP forward-delay Time STP bridge port remains in listening, learning state hello-time Interval for root bridge sending configuration BPDUs interface Interface participating in MSTP or RSTP instance interface-msti Logical interface in Multiple Spanning Tree instance max-age Maximum expected interval between hello BPDUs max-hops Maximum number of hops to forward BPDU in MSTP region mode Link mode to identify point-to-point links msti Multiple Spanning Tree instance configuration priority Priority of interface to become root port protocols Protocol is Multiple STP or Rapid STP revision-level Revision number of MSTP configuration trace-example Sample tracing configuration for STP traceoptions Trace options for Spanning Tree Protocols vlan Single or range of VLAN IDs associated with MSTI vstp VLAN Spanning Tree Protocol instance configuration vstp-requirements Requirements, limitations for VLAN Spanning Tree Protocol [edit] lab@Rum# help topic stp forward-delay Configuring the Forwarding Delay
100 | Chapter 2: EX Platform Overview Download at Boykma.Com
The forwarding delay timer specifies the length of time an STP bridge port remains in the listening and learning states before transitioning to the forwarding state. Setting the interval too short could cause unnecessary spanning-tree reconvergence. Before changing this parameter, you should have a thorough understanding of STP. To configure the forwarding delay timer, include the following statement: forward-delay seconds; You can configure this statement at the following hierarchy levels: * [edit protocols protocol-name] * [edit routing-instances routing-instance-name protocols protocol-name] * [edit protocols vstp vlan vlan-id] * [edit routing-instances routing-instance-name protocols vstp vlan vlan-id]
After learning what a certain command actually accomplished and when it should be used, we can view the syntax and possible options with the help reference command: [edit] lab@Rum# help reference stp forward-delay forward-delay Syntax forward-delay seconds; Hierarchy Level [edit protocols protocol-name], [edit routing-instances routing-instance-name protocols protocol-name], [edit protocols vstp vlan vlan-id], [edit routing-instances routing-instance-name protocols vstp vlan vlan-id] Release Information Statement introduced in JUNOS Release 8.4. Description Specify the length of time an STP bridge port remains in the listening and learning states before transitioning to the forwarding state. Options seconds--(Optional) Number of seconds the bridge port remains in the listening and learning states. Range: 4 through 30 Default: 15 seconds Usage Guidelines See "Configuring the Forwarding Delay". Required Privilege Level
Advanced CLI and Other Cool Stuff | 101 Download at Boykma.Com
routing--To view this statement in the configuration. routing-control
Scheduled Commits and Wildcards Most changes that need to be made on a router can be done at only certain times, referred to as a maintenance window. Because these windows are often at the most inconvenient times for those who have to make them, changes represented by commit can actually be scheduled (comments can also be added): [edit] lab@Rum# commit at 19:00 comment "testing commit at feature" configuration check succeeds commit at will be executed at 2008-03-19 19:00:00 UTC Exiting configuration mode
When a commit is pending, the database is locked, preventing other users from making any modifications: lab@Rum> configure Entering configuration mode Users currently editing the configuration: lab terminal u0 (pid 3443) on since 2008-03-19 15:28:38 UTC commit-at [edit] lab@Rum# set system host-name foo error: configuration database locked by: lab terminal u0 (pid 3443) on since 2008-03-19 15:28:38 UTC commit at
If the system needs to be unlocked before the specified time, an operational mode clear command can stop the timed action: lab@Rum# run clear system commit Pending commit cleared [edit] lab@Rum#
Wildcards and regular expressions Wildcard and regex support are two features that operate together to simplify working with large configurations. You can use wildcards in operational and configuration modes, to display only certain values or to replace/delete matching strings, respectively. In this example, wildcards and a regex match are used to delete a range of matching interfaces: [edit] lab@Rum# wildcard delete interfaces ge-0/0/"[3-5]" matched: ge-0/0/3 matched: ge-0/0/4 Delete 2 objects? [yes,no] (no) yes
102 | Chapter 2: EX Platform Overview Download at Boykma.Com
Note the use of quotes around the regex itself, and the handy confirmation dialog that helps guard against the inevitable regex mistake. In this example, an operational mode command lists the status of only matching interfaces: [edit] lab@Rum# run show interfaces terse Interface Admin Link ge-0/0/3 up up ge-0/0/3.0 up up ge-0/0/4 up up ge-0/0/4.0 up up
ge-0/0/"[3-4]"* Proto Local
Remote
eth-switch eth-switch
Lastly, common configuration changes can be made in one fell swoop with the replace command. Any string can replace any other string, with a string defined from a range of one character to any POSIX 1003.2 expression. The replace function is especially useful when you need to update an IP or MAC address that is referenced in various places, such as firewall filters, policies, protocols, and so on. In this example, we update all instances of “200” with “201”, which in this context refers to a VLAN tag: [edit] lab@Rum# replace pattern ^200$ with 201
The regex anchor characters ^ and $ are used to match only user variables that begin and end with exactly 200, which helps to avoid trouncing on unintentional matches such as might occur with an IP address containing the value 200. The CLI compare function is evoked against its default target, which is rollback 0, and the output confirms that only the VLAN ID has changed, while the IP address remains untouched due to the diligent use of regex matching: [edit] lab@Rum# show | compare [edit interfaces ge-0/0/0 unit 0] vlan-id 200; family inet { address 10.3.5.5/24; address 200.0.0.1/24; } + vlan-id 201; + family inet { + address 10.3.5.5/24; + address 200.0.0.1/24; + }
Copying, Renaming, and Inserting The CLI also allows you to copy portions of the configuration, to rename one value to another, and to insert a string into an existing list of values. The latter is particularly useful for order-sensitive processing such as with ACLs, where you can insert a new
Advanced CLI and Other Cool Stuff | 103 Download at Boykma.Com
address at the desired location without having to clear the entire list and rebuild it from scratch. Here, a Layer 3 interface is copied and the rename function is used to provide it with a unique IP address: [edit interfaces] lab@Rum# copy ge-0/0/4 to ge-0/0/5 [edit interfaces] lab@Rum# edit ge-0/0/5 unit 0 [edit interfaces ge-0/0/5 unit 0] lab@Rum# show family inet { filter { input test; output test; } address 10.5.7.5/24; } [edit interfaces ge-0/0/5 unit 0] lab@Rum# rename family inet address 10.5.7.5/24 to address 10.9.9.10/24 [edit interfaces ge-0/0/5 unit 0] lab@Rum# show family inet { filter { input test; output test; } address 10.9.9.10/24; }
Conclusion This chapter discussed EX platform models and hardware capabilities as well as typical market applications. We also provided an overview of the initial Layer 2 and Layer 3 features, as well as a quick tour and operational guide to the JUNOS software that runs them. The CLI is one of the most flexible and user-friendly frontends in the entire industry, allowing expert status to be achieved in record time. As your familiarity with the CLI increases, you will discover even more features. Now that the groundwork has been established, the rest of the book will dive into the specific EX switching and routing scenarios that will afford you much CLI practice. Yes, much indeed.
104 | Chapter 2: EX Platform Overview Download at Boykma.Com
Chapter Review Questions 1. Which of the following Juniper Networks switches can support a VC? a. EX4200 b. EX2300 c. EX3200 d. EX8200 2. Which hardware component provides the user CLI/management interface? a. Packet Forwarding Engine b. Route processor c. System control board d. Routing engine 3. True or false: adding a higher-wattage power supply can increase the number of PoE ports from the value the chassis initially ships with. 4. Which commands save the entire configuration? (Choose two.) [edit] a. save config
b.
[edit protocols] save config
c. d.
save running configuration [edit] show | save config
5. Which pipe argument is used to find every occurrence of the word error in some file? a. match error b. find error c. search error d. except error 6. What is the default password to enter configuration mode on the router? a. juniper b. enable c. None, a configuration password is not supported d. root 7. Which configuration mode command is issued to navigate to the [edit protocols ospf] directory? a. cd protocols ospf b. edit protocols ospf
Chapter Review Questions | 105 Download at Boykma.Com
8.
9.
10.
11.
c. cd /edit/protocols/ospf d. dir protocols ospf Which configuration mode command activates configuration changes? a. apply b. copy c. save d. commit What is the top level of the configuration tree called? a. C:/ b. top c. edit d. root After performing a commit, which CLI command returns to the previously activated configuration? a. rollback 1 b. rollback 0 c. rollback active d. rollback previous Which command is used to obtain detailed information about configuring OSPF area ranges? a. ospf ? b. help topic ospf area-range c. help reference ospf area-range d. man ospf
Chapter Review Answers 1. Answer: A. Only the EX4200 can be used as part of a VC. 2. Answer: D. The routing engine is the component in the router that controls all management functions, including commands that would be used to debug the router. 3. Answer: False. Installing a PSU with additional amperage does not activate any additional PoE ports. PoE port count is determined by part number only. However, installing an insufficient PSU will result in deactivation of PoE ports to bring the PoE load to within that PSU’s budget.
106 | Chapter 2: EX Platform Overview Download at Boykma.Com
4. Answer: A and D. The save command saves the configuration from the current hierarchy down. Displaying the configuration and piping it to the CLI’s save function has the same effect. 5. Answer: A. The pipe command match will find every occurrence of a string in the output of the command. The find command will locate the first occurrence of the string, search is an invalid option, and hold will hold text without exiting the -More-- prompt. 6. Answer: C. There is no password to enter configuration mode. Users are allowed into configuration mode based on access privileges. 7. Answer: B. Recall that in JUNOS the edit statement functions like a cd (change directory) command. While there is no cd command, you use the edit statement to park at some hierarchy. Once so positioned, you enter configuration statements that are qualified by the current hierarchy, which means that only relevant syntax is displayed with the CLI help function. In contrast, when at the top ([edit]) of the configuration hierarchy, you can modify anything in the configuration but must issue fully qualified statements to remove any ambiguities. 8. Answer: D. To activate changes in the switch’s configuration, issue a commit command. Of the remaining options, copy and save are valid CLI commands but are used for configuration management. 9. Answer: C. When at the top level of the configuration tree, the CLI banner will display the [edit] prompt. 10. Answer: A. The first archive is stored in rollback 1. rollback 0 is used to copy the active configuration to the candidate configuration; the other options are not valid rollback commands. 11. Answer: C. help topic commands provide a functional overview and help reference commands detail configuration options.
Chapter Review Answers | 107 Download at Boykma.Com
Download at Boykma.Com
CHAPTER 3
Initial Configuration and Maintenance
Now that we have introduced you to JUNOS, it is time to get started with initial switch configuration. This chapter walks through the configuration and hardware status checks typically performed when installing a brand-new EX switch. A new switch is set to a factory-default configuration, and the goal of this chapter is to teach you how to configure the switch with the most common settings needed to get the chassis up and running with network management and user accounts. The topics covered include: • • • • •
Factory-default configuration and EZSetup Initial configuration using the command-line interface (CLI) Secondary configuration using the CLI EX interfaces Chassis monitoring and network tools
JUNOS is a flexible operating system and there are several ways to skin the initial configuration cat, which is not to say that any animals were harmed during production of this material. We begin with a quick overview of the EZSetup Wizard, but the focus rapidly shifts to the CLI, where the real work can be quickly done. This chapter walks you through the addition of a new Juniper Networks EX4200 switch, in this case named Tequila, using both EZSetup and the CLI, and demonstrates chassis status monitoring and validation of initial configuration services and operation. The new switch is being integrated into a legacy switched network that comprises two Cisco Catalyst 3550 switches named Whiskey and Gin. Figure 3-1 shows the planned topology expansion.
109 Download at Boykma.Com
Figure 3-1. Planned network topology expansion
The Factory-Default Configuration and EZSetup As we discussed previously, the EX4200 switches are rack-, desk-, or wall-mountable. In our case, the switch is rack-mounted using the mounting brackets and rubber feet supplied with the new switch. This is primarily a spinal type of effort, and we will not document it further here. Details on rack mounting, and other installation options, are available in the user documentation.
Factory-Default Configuration When the switch is installed in the rack, it contains a factory-default configuration. A factory-default configuration is not blank; it contains the following default behavior and settings: • Enables Layer 2 switching mode on all ports • Configures system logging • Enables Link Layer Discovery Protocol (LLDP) and Rapid Spanning Tree Protocol (RSTP) on all interfaces • Enables Power over Ethernet (PoE) on all supported ports • Enables Internet Group Management Protocol (IGMP) snooping • Resets the LCD menu and any Virtual Chassis (VC) configuration on commit The following code displays the factory-default configuration. Note that only the root user can log in when the default configuration is active and no password is set: root@% root root@% OS 9.2R1.9 built 2008-08-05 07:25:22 UTC root@% cli root> configure Entering configuration mode [edit] root# show ## Last changed: 2008-08-05 11:13:01 UTC
110 | Chapter 3: Initial Configuration and Maintenance Download at Boykma.Com
version 9.2R1.9;system { syslog { user * { any emergency; } file messages { any notice; authorization info; } file interactive-commands { interactive-commands any; } } commit { factory-settings { reset-chassis-lcd-menu; reset-virtual-chassis-configuration; } } ## Warning: missing mandatory statement(s): 'root-authentication' } interfaces { ge-0/0/0 { unit 0 { family ethernet-switching; } } ge-0/0/1 { unit 0 { family ethernet-switching; } } ge-0/0/2 { unit 0 { family ethernet-switching; } } ge-0/0/3 { unit 0 { family ethernet-switching; } } ge-0/0/4 { unit 0 { family ethernet-switching; } } ge-0/0/5 { unit 0 { family ethernet-switching; } } ge-0/0/6 { unit 0 { family ethernet-switching;
The Factory-Default Configuration and EZSetup | 111 Download at Boykma.Com
} } ge-0/0/7 { unit 0 { family } } ge-0/0/8 { unit 0 { family } } ge-0/0/9 { unit 0 { family } } ge-0/0/10 { unit 0 { family } } ge-0/0/11 { unit 0 { family } } ge-0/0/12 { unit 0 { family } } ge-0/0/13 { unit 0 { family } } ge-0/0/14 { unit 0 { family } } ge-0/0/15 { unit 0 { family } } ge-0/0/16 { unit 0 { family } } ge-0/0/17 { unit 0 { family
ethernet-switching;
ethernet-switching;
ethernet-switching;
ethernet-switching;
ethernet-switching;
ethernet-switching;
ethernet-switching;
ethernet-switching;
ethernet-switching;
ethernet-switching;
ethernet-switching;
112 | Chapter 3: Initial Configuration and Maintenance Download at Boykma.Com
} } ge-0/0/18 { unit 0 { family } } ge-0/0/19 { unit 0 { family } } ge-0/0/20 { unit 0 { family } } ge-0/0/21 { unit 0 { family } } ge-0/0/22 { unit 0 { family } } ge-0/0/23 { unit 0 { family } } ge-0/1/0 { unit 0 { family } } xe-0/1/0 { unit 0 { family } } ge-0/1/1 { unit 0 { family } } xe-0/1/1 { unit 0 { family } } ge-0/1/2 { unit 0 { family
ethernet-switching;
ethernet-switching;
ethernet-switching;
ethernet-switching;
ethernet-switching;
ethernet-switching;
ethernet-switching;
ethernet-switching;
ethernet-switching;
ethernet-switching;
ethernet-switching;
The Factory-Default Configuration and EZSetup | 113 Download at Boykma.Com
} } ge-0/1/3 { unit 0 { family ethernet-switching; } } } protocols { igmp-snooping { vlan all; } lldp { interface all; } lldp-med { interface all; } rstp; } poe { interface all; }
Notice the existence of the ge-0/1/1 and xe-0/1/1 uplink interfaces in the factory-default configuration. In JUNOS, interfaces are allowed to be configured even if they do not physically exist. The factory-default configuration takes into account that the uplink module could be either 1G or 10G, and the missing physical module will simply be ignored.
The attempt to commit with a factory default fails due to lack of a root authentication setting. This is expected: [edit] root commit [edit] 'system' Missing mandatory statement: 'root-authentication' error: commit failed: (missing statements) [edit] root# quit Exiting configuration mode root> exit root@%
114 | Chapter 3: Initial Configuration and Maintenance Download at Boykma.Com
To return a switch to the factory-default configuration, issue the load factory-default command in configuration mode or navigate the LCD menu by clicking the Menu button and choosing “Restore to factory default.” Note that after the configuration is loaded, it still cannot be committed due to lack of a root password. This safety measure ensures that this important password is set before you install the router in your production network.
However, because such a setting alters the factory default, once the setting is committed the EZSetup feature is no longer available. EZSetup runs only with a true, unaltered factory default. See the warning at the end of the next section for more details.
EZSetup The EZSetup feature is designed to walk you through the most common configuration settings to get your switch up and running quickly. The functionality is similar to the initial configuration dialog seen on IOS-based devices. After logging in as root you have the choice of entering the router’s operational mode by typing cli or ezsetup. You can also access EZSetup through the LCD menu by choosing Initial Setup or via J-Web by connecting to either the ge-0/0/0 or the me0 interface and directing your browser to 192.168.1.1. To access the CLI-based EZSetup feature, you must have a console connection to the switch. The switch is supplied with an RJ-45 to DB-9 EIA-232 cable for this purpose.
Once activated, EZSetup prompts you for the following configuration parameters: • • • • • • •
Hostname Telnet service SSH service Switch management Simple Network Management Protocol (SNMP) Time Time zone
You launch EZSetup from a root shell prompt when a factory-default config is active, as shown in the following code. In this example, various parameters such as hostname and Out of Band (OoB) management addresses are assigned: root@% ezsetup ***************************************************************************** * EZSetup wizard *
The Factory-Default Configuration and EZSetup | 115 Download at Boykma.Com
* * * Use the EZSetup wizard to configure the identity of the switch. * * Once you complete EZSetup, the switch can be accessed over the network. * * * * To exit the EZSetup wizard press CTRL+C. * * * * In the wizard, default values are provided for some options. * * Press ENTER key to accept the default values. * * * * Prompts that contain [Optional] denotes that the option is not mandatory. * * Press ENTER key to ingore the option and continue. * * * ***************************************************************************** EZSetup Initializing..done. Initial Setup Configuration ---------------------------
Enter System hostname [Optional]:Tequila Enter new root password: Re-enter the new password: Enable Telnet service? [yes|no]. Default [no]:yes Enable SSH service? [yes|no]. Default [yes]: Switch Management 1: Configure in-band Management [interface vlan.XX] 2: Configure out-of-band management [me0.0] Choose Option [1 or 2], default [1]:2 Configuring me0.0 Enter Management IP address [192.168.1.1]:172.16.69.4 Enter Subnetmask [255.255.255.0]: Enter Gateway IP address: Invalid IP address format, expected Enter Gateway IP address:172.16.69.9 Configure SNMP [yes|no], default [yes]:yes SNMP Configuration Contact information for administrator, Enter contact [Optional]: Community name, Enter community [Optional]:underdogs Physical location of system, Enter location [Optional]: Enter System Time and Date YYYY:MM:DD:hh:mm:ss [Optional]: Time Zone [Optional], Enter "yes" to choose Timezone from list:yes Select Timezone Africa/Abidjan Africa/Accra Africa/Addis_Ababa Africa/Algiers Africa/Asmera
116 | Chapter 3: Initial Configuration and Maintenance Download at Boykma.Com
Africa/Bamako Africa/Bangui Africa/Banjul Africa/Bissau Africa/Blantyre Africa/Brazzaville ... ... .... America/Los_Angeles America/Louisville America/Maceio America/Managua Press key n to stop and any other key to continue... Press key n to stop and any other key to continue... Enter Timezone:America/Los_Angeles The input configuration parameters are System Hostname: Root password: System Telnet Service: System SSH Service: Management IP Address: SubnetMask: Gateway IP Address: Out-of-band management: SNMP Community: SNMP Location: SNMP Contact: Time-Date: Time-zone: Interfaces:
Tequila ****** yes yes 172.16.69.4 255.255.255.0 172.16.69.9 me0.0 underdogs
America/Los_Angeles
Commit the new configuration? Choosing option "yes" will add new configuration to existing configuration. Option "No" will allow user to come out of EZSetup wizard. Choose option [yes|no], default [yes]:yes Committing the new configuration, please wait..... Commit success. root@tequila% cli
The following code shows the updated configuration. Notice that the system was committed and the hostname was changed. The highlighted portions of the configuration show the configuration delta that resulted from answering the EZSetup prompts, and the rest of the configuration was inherited from the factory-default configuration: root@tequila> show configuration ## Last commit: 2008-08-05 04:41:28 PDT by root
The Factory-Default Configuration and EZSetup | 117 Download at Boykma.Com
version 9.2R1.9; system { host-name Tequila; time-zone America/Los_Angeles; root-authentication { encrypted-password bJOYvGXKxTdr6; ## SECRET-DATA } services { ssh; telnet; web-management { http; } } syslog { user * { any emergency; } file messages { any notice; authorization info; } file interactive-commands { interactive-commands any; } } } interfaces { ge-0/0/0 { unit 0 { family ethernet-switching; } } ge-0/0/1 { unit 0 { family ethernet-switching; } } ge-0/0/2 { unit 0 { family ethernet-switching; } } ge-0/0/3 { unit 0 { family ethernet-switching; } } ge-0/0/4 { unit 0 { family ethernet-switching; } } ge-0/0/5 { unit 0 {
118 | Chapter 3: Initial Configuration and Maintenance Download at Boykma.Com
family ethernet-switching; } } ge-0/0/6 { unit 0 { family } } ge-0/0/7 { unit 0 { family } } ge-0/0/8 { unit 0 { family } } ge-0/0/9 { unit 0 { family } } ge-0/0/10 { unit 0 { family } } ge-0/0/11 { unit 0 { family } } ge-0/0/12 { unit 0 { family } } ge-0/0/13 { unit 0 { family } } ge-0/0/14 { unit 0 { family } } ge-0/0/15 { unit 0 { family } } ge-0/0/16 { unit 0 {
ethernet-switching;
ethernet-switching;
ethernet-switching;
ethernet-switching;
ethernet-switching;
ethernet-switching;
ethernet-switching;
ethernet-switching;
ethernet-switching;
ethernet-switching;
The Factory-Default Configuration and EZSetup | 119 Download at Boykma.Com
family ethernet-switching; } } ge-0/0/17 { unit 0 { family } } ge-0/0/18 { unit 0 { family } } ge-0/0/19 { unit 0 { family } } ge-0/0/20 { unit 0 { family } } ge-0/0/21 { unit 0 { family } } ge-0/0/22 { unit 0 { family } } ge-0/0/23 { unit 0 { family } } ge-0/1/0 { unit 0 { family } } xe-0/1/0 { unit 0 { family } } ge-0/1/1 { unit 0 { family } } xe-0/1/1 { unit 0 {
ethernet-switching;
ethernet-switching;
ethernet-switching;
ethernet-switching;
ethernet-switching;
ethernet-switching;
ethernet-switching;
ethernet-switching;
ethernet-switching;
ethernet-switching;
120 | Chapter 3: Initial Configuration and Maintenance Download at Boykma.Com
family ethernet-switching; } } ge-0/1/2 { unit 0 { family ethernet-switching; } } ge-0/1/3 { unit 0 { family ethernet-switching; } } me0 { unit 0 { family inet { address 172.16.69.4/24; } } } } snmp { community underdogs { authorization read-only; } } routing-options { static { route 0.0.0.0/0 next-hop 172.16.69.9; } } protocols { igmp-snooping { vlan all; } lldp { interface all; } lldp-med { interface all; } rstp; } poe { interface all; }
As of JUNOS 9.2R1.9, the only way to evoke EZSetup after committing any changes is to delete the files in the /config directory from a root shell, and then reboot the switch to force the load of a true factory config. Using load factory-default does not suffice; a root password must be set before you can commit the loaded configuration, after which the config is no longer considered factory-default enough to prompt for EZSetup.
The Factory-Default Configuration and EZSetup | 121 Download at Boykma.Com
Factory-Default Configuration and EZSetup Summary When you purchase a new switch, the system is loaded with a factory-default configuration that enables Layer 2 switching on all interfaces as well as protocols such as RSTP and LLDP. One way to get the initial installation into the router is to use the EZSetup feature. A second way is to configure each statement via CLI commands. We will examine this option next.
Initial Configuration Using the CLI Although the EZSetup menu is, well, easy, it often does not contain all the parameters that are needed in a specific deployment. As a result, users often bypass EZSetup and configure the switch via the CLI. Juniper recommends that you configure the following parameters during initial configuration. Note that with the exception of the system’s domain name, all parameters can be configured via EZSetup, when desired. This section begins by showing the commands that you would type to offer the equivalent functionality to EZSetup. We won’t go into a detailed explanation here, as we discuss each command and topic in detail later in this chapter. Hostname Sets the switch’s name: root# set system host-name Tequila
Root password Sets the password for user root: root# set system root-authentication plain-text-password New password: Retype new password:
Remote access protocols Connects to the router without a physical connection: root# set system services ssh root# set system services telnet
Default VLAN management (EZSetup option only) Uses the default virtual LAN (VLAN) or a new VLAN for management. If you select the New VLAN option, you are prompted to specify the VLAN name, VLAN ID, management IP address, and default gateway. Select the ports that must be part of this VLAN. See Chapter 5 for VLAN details. OoB management IP Uses the dedicated OoB management interface: root# set interfaces me0 unit 0 family inet address 172.16.69.8/24
122 | Chapter 3: Initial Configuration and Maintenance Download at Boykma.Com
OoB default route Creates a default route for the OoB network and ensures, via the no-export tag, that this route is never redistributed into any protocols: root# set routing-options static route 0.0.0.0/0 next-hop 172.16.69.9 no-export
Domain name Sets the Domain Name System (DNS) entry: root# set system domain-name ietraining.net
SNMP contact and community information Adds contact information: root# set snmp community underdogs authorization read-only
System time and time zone Sets the time and time zone: root@Tequila> set date ? Possible completions: New date and time (YYYYMMDDhhmm.ss) ntp Set system date and time using Network Time Protocol servers root# set system time-zone America/Los_Angeles
The candidate configuration is activated to put the initial configuration into effect. Recall that with JUNOS, “If you don’t commit, it don’t mean feces” (euphemism inserted): [edit] root# commit commit complete [edit] root@Tequila#
Note that after the commit, the system prompt changes to reflect the newly assigned hostname. With the preliminary configuration committed, attention now shifts to additional configuration that is often needed as part of the installation of a new switch.
CLI Configuration Summary This section showed how quickly you can get a JUNOS device up and running with a few fell strokes of the CLI interface. The next section builds upon this information with some secondary configuration items that you should consider in any install.
Secondary Configuration After completing the initial configuration via either the CLI or EZSetup, you will likely need additional configuration, such as: • Non-root-user accounts and privileges
Secondary Configuration | 123 Download at Boykma.Com
• OoB management • Additional remote access functionality • Dynamic Host Configuration Protocol (DHCP) services
Customized User Accounts, Authentication, and Authorization There are two types of users on a Juniper Networks system: non-root users and the root user. All users must be authenticated before they can access the switch, and when desired, various levels of authorization are possible to limit the scope of actions or commands available to users in each class. Recall that the root user is the only predefined user, and that root can log in only via the console port until SSH access is configured; the root user is not permitted to remotely access the router via Telnet for security reasons. Non-root users can telnet to the router and su to root when authorized if the SSH service is not running. This is not recommended, as Telnet sends in plain text.
You must set a root password before the switch will allow you to commit a modified factory-default configuration. As we showed previously, to set up a root password, issue the set root-authentication statement under the [edit system] level. There are several options: root@Tequila# set system root-authentication ? Possible completions: + apply-groups Groups from which to inherit configuration data + apply-groups-except Don't inherit configuration data from these groups encrypted-password Encrypted password string t load-key-file File (URL) containing one or more ssh keys plain-text-password Prompt for plain text password (autoencrypted) > ssh-dsa Secure shell (ssh) DSA public key string > ssh-rsa Secure shell (ssh) RSA public key string
The password can be a plain-text password that is encrypted automatically in the configuration, an SSH key, or an encrypted string for copying and pasting between other configurations. In this case, a password of jncie123 is supplied: root@Tequila# set system root-authentication plain-text-password New password: Retype new password:
124 | Chapter 3: Initial Configuration and Maintenance Download at Boykma.Com
When issuing a plain-text password, JUNOS enforces default requirements for password length and structure to help ensure that a strong password is used. The password must be between 6 and 128 characters and must contain one change of case or special character. You can modify these defaults under [edit system password].
Once the password is set, JUNOS automatically displays an encrypted value; there is no need for a password encryption service as in IOS, and only Message Digest 5 (MD5) is supported to prevent any reverse engineering attempts, as often occurs with Cisco type 7 password encryption: [edit] root@Tequila# show system root-authentication encrypted-password "$1$G8r2A1XZ$Nh0j8UP.Z3J/NGsWcBr9k0"; ## SECRET-DATA
The SECRET-DATA tag is used to prevent users who do not have authorization from even viewing the encrypted portion of the configuration; nice and tight, just the way it should be. The encrypted string plays an important role; it allows the root password to be copied to an additional switch without user knowledge of the actual password. Here the password is loaded into another new switch named Vodka: root@Vodka# load merge terminal relative [Type ^D at a new line to end input] encrypted-password "$1$G8r2A1XZ$Nh0j8UP.Z3J/NGsWcBr9k0"; ## SECRET-DATA load complete [edit system root-authentication] root@Vodka# show encrypted-password "$1$G8r2A1XZ$Nh0j8UP.Z3J/NGsWcBr9k0"; ## SECRET-DATA
Now let’s move on to non-root users. These users can be defined with local user passwords and permissions, or an external server such as RADIUS or TACACS can be used for authentication and authorization. Figure 3-2 demonstrates.
Figure 3-2. Server authentication and authorization
To use RADIUS or TACACS, two items must be configured: the server parameters and the authentication order. In JUNOS software, the authentication order determines the order in which the switch looks for a valid login attempt. For instance, the following configuration checks the authentication criteria against the TACACS+ server first, and Secondary Configuration | 125 Download at Boykma.Com
if a communications (not an authentication) failure occurs, it then tries the next method, which is local authentication via the local password database: root@tequila# set system authentication-order [tacplus password]
The authentication order has often been misunderstood and misconfigured in JUNOS. The most important point to remember is that the system will always try every method listed until success is achieved. So, if you want to make sure the local database is not consulted if the RADIUS or TACACS server returns a reject message, do not place the password keyword in the configuration. For example: root@tequila# set system authentication-order tacplus
If you’re betting on the fact that the local database will never be consulted, I suggest you stay away from Las Vegas. If the specified server is not reachable, the local database is always consulted. This default behavior is to protect you from being locked out of the switch if access to the authentication server is lost for any reason. When creating a user or user template, three items need to be configured: • Username • Authorization • Password These three items could be on the switch, server, or a combination of both. Several levels of the authorization components can be configured, as shown in Figure 3-3.
Figure 3-3. User authorization hierarchy
First, each user is applied to a class that defines the permissions for that user. The class can be predefined, as shown in Table 3-1, or user-created. A user’s class determines the user’s overall level of permissions. If the class permissions are a bit too broad or narrow, you can explicitly deny or allow additional commands that can be denied or allowed from the default permission bit setting. For instance, a class with the permission setting of reset allows a restart of all interfaces and processes. This may open up too many opportunities for user mistakes, so a tighter lockdown may be preferred, which you can specify via a set of deny commands with a regular expression. Similarly, you can explicitly choose to allow commands that would otherwise be denied by a given class with the allow keyword.
User authentication case study In this section, we will provide a case study to illustrate some possible options associated with user definition. 126 | Chapter 3: Initial Configuration and Maintenance Download at Boykma.Com
Those familiar with JUNOS Enterprise Routing, by Doug Marschke and Harry Reynolds (O’Reilly), may find this case study a bit familiar. Despite the authors’ apparent laziness, issuing a definition on a switch is no different from doing so on a router, and the selected case study represents a realistic scenario. JUNOS is, after all, JUNOS.
The case study sets the following requirements: 1. Define three local users, doug, harry, and lab, and provide them with maximum access. 2. Create a Network Operations Center (NOC) group consisting of 15 engineers. Each NOC engineer will have his own username, but will share the same permissions of read-only commands and maintenance commands for troubleshooting. 3. Create a design engineer group consisting of three engineers. This group will have full access to all CLI commands, except for the restart and request commands. 4. All users will be authenticated using a RADIUS server with a shared secret of ronkittle. 5. Authorization is defined on the local switch. 6. If the RADIUS server is down, only harry, lab, and doug may log in to the switch. One user that is not explored in this case study is the remote user. This is a user profile created for use on the switch when the authenticated user does not have a local switch profile, or the authenticated user’s record in the authentication server specifies a local user. You can think of this as a default fallback account.
Each defined user must be associated with a login class, which assigns the permissions for the user. The login class can be one of the four default classes listed in Table 3-1, or a custom-defined class. Table 3-1. Predefined JUNOS user classes Class
Permissions
super-user
All
read-only
View
operator
Clear, Network, Reset, Trace, View
unauthorized
None
Users harry, lab, and doug require maximum access, so it makes sense to use a predefined JUNOS software class called super-user. Here we show the step-by-step process for harry only, as the process for users doug and lab is identical:
Secondary Configuration | 127 Download at Boykma.Com
root@Tequila# set system login user harry class super-user authentication plain-text-password New password: Retype new password: [edit] root@Tequila# show system login user harry { class super-user; authentication { encrypted-password "$1$oOspqmHP$jlxUul0cAgPq3j88/7WQP/"; ## SECRET-DATA } }
Next, a group of 15 NOC engineers are defined. Since configuring 15 local users will be a pain to manage and tiresome to type, we will use a user template. A user template allows multiple users defined on the RADIUS server with unique passwords to be grouped to a single local Juniper user. Since a predefined class will not satisfy the authorization level for the NOC engineers of read-only commands and maintenance commands, we will define a custom class: [edit system login] root@Tequila# set class ops permissions [view maintenance trace]
Refer to the access-privilege technical documentation to see each command that is allowed for every permission setting.
Next, we assign the user ops the new class, also called ops: [edit system login] root@Tequila# set user ops class ops [edit system login] root@Tequila# show class ops permissions [ trace view maintenance ]; root@Tequila# show user ops uid 2000; class ops;
The RADIUS server will then have 15 users defined that all map to the same Juniperlocal user of ops. For example, the configuration for 2 of the 15 users using a RADIUS server would be similar to the following: becca
Auth-Type = Local, Password = "authorsgf" Service-Type = Login-User, Juniper-Local-User-Name = "ops"
calumet Auth-Type = Local, Password = "hometown!" Service-Type = Login-User, Juniper-Local-User-Name = "ops"
128 | Chapter 3: Initial Configuration and Maintenance Download at Boykma.Com
The design engineer group requirement will also use a template, but will make use of special allow and deny commands that we can also define in a class. If the permission bits that are set are too broad, we can deny individual commands within the permission settings. (And vice versa: if we need an additional command or set of commands that go beyond the permission setting, we can allow them.) These allow and deny statements could be a single command or a group of commands using regular expressions. They are also separated in allow or deny operational mode commands or configuration mode: [edit system login] root@Tequila# set class design ? Possible completions: allow-commands Regular expression for commands to allow explicitly allow-configuration Regular expression for configure to allow explicitly + apply-groups Groups from which to inherit configuration data + apply-groups-except Don't inherit configuration data from these groups deny-commands Regular expression for commands to deny explicitly deny-configuration Regular expression for configure to deny explicitly idle-timeout Maximum idle time before logout (minutes) login-alarms Display system alarms when logging in login-tip Display tip when logging in + permissions Set of permitted operation categories
The design engineer’s class will have the permission bits set to all, and all commands that start with r (request and restart) will be disallowed: [edit system login] root@Tequila# set class design permissions all [edit system login] root@Tequila# set class design deny-commands "^r.*$" root@Tequila# set user design class design
Although regular expressions are beyond the scope of this chapter, here’s a quick list of common operators: • . (any character) • * (zero or more characters) • ^ (start of string to which the regex is applied) • $ (end of string to which the regex is applied) • ? (zero or one character)
As mentioned, we can define users locally on the switch or on an external server such as RADIUS or TACACS. In this chapter’s case study, we specified a RADIUS server earlier, in requirement 4. The RADIUS server’s IP address and secret password are configured: [edit system] root@Tequila# set radius-server 10.20.130.5 secret ronkittle
Secondary Configuration | 129 Download at Boykma.Com
For the system to use the RADIUS server, we must configure the authenticationorder statement. This indicates which order of authentication method should be used; the default is the local switch database only. In this section of our case study, we must decide between the following configuration choices: 1. authentication-order [radius password] 2. authentication-order [radius] In either configuration, the local database will be consulted if the RADIUS server is down, so the difference between the two options is evident when the RADIUS server returns a reject. This reject could be caused by a mistyped password or a username that is not defined in the RADIUS server. In option 1, the RADIUS server returns the reject and the local database will be consulted. Option 2 consults the local database only if the RADIUS server is unresponsive; processing stops if the server returns a reject message. The requirements state that the RADIUS server should always be used when available (as specified in option 1). If the RADIUS server is not available, users doug and harry will be allowed to log in using the local database since they are the only users with locally defined passwords on the switch. These users are also defined on the RADIUS server: doug
Auth-Type = Local, Password = "reddawnrocks1" Service-Type = Login-User
Here is a complete system login configuration that meets all six of the criteria specified earlier: [edit system] root@Tequila# show host-name Tequila; authentication-order radius password; ports { console type vt100; } root-authentication { encrypted-password "$1$85xXcov4$fLHtgMlqxRSg24zO8Kbe81"; ## SECRET-DATA } radius-server { 10.20.130.5 secret "$9$KdgW87db24aUcydsg4Dj69A0RSWLN24ZNd.5TFAt"; ## SECRET-DATA } login { class design { permissions all; deny-commands "^r.*$"; } class ops { permissions [ trace view maintenance ]; } user design { uid 2004; class design;
130 | Chapter 3: Initial Configuration and Maintenance Download at Boykma.Com
user harry { uid 2001; class super-user; authentication { encrypted-password "$1$oOspqmHP$jlxUul0cAgPq3j88/7WQP/"; ## SECRET-DATA } } user lab { uid 2002; class superuser; authentication { encrypted-password " $1$wD/I1Ybw$M7a/X51Gk36xaRs3XNRuQ1"; ## SECRET-DATA } } user doug { uid 2003; class superuser; authentication { encrypted-password "$1$ocs3AXkS$JdlQW7z4ZIJblfFZD.fqH/"; ## SECRET-DATA } } user ops { uid 2000; class ops; } } services { ftp; ssh; telnet; } syslog { user * { any emergency; } file messages { any notice; authorization info; } file interactive-commands { interactive-commands any; } }
Lastly, to verify that the user has the correct permissions, log in to the switch and issue a show cli authorization command: design@Tequila> show cli authorization Current user: 'design ' class 'design' Permissions: admin -- Can view user accounts admin-control-- Can modify user accounts
Secondary Configuration | 131 Download at Boykma.Com
clear -- Can clear learned network information configure -- Can enter configuration mode control -- Can modify any configuration edit -- Can edit full files field -- Special for field (debug) support floppy -- Can read and write from the floppy interface -- Can view interface configuration interface-control-- Can modify interface configuration network -- Can access the network reset -- Can reset/restart interfaces and daemons routing -- Can view routing configuration routing-control-- Can modify routing configuration shell -- Can start a local shell snmp -- Can view SNMP configuration snmp-control-- Can modify SNMP configuration system -- Can view system configuration system-control-- Can modify system configuration trace -- Can view trace file settings trace-control-- Can modify trace file settings view -- Can view current values and statistics maintenance -- Can become the super-user firewall -- Can view firewall configuration firewall-control-- Can modify firewall configuration secret -- Can view secret configuration secret-control-- Can modify secret configuration rollback -- Can rollback to previous configurations security -- Can view security configuration security-control-- Can modify security configuration access -- Can view access configuration access-control-- Can modify access configuration view-configuration-- Can view all configuration (not including secrets) Individual command authorization: Allow regular expression: none Deny regular expression: ^r.*$ Allow configuration regular expression: none Deny configuration regular expression: none
Out of Band Network The legacy network was deployed with an OoB management network that interconnects the routers and switches to allow management access, even during periods of network malfunction that disrupt in-band network operations. Figure 3-4 shows the OoB network details. The management network is a 172.16.69.0/24 subnet, and physical connections go through a VLAN-aware switch.
132 | Chapter 3: Initial Configuration and Maintenance Download at Boykma.Com
Figure 3-4. OoB management network
The Juniper devices support a separate physical port intended strictly for OoB use; the Cisco switches do not. To create an OoB network for these devices, the best practice is to dedicate a physical port that is bound to a management VLAN, which separates this interface from the rest of the interfaces and their transit network traffic. In our case, the final port of the Cisco switches (port 48) was chosen. A VLAN ID that is not used for any other purpose, 666, is chosen to tie the OoB port into a Switched Virtual Interface (SVI), which is used to support an IP-addressable interface without requiring a Layer 3 routing license. Also, it is a best practice to always change the OoB management VLAN on the Cisco devices, since by default all interfaces are part of that VLAN, which could open a large security risk. You cannot change the management VLAN on Catalyst 1900 and 2820 switches or on Catalyst 2900 switches with 4 MB of memory; VLAN 1 must be the management VLAN for these switches. You can change the management VLAN only on switches running Cisco IOS Release 12.0(5) XU.
Here’s the relevant Cisco configuration from Gin: interface FastEthernet0/48 switchport access vlan 666 switchport mode access ! . . . interface Vlan1 no ip address shutdown ! interface Vlan666 ip address 172.16.69.2 255.255.255.0
Secondary Configuration | 133 Download at Boykma.Com
The new Juniper switch Tequila simply needs to have the me0 management interface configured with the proper IP address. If you are confused about what the heck that strange unit 0 piece is, please consult the interface configuration in “EX Interfaces” on page 143. For now, suffice it to say that it’s a logical interface, which is akin to a subinterface on Cisco devices. However, on the Cisco side, the management interface must be a physical interface and not a subinterface: lab@Tequila> show configuration interfaces me0 unit 0 { family inet { address 172.16.69.4/24; } }
Remote Access After the users are configured on the switch, we must decide what kind of remote access should be provided to the switch, assuming this was not configured via EZSetup or during the initial configuration. Remote access options include: Finger A protocol to get information about a user logged in to the switch. This protocol is no longer used and should never be enabled. For giggles, here is the finger output from the new switch: % finger [email protected] [172.16.69.4] Login: lab Name: Directory: /var/home/lab Shell: /usr/sbin/cli On since Mon Sep 24 00:31 (UTC) on ttyd0, idle 0:01 No Mail. No Plan. %
FTP Provides file transfer services. Although FTP is a widely used protocol, it transfers files in plain text, which can lead to security issues. When possible, you should use secure copy (SCP), which is enabled with the SSH service. Rlogin The Remote login protocol, which allows remote access to the JUNOS shell and CLI. This Unix utility has several security flaws and was used only in private environments. This utility is activated by a hidden command on the switch but, as discussed, should never be enabled on the switch.
134 | Chapter 3: Initial Configuration and Maintenance Download at Boykma.Com
A hidden command is a command that does not show up when you use ? in the CLI and does not auto-complete with the space bar. One of the most famous hidden commands in JUNOS software is show version and haiku. Try it yourself if you want to read some really bad poetry!
SSH Allows communications over an encrypted tunnel. This ensures not only availability, but also data integrity and confidentiality. When SSH is enabled, this automatically enables SCP. The SSH option is available only in the domestic version of JUNOS due to government restrictions on encryption technology. Users on the list of permitted foreign countries can apply for the domestic version to obtain the SSH service. Telnet A common protocol, developed in 1969, for remotely managing a system. Telnet transits all data in clear text, so you should use SSH when possible. Web management Enables use of the J-Web GUI on the switch for management and configuration. These can be either encrypted or unencrypted Hypertext Transfer Protocol (HTTP/ HTTPS) connections. Note that strong HTTPS encryption (128-bit) requires the domestic version of JUNOS and that a Secure Sockets Layer (SSL) security certificate be loaded. JUNOScript server Enables the switch to receive commands from a JUNOScript server via clear text or SSL connections. Netconf The Network Configuration protocol, which is defined in RFC 4741 and uses XML for configuration and messaging. Netconf is the Internet Engineering Task Force (IETF) standard created as a replacement for SNMP and is based on JUNOScript.
XML Tags JUNOScript is a tool you can use to configure and manage the switch. JUNOS output and configuration contain XML tags that can be referenced by a JUNOScript client. Here is an example of a configuration and an operational command that displays the XML tags for each field: root@Tequila> show system users | display xml
4:59PM 1:28 1 0.15 0.09 0.07
lab u0 - 4:16PM - -cli (cli)
lab@tequila> show configuration routing-options |display xml
all
all 10
The most secure methods of remote access on the switch will be SSH and the transfer of files using SCP. To enable any service, simply set it under the [edit system services] level: [edit system services] root@Tequila# set ? Possible completions: + apply-groups Groups from which to inherit configuration data + apply-groups-except Don't inherit configuration data from these
136 | Chapter 3: Initial Configuration and Maintenance Download at Boykma.Com
> > > > >
dhcp finger ftp netconf service-deployment
> > > > >
ssh telnet web-management xnm-clear-text xnm-ssl
groups Configure DHCP server Allow finger requests from remote systems Allow FTP file transfers Allow NETCONF connections Configuration for Service Deployment (SDXD) management application Allow ssh access Allow telnet login Web management configuration Allow clear text-based JUNOScript connections Allow SSL-based JUNOScript connections
Each service typically has a variety of options, such as setting a maximum number of connections, rate-limiting the inbound connection attempts, and choosing supported protocol versions/options. In the case of the SSH service, we have the following options: root@Tequila# set system services ssh ? Possible completions:
Execute this command + apply-groups Groups from which to inherit configuration data + apply-groups-except Don't inherit configuration data from these groups connection-limit Maximum number of allowed connections (1..250) + protocol-version Specify ssh protocol versions supported rate-limit Maximum number of connections per minute (1..250) root-login Configure root access via ssh | Pipe through a command
The following command enables SSH with the default parameters of 75 active sessions and 150 connection attempts per minute: [edit] root@Tequila# set system services ssh
Tequila then initiates an SSH session to Gin. The first connection to a given host needs
to establish the RSA fingerprint for authentication by adding that host’s public key to the user’s list of host keys, which, by the way, are stored in the ~/.ssh directory: lab@Tequila> ssh 172.16.69.2 The authenticity of host '172.16.69.2 (172.16.69.2)' can't be established. RSA key fingerprint is 39:ef:fa:64:83:a0:40:48:f0:a5:ad:f5:0b:de:a9:7a. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '172.16.69.2' (RSA) to the list of known hosts. [email protected]'s password: Gin>
Once Gin is added to the list of known hosts, future sessions do not require identity confirmation: root@Tequila> ssh 172.16.69.2 [email protected]'s password:
When SSH is enabled on the switch, it also automatically enables SCP to initiate secure file exchanges. You can upload or download files via SCP using variations of the file
Secondary Configuration | 137 Download at Boykma.Com
copy command. In this case, Tequila transfers a file called test to Gin. Tequila has already added Gin to its list of known hosts files: root@Tequila> file copy test2 [email protected]:test2.txt [email protected]'s password: test 100% 9480 9.3KB/s
00:00
Dynamic Host Configuration Protocol DHCP is a protocol used by networked devices (clients) to obtain the parameters necessary for operation in an IP network. This protocol reduces system administration workload, allowing devices to be added to the network with little or no manual configuration. Without DHCP, every single client on the network would have to be configured manually. Essentially, DHCP automates the assignment of IP addresses, subnet masks, default gateways, and other optional IP parameters such as DNS addresses. The protocol works on a client/server model in which the server assigns a client the IP information after seeing a request (Figure 3-5).
Figure 3-5. DHCP client/server model
DHCP consists of a four-step transfer process beginning with a broadcast DHCP discovery message from the client. The second step involves a DHCP offer message from the server to the client, which includes the IP address and mask, and DOCSIS-specific parameters. The client then sends a DHCP request to accept the offer it received from the server in the previous step. The DHCP server sends a DHCP response message and removes the now-allocated address from the DHCP scope (Figure 3-6).
138 | Chapter 3: Initial Configuration and Maintenance Download at Boykma.Com
Figure 3-6. DHCP process
So far we have discussed DHCP requests that are on the same physical segment. DHCP requests from a client to a server are not restricted to the physical segment, LAN, or VLAN (discussed in Chapter 7). In this case, a relay agent is needed to pass requests between the client and server. This eliminates the need for a dedicated DHCP server in each LAN or VLAN environment (Figure 3-7).
Figure 3-7. DHCP relay
DHCP server configuration in JUNOS When configuring a DHCP server in JUNOS you can set the following parameters: DHCP subnet To specify the subnet on which DHCP is configured Address range To set the lowest address and highest address that can be used from the DHCP subnet Secondary Configuration | 139 Download at Boykma.Com
Exclude address(es) To specify any addresses from the DHCP subnet that should not be used Lease time To set the time for which the allocated address is reserved Server information To set the IP address reported to the client, domain name, DNS servers, and domain searches Field options To set gateway routers and WINS servers Boot options To specify a boot server and file from which to get configuration information Static bindings To specify the static mapping for the client to use, such as an IP address, hostname, or client identifier These options are displayed on Tequila and are configured under [edit system services dhcp]: lab@Tequila# set system services dhcp ? Possible completions: + apply-groups Groups from which to inherit configuration data + apply-groups-except Don't inherit configuration data from these groups boot-file Boot filename advertised to clients boot-server Boot server advertised to clients default-lease-time Default lease time advertised to clients (seconds) domain-name Domain name advertised to clients > domain-search Domain search list used to resolve hostnames maximum-lease-time Maximum lease time advertised to clients (seconds) > name-server Domain name servers available to the client next-server Next server that clients need to contact > option DHCP option > pool DHCP address pool > router Routers advertised to clients server-identifier DHCP server identifier advertised to clients > static-binding DHCP client's hardware address > traceoptions DHCP server trace options > wins-server NetBIOS name servers
For example, in the following code, Tequila is configured to allocate addresses out of the 172.16.69/24 range, starting at address 172.16.69.50 and ending at address 172.16.69.75, for a total of 25 addresses. It is also assigned a one-hour lease time and a default gateway of 172.16.69.4: lab@Tequila# show system services dhcp default-lease-time 3600; router { 172.16.69.4; } pool 172.16.69.0/24 { address-range low 172.16.69.50 high 172.16.69.75;
140 | Chapter 3: Initial Configuration and Maintenance Download at Boykma.Com
}
[edit] lab@Tequila# commit and-quit
You can verify that the pool is configured properly by issuing the show system services dhcp pool and global commands: lab@Tequila> show system services dhcp pool Pool name Low address High address 172.16.69.0/24 172.16.69.50 172.16.69.75
Excluded addresses
lab@Tequila> show system services dhcp global Global settings: BOOTP lease length infinite DHCP lease times: Default lease time Minimum lease time Maximum lease time
1 hour 1 minute infinite
DHCP options: Name: router, Value: [ 172.16.69.4 ]
When the switch begins to allocate addresses, this can be viewed with the bind commands: lab@tequila> show system services dhcp binding IP Address Hardware Address Type Lease expires at 172.16.69.50 00:a0:12:00:12:ab dynamic 2008-09-27 13:01:45 PDT 172.16.69.51 00:a0:12:00:13:02 dynamic 2008-09-27 13:01:52 PDT
Other useful commands include show system services dhcp statistics to display packet counters and show system services dhcp conflict to view any addresses that are found to be duplicated. Also, to see the actual DHCP messages, traceoptions (discussed in Chapter 8) can be configured and set to the log fud.
DHCP relay configuration in JUNOS If the DHCP relay option is desired, this can also be configured on the EX Series switch. Since DHCP messages are broadcast and are not sent to a specific server or switch, the EX Series cannot function as both a DHCP server and a relay agent at the same time.
Relay options are configured under [edit forwarding options helpers bootp]. At first glance, the hierarchy may seem about as clear as mud, but breaking out each piece helps to clarify the situation:
Secondary Configuration | 141 Download at Boykma.Com
forwarding options
Specifies the inherit forwarding of the DHCP packet helpers
Describes that the switch is providing an aid to the network by sending the packet to a DHCP server bootp
The original DHCP specification name (RFC 951) Here are the most basic configuration parameters that are required: Interface
Specifies the interface(s) that will have incoming DHCP packets that need to be relayed Server
Configures the server IP address toward which to forward the DHCP request The rest of the configuration is optional, including hop counts, wait times, Time to Live (TTL), and special relay options: lab@Tequila# set forwarding-options helpers bootp ? Possible completions: + apply-groups Groups from which to inherit configuration data + apply-groups-except Don't inherit configuration data from these groups client-response-ttl IP time-to-live value to set in responses to client description Text description of servers > interface Incoming BOOTP/DHCP request forwarding interface configuration maximum-hop-count Maximum number of hops per packet (1..16) minimum-wait-time Minimum number of seconds before requests are forwarded relay-agent-option Use DHCP Relay Agent option in relayed BOOTP/DHCP messages > server Server information
In the sample book topology the relay option is not used, but here is a quick example: [edit forwarding-options helpers bootp] user@host# show description "Global DHCP Example"; server 172.18.24.38; maximum-hop-count 4; minimum-wait-time 1; interface { ge-0/0/1
To monitor bootp events configure traceoptions (as discussed in Chapter 8) and observe the /var/log/fud logfile.
142 | Chapter 3: Initial Configuration and Maintenance Download at Boykma.Com
Secondary Configuration Summary This was a big section, and it’s a good time to take a step back and look at what we have accomplished. From a bare-bones basic configuration, we have added users, an OoB network, remote access, and possibly even DHCP. Now it is almost time to get into some networking and protocols, but first let’s examine some basic interface and switch maintenance actions and procedures that may prove helpful at any time.
EX Interfaces This section begins with some general JUNOS interface concepts before providing EXspecific interface configuration, operational analysis, and troubleshooting examples typical to an initial configuration. Historically, Juniper Networks routers contained two major categories of interfaces: permanent and transient. Users cannot remove permanent interfaces, whereas they can move, change, and remove transient interfaces. Transient interfaces are typically based on modular interfaces, which in turn are based on a Flexible PIC Concentrator (FPC) and Physical Interface Card (PIC) model, in which FPCs and PICs can be moved about as desired in the system. The EX3200 and EX4200 are fixed interface platforms, and therefore do not directly support the modular interface model. However, because EX switches run JUNOS software, it can still be said that some EX interfaces are permanent in regard to their intended function—say, as a network management interface, or tunnel services device—whereas others are seen as user or network interfaces, with a broader range of network-oriented functions. The following sections detail the JUNOS-based interface devices that often cause confusion among new users.
Permanent Interfaces A permanent interface is any interface that is always present on the switch (it cannot be altered). These interfaces can be management interfaces such as OoB Ethernet, or a software-based pseudointerface such as a tunnel service device. An EX4200 has three permanent management interfaces: me0-
Management Ethernet 0 is the OoB management Ethernet interface. This interface connects to the routing engine (RE) and is used for management services such as accessing Telnet/SSH, transferring files using FTP/SCP, and sending management messages such as syslog or SNMP traps to remote servers. The me0 interface is a non-transit interface, which means traffic cannot enter this interface and exit via a network interface, nor can it enter a network interface and exit through the management interface.
EX Interfaces | 143 Download at Boykma.Com
vme0-
Virtual Management Ethernet 0 serves the same roles as the physical me0, except in an EX4200 VC, where the virtual management interface automatically connects to the current master RE. Use of a vme0 is optional, but you cannot currently use both the vme0 and the me0 interfaces at the same time. bme0-
This is an internal Gigabit Ethernet interface that links the RE to the various EX Packet Forwarding Engine (PFE) components, the specifics of which vary by EX model. There is never a need to directly configure this interface. Many software pseudointerfaces are created automatically for use in a variety of functions: lo0-
The loopback interface that ties to the switch itself and not to any one physical interface. A loopback interface is used to provide a stable address for management traffic and routing protocols. pimd-
An RE-based Protocol Independent Multicast (PIM) de-encapsulation interface that allows a multicast rendezvous point (RP) to process PIM register messages. pime-
An RE-based PIM encapsulation interface, used in multicast to create a unicast PIM register message to send to the RP. ipip-
An RE-based IP-over-IP encapsulation interface used to create IP-in-IP tunnels. gre-
An RE-based Generic Routing Encapsulation (GRE) interface used to create GRE tunnels. dsc-
A discard interface that can be used to silently discard packets. This is often used to silently dump traffic associated with a distributed denial of service (DDoS) attack. tap-
A virtual Ethernet interface historically used for monitoring on FreeBSD systems. This interface could be used to monitor discarded packets on a router but is no longer officially supported. vlan-
A Routed VLAN Interface (RVI) used to internally route between VLANs. vcp-
Virtual Chassis Port (VCP) interfaces, which exist on EX4200 models only.
144 | Chapter 3: Initial Configuration and Maintenance Download at Boykma.Com
Although used for transit traffic, the VCP protocol is not userconfigurable and simply works, so these interfaces are included here, rather than in the network interface section. Note that using an uplink port as a VCE results in the creation of a vcp-255/1/n device, whereas the built-in VCPs are always vcp-0 and vcp-1.
Network Interfaces Network interfaces, as the name implies, are the front-panel GE and 10 GE uplink ports used for Layer 2 and Layer 3 networking functions. Although Juniper routers support a wide variety of interface types, such as Ethernet, SONET, DS1/DS3, and ATM, among others, on EX switches it’s pretty much Ethernet or bust, which is just fine given that they’re intended to be used as Ethernet switches, after all.
Network interface naming JUNOS interfaces follow a common naming convention—the interface media type abbreviation followed by three numbers that indicate the location of the actual interface. The general convention is MM-F/P/T, where: MM = media type F = chassis FPC slot number P = PIC slot number T = port number EX switches use the same naming approach, which is handy for those already familiar with JUNOS. Just remember that in the EX context, the term FPC maps to a chassis number, and the PIC value is always 0 for network ports and 1 for uplink module ports, and things will go smoothly. On the EX, the media type is either ge or xe, which denotes Gigabit Ethernet or 10G Ethernet, respectively. Note that GE interfaces are multirate-capable and can operate at 10 Mbps, 100 Mbps, or the full 1,000 Mbps (GE) rate. The chassis FPC number ranges from 0 to 9. It’s always 0 on standalone EX3200s or EX4200s; non-zero values reflect a VC member number or the Line Card (LC) slot on an EX8200 series. The PIC slot number is 0 for all built-in network interfaces and 1 for uplink module ports. The port number ranges from 0 to 47, and reflects the actual front-panel port being used.
Logical units Interfaces support the notion of a logical unit, which is analogous to a subinterface in IOS. A key difference is that in JUNOS, an operational network interface must have at least one logical unit, whereas in IOS, explicit use of a subinterface is optional. In some modes of operation, an interface can support multiple logical units, which can range from 0 to 16,385, with each such unit in turn supporting one or more protocol families and operating independently of other units that share the device.
EX Interfaces | 145 Download at Boykma.Com
The unit number follows the period (.) in an interface name. For example, ge-0/1/0.10 identifies a logical interface 10 on a GE interface housed in “FPC” slot 0, “PIC” slot 1, port 0. Ethernet interfaces support multiple units through the use of VLAN tagging in JUNOS software. Note that an untagged Ethernet interface, which by definition can support only a single logical unit, must be assigned unit number 0. When VLAN tagging is enabled (for a Layer 3 interface), you can define multiple units, and each such unit is bound to a unique VLAN tag and one or more Layer 3 protocol families. There is no need for the unit number and VLAN tag to match, though this is the current best practice. EX interfaces that are operating in Layer 2 don’t support VLAN tagging, and therefore are limited to a single logical unit (0). EX interfaces are placed into Layer 2 mode when the ethernet-switching family is specified. Explicit tagging is not supported in this context because these interfaces are either trunks, which support traffic with various tags, or accesses, which generally send untagged traffic. In system log messages, a logical unit is known as an interface logical, or ifl, and the parent is an interface device, or ifd.
Interface Configuration In JUNOS, network interfaces have two levels of configuration: physical properties and logical properties. Physical properties are tied to the entire physical port, whereas logical properties affect only that logical portion of the interface represented by unit numbers or channel numbers. When you configure an interface, you specify physical properties once and logical properties for each unit that is used.
Physical properties You configure an interface’s physical properties at the [edit interfaces ] hierarchy. The CLI’s ? function is used to display the options available in the 9.2 release: {master}[edit interfaces ge-0/0/0] lab@Vodkila# set ? Possible completions: accounting-profile Accounting profile name + apply-groups Groups from which to inherit configuration data + apply-groups-except Don't inherit configuration data from these groups description Text description of interface disable Disable this interface > ether-options Ethernet interface-specific options gratuitous-arp-reply Enable gratuitous ARP reply > hold-time Hold time for link up and link down mac Hardware MAC address
146 | Chapter 3: Initial Configuration and Maintenance Download at Boykma.Com
mtu Maximum transmit packet size (256..9216) no-gratuitous-arp-reply Don't enable gratuitous ARP reply no-gratuitous-arp-request Ignore gratuitous ARP request no-traps Don't enable SNMP notifications on state changes > optics-options Optics options > traceoptions Interface trace options traps Enable SNMP notifications on state changes > unit Logical interface vlan-tagging 802.1q VLAN tagging support {master}[edit interfaces ge-0/0/0]
Most of the keywords are self-explanatory, and we demonstrate virtually all of them at some point in this book. Some key physical properties include: MAC The mac keyword is used to alter the burned-in (Media Access Control [MAC]) address (BIA). There’s rarely a need to change this, but for some testing purposes having known values can be helpful. MTU The maximum transmission unit (MTU) determines the maximum size frame that can be sent out of the interface. In JUNOS, the Ethernet MTU includes the frame’s Source and Destination MAC addresses, and the type field, but not the 4-byte frame check sequence (FCS). The default MTU is 1,514, which permits a 1,500-byte IP payload. EX interfaces support an MTU from 256 all the way to a giant 9,216, but care should be taken to avoid MTU mismatches, which are particularly nasty to troubleshoot in a Layer 2 network. Cisco IOS does not include any Layer 2 overhead in its Ethernet MTU. Therefore, a Cisco Ethernet MTU of 1,500 is compatible with the default JUNOS Ethernet MTU of 1,514. Go figure.
Hold time The hold-time parameter is used to configure a delay for the reaction to interface up or down events. By default, there is intentional delay, but sometimes it’s desirable to ride out short-lived transitions, rather than generating SNMP alarms and destroying protocol adjacencies at each measurable blip. Gratuitous ARP The Gratuitous ARP statements control various Address Resolution Protocol (ARP) behaviors. The no-gratuitous-arp-request option disables the default behavior of responding to a Gratuitous ARP. A Gratuitous ARP request is used for duplicate IP address detection, and does not expect a reply, as there should be no duplicate IP addressing. From the receiving router’s perspective, a Gratuitous ARP request is differentiated from a real ARP request targeted at the local router, because such an ARP contains a foreign Source MAC (SMAC) while both the target and source IP addresses match the local interface’s IP. The gratuitous-arp-reply
EX Interfaces | 147 Download at Boykma.Com
option enables the update of the switches’ ARP cache based on the receipt of unsolicited (gratuitous) ARP replies. Use the no form of the keyword to return to the default behavior of ignoring such replies. A Gratuitous ARP response is usually sent in an attempt to update the ARP cache in remote nodes—for example, after a MAC address changes. From the local router’s perspective, such a packet consists of an ARP reply using a broadcast Destination MAC (DMAC) address that contains the same (non-local) IP address as both the source and the target. Traps The traps and no-traps keywords enable or disable SNMP trap generation upon interface state transitions. Ethernet-specific parameters are configured using the ether-options hierarchy. These options control auto-negotiation, or set speed and duplex settings or IEEE 802.3ad link aggregation. The ether-options are displayed in the following code: {master}[edit interfaces ge-0/0/0] lab@Vodkila# set ether-options ? Possible completions: > 802.3ad IEEE 802.3ad + apply-groups Groups from which to inherit configuration data + apply-groups-except Don't inherit configuration data from these groups auto-negotiation Enable auto-negotiation flow-control Enable flow control link-mode Link duplex no-auto-negotiation Don't enable auto-negotiation no-flow-control Don't enable flow control > speed Specify speed {master}[edit interfaces ge-0/0/0] lab@Vodkila# set ether-options
We cover link aggregation in Chapter 11. The flow-control keyword causes the EX to react to pause frames, which is the default. The use of pause is applicable only to 1,000 Mbps (GE) operation. The non-blocking nature of EX switches means they have no need to actually generate flow control, so this option simply allows the EX to reach to pause frames sent by a congested switch. The link and speed keywords allow you to hardcode half duplex/full duplex (HD/FD) and the speed when needed. The autonegotiation options enable (the default) or disable auto-negotiation.
Juniper’s Auto-Negotiation Stance Over the years, there has been a fair bit of discussion about whether it’s best to manually hardcode various Ethernet parameters to ensure compatibility, or to simply enable auto-negotiation and trust that the two devices will find their highest common ground. Given the maturity of current Ethernet technology, JUNOS enables auto-negotiation by default, and in the vast majority of cases, the process works as expected. Although taking the magic out of the recipe may seem like a good idea, studies have shown that it is common to make mistakes when manually configuring a compatible mode, and in the case of a duplex mismatch, these mistakes can lead to a poorly performing link that works just well enough to go unnoticed. 148 | Chapter 3: Initial Configuration and Maintenance Download at Boykma.Com
If there are known problems with a device’s auto-negotiation capabilities, or if autonegotiation is simply not supported, manual configuration makes sense. Note that using auto-negotiation at one end and manual settings at the other end is not recommended, as this is known to lead to problems. For example, pairing a switch that is hardcoded to 100 Mbps FD with a Fast Ethernet network interface card (NIC) set to auto-negotiate results in the NIC falling back to HD mode. This is due to lack of autonegotiation, and it causes the switch to fall back to the lowest ability of HD, which in turn results in a duplex mismatch.
Logical properties All network interfaces require a logical unit to send or receive traffic. As noted previously, the logical unit abstract carves a single physical interface into multiple logical interfaces. For instance, an Ethernet interface can be subdivided into multiple VLANs, each requiring its own logical unit. Recall that unlike other vendors’ software, JUNOS requires a unit number and a logical interface definition even when a single logical entity is desired; this is because logical properties must be defined after the unit number hierarchy, and one such property is the choice of protocol family. An interface with no protocol family cannot send or receive anything. The most common types of logical properties include: Protocol family Indicates whether the interface operates in Layer 2 or Layer 3 mode, and in the latter case, specifies what Layer 3 protocols can operate on the logical interface. You place an interface into Layer 2 mode by adding the ethernet-switching family. This mode permits a single logical unit, which must be 0, and does not permit VLAN encapsulation. When you omit the ethernet-switching family, the result is a Layer 3 interface. Such an interface can have one or more logical units, and each unit can have one or more protocol families. The most common of these is family inet, which enables the sending and receiving of IPv4 packets in the Transmission Control Protocol/Internet Protocol (TCP/IP) suite (e.g., TCP, User Datagram Protocol [UDP], Internet Control Message Protocol [ICMP], and IP). Other common families are inet6 (IPv6) and iso (Intermediate System to Intermediate System [IS-IS] packets). Protocol address Is the Layer 3 family address, such as a family inet IP address and related network mask. Virtual circuit ID Is used to multiplex traffic from multiple logical units over a single interface device. For an Ethernet-based device, the virtual circuit ID takes the form of a VLAN ID. The current best practice, however, is to keep the circuit address the same as the unit number for easier troubleshooting. So, if you have a VLAN ID of 40 configured on your
EX Interfaces | 149 Download at Boykma.Com
interface, the logical interface should also be a unit of 40, although it’s not required. Again, note that when you configure a non-VLAN tagged Ethernet, the logical unit number must be 0. Think of this unit as a placeholder for all the logical properties that will need to be configured on that interface.
EX Interface Configuration Examples This section provides examples of typical EX interface configuration for both Layer 2 and Layer 3 modes of operation.
Layer 2 interface We begin with a sample Layer 2 interface that is used for bridging and switching: {master} lab@Vodkila> configure Entering configuration mode {master}[edit] lab@Vodkila# edit interfaces ge-0/0/0 {master}[edit interfaces ge-0/0/0]
You begin by entering configuration mode and parking yourself at the [edit interfaces ] hierarchy. This example configures the ge-0/0/0 interface. Some physical properties are set and then displayed: {master}[edit interfaces ge-0/0/0] lab@Vodkila# set ether-options speed 100m {master}[edit interfaces ge-0/0/0] lab@Vodkila# set ether-options link-mode full-duplex {master}[edit interfaces ge-0/0/0] lab@Vodkila# set mac 00:1f:12:3d:b4:dd {master}[edit interfaces ge-0/0/0] lab@Vodkila# show mac 00:1f:12:3d:b4:dd; ether-options { link-mode full-duplex; speed { 100m; } }
By default, all JUNOS network interfaces are administratively enabled. If an interface needs to be administratively disabled, issue a configuration mode set interfaces disable command. To reenable the interface, issue a delete interfaces disable command, or perform a rollback 1 (and commit). Although having to delete a disable seems a bit like a double negative, if you think about it it’s much the same as a “no shutdown” in IOS.
150 | Chapter 3: Initial Configuration and Maintenance Download at Boykma.Com
And now the definition of the logical unit and its binding to a (Layer 2) protocol family: {master}[edit interfaces ge-0/0/0] lab@Vodkila# set unit 0 family ethernet-switching
The complete Layer 2 interface definition is displayed, and committed: {master}[edit interfaces ge-0/0/0] lab@Vodkila# show mac 00:1f:12:3d:b4:dd; ether-options { link-mode full-duplex; speed { 100m; } } unit 0 { family ethernet-switching; }
The show interfaces command is used for operational status verification: {master}[edit interfaces ge-0/0/0] lab@Vodkila# run show interfaces ge-0/0/0 terse Interface Admin Link Proto Local ge-0/0/0 up up ge-0/0/0.0 up up eth-switch
Remote
The output confirms that the interface device and its logical unit are both administratively and operationally up. In the case of plain Ethernet, “being up” at the Link level simply means there are no obvious local interface faults. The lack of Ethernet keepalive, which is performed by Bidirectional Forwarding Detection (BFD) or Operational Administration and Maintenance (OAM), means it’s easy to have an interface that has a status of physically up because the local end is attached to a switch—even though the remote end of the switch link may be unplugged, thereby preventing communications. For more detail, omit the terse switch: {master}[edit interfaces ge-0/0/0] lab@Vodkila# run show interfaces ge-0/0/0 Physical interface: ge-0/0/0, Enabled, Physical link is Up Interface index: 129, SNMP ifIndex: 110 Link-level type: Ethernet, MTU: 1514, Speed: 100mbps, MAC-REWRITE Error: None, Loopback: Disabled, Source filtering: Disabled, Flow control: Enabled, Auto-negotiation: Enabled, Remote fault: Online Device flags : Present Running Interface flags: SNMP-Traps Internal: 0x0 Link flags : None CoS queues : 8 supported, 8 maximum usable queues Current address: 00:1f:12:3d:b4:dd, Hardware address: 00:1f:12:3d:b4:c1 Last flapped : 2005-01-30 07:59:57 UTC (00:00:13 ago) Input rate : 512 bps (1 pps) Output rate : 0 bps (0 pps) Active alarms : None Active defects : None
EX Interfaces | 151 Download at Boykma.Com
Logical interface ge-0/0/0.0 (Index 65) (SNMP ifIndex 111) Flags: SNMP-Traps Encapsulation: ENET2 Input packets : 6 Output packets: 1 Protocol eth-switch, MTU: 0 Flags: None
The highlighted sections point out various details, such as confirmation of speed, autonegotiation, SMAC filtering, and so on. The altered MAC address is also seen, as is a single logical interface that supports Layer 2 switching. Use the extensive switch, or specify the media switch, to see details on the current link properties: lab@Vodkila# run show interfaces ge-0/0/0 media Physical interface: ge-0/0/0, Enabled, Physical link is Up Interface index: 129, SNMP ifIndex: 110 Link-level type: Ethernet, MTU: 1514, Speed: 100mbps, MAC-REWRITE Error: None, Loopback: Disabled, Source filtering: Disabled, Flow control: Enabled, Auto-negotiation: Enabled, Remote fault: Online Device flags : Present Running Interface flags: SNMP-Traps Internal: 0x0 Link flags : None CoS queues : 8 supported, 8 maximum usable queues Current address: 00:1f:12:3d:b4:dd, Hardware address: 00:1f:12:3d:b4:c1 Last flapped : 2005-01-30 07:59:57 UTC (00:11:06 ago) Input rate : 0 bps (0 pps) Output rate : 0 bps (0 pps) Active alarms : None Active defects : None MAC statistics: Input bytes: 4226028, Input packets: 51477, Output bytes: 3074021, Output packets: 27429 Filter statistics: Filtered packets: 0, Padded packets: 0, Output packet errors: 0 Autonegotiation information: Negotiation status: Complete Link partner: Link mode: Full-duplex, Flow control: None, Remote fault: OK, Link partner Speed: 100 Mbps Local resolution: Flow control: None, Remote fault: Link OK
Layer 3 interface This example demonstrates a Layer 3 interface that uses VLAN tagging to support two logical interfaces, each running the IPv4 protocol, and one also running IPv6. Start by deleting the existing Layer 2 configuration: {master}[edit interfaces ge-0/0/0] lab@Vodkila# delete Delete everything under this level? [yes,no] (no) yes
Then move on to define the two logical units and related protocol family properties. This example leaves the physical interface properties at their default values, with the exception that specifying VLAN tagging is in effect:
152 | Chapter 3: Initial Configuration and Maintenance Download at Boykma.Com
{master}[edit interfaces ge-0/0/0] lab@Vodkila# set vlan-tagging
And now the logical interface properties: {master}[edit interfaces ge-0/0/0] lab@Vodkila# set unit 1 family inet address 200.0.0.1/24 {master}[edit interfaces ge-0/0/0] lab@Vodkila# set unit 1 vlan-id 1 {master}[edit interfaces ge-0/0/0] lab@Vodkila# set unit 2 family inet address 10.0.0.1/16 {master}[edit interfaces ge-0/0/0] lab@Vodkila# set unit 2 family inet address 10.0.0.1/16 arp 10.0.0.2 mac 00:1f:12:3d:b4:ff {master}[edit interfaces ge-0/0/0] lab@Vodkila# set unit 2 family inet6 address 200::1/64 {master}[edit interfaces ge-0/0/0] lab@Vodkila# set unit 2 vlan-id 2
The results are displayed: {master}[edit interfaces ge-0/0/0] lab@Vodkila# show vlan-tagging; unit 1 { vlan-id 1; family inet { address 200.0.0.1/24; } } unit 2 { vlan-id 2; family inet { address 10.0.0.1/16 { arp 10.0.0.2 mac 00:1f:12:3d:b4:ff; } } family inet6 { address 200::1/64; } }
The output confirms a VLAN tagged interface device supporting two units, each with IPv4, and one with both IPv4 and IPv6. This example also includes a static ARP definition for the IP address 10.0.0.2 on unit 1. Note that best practice is followed here by matching unit numbers to the Layer 2 virtual circuit ID (the VLAN tag in this case), but such matching is not strictly required. Also note that VLAN 1 is used for the first unit. This VLAN ID has no special significance in JUNOS, but does in IOS, as explained in Chapter 5.
EX Interfaces | 153 Download at Boykma.Com
Note that JUNOS takes network masks in “/” or Classless Inter-Domain Routing (CIDR) notation only, and that failing to specify a mask results in an assumed /32 host address. Such an address may not commit on an Ethernet interface with some versions of JUNOS unless that version happens to support unnumbered /32 Ethernet addressing. The Layer 3 interface’s operational status is quickly confirmed: {master}[edit interfaces ge-0/0/0] lab@Vodkila# run show interfaces ge-0/0/0 terse Interface Admin Link Proto Local Remote ge-0/0/0 up up ge-0/0/0.1 up up inet 200.0.0.1/24 ge-0/0/0.2 up up inet 10.0.0.1/16 inet6 200::1/64 fe80::21f:1200:23d:b4c1/64 ge-0/0/0.32767 up up
The display confirms a single interface with two logical units, and reflects the various IP and IPv6 properties that were configured. The ge-0/0/0.32767 logical interface is automatically created to support OAM when VLAN tagging is in effect. In this JUNOS version, Ethernet OAM is not supported, but when it is, this unit will handle that traffic separately from the Layer 3 user traffic on the other units. At this stage, you could test Layer 3 connectivity using a ping, but this presumes the remote end of the link is also configured, which is not yet the case here. For now, display the route table to confirm the presence of IPv4 and IPv6 directly connected routes for the ge-0/0/0 interface: {master}[edit interfaces ge-0/0/0] lab@Vodkila# run show route protocol direct inet.0: 27 destinations, 28 routes (27 active, 0 holddown, 0 hidden) Restart Complete + = Active Route, - = Last Active, * = Both 10.0.0.0/16
*[Direct/0] 00:05:26 > via ge-0/0/0.2
. . . 200.0.0.0/24
*[Direct/0] 00:05:26 > via ge-0/0/0.1
. . . inet6.0: 4 destinations, 4 routes (4 active, 0 holddown, 0 hidden) Restart Complete + = Active Route, - = Last Active, * = Both 200::/64 fe80::/64
*[Direct/0] 00:05:26 > via ge-0/0/0.2 *[Direct/0] 00:05:26 > via ge-0/0/0.2
154 | Chapter 3: Initial Configuration and Maintenance Download at Boykma.Com
As expected, a direct route is present for the 10.0/16 IPv4 route pointing to the ge-0/0/0.1 interface. Note how the 200.0.0/24 IPv4 and the 200::/64 IPv6 routes point to unit 2 on the same interface device. In most cases, serious interface configuration mistakes will generate an error and fail to commit. For example, here is a combination of Layer 2 and Layer 3 protocol families that are currently not supported on the same interface device: {master}[edit interfaces ge-0/0/0] lab@Vodkila# set unit 10 family ethernet-switching {master}[edit interfaces ge-0/0/0] lab@Vodkila# show vlan-tagging; unit 1 { vlan-id 1; family inet { address 200.0.0.1/24; } } unit 2 { vlan-id 2; family inet { address 10.0.0.1/16 { arp 10.0.0.2 mac 00:1f:12:3d:b4:ff; } } family inet6 { address 200::1/64; } } unit 10 { ## ## Warning: An interface cannot have both family ethernet-switching and vlantagging configured ## family ethernet-switching; }
Note that the CLI generates a warning for an objectionable statement when viewing the configuration. At commit time, such problems result in an error, and therefore, no changes are activated until the issue is corrected: {master}[edit interfaces ge-0/0/0] lab@Vodkila# commit check [edit interfaces ge-0/0/0 unit 10 family] 'ethernet-switching' An interface cannot have both family ethernet-switching and vlan-tagging configured error: configuration check-out failed: (statements constraint check failed)
EX Interfaces | 155 Download at Boykma.Com
Interface Troubleshooting Interfaces and links can have a variety of issues that can stem from simple misconfigurations, broken hardware, or the more difficult area of vendor interoperability problems. Listing all the possibilities would require a separate book! In fact, much information is already available in our companion book in this series, JUNOS Enterprise Routing. Generally speaking, Layer 3 problems are easier to isolate because of the ability to use pings and traceroutes to locate the problem area. With Layer 2 forwarding, either things work end to end, or they simply don’t, and gaining insight as to where the forwarding problem is can be very difficult. In some cases, you must resort to monitoring packet counts until you find the node that receives more than it sends. Such a technique is hard enough to perform in a test network, but on live networks where user traffic cannot be controlled, packet-count-based fault isolation is all but impossible. You will be exposed to a multitude of real-world interface (and other) troubleshooting techniques throughout this book, in the form of various case studies or deployment scenarios that invariably go astray. Really, it’s almost as though they were planned to break just to afford you the benefit of the resulting exercise in fault isolation. To keep things moving, this section highlights the primary tools available for troubleshooting in a JUNOS environment, and leaves demonstration of those tools to later chapters.
JUNOS troubleshooting tools JUNOS is a powerful operating system, and its Unix underpinnings provide a great many troubleshooting tools, most of which are available through the CLI. Although the EX product is somewhat new, JUNOS is now nearing its first decade of deployed use. Much information is already available on general JUNOS troubleshooting, and the single-image model means this is directly portable to EX troubleshooting in general. Direct use of shell commands should be performed only under the supervision of Juniper support personnel. There is a lot of rope in a root shell, after all; if used incorrectly, the switch could be rendered inoperable.
Here’s a list of key JUNOS fault isolation tools, in no particular order. Syslog. The system logfiles often contain explicit information about hardware or software problems, and may also display errors for operational problems such as detection of duplicate IP addressing. Display the messages log and filter the output based on the interface name, or keywords such as error and fail. Monitor the syslog in real time as you commit the changes to spot any issues early. This example searches the messages file for instances of either error or fail: {master} lab@Vodkila> show log messages | match "(fail|error)" Jan 30 01:10:03 Vodkila /kernel: RT_PFE: RT msg op 1 (PREFIX ADD) failed, err 5
156 | Chapter 3: Initial Configuration and Maintenance Download at Boykma.Com
(Invalid) . . .
Monitor interface. This iftop-like utility quickly displays interface packet and byte counts, and also displays any overt alarms or warnings. It’s useful when tracking data loss or testing traffic rates/interface loads. The command can also be performed on a logical interface to limit the statistics to just that unit: lab@Rum> monitor interface ge-0/0/4 Rum
Seconds: 6
Interface: ge-0/0/4, Enabled, Link is Up Encapsulation: Ethernet, Speed: 1000mbps Traffic statistics: Input bytes: 5839292 Output bytes: 9324028 Input packets: 91076 Output packets: 100314 Error statistics: Input errors: 0 Input drops: 0 Input framing errors: 0 Policed discards: 0 L3 incompletes: 0 L2 channel errors: 0 L2 mismatch timeouts: 0
Time: 12:00:51 Delay: 11/0/11
(0 (0 (0 (0
bps) bps) pps) pps)
Current delta [0] [0] [0] [0]
Carrier transitions
[0] [0] [0] [0] [0] [0] [0]
Next='n', Quit='q' or ESC, Freeze='f', Thaw='t', Clear='c', Interface='i'
Monitor traffic. This tcpdump-like command is akin to debug IP on IOS-based routers. It works only for traffic sent to or from the local RE, however. To monitor transient traffic, you need to configure a monitor port and direct the traffic to an external analyzer. This example uses the detail switch for added info and shows a Spanning Tree Protocol (STP) message being transmitted: lab@Rum> monitor traffic interface ge-0/0/4 detail Address resolution is ON. Use to avoid any reverse lookup delay. Address resolution timeout is 4s. Listening on ge-0/0/4, capture size 1514 bytes 12:06:41.406162 Out STP 802.1d, Config, Flags [none], bridge-id 8000.00:19:e2:56:ee:80.8205, length 35 message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s root-id 8000.00:19:e2:56:ee:80, root-pathcost 0
Operational mode show commands. There are numerous operational mode commands, generally beginning with show, that provide insight into interface or general networking/ platform problems. Commands such as show route, show interface, show chassis alarms, show log messages, and show ethernet-switching are particularly useful.
EX Interfaces | 157 Download at Boykma.Com
Ethernet OAM. Beginning with Release 9.4, EX platforms support Ethernet OAM (on Layer 2 interfaces only) to provide fault detection for the forwarding plane between two peers (point-to-point [P-to-P] Ethernet). Because many link or interface hardware issues have no obvious signs, other than a lack of data/connectivity, the ability to eliminate the data plane from a Layer 2 protocol-agnostic point of view is a great help in isolating faults. An in-depth discussion of OAM is outside the scope of this section. For details, see the IEEE 802.3ah standard. For now, suffice it to say that OAM provides an in-band heartbeat, or keepalive function, in addition to basic management functions such as setting or clearing remote loopbacks. Because Ethernet OAM operates in-band, which means over the same data link as the upper-layer user traffic, if OAM shows no issues there is little point in double-checking Physical level interface parameters, given that communication is successfully occurring across the link. Instead, focus should be placed on mistakes in the Layer 2 configuration or a downstream node. Currently, EX switches support interface loopbacks only through the use of OAM, and then only a remote loopback is supported. JUNOS routing devices have a (local) loopback configuration option for Ethernet interfaces. It’s best to perform local loopbacks with an external loopback anyway, given the fact that an internal local loopback does not really validate all interface hardware, but such a loopback requires physical proximity to the port being tested. In this example, a Layer 2 interface is not running Spanning Tree, and has no user traffic flowing; as a result, the interface traffic counters cannot be used to determine link status, given that they are 0: [edit protocols oam] regress# run clear interfaces statistics all [edit protocols oam] regress# run show interfaces ge-0/0/4 extensive Physical interface: ge-0/0/4, Enabled, Physical link is Up Interface index: 133, SNMP ifIndex: 118, Generation: 136 Link-level type: Ethernet, MTU: 1514, Speed: Auto, Duplex: Auto, BPDU Error: None, MAC-REWRITE Error: None, Loopback: Disabled, Source filtering: Disabled, Flow control: Enabled, Auto-negotiation: Enabled, Remote fault: Online Device flags : Present Running Interface flags: SNMP-Traps Internal: 0x0 Link flags : None CoS queues : 8 supported, 8 maximum usable queues Hold-times : Up 0 ms, Down 0 ms Current address: 00:1f:12:35:31:c4, Hardware address: 00:1f:12:35:31:c4 Last flapped : 2009-02-17 16:42:46 UTC (1d 01:21 ago) Statistics last cleared: 2009-02-18 18:03:47 UTC (00:00:02 ago) Traffic statistics: Input bytes : 0 0 bps Output bytes : 0 0 bps Input packets: 0 0 pps Output packets: 0 0 pps IPv6 transit statistics: Input bytes : 0 Output bytes : 0 Input packets: 0
158 | Chapter 3: Initial Configuration and Maintenance Download at Boykma.Com
Output packets: 0 Input errors: Errors: 0, Drops: 0, Framing errors: 0, Runts: 0, Policed discards: 0, L3 incompletes: 0, L2 channel errors: 0, L2 mismatch timeouts: 0, FIFO errors: 0, Resource errors: 0 Output errors: Carrier transitions: 0, Errors: 0, Drops: 0, Collisions: 0, Aged packets: 0, FIFO errors: 0, HS link CRC errors: 0, MTU errors: 0, Resource errors: 0 . . .
The display indicates that all is well with the interface, but it could just be that the local link is up while the remote end is down. OAM is added to the link, and in this case is combined with an action profile, which, as per its name, defines the set of actions to take in the event that OAM thresholds are crossed: [edit protocols oam] regress# show ethernet { link-fault-management { action-profile down_link { event { link-adjacency-loss; } action { link-down; } } interface ge-0/0/4.0 { apply-action-profile down_link; link-discovery active; negotiation-options { allow-remote-loopback; } } } }
The results are quickly confirmed: [edit protocols oam] regress# run show oam ethernet link-fault-management Interface: ge-0/0/4.0 Status: Running, Discovery state: Send Any Peer address: 00:21:59:c0:ba:c4 Flags:Remote-Stable Remote-State-Valid Local-Stable 0x50 Remote entity information: Remote MUX action: forwarding, Remote parser action: forwarding Discovery mode: active, Unidirectional mode: unsupported Remote loopback mode: supported, Link events: supported Variable requests: unsupported Application profile statistics: Profile Name Invoked Executed down_link 0 0
EX Interfaces | 159 Download at Boykma.Com
The output of the show oam ethernet link-fault-management command confirms that the OAM neighbor relationship is operational, and that the associated down_link action profile has not yet been triggered. The in-band operation of OAM results in traffic activity on the interface: regress# run show interfaces ge-0/0/4 extensive Physical interface: ge-0/0/4, Enabled, Physical link is Up . . . Statistics last cleared: 2009-02-18 18:03:47 UTC (00:01:12 Traffic statistics: Input bytes : 3012 512 Output bytes : 3524 512 Input packets: 47 1 Output packets: 55 1 IPv6 transit statistics: Input bytes : 0 Output bytes : 0 . . .
ago) bps bps pps pps
Not wanting to let well enough alone, we test the action profile by disabling OAM on the remote end of the link. The OAM status is again displayed: [edit protocols oam] regress# run show oam ethernet link-fault-management Interface: ge-0/0/4.0 Status: Running, Discovery state: Active Send Local Peer address: 00:00:00:00:00:00 Flags:0x8 Application profile statistics: Profile Name Invoked Executed down_link 1 1
As expected, the OAM neighbor is lost, as evidenced by a null MAC address and the lack of remote capability and status indication. The down_link profile has been executed once, and as a result the ge-0/0/4.0 logical interface is declared down: [edit protocols oam] regress# run show interfaces ge-0/0/4.0 Logical interface ge-0/0/4.0 (Index 64) (SNMP ifIndex 119) Flags: Device-Down 0x0 Encapsulation: ENET2 Input packets : 1571 Output packets: 1769 Protocol eth-switch Flags: Is-Primary
Diagnostic commands. The EX platform has a built-in fault isolation wizard that you can run from the J-Web or CLI interface. This utility includes a basic Time Domain Reflectometer (TDR) function that’s useful in determining the general nature and location of cable faults. The following example is executed on a known working link, and the results are quite informative, with details provided on overall status as well as on a per-MDI-wire-pair basis: lab@Rum> request diagnostics tdr start interface ge-0/0/0 Test successfully executed
160 | Chapter 3: Initial Configuration and Maintenance Download at Boykma.Com
. . . lab@Rum> show diagnostics tdr interface ge-0/0/0 Interface TDR detail: Interface name Test status
: ge-0/0/0 : Started
The output of the show diagnostics tdr command shows that the test is still running, so you patiently bide your time. Some things cannot be rushed, after all, and it’s good to stop and smell life’s TDRs every now and then: lab@Rum> show diagnostics tdr interface ge-0/0/0 Interface TDR detail: Interface name Test status Link status MDI pair Cable status Distance fault Polartiy swap Skew time MDI pair Cable status Distance fault Polartiy swap Skew time MDI pair Cable status Distance fault Polartiy swap Skew time MDI pair Cable status Distance fault Polartiy swap Skew time Channel pair Pair swap Channel pair Pair swap Downshift
: : : : : : : : : : : : : : : : : : : : : : : : : : : :
ge-0/0/0 Passed UP 1-2 Normal 0 Meters Normal 8 ns 3-6 Normal 0 Meters Normal 0 ns 4-5 Normal 0 Meters Normal 8 ns 7-8 Normal 0 Meters Normal 8 ns 1 MDI 2 MDIX No Downshift
The completed test results confirm that all is fine and dandy with the interface and its link. Loopbacks. Performing local and remote loopbacks is an invaluable technique when you need to isolate between interface hardware/configuration and cable/link faults. You can perform a hardwired loopback on any FD interface with an external loop plug. You may need to attenuate the signal on optical interfaces. Unlike M, T, MX, and J Series devices, EX switches don’t support a command-initiated local loopback for Ethernet interfaces. On the upside, you can perform a remote
EX Interfaces | 161 Download at Boykma.Com
loopback on Layer 2 interfaces by enabling OAM and issuing the appropriate command. Once looped, you can use link statistics or pings (as applicable) to determine whether traffic can be sent and received. When both ends pass a local test, the link is bad or the endpoints are misconfigured. If either end fails the local test, that interface (or configuration) is bad. Here’s an OAM-based Layer 2 loopback example. The OAM configuration specifies that OAM should run on the ge-0/0/4.0 interface, and includes the allow-remoteloopback negotiation option to allow remote initiated loopbacks. The remote-loop back keyword is used to place the remote end into the loopback: [edit protocols oam] regress# show ethernet { link-fault-management { interface ge-0/0/4.0 { link-discovery active; remote-loopback; negotiation-options { allow-remote-loopback; } } } }
EX support for Ethernet OAM started in JUNOS Release 9.4. The 9.2 release used in this test bed does not support OAM, so another pair of switches are used.
The output of a show oam ethernet link-fault-management command confirms that the loopback request is successful: [edit protocols oam] regress# run show oam ethernet link-fault-management Interface: ge-0/0/4.0 Status: Running, Discovery state: Send Any Peer address: 00:21:59:c0:ba:c4 Flags:Remote-Stable Remote-State-Valid Local-Stable 0x50 Remote loopback status: Disabled on local port, Enabled on peer port Remote entity information: Remote MUX action: discarding, Remote parser action: loopback Discovery mode: active, Unidirectional mode: unsupported Remote loopback mode: supported, Link events: supported Variable requests: unsupported
After interface statistics are cleared, the matched send and receive count, along with a lack of any error indications, shows that all is well with the local interface, the link, and remote loopback circuitry at the far end of the link:
162 | Chapter 3: Initial Configuration and Maintenance Download at Boykma.Com
regress# run clear interfaces statistics all . . . [edit protocols oam] regress# run show interfaces ge-0/0/4 extensive Physical interface: ge-0/0/4, Enabled, Physical link is Up . . . Statistics last cleared: 2009-02-18 18:43:54 UTC (00:00:41 Traffic statistics: Input bytes : 2624 512 Output bytes : 2624 512 Input packets: 41 1 Output packets: 41 1 . . .
ago) bps bps pps pps
Hard loops. The best way to confirm that an EX port is truly operational is to confirm that it can actually send and receive traffic outside the port itself. Although an internal loopback (not supported on EX ports) is convenient, it does not really confirm the port’s external transmit and receive functions, which can result in a defective port passing such a loopback test. This section describes how you can attach an external loopback cable/plug to an EX switch port to truly test its ability to send and receive. Ideally, such a loop is performed at the end of a cable that is half as long as the real cable, as the round trip accurately simulates the loss through the real link; in most cases, a bad port will fail even with a short length of cable, which means you can carry a small RJ-45 jack with looped pins as part of your troubleshooting toolkit. Here are some things to watch for when performing this type of test: Does not work for GE on copper GE over twisted-pair copper requires extensive Near End Cross Talk (NEXT) circuitry. This function typically prevents a successful external loopback because the circuitry is designed to filter the local end’s transmit from the much weaker signal that’s received from the remote end. This means you will need to configure copper GE ports to operate at 100 Mbps, as the NEXT functionality cannot currently be disabled on EX switches. Requires full duplex Any loopback requires FD. This may require a change in configuration or restart of auto-negotiations if an interface is operating in HD mode. Best when combined with Layer 3 By adding Layer 3 (IP) to the interface being tested, you can use utilities such as ping to generate and confirm test traffic. This takes a bit of finesse, as we will demonstrate shortly, but the results are true indicators of the port’s external and PFE-facing functionality. Figure 3-8 shows the printout of a typical Ethernet loopback plug.
EX Interfaces | 163 Download at Boykma.Com
Figure 3-8. Copper Ethernet loopback plug
All eight wires are used because the wires are cheap, and it allows usage on all flavors of copper-based Ethernet (with the GE and NEXT caveat noted earlier). To perform the loopback, you first configure the test interface for 100 Mbps operation. FD is the default, so an explicit duplex setting is not needed. This example adds an IP configuration to the interface to permit testing with IP packets: [edit] lab@Rum# show interfaces ge-0/0/20 ether-options { speed { 100m; } } unit 0 { family inet { address 200.0.0.1/24 { arp 200.0.0.2 mac 00:19:e2:56:ee:95; } } }
The static ARP entry is needed because you cannot send an IP packet out an Ethernet interface without a next hop MAC address. Because you expect the sending interface to also be the receiving interface, this MAC address must match the current hardware address used by the test interface. Using the local interface’s own MAC address ensures that the frame will make it past the selective listening of the MAC layer so that it can be processed by the IP layer: [edit] lab@Rum# run show interfaces ge-0/0/20 | match hardware Interface flags: Hardware-Down SNMP-Traps Internal: 0x0 Current address: 00:19:e2:56:ee:95, Hardware address: 00:19:e2:56:ee:95
164 | Chapter 3: Initial Configuration and Maintenance Download at Boykma.Com
With this configuration and loopback plug applied, the interface is confirmed to be in an operational state. So far, so good: [edit interfaces ge-0/0/20] lab@Rum# run show interfaces ge-0/0/20 Physical interface: ge-0/0/20, Enabled, Physical link is Up Interface index: 149, SNMP ifIndex: 135 Link-level type: Ethernet, MTU: 1514, Speed: 100mbps, MAC-REWRITE Error: None, Loopback: Disabled, Source filtering: Disabled, Flow control: Enabled, Auto-negotiation: Enabled, Remote fault: Online Device flags : Present Running Interface flags: SNMP-Traps Internal: 0x0 Link flags : None CoS queues : 8 supported, 8 maximum usable queues Current address: 00:19:e2:56:ee:95, Hardware address: 00:19:e2:56:ee:95 Last flapped : 2008-08-29 13:11:51 UTC (00:06:05 ago) Input rate : 0 bps (0 pps) Output rate : 0 bps (0 pps) Active alarms : None Active defects : None Logical interface ge-0/0/20.0 (Index 67) (SNMP ifIndex 149) Flags: SNMP-Traps 0x0 Encapsulation: ENET2 Input packets : 516 Output packets: 516 Protocol inet, MTU: 1500 Flags: None Addresses, Flags: Is-Preferred Is-Primary Destination: 200.0.0/24, Local: 200.0.0.1, Broadcast: 200.0.0.255
The highlights confirm that no error conditions are reported; the 100 Mbps mode; the presence of an IP address; and that no traffic is currently being sent or received. FD mode is also verified with the media switch: [edit interfaces ge-0/0/20] lab@Rum# run show interfaces ge-0/0/20 media Physical interface: ge-0/0/20, Enabled, Physical link is Up Interface index: 149, SNMP ifIndex: 135 . . . Autonegotiation information: Negotiation status: Complete Link partner: Link mode: Full-duplex, Flow control: None, Remote fault: OK, Link partner Speed: 100 Mbps Local resolution: Flow control: None, Remote fault: Link OK . . .
The key to the upcoming Layer 3 confirmation is that you will generate a ping request to a remote address that reflects some host on the directly connected network. Because of the loopback plug, there is no remote host, which is part of the method to this madness. When the packet is transmitted to the fictitious remote IP address, the loopback returns the frame to the receive circuitry of that same port. Because Layer 3 forwarding does not have issues with loops and redundant paths, the receipt of such a packet is
EX Interfaces | 165 Download at Boykma.Com
not considered an error, and the traffic is handled normally. This means the frame is stripped, and a longest match is performed against the destination address of the IP packet. As a result, the router once again transmits the packet out the same interface, except this time with a TTL that is one less than when the packet was originally transmitted. This process continues until the packet’s TTL is decremented to 0, at which point an ICMP error message is generated to report the TTL expiration. Oddly enough, it’s the receipt of this very error message that indicates a successful loopback test! If anything should go wrong with packet processing in any of the loopback iterations, the result is a silent discard, given the datagram nature of IP. Such a discard results in a timeout error, which in this case indicates packet loss. By altering the TTL value, you can control how likely a loss is to occur on a marginal circuit/interface. For example, a TTL of 254 means the packet must be sent and received 254 times before the expected TTL expired message is generated, whereas a TTL of 2 requires far fewer such iterations, and is therefore that much more likely to succeed. Before generating the test traffic, the route to the target remote IP address is confirmed active and pointing out the looped interface: [edit interfaces ge-0/0/20] lab@Rum# run show route 200.0.0.2 inet.0: 5 destinations, 5 routes (5 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 200.0.0.0/24
*[Direct/0] 00:05:06 > via ge-0/0/20.0
In this example, any host address in the range of 2 to 254 could be used. To work, it must not match the local IP address and it must have a static ARP assignment, however. Two test pings are generated with an explicit TTL setting of 254, to create a more strenuous test by overriding the default value of 64: lab@Rum# run ping 200.0.0.2 count 2 ttl 254 PING 200.0.0.2 (200.0.0.2): 56 data bytes 36 bytes from 200.0.0.1: Time to live exceeded Vr HL TOS Len ID Flg off TTL Pro cks Src Dst 4 5 00 0054 3e1f 0 0000 01 01 eb86 200.0.0.1 200.0.0.2 36 bytes from 200.0.0.1: Time to live exceeded Vr HL TOS Len ID Flg off TTL Pro cks Src Dst 4 5 00 0054 3e21 0 0000 01 01 eb84 200.0.0.1 200.0.0.2
--- 200.0.0.2 ping statistics --2 packets transmitted, 0 packets received, 100% packet loss
Despite the 100% loss in the resulting output, the receipt of the TTL expired messages confirms proper port operation. Traffic statistics on the test interface confirm that each
166 | Chapter 3: Initial Configuration and Maintenance Download at Boykma.Com
test packet was looped TTL times, at wire rate, which again is a very good indication that the interface and its PFE links are operational: [edit] lab@Rum# run show interfaces ge-0/0/20 Physical interface: ge-0/0/20, Enabled, Physical link is Up Interface index: 149, SNMP ifIndex: 135 Link-level type: Ethernet, MTU: 1514, Speed: 100mbps, MAC-REWRITE Error: None, Loopback: Disabled, Source filtering: Disabled, Flow control: Enabled, . . . Logical interface ge-0/0/20.0 (Index 67) (SNMP ifIndex 149) Flags: SNMP-Traps 0x0 Encapsulation: ENET2 Input packets : 510 Output packets: 510 Protocol inet, MTU: 1500 Flags: None Addresses, Flags: Is-Preferred Is-Primary Destination: 200.0.0/24, Local: 200.0.0.1, Broadcast: 200.0.0.255
In this case, you may have expected to see a packet count of 254 × 2 (508), but instead you observe 510. The extra two packets reflect the ICMP error message that was sent, and received, twice, resulting in a total of four extra packets in total.
EX Interface Summary The EX platform supports only Ethernet interface types, which greatly reduces the scope of interface configuration and fault isolation. In JUNOS, an interface configuration involves both a device and at least one logical unit. Device-level settings are placed under the interface itself, whereas protocol families and their related properties are specified at the logical unit level. JUNOS software provides numerous operational and diagnostics tools to assist in fault isolation and correction. The tools and techniques we discussed in this section are demonstrated in later real-world networking scenarios when things do not go as planned.
Basic Switch Maintenance Once the switch is configured and ready for deployment, some basic checks should be performed, and logging and recovery configuration should be considered. We begin this section by issuing a few chassis health-check commands. We then discuss some additional syslog, SNMP, and Network Time Protocol (NTP) configurations, which are strongly recommended because they enhance troubleshooting and security-related activities. Lastly, we look at some additional (and cool) JUNOS features that can save the day, and occasionally your bacon, in cases of switch configuration deletion, mistakes, or just strange cosmic-ray-based corruption, as has been known to spread through IOS networks in the past.
Basic Switch Maintenance | 167 Download at Boykma.Com
Chassis Health Check When the chassis powers up for the first time, issue a few basic commands to verify that all the components are working properly. You can do this before or after the initial configuration. First, check to see whether all the proper hardware pieces are working and recognized by the system; you can do this by issuing the show chassis hardware command. This is also a great command to record into your inventory sheet, as it will list the serial and part numbers for each piece of hardware. As displayed, the new switch is an EX4200-24T with a Gigabit Ethernet uplink module with two Small Form-factor Pluggable (SFP) optics and a 320-watt AC power supply: lab@Tequila > show chassis hardware Hardware inventory: Item Version Part number Chassis FPC 0 REV 11 750-021256 CPU BUILTIN PIC 0 BUILTIN PIC 1 REV 03B 711-021270 Xcvr 0 REV 01 740-011613 Xcvr 1 REV 01 740-011613 Power Supply 0 REV 03 740-020957 Fan Tray
Serial number BM0208269767 BM0208269767 BUILTIN BUILTIN AR0208163417 AM0813S8Z6W AM0813S8Z26 AT0508248670
Description EX4200-24T EX4200-24T, 8 POE FPC CPU 24x 10/100/1000 Base-T 4x GE SFP SFP-SX SFP-SX PS 320W AC Fan Tray
SFPs are sold separately from the uplink modules.
Verify that there are no system or chassis alarms. If there were any fan failures, power supply failures, and so forth, they should show up in the chassis command: lab@Tequila> show system alarms No alarms currently active lab@Tequila> show chassis alarms No alarms currently active
The show system storage command is a quick way to gauge flash memory fill levels. The flash is partitioned in various directories with the total storage size of 1 GB: lab@Tequila > show system storage fpc0: --------------------------------------------------------------Filesystem Size Used Avail Capacity Mounted on /dev/da0s2a 184M 83M 87M 49% / devfs 1.0K 1.0K 0B 100% /dev devfs 1.0K 1.0K 0B 100% /dev/ /dev/md0 31M 31M 0B 100% /packages/mnt/jbase /dev/md1 13M 13M 0B 100% /packages/mnt/jcrypto-ex-9.2R1.9 /dev/md2 4.3M 4.3M 0B 100% /packages/mnt/jdocs-ex-9.2R1.9 /dev/md3 88M 88M 0B 100% /packages/mnt/jkernel-ex-9.2R1.9
168 | Chapter 3: Initial Configuration and Maintenance Download at Boykma.Com
/dev/md4 13M /dev/md5 33M /dev/md6 12M /dev/md7 15M /dev/md8 63M /dev/da0s2f 123M /dev/da0s3e 55M /dev/da0s3d 314M /dev/md9 118M procfs 4.0K /var/jail/etc 123M jail/var/etc /var/jail/run 123M jail/var/run /var/jail/tmp 123M jail/var/tmp /var/tmp 314M jail/var/tmp/uploads devfs 1.0K
13M 33M 12M 15M 8.0K 1.2M 58K 4.0K 8.1M 4.0K 1.2M
0B 0B 0B 0B 58M 112M 51M 289M 100M 0B 112M
100% 100% 100% 100% 0% 1% 0% 0% 7% 100% 1%
/packages/mnt/jpfe-ex42x-9.2R1.9 /packages/mnt/jroute-ex-9.2R1.9 /packages/mnt/jswitch-ex-9.2R1.9 /packages/mnt/jweb-ex-9.2R1.9 /tmp /var /config /var/tmp /var/rundb /proc /packages/mnt/jweb-ex-9.2R1.9/\
1.2M
112M
1% /packages/mnt/jweb-ex-9.2R1.9/\
1.2M
112M
1% /packages/mnt/jweb-ex-9.2R1.9/\
4.0K
289M
0% /packages/mnt/jweb-ex-9.2R1.9/\
1.0K
0B
100% /packages/mnt/jweb-ex-9.2R1.9/jail/
Here, the various filesystems are based on slices (partitions) of the flash memory, and we can see that, for example, the /var filesystem has used only 1% of its 123 MB slice. When you install or upgrade JUNOS software, the disk partitions may be resized, and information in user home directories (/var/home/) may be lost. Where possible, JUNOS attempts to keep SSH keys. When needed, use the request system storage cleanup command to delete unneeded files and free up space, such as might be needed to make room for a future software upgrade: lab@Tequila > request system storage cleanup List of files to delete: Size Date 112B Sep 21 08:03 8639B Sep 21 08:03 8429B Aug 22 21:00 8238B Aug 18 11:00 8205B Aug 13 09:00 8155B Aug 7 22:00 8211B Aug 4 06:00 8260B Jul 31 14:00 8185B Jul 27 09:00 8569B Jul 22 10:00 9008B Jul 17 12:00 8335B Sep 21 08:03 14.9K Aug 24 08:00 12.7K Aug 1 22:00 27B Sep 15 04:00 4232B Aug 25 06:38 15.4K Aug 16 04:01 137B Jul 17 08:42 Delete these files ?
Name /var/log/default-log-messages.0.gz /var/log/interactive-commands.0.gz /var/log/interactive-commands.1.gz /var/log/interactive-commands.2.gz /var/log/interactive-commands.3.gz /var/log/interactive-commands.4.gz /var/log/interactive-commands.5.gz /var/log/interactive-commands.6.gz /var/log/interactive-commands.7.gz /var/log/interactive-commands.8.gz /var/log/interactive-commands.9.gz /var/log/messages.0.gz /var/log/messages.1.gz /var/log/messages.2.gz /var/log/wtmp.0.gz /var/log/wtmp.1.gz /var/log/wtmp.2.gz /var/log/wtmp.3.gz [yes,no] (no) yes
Basic Switch Maintenance | 169 Download at Boykma.Com
Verify the software version running on the switch: lab@Tequila > show version fpc0: -------------------------------------------------------------------------Model: ex4200-24t JUNOS Base OS boot [9.2R1.9] JUNOS Base OS Software Suite [9.2R1.9] JUNOS Kernel Software Suite [9.2R1.9] JUNOS Crypto Software Suite [9.2R1.9] JUNOS Online Documentation [9.2R1.9] JUNOS Enterprise Software Suite [9.2R1.9] JUNOS Packet Forwarding Engine Enterprise Software Suite [9.2R1.9] JUNOS Routing Software Suite [9.2R1.9] JUNOS Web Management [9.2R1.9]
Lastly, it’s a good idea to verify that the fans are working properly and temperatures are well below alarm thresholds. Notice that only a single power supply was purchased: lab@Tequila Class Item Power FPC 0 FPC 0 Temp FPC 0 FPC 0 FPC 0 FPC 0 FPC 0 FPC 0 Fans FPC 0 FPC 0 FPC 0
> show chassis environment Status Power Supply 0 OK Power Supply 1 Absent CPU OK EX-PFE1 OK EX-PFE2 OK GEPHY Front Left OK GEPHY Front Right OK Uplink Conn OK Fan 1 OK Fan 2 OK Fan 3 OK
Measurement
37 degrees C / 98 degrees F 46 degrees C / 114 degrees F 47 degrees C / 116 degrees F 30 degrees C / 86 degrees F 31 degrees C / 87 degrees F 32 degrees C / 89 degrees F Spinning at normal speed Spinning at normal speed Spinning at normal speed
Also, for those who prefer the J-Web GUI, there is a nice dashboard that shows many of these commands in a more graphical format. Figure 3-9 shows an example.
Syslog Syslog was originally developed as a method to send information for the sendmail application in BSD, but it was so useful that it was extended to other applications and operating systems. Essentially, syslog is a standard way to send log messages across an IP network. Syslog describes the actual transport mechanism used to send these messages, and is often used to describe the actual application that is sending these messages. Originally, it was an “industry” standard, and was not attached to an informational RFC until 2001, with RFC 3164, “The BSD Syslog Protocol.” Syslog messages are sent over UDP with a destination port of 514. The IP transport mechanism is defined and not the actual syslog content. It is left to the discretion of the application or system coder to create an informative message for the receiver. The message always contains a message severity level and a facility. The facility can be defined as the type of message that is being sent, and the severity level indicates the message’s importance. Table 3-2 defines the severity levels. 170 | Chapter 3: Initial Configuration and Maintenance Download at Boykma.Com
Figure 3-9. The J-Web dashboard Table 3-2. Syslog severity levels Numerical code
Severity
0
Emergency: system is unusable
1
Alert: action must be taken immediately
2
Critical: critical conditions
3
Error: error conditions
4
Warning: warning conditions
5
Notice: normal but significant condition
6
Informational: informational messages
7
Debug: debug-level messages
Table 3-3 lists the facilities that are available in JUNOS.
Basic Switch Maintenance | 171 Download at Boykma.Com
Table 3-3. Syslog facilities Facility
Description
Any
All facilities (all messages)
Authorization
Authentication and authorization attempts
Change-Log
Changes to the configuration
Conflict-Log
Specified configuration is invalid on the routing platform type
Daemon
Actions performed or errors encountered by system processes
DFC
Events related to dynamic flow capture
Firewall
Packet filtering actions performed by a firewall filter
FTP
Actions performed or errors encountered by the FTP process
Interactive commands
Commands executed by the user interface
Kernel
Actions performed or errors encountered by the JUNOS kernel
PFE
Actions performed or errors encountered by the PFE
User
Actions performed or errors encountered by user-space processes
The default system log is called messages, and you can view it with the show log messages command: root@Tequila> show log messages Aug 5 16:14:28 Tequila chassisd[636]: CHASSISD_SNMP_TRAP7: SNMP trap generated: FRU removal (jnxFruContentsIndex 7, jnxFruL1Index 1, jnxFruL2Index 0,jnxFruL3Index 0, jnxFruName FPC: EX4200-24T, 8 POE @ 0/*/*, jnxFruType 3, jnxFruSlot 1) Aug 5 16:14:29 Tequila chassisd[636]: CHASSISD_TIMER_VAL_ERR: Null timer ID Aug 5 16:14:29 Tequila chassisd[636]: CHASSISD_SNMP_TRAP7: SNMP trap generated: FRU insertion (jnxFruContentsIndex 7, jnxFruL1Index 1, jnxFruL2Index 0, jnxFruL3Index 0, jnxFruName FPC: EX4200-24T, 8 POE @ 0/*/*, jnxFruType 3, jnxFruSlot 1) Aug 5 16:14:30 Tequila chassisd[636]: CHASSISD_SNMP_TRAP10: SNMP trap generated: FRU power on (jnxFruContentsIndex 8, jnxFruL1Index 1, jnxFruL2Index 1, jnxFruL3Index 0, jnxFruName PIC: @ 0/0/*, jnxFruType 11, jnxFruSlot 1, jnxFruOfflineReason 2, jnxFruLastPowerOff 243976, jnxFruLastPowerOn 250250) Aug 5 16:14:30 Tequila chassisd[636]: CHASSISD_SNMP_TRAP10: SNMP trap generated: FRU power on (jnxFruContentsIndex 8, jnxFruL1Index 1, jnxFruL2Index 2, jnxFruL3Index 0, jnxFruName PIC: 4x GE SFP @ 0/1/*, jnxFruType 11, jnxFruSlot 1, jnxFruOfflineReason 2, jnxFruLastPowerOff 243976, jnxFruLastPowerOn 250250) Aug 5 16:14:30 Tequila chas[527]: PS 0: Transitioning from empty to online Aug 5 16:14:30 Tequila chassisd[636]: CHASSISD_IFDEV_CREATE_NOTICE: create_pics: created interface device for ge-0/0/0 Aug 5 16:14:30 Tequila chassisd[636]: CHASSISD_IFDEV_CREATE_NOTICE: create_pics: created interface device for ge-0/0/1 Aug 5 16:14:30 Tequila chassisd[636]: CHASSISD_IFDEV_CREATE_NOTICE: create_pics: created interface device for ge-0/0/2 Aug 5 16:14:30 Tequila chassisd[636]: CHASSISD_IFDEV_CREATE_NOTICE: create_pics: created interface device for ge-0/0/3 Aug 5 16:14:30 Tequila chassisd[636]: CHASSISD_IFDEV_CREATE_NOTICE: create_pics: created interface device for ge-0/0/4
172 | Chapter 3: Initial Configuration and Maintenance Download at Boykma.Com
Aug 5 16:14:30 Tequila chassisd[636]: CHASSISD_IFDEV_CREATE_NOTICE: create_pics: created interface device for ge-0/0/5 Aug 5 16:14:30 Tequila chassisd[636]: CHASSISD_IFDEV_CREATE_NOTICE: create_pics: created interface device for ge-0/0/6 Aug 5 16:14:30 Tequila chassisd[636]: CHASSISD_IFDEV_CREATE_NOTICE: create_pics: created interface device for ge-0/0/7 Aug 5 16:14:30 Tequila chassisd[636]: CHASSISD_IFDEV_CREATE_NOTICE: create_pics: created interface device for ge-0/0/8 Aug 5 16:14:30 Tequila chassisd[636]: CHASSISD_IFDEV_CREATE_NOTICE: create_pics: created interface device for ge-0/0/9 Aug 5 16:14:30 Tequila chassisd[636]: CHASSISD_IFDEV_CREATE_NOTICE: create_pics: created interface device for ge-0/0/10 Aug 5 16:14:30 Tequila chassisd[636]: CHASSISD_IFDEV_CREATE_NOTICE: create_pics: created interface device for ge-0/0/11 Aug 5 16:14:30 Tequila chassisd[636]: CHASSISD_IFDEV_CREATE_NOTICE: create_pics: created interface device for ge-0/0/12 Aug 5 16:14:30 Tequila chassisd[636]: CHASSISD_IFDEV_CREATE_NOTICE: create_pics: created interface device for ge-0/0/13 Aug 5 16:14:30 Tequila chassisd[636]: CHASSISD_IFDEV_CREATE_NOTICE: create_pics: created interface device for ge-0/0/14 Aug 5 16:14:30 Tequila chassisd[636]: CHASSISD_IFDEV_CREATE_NOTICE: create_pics: created interface device for ge-0/0/15 Aug 5 16:14:30 Tequila chassisd[636]: CHASSISD_IFDEV_CREATE_NOTICE: create_pics: created interface device for ge-0/0/16 Aug 5 16:14:30 Tequila chassisd[636]: CHASSISD_IFDEV_CREATE_NOTICE: create_pics: created interface device for ge-0/0/17 Aug 5 16:14:30 Tequila chassisd[636]: CHASSISD_IFDEV_CREATE_NOTICE: create_pics: created interface device for ge-0/0/18 Aug 5 16:14:30 Tequila chassisd[636]: CHASSISD_IFDEV_CREATE_NOTICE: create_pics: created interface device for ge-0/0/19 Aug 5 16:14:30 Tequila chassisd[636]: CHASSISD_IFDEV_CREATE_NOTICE: create_pics: created interface device for ge-0/0/20 Aug 5 16:14:30 Tequila chassisd[636]: CHASSISD_IFDEV_CREATE_NOTICE: create_pics: created interface device for ge-0/0/21 Aug 5 16:14:30 Tequila chassisd[636]: CHASSISD_IFDEV_CREATE_NOTICE: create_pics: created interface device for ge-0/0/22 Aug 5 16:14:30 Tequila chassisd[636]: CHASSISD_IFDEV_CREATE_NOTICE: create_pics: created interface device for ge-0/0/23 Aug 5 16:14:30 Tequila chassisd[636]: CHASSISD_IFDEV_CREATE_NOTICE: create_pics: created interface device for ge-0/1/0 Aug 5 16:14:30 Tequila chassisd[636]: CHASSISD_IFDEV_CREATE_NOTICE: create_pics: created interface device for ge-0/1/1 Aug 5 16:14:31 Tequila mib2d[639]: SNMP_TRAP_LINK_DOWN: ifIndex 116, ifAdminStatus up(1), ifOperStatus down(2), ifName ge-0/0/3 Aug 5 16:14:31 Tequila mib2d[639]: SNMP_TRAP_LINK_DOWN: ifIndex 118, ifAdminStatus up(1), ifOperStatus down(2), ifName ge-0/0/4 Aug 5 16:15:05 Tequila mgd[678]: UI_DBASE_LOGIN_EVENT: User 'root' entering configuration mode Aug 5 16:15:17 Tequila mgd[678]: UI_LOAD_EVENT: User 'root' is performing a 'load override' Aug 5 16:15:30 Tequila mgd[678]: UI_COMMIT: User 'root' requested 'commit' operation (comment: none) Aug 5 16:15:30 Tequila chassisd[895]: CHASSISD_IFDEV_DETACH_FPC: ifdev_detach(1) Aug 5 16:15:30 Tequila chassisd[895]: CHASSISD_IFDEV_DETACH_FPC: ifdev_detach(2) Aug 5 16:15:30 Tequila chassisd[895]: CHASSISD_IFDEV_DETACH_FPC: ifdev_detach(3)
Basic Switch Maintenance | 173 Download at Boykma.Com
Aug 5 16:15:30 Tequila chassisd[895]: CHASSISD_IFDEV_DETACH_FPC: ifdev_detach(4) Aug 5 16:15:30 Tequila chassisd[895]: CHASSISD_IFDEV_DETACH_FPC: ifdev_detach(5) Aug 5 16:15:30 Tequila chassisd[895]: CHASSISD_IFDEV_DETACH_FPC: ifdev_detach(6) Aug 5 16:15:30 Tequila chassisd[895]: CHASSISD_IFDEV_DETACH_FPC: ifdev_detach(7) Aug 5 16:15:30 Tequila chassisd[895]: CHASSISD_IFDEV_DETACH_FPC: ifdev_detach(8) Aug 5 16:15:30 Tequila chassisd[895]: CHASSISD_IFDEV_DETACH_FPC: ifdev_detach(9) Aug 5 16:15:33 Tequila vccp[879]: ISIS initialization complete Aug 5 16:15:38 vccp[879]: ISIS initialization complete Aug 5 16:15:39 vccp[879]: TASK_SCHED_SLIP: 4 sec scheduler slip, user: 0 sec 0 usec, system: 0 sec, 5694 usec Aug 5 16:15:39 mgd[678]: UI_DBASE_LOGOUT_EVENT: User 'root' exiting configuration mode Aug 5 16:16:03 login: LOGIN_INFORMATION: User lab logged in from host [unknown] on device ttyu0 Aug 5 16:16:49 LIBJNX_EXEC_WEXIT: Command exited: PID 1128, status 1, command '/usr/bin/scp' Aug 5 17:09:08 mgd[1125]: UI_DBASE_LOGIN_EVENT: User 'lab' entering configuration mode Aug 5 17:11:09 mgd[1125]: UI_DBASE_LOGOUT_EVENT: User 'lab' exiting configuration mode
Many of the syslog messages will have headers specified in uppercase letters that you can input into the command, specifying on which facility the message was logged, the severity level, a description, and a recommended action. Looking at the log entry for August 5, one such header is noted as CHASSISD_IFDEV_CREATE_NOTICE: Aug 5 16:14:30 Tequila chassisd[636]: CHASSISD_IFDEV_CREATE_NOTICE: create_pics: created interface device for ge-0/1/1
You can examine this message using the help syslog command, which indicates that the chassisd software process created a new interface: lab@Tequila> help syslog CHASSISD_IFDEV_CREATE_NOTICE Name: CHASSISD_IFDEV_CREATE_NOTICE Message: : created for Help: chassisd created interface device Description: The chassis process (chassisd) created the initial interface device for the indicated newly installed Physical Interface Card (PIC) or pseudodevice. Type: Event: This message reports an event, not an error Severity: notice
You can create custom logs by specifying a filename, facility, message facility, and location to send the message. The message can be stored in a local file, sent to a syslog server, sent to the console, or sent to a user or group of users when logged in to the switch. The factory-default configuration enables three system logs: two logs that are sent to a file, and one log that is sent to any user that is logged in. Although the default system log receives all information as specified with the any keyword, you can create other files for easier log parsing: syslog { user * { any emergency;
174 | Chapter 3: Initial Configuration and Maintenance Download at Boykma.Com
} file messages { any any; authorization info; } file interactive-commands { interactive-commands any; } }
Syslog case study To avoid having to specify every syslog option available, let’s examine a realistic example with specific goals. The goals are as follows: • Increase the default size of the messages file to 1 MB and the number of archives to 15. • Send all messages to a syslog server with a domain name of syslog.underdogssf.com. • Ensure that all messages sent to the syslog server are in the same format as the Cisco switches in the network. • Create a syslog file to log all firewall filter log information. Each syslog file that is created on a Juniper Networks switch is stored in the file directory var/log and is given a size of 128 KB on a J Series switch and 1 MB on an M Series switch. When the file is full, the file is cleared, an archive is created of the old data, and the file is written to again. For example, once 128 KB of data is written into the messages file, that file will be cleared and the information will be moved into a messages.0 file. When the messages file is filled up again, the old data is archived into messages.0 and the old messages.0 now becomes messages.1. This will continue for 10 archives until the data is written. In the case study, we will increase the default number of archives to 15 and the file size to 1 MB. We can do this with the following archive configuration: [edit system syslog] lab@TEQUILA# set file messages archive files 15 size 1M [edit system syslog] lab@TEQUILA# show file messages any notice; authorization info; archive size 1m files 15;
Next, syslog messages need to be sent to a syslog server: [edit system syslog] lab@TEQUILA# set host syslog.underdogssf.com any any
The default JUNOS message does not send the priority (facility value and severity) of the syslog message, which could cause issues when trying to parse the output at the receiver. Cisco switches by default do send this priority message; to ensure that both vendors send the same message format, configure the explicit-priority keyword:
Basic Switch Maintenance | 175 Download at Boykma.Com
[edit system syslog] lab@TEQUILA# set host syslog.underdogssf.com explicit-priority
Lastly, a new syslog file is created to log firewall entries: [edit system syslog] lab@TEQUILA# set file fw-log firewall info
Here is the complete stanza: [edit system syslog] lab@TEQUILA# show user * { any emergency; } host syslog.underdogssf.com { any any; explicit-priority; } file messages { any notice; authorization info; archive size 1m files 15; } file interactive-commands { interactive-commands any; } file fw-log { firewall info; }
SNMP SNMP is a standard protocol used for a network management station to receive information for the switch (agent), as shown in Figure 3-10. The manager can poll the switch for switch health information such as memory utilization, link status, or firewall filter statistics in the form of a GET command. The switch can also send event information to the network manager without polling, in a process called a trap.
Figure 3-10. SNMP concept
The data structure that is used to carry information is called a Management Information Base (MIB). A MIB has a structure in the format of a tree that defines groups of objects into related sets. These MIBs are identified by an Object Identifier (OID), which names the object. The leaf of the OID contains the actual managed objects. MIBs are defined 176 | Chapter 3: Initial Configuration and Maintenance Download at Boykma.Com
into two categories: standard MIBs and enterprise-specific MIBs. Standard MIBs are defined by the IETF in various RFCs, whereas enterprise-specific MIBs are defined by the vendor and must be compiled into the management station. Here is an example of MIB data taken from a network manager: SNMPv2-MIB::sysDescr.0 = STRING: Mx480 - Okemos, MI SNMPv2-MIB::sysObjectID.0 = OID: JUNIPER-MIB::jnxProductNameM480 SNMPv2-MIB::sysUpTime.0 = Timeticks: (80461526) 9 days, 7:30:15.26 SNMPv2-MIB::sysContact.0 = STRING: Doug Marschke - x8675309 SNMPv2-MIB::sysName.0 = STRING: TEQUILA-3 SNMPv2-MIB::sysLocation.0 = STRING: Okemis, MI USA - Rack 4 SNMPv2-MIB::sysServices.0 = INTEGER: 4
To configure SNMP on a Juniper switch, you must specify a community string on the switch. This acts as a password to verify incoming SNMP information on the management station: [edit snmp] root@Tequila# set community sample [edit snmp] root@Tequila# show community sample;
JUNOS software supports SNMPv1, SNMPv2, and SNMPv3.
With this basic configuration, SNMP GETs can be received on any interface from any management statement. It is recommended that access be restricted to particular interfaces and clients, such as the management network: root@Tequila# show interface me0.0; community sample { clients { 172.16.69.0/24; 0.0.0.0/0 restrict; } }
Also, the switch may want to initiate some information in the form of traps. Traps are sent to a specified list of targets and are defined by categories. Possible categories include: Authentication User login authentication failures Chassis Chassis and environmental notifications
Basic Switch Maintenance | 177 Download at Boykma.Com
Configuration Notification of configuration changes Link Link status changes Remote operations Remote operation notifications Rmon-alarm Events for remote monitoring (RMON) alarms Routing Routing protocol information such as neighbor status changes Services Events for additional JUNOS services such as Network Address Translation (NAT) and SFW Sonet-alarm A variety of Synchronous Optical Network (SONET) alarms such as loss of light, bit error rate (BER) defects, and so on Start-up Warm and cold boots VRRP events Virtual Router Redundancy Protocol (VRRP) events such as mastership changes In the following example, a trap group called health is added to the SNMP configuration, which sends chassis and link traps to station 10.10.12.4: root@Tequila# show interface fe-0/0/0.1141; community sample { clients { 10.10.12.4/32; 0.0.0.0/0 restrict; } } trap-group health { categories { chassis; link; } targets { 10.10.12.4; } }
By default, both SNMP v1 and v2 traps are sent. Since v3 has certain security parameters that must be configured, these are not sent automatically. You can overwrite this by specifying a version under the trap group.
178 | Chapter 3: Initial Configuration and Maintenance Download at Boykma.Com
It may also be useful to walk down the MIB tree to verify information in the MIB and for troubleshooting purposes. To perform an SNMP walk on the switch, issue the show snmp mib command. In this case, the system MIB is examined on the switch: root@Tequila> show snmp mib walk system sysDescr.0 = Juniper Networks, Inc. ex4200-24t internet router, kernel JUNOS 9.2R1.9 #0: 2008-08-05 07:25:22 UTC [email protected]:/volume/build/junos/9.2/release/9.2R1.9/objpowerpc/sys/compile/JUNIPER-EX Build date: 2008-08-05 07:40:05 UTC Copyright ( sysObjectID.0 = jnxProductNameEX4200 sysUpTime.0 = 569337 sysContact.0 sysName.0 = Tequila sysLocation.0 sysServices.0 = 6
NTP When examining logs, it is essential to ensure that the proper date and time are recorded for each event; otherwise, an event on one system component will be very hard to compare on another! You can set the time and date manually on each switch using the set date command: root@Tequila> set date ? Possible completions: New date and time (YYYYMMDDhhmm.ss) ntp Set system date and time using Network Time Protocol servers
However, since many devices are likely to be managed at once, each with slightly different clock speeds and drift, it is virtually impossible to keep all the clocks on every device synchronized. NTP was developed for the purpose of clock synchronization. NTP works in one of three modes: Client A client has a one-way synchronization with a server. Symmetric active There is equal peer synchronization with each other’s local clock. Broadcast The server sends periodic broadcast messages on shared media, and clients listen to these messages for synchronization. NTP uses a concept of clock strata to define the distance from the clock reference and the accuracy. A stratum 0 clock is the reference clock (such as an atomic clock) and each level of peering relationship decreases in accuracy and stratum level (see Figure 3-11).
Basic Switch Maintenance | 179 Download at Boykma.Com
Figure 3-11. NTP stratum levels
All NTP configurations are set under [edit system ntp]. In the following configuration, Tequila is configured in client mode with a server of 172.16.69.254. Also, a boot server is configured to allow the initial clock setting to be set at boot time: root@Tequila> show configuration system ntp boot-server 172.16.69.254; server 172.16.69.254;
If a switch is configured for NTP and the clocks are more than 128 seconds apart, the synchronization process will fail. In the past, to recover from that scenario the operator either rebooted the device with the boot server configuration or set the date manually within 128 seconds. JUNOS software now allows you to synchronize the device by simply issuing the set date ntp command and avoiding a reboot: root@Tequila> set date ntp 172.16.69.254 10 Nov 22:50:21 ntpdate[794]: step time server 172.16.69.254 offset 0.000163 sec
To verify that NTP has worked correctly, issue the show ntp associations command and look for the * next to the remote IP: lab@tequila> show ntp associations remote refid st t when poll reach delay
180 | Chapter 3: Initial Configuration and Maintenance Download at Boykma.Com
offset jitter
==================================================================== *172.16.69.254 LOCAL(0) 11 u 10 64 17 0.491 12.991 10.140
Check the correct time: root@Tequila> show system uptime Current time: 2008-11-22 03:53:35 UTC System booted: 2008-11-20 04:58:58 UTC (1d 22:54 ago) Protocols started: 2008-11-20 04:59:24 UTC (1d 22:54 ago) Last configured: 2008-11-22 03:40:02 UTC (00:13:33 ago) by lab 3:53AM up 1 day, 22:55, 1 user, load averages: 0.19, 0.10, 0.03
You also can change the time zone in the switch by issuing a set system time-zone command: root@Tequila# set system time-zone ? Possible completions:
Time zone name or POSIX-compliant time zone string Africa/Abidjan Africa/Accra Africa/Addis_Ababa Africa/Algiers Africa/Asmera ---(more 5%)---[abort]
Is NTP really working? The show ntp associations command is often a source of mass confusion and terror for operators, as there is no distinct “broken field.” The synchronization process will be indicated by interpreting the delay and offset fields, as well as by noting the presence or absence of a * character. Here is an example of an association that has failed. Notice the space in front of the 172.16.69.254, as well as the zeros in the delay and offset fields. This is an indication that no messages have been sent at all! root@Tequila> show ntp associations remote refid st t when poll reach delay offset jitter ===================================================================== 172.16.69.254 0.0.0.0 0 u 12 64 0 0.000 0.000 4000.00
In comparison, here is another association that failed; however, notice that there are values in the delay and offset fields. These indicate that NTP messages have been exchanged but synchronization has not been achieved, as no * has been displayed next to the remote peer. The large offset is usually an indication that the clocks are too far apart (above the 128-second threshold): root@Tequila> show ntp associations remote refid st t when poll reach delay offset jitter ================================================================== 172.16.69.254 LOCAL(0) 11 u 25 64 37 0.492 2542804 4000.00
Basic Switch Maintenance | 181 Download at Boykma.Com
After issuing a set date ntp command, the clocks synchronize without having to reboot the switch. Note the more sane offset value and the presence of the illustrious star next to the remote peer address: lab@r1> show ntp associations remote refid st t when poll reach delay offset jitter ===================================================================== *172.16.69.254 LOCAL(0) 11 u 10 64 17 0.491 12.991 10.140 3:53AM up 1 day, 22:55, 1 user, load averages: 0.19, 0.10, 0.03
Since NTP uses a step process to synchronize the clocks after issuing the set date ntp command, the association could still appear to be broken. This is normal for NTP, so just sit back, enjoy a drink, and after three to five minutes, everything should be working as normal.
Rescue Configuration The last item that should be set is the rescue configuration, which should be considered a “known good” configuration. This configuration is usually enough to get basic connectivity to the switch if the original configuration was deleted or lost. For security, the rescue configuration must contain a root password. By default, there is no rescue configuration, so it must be set after the initial configuration. To save a configuration as the rescue configuration, use either jweb configmanagement→Rescue, or the CLI command: --- JUNOS 9.2R1.9 built 2008-08-05 07:25:22 UTC lab@Tequila> request system configuration rescue save
The rescue configuration is now stored in /config: lab@Tequila> file list /config/ /config/: .snap/ db / juniper.conf.1.gz juniper.conf.2.gz juniper.conf.gz rescue.conf.gz ssh_host_dsa_key ssh_host_dsa_key.pub ssh_host_key ssh_host_key.pub ssh_host_rsa_key ssh_host_rsa_key.pub usage.db vchassis/
If the rescue configuration needs to be removed, issue a request system configuration rescue delete command.
182 | Chapter 3: Initial Configuration and Maintenance Download at Boykma.Com
Password Recovery If you’re locked out of your switch due to lack of password knowledge, and you don’t want to return the switch to a factory or rescue configuration from the LCD panel, password “recovery” is the ticket. Recovery is really a misused word here, as you can never really recover a lost password, but you can change the passwords of user root or local users to a new value that hopefully they will pay attention to this time! Due to a bug in JUNOS v9.2, which was fixed in JUNOS v9.3, the password recovery output is displayed on a system running v9.3. This system is not used in the rest of this chapter’s topology.
To recover a lost password: 1. Connect to the router via the console port through a direct connection from your PC or a term server. 2. Power-cycle the switch and wait for the following prompt: Hit [Enter] to boot immediately, or space bar for command prompt. Booting [kernel] in 1 second...
3. After pressing the space bar, enter single-user mode by typing boot -s: U-Boot 1.1.6 (Feb Board: EPLD: DRAM: FLASH: USB:
6 2008 - 11:27:42)
EX4200-24T 2.11 Version 6.0 (0x85) Initializing (1024 MB) 8 MB scanning bus for devices... 2 USB Device(s) found scanning bus for storage devices... 1 Storage Device(s) found
Consoles: U-Boot console Found compatible API, ver. 7 FreeBSD/PowerPC U-Boot bootstrap loader, Revision 2.1 ([email protected], Wed Feb 6 11:23:55 PST 2008) Memory: 1024MB Loading /boot/defaults/loader.conf /kernel data=0x9ec818+0x6eb6c syms=[0x4+0x888e0+0x4+0x8f04d] Hit [Enter] to boot immediately, or space bar for command prompt. Booting [/kernel] in 1 second... Type '?' for a list of commands, 'help' for more detailed help. loader> boot -s
4. After the system boots up, start the recovery script: Kernel entry at 0xa0000100 ... GDB: no debug ports present KDB: debugger backends: ddb KDB: current backend: ddb
Basic Switch Maintenance | 183 Download at Boykma.Com
Copyright (c) 1996-2008, Juniper Networks, Inc. All rights reserved. Copyright (c) 1992-2006 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. JUNOS 9.3-20080719.0 #0: 2008-07-19 06:10:30 UTC [email protected]:/volume/build/junos/9.3/production/20080719. 0/obj-powerpc/sys/compile/JUNIPER-EX WARNING: debug.mpsafenet forced to 0 as ipsec requires Giant Timecounter "decrementer" frequency 50000000 Hz quality 0 cpu0: Freescale e500v2 core revision 2.2 cpu0: HID0 80004080 real memory = 512753664 (489 MB) avail memory = 501309440 (478 MB) ETHERNET SOCKET BRIDGE initialising nexus0: ocpbus0: on nexus0 openpic0: iomem 0xfef40000-0xfef600b3 on ocpbus0 uart0: iomem 0xfef04500-0xfef0450f irq 58 on ocpbus0 uart0: console (115207,n,8,1) uart1: iomem 0xfef04600-0xfef0460f irq 58 on ocpbus0 lbc0: iomem 0xfef050000xfef05fff,0xff000000-0xffffffff irq 22 on ocpbus0 cfi0: iomem 0xff800000-0xffffffff on lbc0 syspld0 iomem 0xff000000-0xff00ffff on lbc0 tsec0: iomem 0xfef24000-0xfef24fff irq 45,46,50 on ocpbus0 tsec0: hardware MAC address 00:19:e2:50:71:5f miibus0: on tsec0 e1000phy0: on miibus0 e1000phy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseTX-FDX, auto pcib0: iomem 0xfef080000xfef08fff,0xf0000000-0xf3ffffff on ocpbus0 pci0: on pcib0 pci0: at device 18.0 (no driver attached) ehci0: mem 0xf0001000-0xf00010ff irq 22 at device 18.2 on pci0 usb0: EHCI version 0.95 usb0: on ehci0 usb0: USB revision 2.0 uhub0: Philips EHCI root hub, class 9/0, rev 2.00/1.00, addr 1 uhub0: 2 ports with 2 removable, self powered umass0: STMicroelectronics ST72682 High Speed Mode, rev 2.00/2.10, addr 2 pcib1: iomem 0xfef0a0000xfef0afff,0xe0000000-0xe3ffffff,0xec000000-0xec0fffff on ocpbus0 pci1: on pcib1 pcib2: at device 0.0 on pci1 pci2: on pcib2 mpfe0: mem 0xa40000000xa40fffff,0xa0000000-0xa3ffffff irq 20 at device 0.0 on pci2 pcib3: iomem 0xfef090000xfef09fff,0xe4000000-0xe7ffffff,0xec100000-0xec1fffff on ocpbus0
184 | Chapter 3: Initial Configuration and Maintenance Download at Boykma.Com
pci3: on pcib3 pcib4: at device 0.0 on pci3 pci4: on pcib4 mpfe1: mem 0xac0000000xac0fffff,0xa8000000-0xabffffff irq 18 at device 0.0 on pci4 pcib5: iomem 0xfef0b0000xfef0bfff,0xe8000000-0xebffffff,0xec200000-0xec2fffff on ocpbus0 pci5: on pcib5 pcib6: at device 0.0 on pci5 pci6: on pcib6 mpfe2: mem 0xb40000000xb40fffff,0xb0000000-0xb3ffffff irq 19 at device 0.0 on pci6 i2c0: iomem 0xfef03000-0xfef03014 irq 59 on ocpbus0 i2c1: iomem 0xfef03100-0xfef03114 irq 59 on ocpbus0 idma0: iomem 0xfef21000-0xfef21300 irq 36 on ocpbus0 bme0:Virtual BME driver initializing Timecounters tick every 1.000 msec Loading common multilink module. IPsec: Initialized Security Association Processing. if_pfe_open: listener socket opened, listening on ... da0 at umass-sim0 bus 0 target 0 lun 0 da0: Removable Direct Access SCSI-2 device da0: 40.000MB/s transfers da0: 500MB (1024000 512 byte sectors: 64H 32S/T 500C) Trying to mount root from ufs:/dev/da0s2a Attaching /packages/jbase via /dev/mdctl... Mounted jbase package on /dev/md0... System watchdog timer disabled Enter full pathname of shell or 'recovery' for root password recovery or RETURN for /bin/sh: recovery
5. The system will do some file-checking and then dump you into the CLI: Performing filesystem consistency checks ... /dev/da0s2a: FILE SYSTEM CLEAN; SKIPPING CHECKS /dev/da0s2a: clean, 1005 free (13 frags, 124 blocks, 0.0% fragmentation) /dev/da0s3e: FILE SYSTEM CLEAN; SKIPPING CHECKS /dev/da0s3e: clean, 14031 free (15 frags, 1752 blocks, 0.1% fragmentation) /dev/da0s2f: FILE SYSTEM CLEAN; SKIPPING CHECKS /dev/da0s2f: clean, 29276 free (124 frags, 3644 blocks, 0.4% fragmentation) /dev/da0s3d: FILE SYSTEM CLEAN; SKIPPING CHECKS /dev/da0s3d: clean, 80452 free (20 frags, 10054 blocks, 0.0% fragmentation) Performing mount of main filesystems ... Mounted jkernel-ex package on /dev/md3... Mounted jpfe-ex42x package on /dev/md4... Mounted jroute-ex package on /dev/md5... Mounted jcrypto-ex package on /dev/md6... Mounted jswitch-ex package on /dev/md7... machdep.bootsuccess: 0 -> 0 Performing initialization of management services ... mgd: error: could not open database: /var/run/db/schema.db: No such file or
Basic Switch Maintenance | 185 Download at Boykma.Com
directory mgd: error: Database open failed for file '/var/run/db/schema.db': No such file or directory mgd: error: could not open database schema: /var/run/db/schema.db mgd: error: could not open database schema mgd: error: database schema is out of date, rebuilding it mgd: error: could not open database: /var/run/db/juniper.data: No such file or directory mgd: error: Database open failed for file '/var/run/db/juniper.data': No such file or directory mgd: error: Cannot read configuration: Could not open configuration database mgd: error: Couldn't open lib /usr/lib/dd//libjdocs-dd.so mgd: error: Couldn't open lib /usr/lib/dd//libjdocs-dd.so Performing checkout of management services ... NOTE: NOTE: NOTE: NOTE: NOTE: NOTE: NOTE: NOTE: NOTE: NOTE: NOTE:
Once in the CLI, you will need to enter configuration mode using the 'configure' command to make any required changes. For example, to reset the root password, type: configure set system root-authentication plain-text-password (enter the new password when asked) commit exit exit When you exit the CLI, you will be asked if you want to reboot the system
6. Enter configuration mode and set a root password: Starting CLI ... root> configure Entering configuration mode [edit] root# set system root-authentication plain-text-password New password: Retype new password:
7. Don’t forget to commit the configuration: [edit] root# commit and-quit error: could not open database: /var/run/db/juniper.data: No such file or directory error: Database open failed for file '/var/run/db/juniper.data': No such file or directory commit complete Exiting configuration mode root@l48p2-sys>
8. Then reboot the switch to get it out of single-user mode: root@l48p2-sys> request system reboot Reboot the system ? [yes,no] (no) yes
186 | Chapter 3: Initial Configuration and Maintenance Download at Boykma.Com
Shutdown NOW! [pid 358] Sep 25 07:35:42 shutdown: reboot by root:"libthr.so.2" not found, required by "rpdc" --- JUNOS 9.2R1.9 built 2008-08-05 07:25:22 UTC lab@tequila> request system halt Halt the system ? [yes,no] (no) *** FINAL System shutdown message from lab@teqila *** System going down IMMEDIATELY
Shutdown NOW! [pid 663]
Now that the new switch is up and running with an initial configuration, take note that it’s always best to perform a graceful shutdown to allow the multitasking JUNOS to close the file and gracefully terminate the various daemon processes that run in the background. Although rare, filesystem damage can occur with an abrupt power off, which may cause problems on the next boot. Use the request system halt or request system reboot command to gracefully shut down or reboot the OS. Once the OS is halted, it is safe to remove power.
Switch Maintenance Summary This section pointed out the command used to determine overall hardware status, as well as additional configuration for syslogging, network management, and time synchronization, which can aid in later diagnostic activities. The section ended with a discussion of rescue configuration, which should always be saved, should you need it later, and password recovery for those aging hippies among us.
Conclusion This chapter demonstrated the addition of a Juniper Networks EX switch into an existing all-Cisco network. First we examined two ways to get the initial configuration into the router, either with EZSetup or by manually entering the related CLI command, which in the end was not bad at all. With the initial configuration in place, additional users, remote access, DHCP, and OoB management were also configured. The install continued with verification of the switch’s health, as well as adding a syslog, SNMP, and NTP configuration for enhanced switch health monitoring—for example, to allow proactive notice when the switch’s health or operational status changes. We ended with a look at ways to recover the switch to a rescue or factory-default configuration in the event that the current configuration is corrupted, changed, or deleted. Later chapters build upon this fine base by adding various Layer 2 and Layer 3 protocols and services. Conclusion | 187 Download at Boykma.Com
Chapter Review Questions 1. What is the default password on the switch? a. Juniper b. Cisco c. There is no password d. Enable 2. Which predefined login class allows the user to have access rights to any login command? a. privileged b. super-user c. privileged exec d. power-user 3. Which interface on a EX Series switch is set aside for OoB management? a. fxp0 b. fxp1 c. bcm0 d. me0 4. In which DHCP modes can an EX Series switch operate? (Choose two.) a. client b. server c. relay d. bootstrap 5. Which command is issued to view the DHCP configuration on an EX Series switch? a. show dhcp b. show system services dhcp c. show system services dhcp global d. show dhcp global 6. True or false: the switch is preloaded with a default rescue configuration. a. True b. False c. This question is totally unfair; I refuse to answer it! 7. In what ways can you configure the initial configuration settings on the switch? (Choose two.) a. CLI b. LCD panel 188 | Chapter 3: Initial Configuration and Maintenance Download at Boykma.Com
8.
9.
10.
11.
12.
c. EZSetup d. QuickSetup e. BSD shell Choose two items that are included in the factory-default configuration. a. LLDP b. OoB management c. RSTP d. Telnet Which syslog facility logs all CLI commands? a. cli-commands b. accounting c. change-log d. interactive-commands In which directory are all logfiles stored? a. /var/home/user b. /log c. /var/home/log d. /var/log e. /syslog Which feature of SNMPv2 acts as a password to authenticate SNMP messages? a. MIBs b. Communities c. OID d. Traps Which command allows NTP synchronization without a switch reboot? a. set system ntp b. request system time update c. set date ntp d. set ntp boot-server
Chapter Review Answers 1. Answer: C. There is no default password on a Juniper switch in the factory-default configuration. A single user, root, will be configured with no password. 2. Answer: B. The class of super-user allows users to issue any command that they desire on the switch. The other options listed are not supported classes. Chapter Review Answers | 189 Download at Boykma.Com
3. Answer: D. The other answers are valid interfaces for JUNOS, but none of them are used for OoB management on an EX Series switch. For instance, fxp0 is used for OoB management on M/T Series routers. 4. Answer: B and C. The switch either can be set as a DHCP server or can act as a relay agent. It cannot be a server and a relay agent at the same time, however. 5. Answer: C. The other commands are not valid commands. 6. Answer: B. The switch does not come with a default rescue configuration, so it is very important that you set this after your initial installation. 7. Answer: A and C. The initial configuration can be done via the CLI or EZSetup. Remember that EZSetup can be invoked from the shell or the LCD panel. 8. Answer: A and C. The factory-default configuration contains many default parameters, including RSTP and LLDP. Remote access such as Telnet and an OoB management interface would have to be configured via the CLI or using EZSetup. 9. Answer: D. The facility interactive-commands will log any commands that were typed via any user interface method, including the CLI. 10. Answer: D. This is the directory for all syslog and traceoptions files. 11. Answer: B. A community will act as a password for SNMP messages. This community value is sent in clear text on the wire, which could easily be captured. The next version of SNMP corrects this issue. 12. Answer: C. If the NTP server is reachable, set date ntp will restart the NTP update process without having to reboot the switch, thus eliminating the need for a boot-server configuration statement.
190 | Chapter 3: Initial Configuration and Maintenance Download at Boykma.Com
CHAPTER 4
EX Virtual Chassis
EX4200 switches support clustering of up to ten 4200 chassis into a single Virtual Chassis (VC), which provides significant High Availability (HA) benefits in addition to simplified network management. VC capabilities are included in the base 4200 model. A VC can be built incrementally, which means you can grow the VC by adding one or more switch chassis at any time, until the 10-chassis limit is reached, and you can mix and match any EX4200 model as part of the same VC. This capability means an enterprise can start at a modest scale with a single 4200 chassis, and then expand into a full-blown VC offering a local switching capacity of 1.36 Tbps/1.01 Bpps, with 128 Gbps of throughput for switching within the VC. The topics covered in this chapter include: • EX VC operation and deployment designs • Configuration, operation, and maintenance • VC deployment case study
The EX Virtual Chassis The EX4200 VC is an exciting concept. By simply attaching a few rear-panel cables, you can turn any mix of 10 standalone 4200s into a single logical entity that both simplifies management and increases resiliency to hardware- and software-related faults.
Virtual Chassis Overview The individual member switches comprising a VC can be any type of EX4200, with any mix of supported power supply units (PSUs), Power over Ethernet (PoE) options, and uplink modules. A fully blown VC can offer 480 × 1 GE and 20 × 10 GE ports with 128 Gbps of full duplex (FD) switching capacity between any pair of adjacent nodes. When desired, you can use ports on either the 2 × 10 GE or 4 × 1 GE uplink modules to form a VC Extension (VCE), which, as its name implies, supports extended distances (up to 400 meters) between VC members. 191 Download at Boykma.Com
Here are some key VC capabilities and functional highlights: • You can interconnect from 2 to 10 EX4200s to operate as though they are a single chassis. • Management is simplified via a single management interface, a common JUNOS software version, a single configuration file, and an intuitive chassis-like slot and module/port interface numbering scheme. • The design is simplified through a single control plane and the ability to aggregate interfaces across VC members. • Increased availability and reliability is available through N:1 redundant routing engines. Also, JUNOS supports Graceful Restart, Graceful Routing Engine Switchover, and Non-Stop Routing (GR, GRES, and NSR). • Performance and flexibility accommodate a grow-as-you-go design with no upfront investment in costly chassis hardware. At this time, Link Aggregation Control Protocol (LACP)/aggregated Ethernet (AE) across multiple VCs is not supported. Member links of a bundled interface can be housed in different switch members within a VC, however. Each EX4200 ships with a .5-meter Virtual Chassis Port (VCP) cable; VCP cables are also available in 1- and 3-meter lengths. This 3-meter length limit is the only restriction on physical member placement, and with some of the creative cabling schemes discussed later, a VCP ring can be built spanning some 13.5 meters (~44 feet), which is quite a respectable distance and more than suitable for a typical top-of-rack deployment scenario. A VC design based on a chain extends this distance to some 27 meters (88.5 feet), but such a design comes at the cost of a 50% reduction in VC trunk bandwidth and reduced reliability, as there is no tolerance for single VCP cable faults in such an arrangement. The VCP cables use a 68-pin connector and are considered proprietary, and therefore are available only through Juniper Networks and its authorized resellers. The user manual provides pin outs for the VCP cables, however.
Interchassis distances greater than 6 meters require use of a VCE, which has the disadvantages of requiring uplink module hardware, and the resulting reduction in trunk capacity, as determined by the speed of the uplink module used (e.g., 20 Gbps with 2 × 10 GE or 2 Gbps with 2 × 1 GE ports). Currently, the maximum supported VCE distance is 500 meters. Figure 4-1 illustrates these key VC capabilities.
192 | Chapter 4: EX Virtual Chassis Download at Boykma.Com
Figure 4-1. The EX VC
Figure 4-1 shows two EX4200 VCs. Within each VC, some switches are not collocated, hence the use of both VCP ring cabling and VCEs to tie in the remote switches to the main VC location. The VCEs could be 10 GE or 1 GE front-panel uplinks, and uplink speed can be mixed and matched within a single VC. In this example, the two VCs are interconnected using a Layer 2 Redundant Trunk Group (RTG), which is a Juniper proprietary link redundancy scheme that provides rapid failover convergence without the need for Spanning Tree Protocol (STP) given its primary/forwarding/secondary blocking operation. An RTG is similar in functionality to Cisco’s flexlink feature. If desired, you can define an AE link to add additional inter-VC bandwidth, but depending on interconnection specifics, STP may be required to prevent loops. A key aspect of Figure 4-1 is that each VC is associated with a single virtual management IP address that represents the entire VC cluster, thereby greatly simplifying network management. Lastly, note that an access layer switch is shown being dual-homed to The EX Virtual Chassis | 193 Download at Boykma.Com
each VC using an AE bundle. Such an AE link can contain from two to eight members, yielding as much as 80 Gbps, with added redundancy, as the Ethernet bundle can survive the loss of individual member links until the minimum link threshold is crossed; the minimum number of member links can be set to the range of 1 to 8 inclusive. Getting the 80 Gbps aggregated link mentioned previously on an EX4200 requires use of a four-node VC, with each member having a 2 × 10 GE uplink module. Recall that an AE bundle can span members within a chassis, allowing you to define an eight-member bundle that uses both 10 GE uplink ports on all four members. For large-scale 10 GE aggregation scenarios, consider an MX platform.
Also, note that each VC member can contain an uplink module, yielding a maximum of forty 1 GE or twenty 10 GE uplink ports per VC, in addition to the 480 GE ports supported in a single VC (each of the 10 member chassis can support 48 front-panel GE ports). Figure 4-2 provides another VC deployment example. Figure 4-2 shows a dual-VC design based on a top-of-rack deployment scenario. In this example, the access layer VCs are in turn dual-homed into a redundant aggregation/ core layer to eliminate single points of failure (assumes redundant power feeds) for maximum reliability and uptime. The single IP address used to manage and configure each VC greatly simplifies network management and support activities. “Virtual Chassis Design and Deployment Options” on page 198 provides tips on how to get maximum bang from the limited length of VCP cables, and details design options that combine VCP and VCE links to optimize both performance and VC coverage area.
Virtual Chassis Control Protocol The heart of Juniper VC technology is the Juniper proprietary link state (LS) Virtual Chassis Control Protocol (VCCP). VCCP functions to automatically discover and maintain VC neighbors, and to flood VC topology information that permits shortestpath switching between member switches using either internal or external (VC trunk) switch paths. VCCP is not user-configurable, and operates automatically on the rear-panel VC ports. VCCP also operates over uplink ports when they are configured as VCE ports. As with any LS protocol, the net effect is that VCCP rapidly detects and reacts to changes in the VC topology to ensure maximum connectivity over optimal paths in the face of VC moves and additions, because of switch or VC backbone failures. The loop-free switching topology that results from the Shortest Path First (SPF) calculations allows VCCP to “do the right thing” in almost any VC topology cabling scheme imaginable.
194 | Chapter 4: EX Virtual Chassis Download at Boykma.Com
Figure 4-2. A top-of-rack VC design promoting High Availability
The EX Virtual Chassis | 195 Download at Boykma.Com
VCCP uses a link metric that’s scaled to interface speed when calculating its SPF tree. Load balancing is currently not supported; a single best path is installed for each known destination, even though multiple equal-costs paths may exist.
Member roles within a VC As mentioned previously, a VC consists of any 2 to 10 EX4200 switches. Within each VC, there are three distinct roles: master routing engine (RE), backup RE, and Line Card Chassis (LCC): Master RE The master RE runs the VC show, so to speak, by actively managing the VC switch members as far as VC operations go, and as importantly, by maintaining the master copy of the switching/routing table (RT). Because this table is in turn copied to each remaining VC member, the master RE controls overall packet and frame forwarding based on the operation of its switching and routing protocols. Within a VC, hardware-related commands are normally executed on the master RE, which then conveys the instructions and results over an internal communications path. Virtual console and Out of Band (OoB) management capability is also available, again via the master RE and its internal communications channels to all VC members. When a new switch member attempts to join a VC, the master RE is responsible for determining its compatibility with the VC and the resulting assignment of a member ID and VC role. A functional VC must contain a master RE. You can configure mastership parameters that ensure a deterministic election behavior, or rely on the built-in tiebreaking algorithms, which ultimately favor the first switch powered up. We provide details on mastership election in a later section. Backup RE The backup RE, as its name implies, is the second most-preferred switch member that stands ready to take over chassis operations if the current master RE should meet an untimely demise. With default parameters, the backup RE is the second switch that is powered up in the VC. At a minimum, the backup RE maintains a copy of the active configuration (through use of commit synchronize on the master RE); if GR is enabled, the backup RE also maintains copies of the forwarding table (FT) to enable Non-Stop Forwarding (NSF) through a GRES event. Alternatively, with NSR enabled both the FT and control plane state—for example, Open Shortest Path First (OSPF) adjacency status or STP and learned Media Access Control (MAC) address state—are mirrored to provide a truly hitless GRES experience. LCC An LCC is any switch member that is not currently acting as the master or backup RE. This may simply be because it was the third through tenth switch member powered up, meaning it could one day become a master or backup RE, or because a configuration constraint bars it from any such ascendancy. An LCC accepts (and stores) its member ID from the current master, and then proceeds to perform as 196 | Chapter 4: EX Virtual Chassis Download at Boykma.Com
instructed with regard to hardware operations and FT entries. The LCC runs only a subset of JUNOS. For example, it does not run the chassis control daemon (chassid). The receipt of exception traffic—for example, a newly learned MAC address or local hardware error condition—results in intrachassis communications between that switch member and the master RE, which may then mirror the change to the backup RE when GR or NSR is enabled. After processing the update, any related actions, such as updating the FT or taking a failed piece of hardware offline, are then communicated back to affected member switches, thereby keeping everything tidy and in sync within the VC.
Member ID When an EX4200 is powered on and attached to a VC, it determines whether it should be master, and if not it’s assigned the next available member ID. The assigned member ID is displayed on the front-panel LCD. When powered up as a standalone switch, the member ID is always 0. A VC master assigns member IDs based on various factors, such as the order in which the switch was added to the VC. Generally speaking, as each switch is added and powered on, it receives the next available (unused) member ID unless the VC configuration specifically maps that switch’s serial number to a specific value. Promoted stability ID assignments are sticky, meaning that the ID is not automatically reused if the corresponding switch is removed from the VC. A later section describes how you can clear or recycle VC switch member IDs when desired. The member ID distinguishes the member switches from one another, and is used to: • Assign a mastership priority value to a member switch • Configure interfaces for a member switch (the function is similar to a slot number on Juniper Networks routers) • Apply some operational commands to a member switch • Display the status or characteristics of a member switch The switch member ID is a logical function and is independent of any particular VC member role, or physical location along a VC ring or chain. Although it is a best practice to have the master RE assigned ID 0, this is not mandatory.
Mastership priority You can designate the role (master, backup, or LCC) that a member switch performs within a VC by explicitly configuring its mastership priority. The priority ranges from 1 to 255, and larger values are preferred. The mastership priority value has the greatest influence over VC mastership election, and so is a powerful knob. The default value for mastership priority is 128. The current best practice is to assign explicit priority values for the master and backup roles, which should be the same, and should be set The EX Virtual Chassis | 197 Download at Boykma.Com
to the highest value (255) to avoid preemption after a GRES and to then ensure that any new LCC members have an explicit priority configured before they are attached to the VC. These procedures are described in detail in a later section and are intended to prevent undesired master RE transitions.
Default election algorithm The default parameters ensure that even with no explicit configuration the VCP protocol will correctly detect and assign chassis member roles, such that there will be a master and a backup RE, and one or more LCCs if at least three member switches are present. Variations among switch models, such as whether the switch has 24 or 48 ports, have no impact on the master election process. The steps of the master election algorithm are: 1. Choose the member with the highest user-configured mastership priority (255 is the highest possible value). 2. Choose the member that was master the last time the VC configuration booted (retained in each switch’s private configuration). 3. Choose the member that has been included in the VC for the longest period of time, assuming there was at least a one-minute uptime difference; the power-up sequence must be staggered by a minute or more for uptime to be factored. 4. Choose the member with the lowest MAC address, always a guaranteed tiebreaker.
Virtual Chassis Identifier All members in a VC share a common Virtual Chassis Identifier (VCID) that is derived from internal parameters and is not directly configurable by the user. Various VC monitoring commands display the VCID as part of the command output. Although it’s clear that you can form a functional VC by simply slapping together 10 EX4200 switches (via their VC ports) with default configurations, such an arrangement is generally less than ideal. For example, you need to configure a virtual management interface to avail yourself of the benefits of a single IP management entity per VC, N:1 RE redundancy may not be desired, and you may wish to exert control over which members provide what VC functions, perhaps to maximize reliability in a given design. Later sections provide VC design guidelines that promote high levels of reliability while also alleviating potential confusion through explicit configuration of VC member roles.
Virtual Chassis Design and Deployment Options This section details various VC design options and alternatives that you should carefully factor before deploying a VC in your network. Although the physical topology of the VC is a significant component of a VC’s design, several aspects of a VC’s operation can be controlled through configuration. This section explores VC topology and
198 | Chapter 4: EX Virtual Chassis Download at Boykma.Com
configuration options, with a focus on current best practices relating to overall VC design and maintenance. In many cases, the basic choice of a VC topology is determined by the degree of separation between VC switch members. The approach used for a single closet will likely differ for a top-of-rack design in a data center, and both differ from a VC design that extends over a campus area (multiple wiring closets). In addition, some designs promote optimal survivability in the event of VC backplane faults, a design factor that is often overlooked. It is worth pointing out that the Juniper VC architecture is such that local switching between the chassis front-panel ports, to include the uplinks, does not involve use of the VC trunks. As a result, when EX4200 switches are interconnected as part of a VC, each individual switch is still capable of local switching at the maximum standalone switching capacities detailed in Chapter 2. Therefore, in a 10-member VC where all traffic is locally switched, the maximum total switching capacity is 1.36 Tbps (10 × 136 Gbps), with an aggregate throughput of 1.01 billion packets per second!
VCP topologies As described in Chapter 2, each EX4200 chassis has two rear-panel VCPs. Each VCP operates at 32 Gbps FD, which translates to 64 Gbps of throughput when you consider that a single VCP can be simultaneously sending and receiving 32 Gbps of traffic. The combined throughput of both VCPs is therefore 128 Gbps, or 64 Gbps FD. Note that the maximum FD throughput for any single flow between a sender and receiver that are housed on different VC switch members is 32 Gbps. When deployed in the recommended ring topology, each VC member could be simultaneously switching among its front-panel and uplink ports, while also sending and receiving 128 Gbps of traffic (64 Gbps per VCP) to and from other VC members. When interconnected as a chain, or as a result of a VCP ring break, trunk capacity is reduced to 64 Gbps at the ends, while the switches in the middle still enjoy the ability to use both VCP ports. Note that the actual VCP throughput is a function of the ingress and egress points associated with the traffic being switched (or routed), both locally and by other VC members. This is in part because currently EX switches do not support load balancing or congestion avoidance across VC trunks; for each destination, a given switch installs a single best path as determined by the lowest VCCP path metric to reach the switch associated with that destination. In the event of a metric tie, the first path learned is installed and used exclusively, until the VCCP signals a topology change, resulting in a new SPF calculation and subsequent update to the shortest path tree. A VCP ring offers 128 Gbps of throughput capacity between any two member switches, but usage patterns and SPF switching between ring members may prevent any two members from being able to use the full 128 Gbps VC trunk capacity. Similarly, aggregate VC throughput can be higher than 128 Gbps when traffic patterns are carefully The EX Virtual Chassis | 199 Download at Boykma.Com
crafted to prevent congestion by having each pair of adjacent switches sink each other’s traffic, which effectively yields an aggregate throughput potential of n × 64 Gbps, where n is the number of member switch adjacencies in the VCP ring topology. To help demonstrate this traffic dependency, consider the VC topology shown in Figure 4-3.
Figure 4-3. Effects of traffic patterns on VC trunk throughput
Given the VC ring topology, a total of 128 Gbps of VC switching capacity is available between member switches. However, because two VCP ports are used to instantiate the VC ring, only 64 Gbps of capacity is available in each direction. Figure 4-3 shows a somewhat simplified scenario involving 64 Gbps of traffic arriving at Switch 1, of which 32 Gbps is destined to Address X on Switch 2, while the remaining 32 Gbps is for Address Z on Switch 4. Given the topology shown in Figure 4-2, and knowledge that the VCP installs routes to other destinations based on path metric, it’s safe to assume that Switch 1 directs 32 Gbps of traffic out its VCP A port on to Switch 2 while simultaneously sending the 32 Gbps of traffic to Switch 4 via its VCP B port. The next result is a total of 64 Gbps of traffic leaving Switch 1, which is split over its 200 | Chapter 4: EX Virtual Chassis Download at Boykma.Com
two VCP ports and effectively consumes all available transit trunk bandwidth at Switch 1, given that each VCP port operates at 32 Gbps FD. Because the VCP ports are FD, at this same time both Switch 2 and Switch 4 can be sending 32 Gbps of traffic to Destination Y on Switch 1. In this state, the trunk bandwidth between Switch 1, Switch 2, and Switch 4 is consumed, and there is a total of 128 Gbps of traffic being switched, which is the stated VC trunk capacity. However, because the traffic that is sent by Switch 1 is pulled off the ring at both Switch 2 and Switch 4, the traffic sent by Switch 1 to Address X and Address Z does not consume VC trunk bandwidth between Switch 2, Switch 3, and Switch 4. It’s therefore possible to switch an additional 128 Gbps of traffic, as long as this traffic is confined to sources and destinations on Switch 2, Switch 3, and Switch 4. In this somewhat contrived scenario, a total of 256 Gbps of traffic is switched over the VC ring. This is truly a case of the “under-promise and over-deliver” philosophy users have come to expect from Juniper Networks gear. Although the previous example shows how you may get more than 128 Gbps of throughput over a VC ring, there are situations where the VC topology and traffic patterns are such that congestion occurs on some VC trunk segments, while other segments are otherwise idle. For example, if a source on Switch 3 were to send 32 Gbps to Destination Y on Switch 1, rather than some destination on Switch 4 or 2, we have the case of the VC link between Switch 3 and Switch 4 remaining idle (assumes that the VCCP at Switch 3 has installed the path through Switch 2 to reach Switch 1), while a total of 64 Gbps of traffic, 32 Gbps sourced by Source X at Switch 2 and another 32 Gbps from the remote Switch 3, begins queuing up for the 32 Gbps VCP port linking Switch 2 to Switch 1. Generally speaking, there are two ways to form VCP connections: via a ring, and via a braid. The differences primarily deal with how many switches are spanned by the longest VCP cable used. We examine these options in the next section.
VCP single rack rings The most direct way to form a VCP ring is to simply connect each switch to the next, with the last switch in the VC tied back to the first, as shown in Figure 4-4. This type of linear ring cabling is best suited to a single-rack deployment, given that the maximum separation between VC members is limited to 3 meters/9.8 feet (the maximum supported VCP cable length). All three VCP cabling arrangements in Figure 4-4 are functionally identical. The approaches are termed a linear ring because the flow of traffic is sequential, passing through each switch until it—or, more correctly, some other traffic inserted by another switch—loops back at the end of the ring to start its journey anew at the first switch. Figure 4-4 also provides a top-of-rack equivalent that is spaced horizontally.
The EX Virtual Chassis | 201 Download at Boykma.Com
Figure 4-4. A linear ring; the longest cable spans the VC
VC cable can be arranged in many ways; the takeaway here is that VCP ports just work: as long as each switch is connected to the next and the last switch is tied to the first, a functional VCP ring will form.
VCP multiple rack rings As stated previously, the longest supported VCP cable is only 3 meters, or some 9.8 feet. However, with some creative cabling, it’s possible to create a ring that spans as much as 15 meters/49.2 feet. This respectable distance brings a VC ring topology into the realm of many multirack/data center deployment scenarios. Figure 4-5 depicts such braided ring cabling at work. The key to the braided VC ring is that the longest VCP cable now spans only three switch members. Where desired, you can form a braided ring using a mix of short and long cables to save money, given that a short VCP cable ships with each EX4200 switch. As before, Figure 4-5 also provides a horizontally oriented top-of-rack equivalent. Trying to trace the packet flow through a braided ring can be a bit confusing, but overall performance and VCCP operation remain unchanged, and things simply work. In this example, the top switch sees the third switch as its VCP B neighbor, and packets take a somewhat convoluted path as they wind their way around the ring, sometimes being sent to a physically adjacent neighbor (at the ring’s ends) and other times being sent past the physically adjacent member switch and onto the VCCP neighbor at the other end of the VCP cable.
202 | Chapter 4: EX Virtual Chassis Download at Boykma.Com
Figure 4-5. A braided VC ring; the longest cable spans three switches
VCP serial chain The final VCP cabling option is a serial chain. Figure 4-6 shows this arrangement. The obvious advantage to the serial chain is the ability to achieve the largest possible VC diameter, which is now some 27 meters/88.5 feet. The equally obvious downside is the use of a single VCP port at each switch, which halves the total VC trunk throughput to 64 Gbps. Another significant drawback is the lack of tolerance to any VCP cable fault, which results in a bifurcated VC, and the potential for unpredictable operation, given that a split VC is currently not supported.
The EX Virtual Chassis | 203 Download at Boykma.Com
Figure 4-6. A serial VCP chain
VCE topologies VCE topologies are formed by setting one or more ports on the (optional) uplink module to function in VCCP mode. Oddly, this is done with an operational rather than a configuration mode command, in the form of a request virtual-chassis vc-port statement, as we describe in a later section. Once placed into VCCP mode the related port cannot be used for normal uplink purposes until the VCE mode is reset. You can configure all uplink module ports as VCEs, and you can also mix and match normal and VCE modes on a per-port basis. VCE functionality is supported on both the 2 × 10 GE and 4 × 1 GE uplink modules, and a mix of 1 GE and 10 GE VCE links can be used as part of an extended VCE design. It should be noted that even the rear-panel VCP ports, which offer an aggregate 128 Gbps of throughput, can become congested in some cases. Therefore, careful thought should be given before attempting to deploy a VC design incorporating 1× GE uplink ports because of the obvious potential for serious performance bottlenecks should there be a significant amount of interswitch member traffic over these links. You can use any type of supported optics modules (SFP/XFP) and fiber for VCE links, but the maximum supported distance is currently limited to 500 meters. Although this may not reflect the maximum distance the related optics can drive, at 500 meters per VCE link, and with as many as 9 such links in a 10-member serial VC chain configuration, you are talking 4,500 meters (14,763 feet), which is some serious VC-spannage indeed!
204 | Chapter 4: EX Virtual Chassis Download at Boykma.Com
A VCE-based topology can be either a ring (recommended), or a serial bus, as we described for VCP-based topologies earlier. Because even a 10× GE port represents reduced bandwidth, and due to the increased probability of a fault occurring on an extended length of fiber optic cable, you should always deploy a VCE ring topology, and should never rely on a single VCE to tie together to remote member clusters. A pure VCE ring configuration requires two VCE ports, and therefore consumes all uplink ports when using the 2 × 10 GE uplink module. However, a hybrid VCP/VCE design can allow the benefits of a ring topology while using only a single VCE port in some cases.
Extending the VC A VC design based solely on VCE links is considered rare; the far more common case is a single- or multiple-rack deployment using only VCP ports, as this eliminates the need for uplink ports and their related SFPs, and also yields maximum performance with plug-and-run simplicity. Recall that a VCP ring can span 15 meters, and a VCP chain can extend up to 27 meters, distances that bring most data center and top-ofrack designs well within reach. By combining VCP and VCE ports as part of your VC design, you can achieve the best of both worlds: high-speed VCP-based and local switching within a wiring closet and lower-speed VCE-based trunks linking the closets together. Figure 4-7 shows such a design. In this example, the VCE links are shown as 10 GE, but 1 GE links could be substituted with no change in core functionality. Note how some of the VC members use only VCP ports, whereas other switch members use both VCP and VCE ports. An advantage of this design is that it preserves one of the two supported 10 GE uplinks for use in, well, uplinking non-local traffic to the distribution layer, where it’s then sent to the core or to other distribution layer nodes as needed. The use of two VCE links between different VC members provides added capacity and redundancy in the event of VCE link failure. You can use as many parallel VCE links as desired to maximize these characteristics. When deploying an extended VC, give careful thought to typical and projected traffic patterns. Where possible, you should follow the 80/20 rule, which is to say that ideally 80% of traffic is locally switched, which in this case refers to not having to be trunked over relatively low-bandwidth VCE links. Recall that local switching capacity is unaffected, and therefore remains wire-speed for intraswitch traffic. If the majority of traffic can be kept local to each member switch, bandwidth on the VC trunks is not a significant factor. The design shown in Figure 4-7 is optimized when most of the traffic is switched within that closet/VCP wiring domain, as this takes advantage of local switching and the high-speed VCP links.
The EX Virtual Chassis | 205 Download at Boykma.Com
Figure 4-7. Typical extended VC deployment scenario
Packet Flow in a Virtual Chassis This section focuses on packet flow through a VC, during both normal and VCP link failure conditions. Note that Chapter 3 details Layer 2 and Layer 3 packet flows within a standalone EX switch. Here the focus is on VC topology discovery and communications between switch members making up a VC.
206 | Chapter 4: EX Virtual Chassis Download at Boykma.Com
Virtual chassis topology discovery When a VC is brought up, each member switch floods VCCP packets over its VC trunk ports. Although proprietary, it can be said that VCCP is based on the well-known Intermediate System to Intermediate System (IS-IS) routing protocol. VCCP automatically discovers VC neighbors, builds adjacencies with these neighbors, and then floods link state packets (LSPs) to facilitate automatic discovery of the VC’s topology, as well as rapid detection and reaction to changes in the VC topology due to a switch or VC trunk failure. Figure 4-8 illustrates this process in the context of a VC comprising three switch members arranged in a VCP-based ring topology.
Figure 4-8. VC topology discovery
In this example, each member switch is a 48-port model, and therefore contains three EX-PFEs that work together to drive the 48 front-panel 1× GE ports, the optional uplink ports, as well as the internal and external VC trunks. Each PFE is identified as A–I, and each switch member is identified by a member ID, here shown as A1, B1, and C1. Note that in Figure 4-8, the B, E, and H entities are EX-PFE application-specific integrated circuits (ASICs) that have only internal or front-panel links. Figure 4-8 also shows the resulting logical topology that is formed through the VC ring cabling. Note that a break in the VCP ring creates a serial chain, and a resulting halving The EX Virtual Chassis | 207 Download at Boykma.Com
of VC trunk bandwidth for destinations near the break, as their maximum VC bandwidth drops to 64 Gbps given the single communications path at the ends of the chain. Because each VC trunk segment operates point to point, those switches that are still connected by two functional VCP segments could still send and receive as much as 128 Gbps of traffic—for example, 32 Gbps (FD) to and from each adjacent neighbor. But if this traffic is destined for the ends of the chain, all VC trunk bandwidth is consumed, and the switches at either end of the break are each limited to 64 Gbps of switching throughput. Because each switch member is using two VCP ports, there are two communications paths to choose from for any given destination; for example, member A1 can send out the VCP port connected to PFE B, or it can send out its other port to I. The destinationto-port mapping at any given time is a function of each switch’s SPF calculation, as described next.
The SPF calculation Figure 4-9 shows how the example’s logical topology is in turn viewed as a sourcerooted SPF tree at each EX-PFE to all other PFE destinations in the VC.
Figure 4-9. The source-rooted SPF tree for inter-VC destinations
Once the VC topology has stabilized, and all PFEs have sent and received each other’s VCCP link state advertisements (LSAs), the result is a replicated link state database (LSDB) at each PFE. Changes to the VC topology are rapidly communicated by flooding 208 | Chapter 4: EX Virtual Chassis Download at Boykma.Com
updated VCCP LSPs, which in turn trigger new SPF runs at each PFE as an updated SPF tree is calculated. Currently, load balancing is not supported. In the event of a hop-count tie, the winner is selected with preference to the PFE associated with the lowest member ID. Figure 4-9 shows the result for PFEs E and A, and depicts how their respective SPF trees reach the other PFEs that comprise the VC. The lack of load balancing results in a single forwarding next hop for each PFE destination. However, although there is no load balancing to a specific PFE, load balancing is possible to different PFE destinations. This is because VCPs are always in a forwarding state for some subset of the VC’s PFE destinations, such that one port is used as the forwarding next hop for one-half of the VC’s destinations and vice versa. Based on Figure 4-9, we see that packets in PFE A that need to be switched toward a destination housed on PFE D are sent out the upper VCP link toward PFE B over the internal VC trunk within switch member A1. A topology change in the form of a ring break triggers a new SPF recalculation by all PFEs. For those stations adjacent to the break, the result is that the surviving VCP port is used to forward to all remaining PFE destinations. Figure 4-10 shows this state.
Figure 4-10. SPF after a VCP trunk failure
The EX Virtual Chassis | 209 Download at Boykma.Com
Figure 4-10 shows an updated SPF tree for PFE C, which is adjacent to the break, and A, which is shielded from the break through its adjacent PFE neighbors B and C. Because this is a ring rather than a switch break, all PFEs and all destinations remain reachable, albeit at reduced VC trunk capacity, as described previously. A similar situation results in the event of a VC switch member failure, except that the PFEs associated with the failed switch are no longer reachable and are removed from the VC’s topology. Connectivity to remaining PFEs continues, and based on design redundancy, connectivity to endpoints can reconverge through an alternative path. It should be noted that VC switch member roles are not affected by changes in VC topology or costs to reach a given PFE. A switch member’s VC role is linked to its member ID and associated priority. Thus, a member switch need only remain reachable for it to retain its current VC role. As a result, only the failure of the current master, or two VCP trunk failures that serve to isolate the master from the rest of the VC, can result in the need to promote a backup RE to the role of master RE.
A bifurcated VC: It’s a bad thing When two VC trunk failures occur between two pairs of adjacent member switches, the result can be a bifurcated VC. In such a state, PFEs that were formerly part of the same VC lose contact. This can result in multiple master REs becoming active, each feeding its VC members with a copy of the VC configuration file, which can result in unpredictable and even network-disruptive behavior. In this example, in addition to both VCs potentially forwarding the same traffic, this condition also results in a duplicated IP management address; recall that the single vme.0 address is shared by all members in a VC, but we now have two VCs running the same configuration, which includes the virtual management address. It’s rare to actually encounter this condition, because it requires the simultaneous failure of two VC switch members, or two VC trunk cable segments between two different pairs of adjacent VC members. Given the relative infrequency of this failure mode, and the complexity of making things work in such a state, a bifurcated VC is currently not supported. With that said, the best practice in a vertical VC design has the master RE at either the top or the bottom, and the desired backup RE in the middle so that it’s equidistant from either end. The rationale is that in the event of a bifurcation there is maximum probability that each of the split VCs will continue to operate using one of the two RE-capable switch members; this is especially important when deploying a redundancy scheme that permits only two of the VC members to function in the RE role.
Virtual chassis packet walk-through This section details packet processing in a number of different scenarios. Figure 4-11 provides a macro view of VC packet forwarding.
210 | Chapter 4: EX Virtual Chassis Download at Boykma.Com
Figure 4-11. VC packet forwarding
As described previously, VC member discovery results in an SPF tree rooted at each EX-PFE that is optimized on the path metric and, in the case of a VCP ring, points to one of two VC port interfaces for forwarding between member switches within the VC. In this example, a source on Switch 0’s ge-0/0/28 interface is sending to a destination on Switch 2’s ge-2/0/47; Sequence Number 1 and the related solid arrows show the prefailure forwarding state, which—being based on path metric optimization—has Switch 0 forwarding toward Switch 2 through its VCP link to Switch 1 with a hop count of 2. When all interfaces have the same bandwidth, as is the case here, the SPF result is effectively based on hop count.
At step 2, the VCP cable between Switch 0 and Switch 1 suffers a fault, resulting in flooding of updated VCCP LSAs. After the new VC topology has stabilized, the updated calculation at Switch 0 causes it to begin forwarding toward Switch 2 via its VCP link to Switch 4, shown at step 3. The dashed arrows show that the remaining switches have also converged on the new topology, with the result being a sane forwarding path that, albeit no longer at three hops, permits ongoing communications between the source and destination VC interfaces.
The EX Virtual Chassis | 211 Download at Boykma.Com
Intersystem packet flows This section builds on the previous, high-level example of interswitch packet flow by detailing how unicast and multicast packet flows are processed within each switch and its respective EX-PFEs. Figure 4-12 starts the discussion with a unicast flow for a known source and destination address.
Figure 4-12. Known source: unicast flow
Figure 4-12 shows a somewhat simplified VC consisting of three EX switches, with each switch member having a single PFE. In this example, the switch member ID and PFE ID are the same, and range from 0 to 2. The three switches are connected in a ring, and each switch’s PFE to VCP port mapping is shown. This is a function of a hop-countoptimized SFP run at each member switch given that all interface metrics are the same. Figure 4-12 shows two simultaneous unicast flows. The solid flow ingresses at Switch 0 and egresses at Switch 1, and the dashed flow begins at Switch 2 and terminates at Switch 0. The MAC address to switch member/PFE ID mapping is assumed to be in place, meaning that both the Source MAC (SMAC) and Destination MAC (DMAC) addresses for both flows have been learned and the appropriate TCAM entries are in place and are used to map a MAC address to a destination PFE. In a normal case, many MAC addresses can map to the same PFE ID, and therefore to the same forwarding VCP next hop. 212 | Chapter 4: EX Virtual Chassis Download at Boykma.Com
The highlighted entry in Switch 0’s mapping table shows its mapping of Switch ID 1 to its VCP port 0, and the solid line shows the resulting unicast flow. In similar fashion, the dashed line at Switch 2 highlights the mapping table entry that causes it to use its VCP 0 to reach PFE 0. Multicast, broadcast, or unknown DMAC address flows require special handling, as they must be flooded within the VC while taking safeguards to ensure that endless packet loops/broadcast storms do not occur. This is because such flows need to be flooded to all ports associated with the ingress port’s virtual LAN (VLAN). This causes such traffic to be flooded to all remote PFEs, which may or may not have local VLAN members resulting in the decision to either replicate and forward, or discard, respectively. The lack of a Time to Live (TTL) field in Ethernet frames makes a forwarding loop particularly nasty and can easily bring a Layer 2 network to a grinding halt. Figure 4-13 details how EX-PFEs solve this problem.
Figure 4-13. Known source: flooded traffic
The key to preventing broadcast storms is the use of a source ID mapping table in each PFE that ensures that a single copy of each flooded frame is received by every PFE within the VC. Step 1 in Figure 4-13 shows a single multicast stream sourced at Switch 0. The highlighted source ID mapping tables show how each switch forwards the associated traffic. Switch 0’s locally originated traffic is flooded out through both its VCP 0 and The EX Virtual Chassis | 213 Download at Boykma.Com
VCP 1 ports at step 2. This traffic, when received by PFEs 1 and 2, results in blocking at Switch 1’s VCP 0 port, and also at Switch 2’s VCP 1 port, which is shown in step 3. The result is that each switch/PFE in the VC receives a single copy of each flooded frame, where specifics determine whether local replication or discard is appropriate for its front-panel ports. Forwarding of this traffic out the remaining VCP port to another PFE is constrained by a source ID mapping table built within each PFE that is based on VCCP exchanges and the resulting topology database. Changes in the VC topology trigger VCCP updates and a resulting modification to the source ID mapping tables to ensure continued connectivity. Figure 4-14 expands on the preceding discussion with details of the flow of exception traffic within a VC.
Figure 4-14. Exception flows within a VC
Exception traffic refers to packets that need to be shunted out of the ASIC fast path and up to the RE for processing that is outside the realm of pure packet forwarding. For example, when in Layer 2 bridging mode, each SMAC address must be learned so that forwarding decisions based on the DMAC can be intelligently made. When in Layer 3 mode, a similar exception flow occurs for certain IP packets—for example, those with a source route or Router Alert (RA) option, or in the case of traffic that is addressed to the switch itself. Exception flows are rate-limited and policed within both the PFE and the RE to prevent the lockout of critical control plane processes during periods of abnormally high levels of exception traffic, such as might occur during a denial of service (DoS) attack. You can view exception traffic statistics, including policed drops, using the output of the show pfe statistics and show system statistics commands.
Figure 4-14 details how an unrecognized SMAC address results in the need to redirect traffic to the control plane for additional processing. Things start at step 1, when a 214 | Chapter 4: EX Virtual Chassis Download at Boykma.Com
frame is received with a known DMAC address of A but an unknown SMAC address of X. The ingress PFE performs both SMAC and DMAC lookups for each frame as part of its Layer 2 forwarding and learning functions. Upon seeing the unknown SMAC, the frame is shunted out of the ASIC forwarding path and into the control plane, where it is sent to the local switch’s RE at step 2 in Figure 4-14. At step 3, the LC switch constructs a notification message from the buffered frame’s particulars. The notification is then sent to the VC’s master RE using the SPF between the ingress switch’s CPU and the master RE. The path chosen can contain both internal PFE-PFE and external VCP links, as shown in this example. Step 4 has the VC’s RE perform the needed accounting and admission control functions. For example, a MAC limit parameter may be set that prevents this SMAC from being learned, or perhaps a Layer 2 firewall filter is in place that indicates this SMAC should be blocked. Assuming no forwarding restrictions exist, the master RE sends an update to all PFEs in the VC, which is shown at step 5. This update instructs all PFEs to update their TCAM with the newly learned SMAC. Things conclude at step 6 when the ingress switch reinjects the previously buffered frame back into the local PFE complex, where it’s now switched toward the egress PFE, and then toward the egress port, based on the frame’s DMAC, using the SPF between the two PFEs. When the frame is received by the egress switch, which functions as a backup RE in this example, no additional learning/intra-VC communications are needed because the SMAC was programmed into all PFEs back at step 5, so the egress PFE simply forwards the frame out the port associated with Destination A.
Virtual Chassis Summary This section detailed the architectural and design aspects of the EX4200 VC. With an understanding of VC member roles, member ID, and mastership priority, in addition to VCP topologies and cabling schemes, you are no doubt ready to move on to the act of configuring and maintaining a VC. You are in luck, because the next section provides this very information.
Configuration, Operation, and Maintenance You configure and manage almost all aspects of a VC via the VC’s master RE. However, you can also configure VC parameters when an EX4200 is a standalone switch and not actually attached to other switches. This is because each EX4200 switch has some innate characteristics of a VC by default. A standalone EX4200 switch is assigned member ID 0 and is the master of its own (and therefore single-member) VC, which allows you to configure VC parameters on a standalone switch. When the previously standalone switch is interconnected with an existing VC, the VC configuration statements and any VCE uplink settings that you previously specified on the standalone switch remain part of its configuration, where they can do such things
Configuration, Operation, and Maintenance | 215 Download at Boykma.Com
as influence mastership reelections. Once a switch becomes part of a VC, the current VC master synchronizes its configuration copy to all member switches, overwriting any local changes that conflict with the current master’s settings. As with configuration, VC operation and diagnostic troubleshooting is generally performed through the master switch. In a typical configuration, a single virtual IP address is shared among all VC switch members, and any incoming traffic received by a VC member for that shared address is automatically redirected to the current master RE. In a similar manner, a virtual console service redirects console input on any VC switch member to the master RE’s console using an internal communications path. There is a configuration option to disable the internal management VLAN, which allows you to access each VC switch member through its (now) individually IP-addressed OoB management Ethernet port. This option is generally used only in advanced VC troubleshooting situations, and is described later. The next section details the parameters that are normally configured when deploying a VC with a preprovisioned configuration file.
Virtual Chassis Configuration Modes Broadly speaking, there are two primary ways to deploy a VC: via plug-and-play with a default or non-provisioned configuration, or via preprovisioned mode. The latter must include explicit configuration that can force VC member ID and roles in a deterministic manner. Although the anything-goes nature of a default configuration VC is guaranteed to work (when using all VCP cabling), such a design is generally not considered to be a best practice. Note that use of VCE ports requires explicit actions because, by default, these ports operate in uplink mode. In non-provisioned mode with all switches running default configurations, all will have the same mastership priority. As such, the master switch will be the first one powered up, and the backup RE is the second switch powered on. Should the current master later fail, the backup RE becomes the master and any of the remaining switches could become the new backup, assuming they were all powered up at nearly the same time; recall that uptime can influence mastership tiebreaking, as described previously. Although some might argue that having 1:10 RE redundancy (meaning that any of the 10 VC members can become the active RE) is a good thing, others argue that the law of diminishing returns kicks in when you actually factor the probability of a failure mode that manages to take down two switches while somehow managing to spare all other VC members. In most cases, whatever causes you to lose both your current and backup master REs at the same time—for example, the loss of AC power distribution—is going to take down the entire VC anyway. In contrast, a deterministic design uses a preprovisioned VC member-to-role mapping that, in the best practice case, assigns a master and backup RE with all remaining VC members forced into a Line Card (LC) role. In most cases, you will also want to statically
216 | Chapter 4: EX Virtual Chassis Download at Boykma.Com
assign switch member IDs. Such an approach removes the significance of the switch power-up/VC attachment sequence, which, by default, assigns member IDs in the sequence in which each switch is powered up/attached to the VC. This is a significant point, because in addition to its use in various operational and maintenance commands, the member ID also impacts the interface names for that switch’s front-panel ports. For example, the first GE port on the VC member with ID 3 is ge-3/0/0, and you may want this ID to be deterministically assigned to the third EX switch in a vertical stack, and to ensure that it can never change by nailing the value down with explicit configuration.
Hot or cold insertion: when does a VC addition become a VC merge? Regardless of whether you use a default or prestaged configuration, when it comes to expanding a VC you will need to physically attach a new switch member to an existing VC. When performing a VC addition, you must ensure that the new switch is powered off before attaching it to the existing VC. You can attach a powered-on switch to an existing VC, but this operation is disruptive because it constitutes the merging of two VCs into one. Recall that every standalone EX4200 is, by definition, the master of its own domain. Therefore, when attached to a VC after being powered on, there are two active master REs, which forces a contention situation, with the result being the reboot of the losing RE and its VC members, along with the loss of its configuration. Because the old master’s configuration is lost, the final VC configuration will be that of the winning master, and it’s likely that the member ID will also change. Because of the potential for resulting network disruption, cold insertion is always recommended when adding a new member to a VC. In a cold insertion, the newly attached and powered-on switch does not assume a master role, and instead listens to VCCP messages to learn its role in the VC. Assuming the new switch has a lower priority, there will be no master contention process, as would occur with a host insertion.
Virtual Chassis Configuration Several parameters can be configured to control and manage the operation of a VC. At a minimum, you should assign a virtual management address that represents the VC itself and is serviced by whatever member switch is the VC’s current master RE. Most VC designs, even when using non-provisioned mode, typically add additional configuration to help promote some degree of deterministic operation. This section details VC configuration options, along with some best practice design tips to keep things interesting. Note that with a few exceptions, all of these parameters are configured through the master RE, which then pushes the changes to the affected members when the configuration is synchronized.
Configuration, Operation, and Maintenance | 217 Download at Boykma.Com
Virtual management address You configure a virtual management IP address as you would on any real interface, except the vme interface does not accept any encapsulation options, and forces the use of unit 0, given that VLAN tagging is currently not supported. Once in place, any matching traffic received on the physical me0 interface at any switch member is automatically redirected to the vme.0 interface on the active VC master, regardless of the member switch on which the traffic ingresses. You can configure both an IPv4 and IPv6 address if needed; an advanced license is not required for IPv6 on the OoB management interface. The example shown here performs IPv4 address configuration for the vme.0 interface: [edit] lab@Vodka# edit interfaces [edit interfaces] lab@Vodka# set vme unit 0 family inet address 172.16.69.34/24 [edit interfaces] lab@Vodka# show vme unit 0 { family inet { address 172.16.69.34/24; } }
The result is a vme.0 interface instantiation on the current master RE. Note that nonmaster member switches do not display a vme.0 interface, and show their respective me0 interfaces as having no configuration. A later section details use of the no-management-vlan option to permit explicit IP addresses of a member switch’s me0 interface while part of a VC.
Don’t Use Both the vme and me0 Interfaces The 9.2R1.9 used in this book permitted explicit configuration of both the vme.0 and me0 interfaces. However, even when a different subnet was used, the presence of an IP address on the me0 interface prevents proper operation of the vme.0 interface. The me0 interface worked as expected. Be sure to remove any explicit me0 configuration when planning a VC with a virtual vme0 interface. This behavior may change as the code evolves: [edit] lab@Vodka# run show interfaces vme.0 Logical interface vme.0 (Index 8) (SNMP ifIndex 36) Flags: Link-Layer-Down SNMP-Traps Encapsulation: Unspecified Input packets : 82895 Output packets: 51005 Protocol inet, MTU: 1500 Flags: Is-Primary Addresses, Flags: Dest-route-down Is-Preferred Is-
218 | Chapter 4: EX Virtual Chassis Download at Boykma.Com
Primary Destination: 172.16.69/24, Local: 172.16.69.34, Broadcast: 172.16.69.255 [edit] lab@Vodka# delete interfaces me0 [edit] lab@Vodka# commit fpc0: configuration check succeeds fpc1: commit complete fpc0: commit complete [edit] lab@Vodka# run show interfaces vme.0 | match flags Flags: SNMP-Traps Encapsulation: Unspecified Flags: Is-Primary Addresses, Flags: Is-Preferred Is-Primary
Virtual chassis member parameters Most of the VC configuration parameters are found at the [edit virtual-chassis] hierarchy, as you might expect. The options are shown here with the command-line interface (CLI) help function: [edit virtual-chassis] lab@Vodka# set ? Possible completions: + apply-groups Groups from which to inherit configuration data + apply-groups-except Don't inherit configuration data from these groups > mac-persistence-timer How long to retain MAC address when member leaves virtual chassis > member Member of virtual chassis configuration preprovisioned Only accept preprovisioned members > traceoptions Global tracing options for virtual chassis
The mac-persistence-timer knob determines how long a new master continues to use the MAC address that was owned by the previous master. The default is 10 minutes, and can be set to 0 for an immediate switch or to some really long value so that the manual claims are unlimited. The goal is to avoid a MAC address change and the resulting reflooding/relearning, in the event that the old master’s departure is short-lived and it can return to operation without any external device being the wiser. The preprovisioned option establishes how deterministic you wish to be. When this is enabled, you must map each member switch’s serial number to a member ID and a specific role of either RE or LC. You cannot specify a member priority in a preprovisioned configuration. The priority is assigned based on a default mapping-to-member role (i.e., the RE role is assigned 129 while the LC role is assigned 0). In preprovisioned mode, a matching serial number must be found or the new member cannot become
Configuration, Operation, and Maintenance | 219 Download at Boykma.Com
part of the active VC topology. Note that a VCCP adjacency is still formed in this case, and the unwelcome switch will quickly be relegated to an LC role where it can do little damage. Note also that the virtual console/management functionality will not work from the non-provisioned switch, and its LSAs are ignored during SPF calculation, which effectively eliminates it from the active VC’s topology. By default, the VC configuration mode is considered non-provisioned, which is synonymous with the factory default in that no explicit VC configuration is required. The default VC mode permits the mapping of specific member IDs to a mastership priority value, but this mapping is not required. Member IDs with no mapping receive the default value of 128; you can prevent a member from being able to become the master or backup RE by assigning a value of 0. The highest priority of 255 should be assigned to the members that you wish to function as the master and backup REs. You cannot manually assign a VC member role, or specify a serial number when in nonprovisioned mode. The current best practice is to have both a master and a backup RE in each VC. When there are more than three VC members, the remaining members are forced into an LC role. Both of the candidate RE members are assigned the same priority, which is typically the highest possible value of 255. This is done to prevent RE mastership preemption in the case that a primary RE suffers a transient failure, such as a reboot, and is known as non-revertive behavior. When the old master comes back online, its equal priority setting prevents it from forcing another mastership change, which promotes general stability while allowing human intervention (e.g., logfile analysis) before the decision is made to revert to the original mastership roles, which can then be performed in a maintenance window.
In a non-provisioned mode, the master RE assigns the next sequential member ID (and any associated priority that is set in the configuration) to each member switch as it is attached to the VC and powered on. The new switch’s priority value is then used to determine its VC member role based on the mastership election algorithm. You control member ID assignment in this mode by powering up the member switches in the desired order so that each switch receives the next sequential (and desired) member ID. After the fact, you can still use the CLI to alter the membership values. The member subhierarchy houses the remaining VC configuration options: [edit virtual-chassis] lab@Vodka# set member 0 ? Possible completions: + apply-groups Groups from which to inherit configuration data + apply-groups-except Don't inherit configuration data from these groups mastership-priority Member's mastership priority (1..255) no-management-vlan Disable magagement VLAN role Member's role serial-number Member's serial number
220 | Chapter 4: EX Virtual Chassis Download at Boykma.Com
Here, you set parameters such as member ID to mastership priority when in nonprovisioned mode, or in preprovisioned mode by binding a serial number to either an RE or an LC role. A typical non-provisioned mode configuration is as follows: [edit virtual-chassis] lab@Vodka# show member 0 { mastership-priority 255; } member 1 { mastership-priority 255; } member 2 { mastership-priority 1; }
Note again that to make the priority values matter you must control member ID assignment via the power-on sequence or via CLI commands after things have settled. In this example, members 0 and 1 are the primary REs and member 1 could become an RE only in the event of both members 0 and 1 failing. You cannot assign a 0 priority in non-provisioned mode, which means all VC members are candidates to become the master RE. Here is a sample preprovisioned configuration: [edit virtual-chassis] lab@Vodka# show preprovisioned; member 1 { role routing-engine; serial-number BM0208269767; no-management-vlan; } member 0 { role routing-engine; serial-number BM0208269834; } member 2 { role line-card; serial-number BM0208269888; }
The preprovisioned keyword places the VC into non-default mode, where each member must be explicitly listed by serial number and allowed role. Priority assignments are now based on default values for the RE and LC roles. The example forces member 2 to function as an LC with a derived priority of 0, while members 0 and 1 can be REs. All candidate REs are assigned the same priority, leading to a non-revertive mode of operation.
VCEs The use of a front-panel uplink as a VCE is an optional aspect of a VC design. As noted previously, the rear-panel VCP ports simply work, and accept no user configuration. Anytime you attach cables to these ports, a VC will attempt to form.
Configuration, Operation, and Maintenance | 221 Download at Boykma.Com
By default, an uplink port does not run the VCCP; hence it is called an “uplink” and not a VCE port. You use the request virtual-chassis vc-port operational mode command to activate or deactivate VCCP/uplink mode on these ports: lab@Vodka# run request virtual-chassis vc-port ? Possible completions: delete Delete a member's virtual chassis port set Set a member's virtual chassis port
When performed in operational mode, these commands write the VCE port information into the affected switches’ private configuration, where it persists until removed. While in uplink mode the various ports are indexed as ge-id/1/n, where id is the switches’ member ID and n is the port number, which can range from 0 to 3, depending on uplink module type. Once placed into VCE mode, these same ports are renamed and become vcp-255/1/n, and the corresponding uplink port device is removed. This process is shown in the following code for a switch with member ID 0: lab@Vodka> show interfaces ge-0/1/0 terse Interface Admin Link Proto Local Remote ge-0/1/0 up up ge-0/1/0.0 up up eth-switch lab@Vodka> request virtual-chassis vc-port set pic-slot 1 port 0
Once placed into VCP mode, the previous uplink port is no longer available and a new VCP device is created: lab@Vodka> show interfaces ge-0/1/0 terse error: device ge-0/1/0 not found lab@Vodka> show interfaces vcp-255/1/0 terse Interface Admin Link Proto Local vcp-255/1/0 up up vcp-255/1/0.32768 up up
Remote
When you plan to use a VCE to attach a new switch to an existing VC, you should power up the new switch and configure both ends of the VCE (one end on the new switch, the other on an existing VC member) before you physically attach the new switch to the VC using the VCE link. This ensures that both ends agree to use VCCP over the shared link, and that proper VC topology discovery and member role determination is performed. Failing to perform these steps may cause master reelection and result in disruption to traffic forwarding until the VC topology stabilizes. Once a switch is part of a VC, additional VCE ports can be provisioned or removed through the master RE by adding the desired member ID to the request virtualchassis commands. In most cases the master RE will be member ID 0, but this is not mandatory. When a member ID is not specified, the local switch is assumed and the command is performed on the local master RE: lab@Vodka> request virtual-chassis vc-port set pic-slot 1 port 1 ? Possible completions:
Execute this command all-members Set virtual chassis port on all virtual chassis members
222 | Chapter 4: EX Virtual Chassis Download at Boykma.Com
local member . . .
Set virtual chassis port on local virtual chassis member Set virtual chassis port on specific virtual chassis member (0..9)
Using Synchronized Commits With the 9.2 version used in this book, it’s important that you perform a commit synchronize operation when you have made any changes to the virtual-chassis stanza on the master RE. Failing to do this can result in a member switch retaining the previous VC configuration, which causes the changes to not take effect. Later JUNOS versions may perform these operations without needing the synchronize option. Using synchronize is always recommended in a dual-RE environment, but in a VC it’s also needed when making VC-related changes, even when there is only one RE. Consider adding set system commit synchronize to your configuration to make every commit behave as though you added synchronize.
Virtual chassis configuration summary Well, that’s pretty much it; there really isn’t much to configuring a VC. In fact, if determinism is not your bag, you can just plug a bunch of EX4200s together using just about any VCP cabling scheme, and things will just work. With that said, you really should configure a virtual management address, and at a minimum map member IDs to priorities as part of a non-provisioned deployment, to ensure consistency across various reboot scenarios. Once a member is assigned it becomes sticky, meaning that the associated priority remains fixed across reboots and power-downs, which tends to ensure the same master, backup, and LC roles when all members are up and running. The next section details operational analysis and VC maintenance procedures.
Virtual Chassis Operation and Maintenance This section details commands and techniques used to perform operational analysis, troubleshooting, or VC moves and changes. The next section demonstrates most of these commands and techniques as part of a VC deployment case study. To help keep you interested, the material is presented in the context of a VC discovery task, in which your goal is to reverse-engineer a VC you know nothing about using only CLI operational mode show commands. We suggest you use a sheet of paper to diagram your discoveries as they are made. You start by displaying the VC configuration: [edit] regress@EX4200_VC_demo# show virtual-chassis [edit]
From the preceding code, note that you are dealing with a default virtual-chassis stanza, and therefore a non-provisioned deployment scenario. The lack of configuration details means there is not much more to be learned here, so let’s move along. Your Configuration, Operation, and Maintenance | 223 Download at Boykma.Com
VC discovery diagram remains largely blank, except that the name of the VC and its mode of deployment are known.
Operational mode commands with member context Several CLI commands support member-specific context when executed in a VC. Generally speaking, when the member argument is omitted, the command acts on the local master RE. Adding the all keyword ensures that a command runs on all members, and in similar fashion, specifying a specific member ID constrains the command to that member. For a complete list of VC member-aware commands, consult the JUNOS documentation matching the EX software release on your switch. For Release 9.2, this information is available at http://www.juniper.net/techpubs/en_US/junos9.2/topics/reference/general/ virtual-chassis-command-forwarding.html. Most of the CLI’s request system and show system commands support the member keyword. The reboot command is demonstrated: regress@EX4200_VC_demo > request system reboot ? Possible completions:
Execute this command all-members Reboot all virtual chassis members at Time at which to perform the operation in Number of minutes to delay before operation local Reboot local virtual chassis member media Boot media for next boot member Reboot specific virtual chassis member (0..9) message Message to display to all users other-routing-engine Reboot the other Routing Engine partition Partition on boot media to boot from | Pipe through a command regress@ EX4200_VC_demo > request system reboot member 1 Reboot the system ? [yes,no] (no) yes Rebooting fpc1 regress@ EX4200_VC_demo >
A show version command runs on all members by default, and is a good way to confirm software compatibility, as all VC members should run the same code and members with mismatched software versions are typically not allowed to actively join the VC: regress@EX4200_VC_demo> show version fpc0: -------------------------------------------------------------------Hostname: EX4200_VC_demo Model: ex4200-48t JUNOS Base OS boot [9.2R1.9] . . . fpc1: -------------------------------------------------------------------Hostname: -fpc1-BK Model: ex4200-48t
224 | Chapter 4: EX Virtual Chassis Download at Boykma.Com
JUNOS Base OS boot [9.2R1.9] . .
Notice that fpc1 has automatically been assigned a hostname that reflects its member ID (1) and its current VC role of BacKup (BK) RE. From the vacant configuration and its current backup status, you can deduce that fpc0 has a higher mastership priority, was powered on first, has been booted the longest, or simply has the lowest MAC address, as it has won the master election process. Further investigation shall reveal the truth. Your discovery diagram now shows a single VC, with two members, both as candidate masters. You can also add that both VC members are 48-port models, but there’s not much else to be learned here. The show chassis lcd command is a fine way to view the information displayed on the EX’s LCD panel, assuming you are not around to gaze upon its cheery countenance directly: regress@EX4200_VC_demo> show chassis lcd fpc-slot 0 Front panel contents for slot: 0 --------------------------------LCD screen: 00:RE EX4200_VC_ LED:SPD ALARM 00 LEDs status: Alarms LED: Off Status LED: Green Master LED: Green Interface LED(ADM/SPD/DPX/POE) ------------------------------------ge-0/0/0 On:3 blinks per sec ge-0/0/1 On:3 blinks per sec . . .
The information displayed confirms that slot 0 is the active RE, the model number, and that no alarm-level events have been detected. The port status shows that the port is up, but shows no activity (the first LED is on), and that the port is in 1,000 Mbps mode (three blinks per second).
VC monitoring commands Use the show virtual-chassis command to obtain VC-specific information. Given your current task, this seems a fine place to explore: regress@EX4200_VC_demo> show virtual-chassis ? Possible completions:
Execute this command active-topology Virtual chassis active topology member-config Show virtual chassis member configuration from specified member protocol Show virtual chassis protocol information status Virtual chassis information vc-port Virtual chassis port information | Pipe through a command
Configuration, Operation, and Maintenance | 225 Download at Boykma.Com
Note that the full range of command options is available only at the master RE. NonRE switches run only a subset of the JUNOS processes, and therefore support a subset of the commands shown here for a master RE. Your discovery proceeds with a display of VC ports: regress@EX4200_VC_demo> show virtual-chassis vc-port fpc0: --------------------------------------------------------------------Interface Type Status or PIC / Port vcp-0 Dedicated Up vcp-1 Dedicated Down fpc1: --------------------------------------------------------------------Interface Type Status or PIC / Port vcp-0 Dedicated Up vcp-1 Dedicated Down
The display tells you a few things. It seems that neither member has any VCE ports defined, given that only VCP port-related information is displayed. Also, each member switch is showing a single VCP port in the Up state, indicating that the two switches are attached in a serial VCP chain, which in this case is attached to the VCP 0 port on both members. Additional information is displayed to confirm that VCCP packets are being sent and received over member 0’s VCP 0 interface: regress@EX4200_VC_demo> show virtual-chassis vc-port statistics vcp-0 member 0
Member ID: 0
Port: vcp-0
Total octets: Total packets:
RX 20807032 77187
TX 7654180 67757
Note that show virtual-chassis and show virtual-chassis status commands are synonymous in this release: regress@EX4200_VC_demo> show virtual-chassis Virtual Chassis ID: 3f04.fea3.76b3 Mastership Member ID Status Serial No Model priority Role 0 (FPC 0) Prsnt BP0208207200 ex4200-48t 128 Master* 1 (FPC 1) Prsnt BP0208207201 ex4200-48t 128 Backup
Neighbor List ID Interface 1 vcp-0 0 vcp-0
Member ID for next new member: 2 (FPC 2)
There’s some real gold here. You see confirmation of member ID assignment, member operational status, and serial number (handy, as this information is needed for a preprovisioned deployment); the mastership priority (set to default for non-provisioned mode); the member’s role within the VC; and the member’s adjacency status. In this 226 | Chapter 4: EX Virtual Chassis Download at Boykma.Com
example, you see that member 0 connects to member 1 using VCP 0, which meshes nicely with your discoveries to date. Also note that the master switch plans to assign member ID 2 to the next switch that successfully joins this VC. The active-topology switch displays the results of the VCCP that operates between EX-PFEs to ensure optimal paths and loop-free switching among all member switches. The active-topology option is available only on the master RE because LC members do not run any switching/routing daemons: regress@EX4200_VC_demo> show virtual-chassis active-topology Destination ID Next-hop 1(vcp-0)
Wow, this is somewhat of a letdown, especially if you have ever had to wade through the route table of an Internet router sporting several full Border Gateway Protocol (BGP) routing feeds. Still, this is a simple two-node VC with a single interconnection link, and therefore the active topology consists of Switch 0 connected to Switch 1, with a single link, as displayed.
Monitor the VC control protocol The show virtual-chassis protocol command has several arguments that help get to the meat of a VC’s operation: regress@EX4200_VC_demo> show virtual-chassis protocol ? Possible completions: adjacency Show virtual chassis adjacency database database Show virtual chassis link-state database interface Show virtual chassis protocol interface information route Show virtual chassis routing table statistics Show virtual chassis performance statistics
As with any LS protocol, displaying adjacency status is always a good place to start when performing operational analysis.
A Word on VCCP and IS-IS VCCP is a proprietary adaptation of the IS-IS routing protocol. Therefore, knowing ISIS operation definitely helps in your understanding of VCCP. A complete description of IS-IS operation is beyond the scope of this book. Suffice it to say that IS-IS has traditionally served as an Interior Gateway Protocol (IGP) for the IPv4 and IPv6 (and even ISO/CNLS) protocols in large service provider or government networks. IS-IS uses hellos to discover and maintain adjacencies and reliably floods LSPs that are stored in a replicated LSDB among all routers in the same level. Each IS-IS node then computes a shortest path from itself to all other IS-IS nodes to form an RT. Unlike IP, IS-IS routers do not assign an address to each interface; instead, a single system-level ID, called a Network Entity Title (NET), is used to represent each node in the level. IS-IS uses a Designated Intermediate System (DIS) concept similar to OSPF’s Designated Router (DR); however, all stations on a shared LAN form an adjacency with each Configuration, Operation, and Maintenance | 227 Download at Boykma.Com
other, which differs from OSPF, where DR-other routers see each other as neighbors but form an adjacency only with the LAN’s DS and BDRs (Designated and Backup Designated Routers). IS-IS supports levels, which are somewhat analogous to OSPF’s areas, provide hierarchy routing. The nature of IS-IS is to use an easily extensible type length value (TLV) format that often results in it being used as a mule, in that it transports information that is opaque to the IS-IS protocol itself. The inherent transport flexibility, combined with its addressper-node rather than per-interface model, allowed Juniper to leverage its prior IS-IS development work for VCCP. This is good, as Juniper’s IS-IS implementation is proven to offer high performance while also being robust and reliable.
This display shows several VCCP adjacencies, and the good news is they are all up: regress@EX4200_VC_demo> show virtual-chassis protocol adjacency fpc0: -----------------------------------------------------------------Interface System State Hold (secs) internal-0/24 001f.1234.8842 Up 65535 internal-1/25 001f.1234.8842 Up 65535 internal-2/24 001f.1234.8840 Up 65535 internal-2/27 001f.1234.8841 Up 65535 vcp-0 001f.1234.7dc0 Up 58 ] fpc1: -----------------------------------------------------------------Interface System State Hold (secs) internal-0/24 001f.1234.7dc2 Up 65535 internal-1/25 001f.1234.7dc2 Up 65535 internal-2/24 001f.1234.7dc0 Up 65535 internal-2/27 001f.1234.7dc1 Up 65535 vcp-0 001f.1234.8840 Up 58
At first glance, this output may seem odd. Where did all these devices and interfaces come from? You can find the answer, in part, in Chapter 3. Recall that an EX4200-48 comprises three EX-PFEs, with each PFE dividing the work associated with front-panel, uplink, and VC ports. Each PFE has an internal device ID and an associated MAC address that serves as its VCCP system ID. By default, the EX itself is represented by the lowest-numbered PFE, which effectively functions as the DIS for the internal LAN connections. Each PFE has both internal links and external links to other PFEs, with the latter in the form of VCE or VCP ports. Looking in detail at fpc0, we see a total of five adjacencies, only one of which is to an external PFE, in this case reachable over the VCP-0 port. The remaining adjacencies must therefore represent internal PFE connections, and in fact this is found to be the case given the internal interface designations. Although you could make some discovery diagram updates based on the adjacency information, you opt to take the next analysis step by displaying the VCCP LSDB. In this example, the LSDB is displayed for switch member 1 only; given that all members 228 | Chapter 4: EX Virtual Chassis Download at Boykma.Com
have an identical LSDB when things are working, it should not matter which copy you view: regress@EX4200_VC_demo> show virtual-chassis protocol database member 0 fpc0: ---------------------------------------------------------------------LSP ID Sequence Checksum Lifetime 001f.1234.7dc0.00-00 0xa7c 0xe1e9 116 001f.1234.7dc1.00-00 0x31b 0xb393 114 001f.1234.7dc2.00-00 0x315 0xaceb 115 001f.1234.8840.00-00 0xa6e 0x701c 117 001f.1234.8841.00-00 0x31b 0x869c 111 001f.1234.8842.00-00 0x318 0x4d99 112 6 LSPs
The results show there are six LSPs. This makes sense, given that there are six EX-PFEs in this VC, and each runs a VCCP instance, and therefore each forms adjacencies with its neighbor PFEs and floods LSPs as a result. Based on this information, your VC discovery diagram begins to take the shape of a network consisting of two LAN segments (one per member switch), each with three VCCP entities (one per EX-PFE), which are in turn connected by a serial link (VCP-0). The extensive switch is used to display as much VCCP LSDB information as Juniper sees fit to make available. The display is taken from member 1, in part to show it has the same database entries as did member 0. Note that some TLVs are not completely decoded.... How mysterious! regress@EX4200_VC_demo> show virtual-chassis protocol database extensive member 1 | no-more fpc0: --------------------------------------------------------------------001f.1234.7dc0.00-00 Sequence: 0xa3a, Checksum: 0x49ed, Lifetime: 117 secs Neighbor: 001f.1234.7dc2.00 Interface: internal-0/24 Metric: 10 Neighbor: 001f.1234.8840.00 Interface: vcp-0 Metric: 10 Header: LSP ID: 001f.1234.7dc0.00-00, Length: 356 bytes Allocated length: 1492 bytes, Remaining lifetime: 117 secs, Interface: 0 Estimated free bytes: 1075, Actual free bytes: 1136 Aging timer expires in: 117 secs Packet: LSP ID: 001f.1234.7dc0.00-00, Length: 356 bytes, Lifetime : 118 secs Checksum: 0x49ed, Sequence: 0xa3a, Fixed length: 27 bytes, Version: 1, Sysid length: 0 bytes Packet type: 18, SW version: 9.2 TLVs: Node Info: Member ID: 1, VC ID: 3f04.fea3.76b3, Flags: 1, Priority: 128 System ID: 001f.1234.7dc0, Device ID: 3 System ID: 001f.1234.7dc1, Device ID: 4 System ID: 001f.1234.7dc2, Device ID: 5 Neighbor Info: 001f.1234.7dc2.00, Interface: internal-0/24, Metric: 10
Configuration, Operation, and Maintenance | 229 Download at Boykma.Com
Neighbor Info: 001f.1234.8840.00, Interface: Unknown TLV, Type: 24, Length: 1 Unknown TLV, Type: 28, Length: 112 No queued transmissions
vcp-0, Metric: 10
001f.1234.7dc1.00-00 Sequence: 0x307, Checksum: 0x1deb, Lifetime: 111 secs Neighbor: 001f.1234.7dc2.00 Interface: internal-1/25 Metric: 10 Header: LSP ID: 001f.1234.7dc1.00-00, Length: 195 bytes Allocated length: 1492 bytes, Remaining lifetime: 111 secs, Interface: 0 Estimated free bytes: 1233, Actual free bytes: 1297 Aging timer expires in: 111 secs Packet: LSP ID: 001f.1234.7dc1.00-00, Length: 195 bytes, Lifetime : 118 secs Checksum: 0x1deb, Sequence: 0x307, Fixed length: 27 bytes, Version: 1, Sysid length: 0 bytes Packet type: 18, SW version: 9.2 TLVs: Node Info: Member ID: 1, VC ID: 3f04.fea3.76b3, Flags: 1, Priority: 128 System ID: 001f.1234.7dc0, Device ID: 3 System ID: 001f.1234.7dc1, Device ID: 4 System ID: 001f.1234.7dc2, Device ID: 5 Neighbor Info: 001f.1234.7dc2.00, Interface: internal-1/25, Metric: 10 No queued transmissions 001f.1234.7dc2.00-00 Sequence: 0x301, Checksum: 0x1644, Lifetime: 111 secs Neighbor: 001f.1234.7dc0.00 Interface: internal-2/24 Metric: 10 Neighbor: 001f.1234.7dc1.00 Interface: internal-2/27 Metric: 10 Header: LSP ID: 001f.1234.7dc2.00-00, Length: 239 bytes Allocated length: 1492 bytes, Remaining lifetime: 111 secs, Interface: 0 Estimated free bytes: 1188, Actual free bytes: 1253 Aging timer expires in: 111 secs Packet: LSP ID: 001f.1234.7dc2.00-00, Length: 239 bytes, Lifetime : 118 secs Checksum: 0x1644, Sequence: 0x301, Fixed length: 27 bytes, Version: 1, Sysid length: 0 bytes Packet type: 18, SW version: 9.2 TLVs: Node Info: Member ID: 1, VC ID: 3f04.fea3.76b3, Flags: 1, Priority: 128 System ID: 001f.1234.7dc0, Device ID: 3 System ID: 001f.1234.7dc1, Device ID: 4 System ID: 001f.1234.7dc2, Device ID: 5 Neighbor Info: 001f.1234.7dc0.00, Interface: internal-2/24, Metric: 10 Neighbor Info: 001f.1234.7dc1.00, Interface: internal-2/27, Metric: 10 No queued transmissions 001f.1234.8840.00-00 Sequence: 0xa2e, Checksum: 0xaa09, Lifetime: 116 secs Neighbor: 001f.1234.7dc0.00 Interface: vcp-0 Metric: 10 Neighbor: 001f.1234.8842.00 Interface: internal-0/24 Metric: 10
230 | Chapter 4: EX Virtual Chassis Download at Boykma.Com
Header: LSP ID: 001f.1234.8840.00-00, Length: 542 bytes Allocated length: 542 bytes, Remaining lifetime: 116 secs, Interface: 26 Estimated free bytes: 42, Actual free bytes: 0 Aging timer expires in: 116 secs Packet: LSP ID: 001f.1234.8840.00-00, Length: 542 bytes, Lifetime : 118 secs Checksum: 0xaa09, Sequence: 0xa2e, Fixed length: 27 bytes, Version: 1, Sysid length: 0 bytes Packet type: 18, SW version: 9.2 TLVs: Node Info: Member ID: 0, VC ID: 3f04.fea3.76b3, Flags: 3, Priority: 128 System ID: 001f.1234.8840, Device ID: 0 System ID: 001f.1234.8841, Device ID: 1 System ID: 001f.1234.8842, Device ID: 2 Neighbor Info: 001f.1234.8842.00, Interface: internal-0/24, Metric: 10 Neighbor Info: 001f.1234.7dc0.00, Interface: vcp-0, Metric: 10 Master Info: System ID: 001f.1234.8840 Backup Info: System ID: 001f.1234.7dc0 Member Info: System ID: 001f.1234.7dc0, Member ID: 1 Member role: Backup System ID: 001f.1234.7dc0, Device ID: 3 System ID: 001f.1234.7dc1, Device ID: 4 System ID: 001f.1234.7dc2, Device ID: 5 Member Info: System ID: 001f.1234.8840, Member ID: 0 Member role: Master System ID: 001f.1234.8840, Device ID: 0 System ID: 001f.1234.8841, Device ID: 1 System ID: 001f.1234.8842, Device ID: 2 Unknown TLV, Type: 24, Length: 1 Unknown TLV, Type: 28, Length: 112 No queued transmissions 001f.1234.8841.00-00 Sequence: 0x308, Checksum: 0x11cd, Lifetime: 111 secs Neighbor: 001f.1234.8842.00 Interface: internal-1/25 Metric: 10 Header: LSP ID: 001f.1234.8841.00-00, Length: 195 bytes Allocated length: 284 bytes, Remaining lifetime: 111 secs, Interface: 26 Estimated free bytes: 89, Actual free bytes: 89 Aging timer expires in: 111 secs Packet: LSP ID: 001f.1234.8841.00-00, Length: 195 bytes, Lifetime : 118 secs Checksum: 0x11cd, Sequence: 0x308, Fixed length: 27 bytes, Version: 1, Sysid length: 0 bytes Packet type: 18, SW version: 9.2 TLVs: Node Info: Member ID: 0, VC ID: 3f04.fea3.76b3, Flags: 3, Priority: 128 System ID: 001f.1234.8840, Device ID: 0 System ID: 001f.1234.8841, Device ID: 1 System ID: 001f.1234.8842, Device ID: 2 Neighbor Info: 001f.1234.8842.00, Interface: internal-1/25, Metric: 10 No queued transmissions 001f.1234.8842.00-00 Sequence: 0x305, Checksum: 0xfaa2, Lifetime: 115 secs
Configuration, Operation, and Maintenance | 231 Download at Boykma.Com
Neighbor: 001f.1234.8840.00 Neighbor: 001f.1234.8841.00
Interface: internal-2/24 Metric: Interface: internal-2/27 Metric:
10 10
Header: LSP ID: 001f.1234.8842.00-00, Length: 239 bytes Allocated length: 284 bytes, Remaining lifetime: 115 secs, Interface: 26 Estimated free bytes: 45, Actual free bytes: 45 Aging timer expires in: 115 secs Packet: LSP ID: 001f.1234.8842.00-00, Length: 239 bytes, Lifetime : 118 secs Checksum: 0xfaa2, Sequence: 0x305, Fixed length: 27 bytes, Version: 1, Sysid length: 0 bytes Packet type: 18, SW version: 9.2 TLVs: Node Info: Member ID: 0, VC ID: 3f04.fea3.76b3, Flags: 3, Priority: 128 System ID: 001f.1234.8840, Device ID: 0 System ID: 001f.1234.8841, Device ID: 1 System ID: 001f.1234.8842, Device ID: 2 Neighbor Info: 001f.1234.8840.00, Interface: internal-2/24, Metric: 10 Neighbor Info: 001f.1234.8841.00, Interface: internal-2/27, Metric: 10 No queued transmissions
The display is rather long, but also largely repetitive. We highlighted the key points. For example, within each switch, the PFE with the lowest MAC address serves as the primary system ID. For switch member 0, this is 001f.1234.8840, which is lower than both 001f.1234.8841 and 001f.1234.8842. This PFE acts as the DIS for the internal network by advertising the list of internal device (PFE) IDs along with their adjacent neighbors. The master RE places additional information into its LSPs that details the role of each VC member. This information represents the results of mastership election, and is used to confirm how each member switch should operate. Each LSP also reports the software version that it’s running. This information is used to detect software incompatibilities among VC members. Figure 4-15 represents the result of your VC discovery exercise. Considering that no details were originally provided, it’s clear you can learn a lot about a VC’s operation (or lack thereof when it’s broken), using the provided CLI commands and tracing tools. Figure 4-15 shows that switch member 0 is the master, and that it contains three EX-PFEs. The lowest-numbered PFE MAC address is used as the system identifier, and is shown in the truncated form of 8840. Each internal link, which is numbered based on PFE ID, has a pair of adjacent PFEs, which accounts for four of the five adjacencies shown within each switch. The fifth adjacency is via the external VCP0 connection to member 1.
232 | Chapter 4: EX Virtual Chassis Download at Boykma.Com
Figure 4-15. VC discovery: the result
The LSDB information indicates that member 0 is the current master and member 1 is a backup master. Similar information is deduced for switch member 1, using the same combination of CLI commands and LSDB analyses. Based on the number of LSPs generated by member 1, you can conclude that it is a three-PFE system, for example. This information allows the complete VC internal topology to be documented in Figure 4-15.
VC tracing Tracing the operation of a VC is an excellent way to learn more about its operation and to troubleshoot problems when things don’t go according to plan. The discovery VC is updated with the following tracing configuration: [edit] regress@EX4200_VC_demo# show virtual-chassis
Configuration, Operation, and Maintenance | 233 Download at Boykma.Com
traceoptions { file vc_trace; flag hello; flag lsp; flag me; flag error; flag psn; flag csn; }
In the trace config, the me flag traces master election. The error flag should call out any errors, and the hello, lsp, and sequence number (psn/csn) flags result in tracing hello packet exchanges, LSP flooding, and sequence number exchanges, respectively. Note that in IS-IS, DIS and non-DIS nodes periodically send CSN and PSN packets (respectively) to perform LSP acknowledgment. After committing, the vc_trace logfile is monitored as the virtual-chassis process is restarted, which is a good way to shake VC things up: regress@EX4200_VC_demo> monitor start vc_trace regress@EX4200_VC_demo> restart virtual-chassis-control *** vc_trace *** Oct 5 14:35:28.207928 TASK_SIGNAL_TERMINATE: first termination signal received Oct 5 14:35:28.208897 Oct 5 14:35:28.208897 VCCPD_PROTOCOL_ADJDOWN: Lost adjacency to 001f.1234.8842 on internal-0/24, . . . Oct 5 14:35:28.514872 vccpd_provision_cfg_apply: pre_provisioned_cfg 0 . . . Oct 5 14:35:28.517918 internal-0/24 Oct 5 14:35:28.517918 Oct 5 14:35:28.518292 Oct 5 14:35:28.518292 internal-2/27 Oct 5 14:35:28.518292 Oct 5 14:35:28.518700 Oct 5 14:35:28.518700 internal-2/24 . . . Oct 5 14:35:28.525734 Oct 5 14:35:28.525787 Oct 5 14:35:28.527487 Oct 5 14:35:28.527620 Oct 5 14:35:28.527663 Oct 5 14:35:28.528845 Oct 5 14:35:28.529222 . . . Oct Oct Oct
VCCPD_PROTOCOL_ADJUP: New adjacency to 001f.1234.8842 on
VCCPD_PROTOCOL_ADJUP: New adjacency to 001f.1234.8841 on
VCCPD_PROTOCOL_ADJUP: New adjacency to 001f.1234.8840 on
Sending PTP IIH on vcp-0.32768 packet length 1492 Received PTP IIH, source id 001f.1234.7dc0 on vcp-0.32768 Sending PTP IIH on vcp-0.32768 packet length 1492 Received PTP IIH, source id 001f.1234.7dc0 on vcp-0.32768
5 14:35:28.547225 isis_install_lsp: starting me link election 5 14:35:28.547282 vccpd_run_me_link_election: found 1 members 5 14:35:28.547304 member: id 0, role 5, link 0, me_ifl 0, bme_ifl 0
234 | Chapter 4: EX Virtual Chassis Download at Boykma.Com
Oct 5 14:35:28.547376 vccpd_run_me_link_election: me_link_owner is 65535 Oct 5 14:35:28.547399 vccpd_run_me_link_election: my member role 5 . . .
The truncated output shows the detection of a non-provisioned installation, the formation of new adjacencies, and the exchange of VCCP hello packets, which are displayed as IIH (which stands for Intermediate System to Intermediate System Hello, by the way). The capture also shows the beginnings of the chassis mastership election process. The mastership election process is traced with all other flags removed to reduce clutter. Recall that at the time the VC process was restarted, FPC0 was acting as the backup RE: . . . Oct 5 14:49:44.261942 vccpd_run_me_link_election: found 1 members Oct 5 14:49:44.262000 member: id 0, role 5, link 0, me_ifl 0, bme_ifl 0 Oct 5 14:49:44.262019 vccpd_run_me_link_election: me_link_owner is 65535 Oct 5 14:49:44.262040 vccpd_run_me_link_election: my member role 5 Oct 5 14:49:44.293543 isis_run_me Oct 5 14:49:44.293604 isis_run_me: starting exit_vc_mode_startup timer Oct 5 14:49:44.293636 Oct 5 14:49:44.348031 Oct 5 14:49:44.348089 Oct 5 14:49:44.348109 Oct 5 14:49:44.348129 Oct 5 14:49:44.348363 Oct 5 14:49:44.348390 Oct 5 14:49:44.348409 Oct 5 14:49:44.348428 Oct 5 14:49:44.348660 Oct 5 14:49:44.348687 Oct 5 14:49:44.348706 Oct 5 14:49:44.348725 Oct 5 14:49:44.404440 Oct 5 14:49:44.404499 Oct 5 14:50:24.293693 vc_mode_line_card
exit_vc_mode_startup timer running, exit ME vccpd_run_me_link_election: found 1 members member: id 0, role 5, link 0, me_ifl 0, bme_ifl 0 vccpd_run_me_link_election: me_link_owner is 65535 vccpd_run_me_link_election: my member role 5 vccpd_run_me_link_election: found 1 members member: id 0, role 5, link 0, me_ifl 0, bme_ifl 0 vccpd_run_me_link_election: me_link_owner is 65535 vccpd_run_me_link_election: my member role 5 vccpd_run_me_link_election: found 1 members member: id 0, role 5, link 0, me_ifl 0, bme_ifl 0 vccpd_run_me_link_election: me_link_owner is 65535 vccpd_run_me_link_election: my member role 5 isis_run_me exit_vc_mode_startup timer running, exit ME isis_exit_vc_mode_startup: mastership mode to
At this time, FPC0 has returned to the default LC role, where it waits to determine whether any master REs are present: regress@EX4200_VC_demo> show virtual-chassis Virtual Chassis ID: 3f04.fea3.76b3 Member ID 0 (FPC 0)
Status Prsnt
Mastership Neighbor List Serial No Model priority Role ID Interface BP0208207200 ex4200-48t 128 Linecard*
The tracing continues: Oct Oct Oct Oct 1>5
5 5 5 5
14:50:24.294832 isis_run_me 14:50:24.294889 001f.1234.7dc0.00 selected as master 14:50:24.295008 001f.1234.8840.00 selected as backup 14:50:24.295034 001f.1234.7dc0.00 over 001f.1234.8840.00 vc_mode_master
Configuration, Operation, and Maintenance | 235 Download at Boykma.Com
Oct 1>5 Oct Oct
5 14:50:24.295058
001f.1234.7dc0.00 over 001f.1234.8840.00 vc_mode_master
5 14:50:24.295162 Assignment: role-2, mid-0, devs-3, devid1-0, devid2-1 5 14:50:24.295193 mastership mode changed from line_card to backup
Oct 5 Oct 5 Oct 5 Oct 5 Oct 5 Oct 5 Oct 5 Oct 5 Oct 5 . . .
14:50:24.295291 14:50:24.295321 14:50:24.295342 14:50:24.295362 14:50:24.295381 14:50:24.295401 14:50:24.396111 14:50:24.396204 14:50:24.396231
isis_run_me: starting me link election vccpd_run_me_link_election: found 2 members member: id 1, role 1, link 1, me_ifl 0, bme_ifl 0 member: id 0, role 5, link 0, me_ifl 0, bme_ifl 0 vccpd_run_me_link_election: me_link_owner is 1 vccpd_run_me_link_election: my member role 5 isis_run_me 001f.1234.7dc0.00 selected as master 001f.1234.8840.00 selected as backup
At the end, FPC0 transitions from LC to backup RE role; given that the current master RE never restarted, its uptime was higher, and therefore it was not preempted. Had both FPCs restarted, the result would be the same, as the tiebreaker is the lowest MAC address, which again favors FPC0 in this example.
VC maintenance Maintaining a VC is much like maintaining a standalone router or switch. As noted previously, many operational commands have a member context to allow execution on one or all VC members. When performing a reboot or shutdown operation, you should factor the potential effects of mastership transitions in the event of only some VC members being rebooted. As a general rule, it’s always best to reboot or shut down all members of a VC at the same time, especially when not using a preprovisioned mode: lab@Vodkila> request system halt all-members warning: This command will halt all the members. If planning to halt only one member use the member option Halt the system ? [yes,no] (no) yes Halting fpc0 *** FINAL System shutdown message from lab@Vodkila *** System going down IMMEDIATELY *** FINAL System shutdown message from lab@Vodkila *** System going down IMMEDIATELY Shutdown NOW! [pid 677]
You can perform software upgrades or downgrades on selected members by adding the appropriate member switch to the request system software command. Future releases may offer automatic software download to members with a mismatched version. In the current release, the user is responsible for ensuring version compatibility:
236 | Chapter 4: EX Virtual Chassis Download at Boykma.Com
regress@EX4200_VC_demo> request system software add jinstall-ex-9.2R1.9-domesticsigned.tgz member ? Possible completions:
Install package on VC Member (0..9) regress@EX4200_VC_demo> ...install-ex-9.2R1.9-domestic-signed.tgz member 1 Pushing bundle to fpc1 WARNING: A reboot is required to install the software WARNING: Use the 'request system reboot' command immediately
VC adds, moves, and changes There are a few scenarios where a VC member switch may be removed from the VC. In some cases, the switch is taken away, never to return, resulting in a smaller VC. In other cases, a switch may be removed temporarily—for example, to have repair actions performed after a hardware failure. In yet other cases, one member switch may be replaced with a different switch—for example, swapping out a 24-port model with a 48-port version. In all of these cases, you should understand the default member ID assignment function, and how CLI commands are used to alter and control member IDs. By default, a switch member writes its ID into a private area of its configuration, and this value is retained through removal and reinsertion events. To prevent conflicts, the master RE retains a list of all assigned values and assigns the next highest available value when a new switch joins the VC. Use the request virtual-chassis recycle command when a switch is removed from a VC to free up a previously assigned member ID, thus making it available for use by another switch. Use the request virtual-chassis renumber command to change a member’s current assignment to a new value; an error is returned if the new value is currently in use. It’s a best practice to assign member ID 0 to the primary master RE, and then number all switches sequentially based on their vertical or horizontal placement relative to member 0. If you assume a three-member VC, you would thus have switch IDs 0, 1, and 2 assigned. If switch member 1 is to be removed from the VC for good, you perform these actions, which are not disruptive to the VC’s overall operation: 1. Power down and remove Switch 1 (the second switch). Adjust the cabling to account for its loss. 2. Use the request virtual-chassis renumber member-id 2 new-member-id 1 command to maintain best-practice sequential numbering. Note that as a result of a member ID change, you will need to update the master’s interface configuration to reflect the new member ID, which recalls functions such as the FPC component in a traditional JUNOS interface name. The CLI conveniently warns the user of this necessity, and even offers sample syntax to make the job easier:
Configuration, Operation, and Maintenance | 237 Download at Boykma.Com
lab@switch> request virtual-chassis renumber member-id 1 new-member-id 2 To move configuration specific to member ID 1 to member ID 2, please use the replace command. e.g. replace pattern ge-1/ with ge-2/ Do you want to continue ? [yes,no] (no)no
In typical JUNOS software fashion, you can configure interfaces that relate to a VC switch member that has not yet been attached. Such a configuration is simply ignored until the related hardware is present, at which point the related configuration is activated.
To replace switch member 1 with a new switch that is intended to take over its role in the VC, perform the following steps: 1. Power down and remove Switch 1 (the second switch). 2. Load the default config on the replacement switch, power it down, and attach it to the VC. 3. Apply power to the new switch. The new switch receives the next available member ID, which will be 3 in this example. Use the request virtual-chassis renumber member-id 3 new-member-id 1 command to reassign the member ID to 1, the value that is associated with the switch being replaced. When using preprovisioned mode, you will need to update the configuration to reflect the serial number of the replacement switch before it can join the VC. At this point, the previous commands are used to reassign the member ID as desired.
Connecting to non-master members You can use the request session member command to connect to a non-master switch member using an internal communications path. This command operates regardless of whether you have configured the no-management-vlan option for that member switch. This capability can be useful when you are troubleshooting an issue with a specific VC member and wish to view its private configuration or view its local operational status.
Using the no-management-vlan option In most cases, you will assign a virtual management address that redirects your session from any management port to the VC’s current master. You can alter this behavior and assign explicit me0 OoB management addresses to the master and backup REs so that you can access each simultaneously. Note that configuring the me0 interface disables the vme0 functionality.
238 | Chapter 4: EX Virtual Chassis Download at Boykma.Com
In either case, you may want to access the OoB port of an LC member without having to connect to the master and then request a session. This capability is also useful during VC communications failures that may prevent you from connecting through the master switch. In addition to specifying the no-management-vlan option for the desired member, you must also access a root shell on the desired member switch so that you can assign an IP address to the me0 interface using the ifconfig command. Note that in the current release you cannot use the CLI to assign an me0 address to an LC member in a VC. Although this procedure also works for a backup RE, it’s not needed because you can use the CLI on a master or backup master to assign an me0 address. The process is demonstrated here, but is performed on a backup RE as the demonstration VC has only two members, and neither is in the LC role: [edit virtual-chassis] regress@EX4200_VC_demo# set member 1 no-management-vlan [edit virtual-chassis] regress@EX4200_VC_demo# show member 1 { no-management-vlan; } [edit virtual-chassis] regress@EX4200_VC_demo# commit synchronize fpc0: configuration check succeeds fpc1: commit complete fpc0: commit complete
You start by placing the no-management-vlan option into effect for member 1. Note the use of commit synchronize to push the change to other members, in this case member 1. Next, request a session to member 1. Note that you cannot use the console to perform this operation because of virtual console redirection, which places you right back at the master, unless a communications problem prevents the redirection, in which case you are presented with a local login prompt: [edit virtual-chassis] regress@EX4200_VC_demo# run request session member 1 € --- JUNOS 9.2R1.9 built 2008-08-05 07:25:22 UTC regress@EX4200_VC_demo-fpc1-BK> show interfaces terse me0 Interface Admin Link Proto Local me0 up up me0.0 up up eth-switch
Remote
regress@EX4200_VC_demo-fpc1-BK> show interfaces terse vme0 error: device vme0 not found
Configuration, Operation, and Maintenance | 239 Download at Boykma.Com
Once you are connected, the CLI confirms that no me0 or vme0 interface address is currently assigned. To run ifconfig, you must access a root shell: regress@EX4200_VC_demo-fpc1-BK> start shell % su Password:
As root, the ifconfig command is used to assign and then display an IPv4 address to the me0 device: root@EX4200_VC_demo-fpc1-BK% ifconfig me0.0 add inet 172.69.16.6 netmask 255.255.255.0 root@EX4200_VC_demo-fpc1-BK% ifconfig me0 me0: encaps: ether; framing: ether flags=0x3/0x8000 curr media: i802 0:1f:12:34:7e:3e me0.0: flags=0x8000 inet primary mtu 1500 local=172.69.16.6 dest=172.69.16.0/24 bcast=172.69.16.255 primary mtu 0 root@EX4200_VC_demo-fpc1-BK% exit %exit
The root shell is exited and the CLI at member 1 confirms that the address is in effect: regress@EX4200_VC_demo-fpc1-BK> show interfaces me0 Physical interface: me0, Enabled, Physical link is Up Interface index: 1, SNMP ifIndex: 33 Type: Ethernet, Link-level type: Ethernet, MTU: 1514, Speed: 100mbps . . . Addresses, Flags: Is-Preferred Is-Primary Destination: 172.69.16/24, Local: 172.69.16.6, Broadcast: 172.69.16.255 Protocol eth-switch, MTU: 0 Flags: Is-Primary
The result of all this is the ability to telnet or SSH directly to VC member 1 using the assigned 172.16.69.6 address. Once you are connected, the lack of management VLAN prevents redirection to the current master RE, thereby allowing you to work on the member switch directly. Generally speaking, this capability is used for specific troubleshooting or fault isolation procedures. For example, if a new JUNOS software bundle cannot be pushed from the master RE to some switch member using the internal communications paths, perhaps due to a software version issue, you may need to FTP a matching software bundle directly to a switch member. Without the no-managementvlan option, you can FTP only to the active or backup REs, and this is possible only when you are not using a virtual management interface. When you are using a virtual management interface, you can FTP only to the active RE.
Configuration, Operation, and Maintenance Summary The EX4200 VC does not require any explicit configuration to just work, out of the box, so to speak. The use of uplink ports as a VC extension does require explicit
240 | Chapter 4: EX Virtual Chassis Download at Boykma.Com
configuration, however. There are two main options when deploying a VC: the nonprovisioned and preprovisioned modes. The former, which can use a factory default, can also include a member ID to priority mapping, which, given the sticky nature of member IDs, helps to promote stability of the original VC configuration through reboots and power-down events. The current best practice is to use preprovisioned mode, which explicitly maps member serial numbers to a desired VC role. This mode provides maximum determinism, and also security, in that a switch must be preconfigured as a member before it is allowed to actively join the VC. The operation and maintenance of a VC is much like that of any standalone EX, which is the beauty of the design. Various operational mode commands exist to specifically monitor and control VC operation, and many support a member context to allow global versus targeted actions. The next section combines the information we’ve covered to this point as part of a VC deployment case study involving the book’s topology.
Virtual Chassis Case Study This section combines the information we’ve covered thus far in the form of a practical VC deployment case study based on the book’s topology. Here are the design requirements: 1. Rename Switch 3, Vodka, to Vodkila, to reflect the impending merger of the two previously standalone switch names. There is an old saying that mixing beer and whiskey is risky; this is sage advice and we can only hope that no ill effects result from the vodka-tequila combination that is soon to be born!
2. Assign 172.16.69.34/24 to the OoB interface; ensure that incoming Telnet and console connections to any switch members are redirected to the current VC master. 3. Switch 3 and Switch 4 share a closet; the third member is located in a remote closet. 4. Ensure that Switch 3 and Switch 4 can function as the master RE in a non-revertive manner. 5. Ensure that the third VC member functions as an LC whenever either or both Switch 3 and Switch 4 are operational. 6. Assign Switch 3 and Switch 4, and the new VC member IDs 0, 1, and 2, respectively. 7. Ensure that no additional switches can join the VC without management intervention.
Virtual Chassis Case Study | 241 Download at Boykma.Com
8. The design must have no single point of VC failure, and the loss of any VC trunk should not prevent ongoing communications. You may need the following information to complete your task: 1. All three VC member switches have a 4 × 1 GE uplink module installed. 2. The EX4200 serial numbers are: • Switch 3 = BM0208269780 • Switch 4 = BM0208269767 • Third VC member = BM0208269780 Figure 4-16 shows the before and after topologies. In this example, the VC deployment occurs in two phases. Phase 1 combines the two existing switches, Vodka and Tequila, into the mythical Vodkila, and phase 2 brings in a third VC member that is housed in a remote closet. Note how the interface names change on switch member 1 to reflect its shift from a standalone VC with member ID 0 to member ID 1. Except for LLDP updates that report the connected peer’s interface name change, there is minimal disturbance to the surrounding switches. The same level of connectivity is maintained, and for the most part things just get simpler, given that there is one less bridge/router in the network to generate protocol updates and to contend for the role of designated bridge. Combining the two switches may result in changes to the spanning tree forwarding topology, especially if either Switch 3 or Switch 4 is the current designated bridge. Regardless, the nature of Layer 2 forwarding and its propensity to form loops means there will be fewer forwarding or root bridge ports in the “after” topology. For example, assuming that Whiskey is the current root bridge, before the merge Switch 3 and Switch 4 have a root port that can forward toward the root. After the merge the combined VC has a single root port; assuming default parameters, this will be either the ge-0/0/3 or the ge-0/0/4 interface. Despite the potential for some reduction in the aggregate number of forwarding ports, the VC provides many administrative gains, and if desired the physical topology could be altered to provide added capacity, likely in the form of an aggregated bundle. In fact, with the addition of AE bundles, more capacity can be easily attached. Note that in Layer 3 mode the redundant links can still be used and the ability to loadbalance means there is little net effect to forwarding capacity. This is yet another reason router geeks are prone to saying, “Bridge when you must and route when you can.”
242 | Chapter 4: EX Virtual Chassis Download at Boykma.Com
Figure 4-16. The results of VC deployment
Virtual Chassis Case Study | 243 Download at Boykma.Com
Prepare for the Merge Before rolling out the VC bandwagon, there are a few things you should do to ensure a smooth migration: 1. Back up both standalone switch configurations to a remote location. 2. Return one of the switches to a factory-default configuration, and power off. 3. Attach VCP cables. The first step is just a good practice and is pretty much common sense. After the merge, you will need to modify the interface assignments in one of the switches to match its new member ID. The master switch overwrites the public configuration portion of all VC members, resulting in loss of the original configuration. Lastly, the master could (in some future release) automatically push a new JUNOS install image into any members with a mismatched software version. The install process may only attempt to save SSH keys from the original configuration, so be sure to move anything you plan to keep to safe storage off the EX device itself. In this example, the OoB is used to quickly copy a saved configuration from Vodka to an FTP server. The same process is performed at Tequila, but is not shown: [edit] lab@Vodka# save Vodka_pre_vc_config Wrote 172 lines of configuration to 'Vodka_pre_vc_config' [edit] lab@Vodka# run file copy Vodka_pre_vc_config ftp://instructor:training1@ftp_server/juniper/vodka_l3_vc ftp://instructor:training1@ftp_server/juniper/100% of 3346 B 917 kBps
In case you’re curious, a static host mapping is configured to allow use of the hostname: [edit] lab@Vodka# show system static-host-mapping ftp_server inet 172.16.69.254;
Next, you load and commit a factory default on Tequila. Given that root is the only user in the new config, you log out as user lab, so you can return as root to perform a graceful shutdown (the non-existent lab user is no longer permitted to perform this operation): lab@Tequila> configure Entering configuration mode [edit] lab@Tequila# load factory-default warning: activating factory configuration [edit]
244 | Chapter 4: EX Virtual Chassis Download at Boykma.Com
lab@Tequila# set system root-authentication plain-text-password New password: Retype new password: [edit] lab@Tequila# commit and-quit commit complete Exiting configuration mode lab@Tequila> quit login: Amnesiac (ttyu0) root@% root@% root root@% OS 9.0R2.10 built 2008-03-06 10:31:45 UTC root@% cli root> request system halt Halt the system ? [yes,no] (no) yes *** FINAL System shutdown message from root@ *** System going down IMMEDIATELY Shutdown NOW! [pid 1198] . . .
Though not easy to show in this book, the final preparation step is the attachment of the VCP cables between Switch 3 and Switch 4. Given the redundancy aspects of the design, and their close proximity, you opt for a VCP ring. In this case, there is no merit to any particular VCP cabling scheme, as distance is not an issue and all VCP ports operate the same. As a result, you end up attaching the VCP 0 port of both switches with one VCP cable, and their VCP 1 ports with the other. Preparation is complete; you are now ready to actually deploy the VC!
Configure VC Parameters Now the fun can officially start. Your first configuration choice is to perform a nonprovisioned versus a preprovisioned installation. Thinking back, the choice is clear given the requirement that no switch be allowed to join the VC without management action. The non-provisioned mode does not offer you the ability to list allowed members by serial number, and will therefore allow any switch with compatible software into the VC. So, preprovisioned it is. The preprovisioned mode allows you to explicitly bind each member’s serial number with a VC member ID and VC role, which is just the ticket here. This helps to ensure that you also meet the stated member ID requirements, which will no longer be based on VC attachment sequence. This mode also handles priority based on role, taking care of the requirement that member 3 must be an LC when either member 1 or member 2 is acting as the master RE. Virtual Chassis Case Study | 245 Download at Boykma.Com
The first step is to assign the new hostname: lab@Vodka> configure Entering configuration mode [edit] lab@Vodka# set system host-name Vodkila
The next configuration task removes the standalone me0 OoB management interface configuration to replace it with a virtual one that is shared among REs. You configure the vme interface as though it were any other interface, but currently there is no VLAN encapsulation and you must use unit 0: [edit interfaces] lab@Vodka# show me0 unit 0 { family inet { address 172.16.69.3/24; } } [edit interfaces] lab@Vodka# delete me0
With the physical me0 interface out of the way, you are clear to add the vme configuration. Note that committing with both prevents the virtual interface from being created: [edit interfaces] lab@Vodka# set vme unit 0 family inet address 172.16.69.34/24 [edit interfaces] lab@Vodka# show vme unit 0 { family inet { address 172.16.69.34/24; } }
Rather than deleting the me0 and adding a new vme, you might consider using the CLI’s rename function. After renaming me0 to vme you will likely have to reassign the IP address, an operation that can also be performed using rename.
Next, position yourself at the [edit virtual-chassis] hierarchy to begin configuration of the VC-specific parameters: [edit interfaces] lab@Vodka# top edit virtual-chassis [edit virtual-chassis] lab@Vodka# set preprovisioned
246 | Chapter 4: EX Virtual Chassis Download at Boykma.Com
The preprovisioned statement does what it says, and once in this mode you must list each member that is allowed to join the VC by its serial number, which is then mapped to an ID and VC role. You start with the current switch, Vodka, because it’s supposed to be assigned ID 0, and because it’s the only VC member currently powered on. As previously explained, this switch is already the master of its one-VC domain using ID 0. Because you will assign this switch an RE role, and because it’s been powered up first, expect this switch to remain as master once construction of the new Vodkila is complete. The definition for switch member 0 is added: [edit virtual-chassis] lab@Vodka# set member 0 role routing-engine [edit virtual-chassis] lab@Vodka# set member 0 serial-number BM0208269834 [edit virtual-chassis] lab@Vodka# show preprovisioned; member 0 { role routing-engine; serial-number BM0208269834; }
That was pretty straightforward, so you move on to complete the definition for member ID 1. The updated configuration is displayed: [edit virtual-chassis] lab@Vodka# set member 1 role routing-engine serial-number BM0208269766 [edit virtual-chassis] lab@Vodka# show preprovisioned; member 0 { role routing-engine; serial-number BM0208269834; } member 1 { role routing-engine; serial-number BM0208269766; }
Happy with your work, you decide to commit the changes. Before doing so, add the commit synchronize option so that all commit events are treated as though the synchronize switch was included. Recall that in any dual-RE configuration it’s recommended that you always synchronize the configuration at every commit, for obvious reasons. As a rule, if you do not have a specific need to maintain distinctly different configs on the master and backup REs, don’t. Note that NSR/Non-Stop Bridging support mandates this option, but general GRES and/or protocol GR does not: [edit virtual-chassis] lab@Vodka# top
Virtual Chassis Case Study | 247 Download at Boykma.Com
[edit] lab@Vodka# set system commit synchronize [edit] lab@Vodka# commit and-quit error: Could not connect to fpc-1 : Can't assign requested address warning: Cannot connect to other RE, ignoring it commit complete
The commit warning is expected; given that only member 0 is powered up, the attempt to synchronize the configuration to non-existent VC members is in vain, and fails accordingly. Before powering up Switch 4, you quickly access VC status at member 0: lab@Vodkila> show virtual-chassis Preprovisioned Virtual Chassis Virtual Chassis ID: 001f.123d.b4c0 Member ID 0 (FPC 0)
Status Prsnt
Mastership Neighbor List Serial No Model priority Role ID Interface BM0208269834 ex4200-24t 129 Master*
The VC status is as expected. One switch is up; it’s the current master RE, and it has an ID of 0: lab@Vodkila> show virtual-chassis vc-port fpc0: --------------------------------------------------------------------Interface Type Status or PIC / Port vcp-0 Dedicated Down vcp-1 Dedicated Down
There is nothing to be alarmed about here; VCP ports can be up only when attached to another switch that has power applied: lab@Vodkila> show virtual-chassis protocol adjacency fpc0: --------------------------------------------------------------------Interface System State Hold (secs) internal-0/27 001f.123d.b4c1 Up 65535 internal-1/24 001f.123d.b4c0 Up 65535
The VCCP adjacency status confirms that the switch has two PFEs and that both are internally adjacent. Again, all is as expected. Note that the presence of only two PFEs indicates this must be a 24-port model, which in fact is the case: lab@Vodkila> show chassis hardware Hardware inventory: Item Version Part number Chassis
Serial number BM0208269834
248 | Chapter 4: EX Virtual Chassis Download at Boykma.Com
Description EX4200-24T
Confirm initial VC operation With the single-node VC doing all it can, the time has come to power up the old Tequila. Before flipping its power switch, attach to its console to monitor its boot progress and look for any error messages: . . . FLASH: 8 MB USB: scanning bus for devices... 2 USB Device(s) found scanning bus for storage devices... 1 Storage Device(s) found . . . starting local daemons:. Sat Jan 1 01:41:09 UTC 2005 Amnesiac (ttyu0)
Nothing noteworthy shows in the boot-up messages, except that things do not end well given the display of an Amnesiac prompt. The expectation was a virtual console redirection to the current master RE, which clearly did not happen. This does not bode well for the nascent VC. You log in to the now factory-default configuration as root: root@% root root@% OS 9.0R2.10 built 2008-03-06 10:31:45 UTC root@% cli root> show virtual-chassis ^ syntax error, expecting .
After logging in as root, you find it odd that the show virtual-chassis command does not complete as it did on Switch 3. You decide to create a lab/super-user account so that you can log in via internal communications paths via Switch 3/Vodkila; root logins are not currently permitted on the intra-VC communications path: root> configure Entering configuration mode root# ...user lab class super-user authentication plain-text-password New password: Retype new password: [edit] root# commit commit complete
Back on member 0/Switch 3, you decide to do some troubleshooting: lab@Vodkila> show virtual-chassis Preprovisioned Virtual Chassis Virtual Chassis ID: 001f.123d.b4c0 Mastership Member ID Status Serial No Model priority Role 0 (FPC 0) Prsnt BM0208269834 ex4200-24t 129 Master*
Neighbor List ID Interface 1 vcp-0 1 vcp-1
Virtual Chassis Case Study | 249 Download at Boykma.Com
1 (FPC 1) Prsnt BM0208269767 ex4200-24t
129 Linecard
0 vcp-0 0 vcp-1
The output of the show virtual-chassis command works again, and interestingly it shows two members, each connected by two VC ports, which is pretty much as expected. The only detail that seems off is that member 1 is shown as an LC, when the preprovisioned configuration stated it should function in an RE role; the expected status for member 1 is therefore backup. Something is not right. You next display VC adjacency status: lab@Vodkila> show virtual-chassis protocol adjacency fpc0: --------------------------------------------------------------------Interface System State Hold (secs) internal-0/27 001f.123d.b4c1 Up 65535 internal-1/24 001f.123d.b4c0 Up 65535 vcp-0 001f.123d.d281 Up 58 vcp-1 001f.123d.d280 Up 57 fpc1: --------------------------------------------------------------------Interface System State Hold (secs) internal-0/27 001f.123d.d281 Up 65535 internal-1/24 001f.123d.d280 Up 65535 vcp-0.32768 001f.123d.b4c1 Up 58 vcp-1.32768 001f.123d.b4c0 Up 59
The output confirms that all expected adjacencies for two EX4200-24s connected via two VCP ports are present. Each switch has two internal and two external adjacencies, which is expected given this configuration and cabling scheme. VCCP LSP flooding also seems to be working, given that the expected number of LSPs (one from each PFE in the VC) is present in both members: lab@Vodkila> show virtual-chassis protocol database fpc0: --------------------------------------------------------------------LSP ID Sequence Checksum Lifetime 001f.123d.b4c0.00-00 0x2cd 0xea48 117 001f.123d.b4c1.00-00 0x2c9 0xef34 117 001f.123d.d280.00-00 0x1e1 0xe412 115 001f.123d.d281.00-00 0x1e3 0xce41 116 4 LSPs fpc1: --------------------------------------------------------------------LSP ID Sequence Checksum Lifetime 001f.123d.b4c0.00-00 0x2cd 0xea48 115 001f.123d.b4c1.00-00 0x2c9 0xef34 115 001f.123d.d280.00-00 0x1e1 0xe412 117 001f.123d.d281.00-00 0x1e3 0xce41 118 4 LSPs
The first clue as to what is wrong comes from a detailed analysis of the LSP generated by the DIS/pseudonode at member 0/Switch 3. The output is truncated to save space: 250 | Chapter 4: EX Virtual Chassis Download at Boykma.Com
lab@Vodkila> show virtual-chassis protocol database extensive member 0 fpc0: -------------------------------------------------------------------------. . . Packet: LSP ID: 001f.123d.b4c0.00-00, Length: 584 bytes, Lifetime : 118 secs Checksum: 0x84cc, Sequence: 0x2d6, Fixed length: 27 bytes, Version: 1, Sysid length: 0 bytes Packet type: 18, SW version: 9.2 TLVs: Node Info: Member ID: 0, VC ID: 001f.123d.b4c0, Flags: 3, Priority: 129 System ID: 001f.123d.b4c0, Device ID: 0 System ID: 001f.123d.b4c1, Device ID: 1 Neighbor Info: 001f.123d.b4c1.00, Interface: internal-0/27, Metric: 10 Neighbor Info: 001f.123d.d281.00, Interface: vcp-0, Metric: 10 Master Info: System ID: 001f.123d.b4c0 Backup Info: System ID: 0000.0000.0000 Member Info: System ID: 001f.123d.d280, Member ID: 1 Member role: Not Part of Virtual Chassis System ID: 001f.123d.d280, Device ID: 3 System ID: 001f.123d.d281, Device ID: 4 Member Info: System ID: 001f.123d.b4c0, Member ID: 0 Member role: Master System ID: 001f.123d.b4c0, Device ID: 0 System ID: 001f.123d.b4c1, Device ID: 1 Unknown TLV, Type: 25, Length: 40 Unknown TLV, Type: 24, Length: 1 Unknown TLV, Type: 28, Length: 112 No queued transmissions . . .
Given the highlighted output, it appears the VC’s master feels that member 1 is not a functional part of the VC. This condition should help drive home how the operation of VCCP is independent of the results; this is to say that VCCP appears to be working fine here, but the result is not the expected two-member VC. You decide to monitor the messages log to see whether anything is up, and the following messages are found to be repeating: lab@Vodkila> monitor start messages lab@Vodkila> *** messages *** Jan 1 02:13:48 Vodkila fpc1 (mrvl_cos_egr_buf_init) Egress buffer limits on 0 error 0 Jan 1 02:13:48 Vodkila /kernel: invalid fpc 1, closing connection Jan 1 02:13:48 Vodkila /kernel: pfe_listener_disconnect: conn dropped: listener idx=3, tnpaddr=0x11, reason: none Jan 1 02:13:48 Vodkila fpc1 (mrvl_cos_egr_buf_init) Egress buffer limits on 1 error 0 Jan 1 02:13:48 Vodkila fpc1 PFEMAN: Master socket closed Jan 1 02:13:48 Vodkila fpc1 PFEMAN disconnected; PFEMAN socket closed abruptly Jan 1 02:13:48 Vodkila fpc1 pfeman_get_server_addr: selecting master RE Jan 1 02:13:48 Vodkila fpc1 Routing engine PFEMAN reconnection succeeded after 1
Virtual Chassis Case Study | 251 Download at Boykma.Com
tries Jan 1 02:13:48
Vodkila fpc1 PFEMAN master RE reconnection made
Clearly something is not right with member 1. You add tracing to the VC, and see what it has to say: [edit] lab@Vodkila# show virtual-chassis preprovisioned; traceoptions { file vc_trace; flag error; } member 0 { role routing-engine; serial-number BM0208269834; } member 1 { role routing-engine; serial-number BM0208269767; } [edit] lab@Vodkila# run monitor start vc_trace [edit] lab@Vodkila# *** vc_trace *** Jan 1 02:38:56.329244 WARNING: LSP from 001f.123d.d281 on interface vcp-0 with bad packet version 9.0 Jan 1 02:38:56.329451 WARNING: LSP from 001f.123d.d280 on interface vcp-1 with bad packet version 9.0 . . .
The VC trace spews out errors that serve to make the issue somewhat clear. The bad version messages jog your memory; what was that about a VC needing compatible software versions again? You internally connect to member 1 and have a real “d’oh!” moment as its version is displayed: ab@Vodkila> request session member 1 € --- JUNOS 9.0R2.10 built 2008-03-06 10:31:45 UTC lab>
Breaking the connection and back on the master RE, you are relieved to note a compatible Jinstall package on its local storage: lab> exit rlogin: connection closed lab@Vodkila> file list /var/home/lab/: .ssh/ Vodka_pre_vc_config jinstall-ex-9.2R1.9-domestic-signed.tgz
252 | Chapter 4: EX Virtual Chassis Download at Boykma.Com
l2_base l2_base_vc . . .
And now the beauty of VCCP strikes you. It provides an opaque transport of VC-related information, and therefore can operate even when VC parameters do not match. Although a VC may not form, the continued operation of the VCCP protocols permits ongoing diagnostics and facilitates maintenance activities, such as use of internal links to allow login into member switches or, luckily for you, the pushing and subsequent installation of software upgrades: lab@Vodkila> request system software add jinstall-ex-9.2R1.9-domestic-signed.tgz member 1 reboot Pushing bundle to fpc1 WARNING: A reboot is required to install the software WARNING: Use the 'request system reboot' command immediately Rebooting ... shutdown: [pid 720] Shutdown NOW! lab@Vodkila>
The software add command makes use of the member switch, and correctly identifies member 1, preventing the software from being installed on member 0, which is already on that version and would serve only to force a needless reboot. Meanwhile, you switch attention back to Switch 4’s console port to again monitor its boot progress: . . . Verified SHA1 checksum of jswitch-ex-9.2R1.9.tgz Verified SHA1 checksum of jweb-ex-9.2R1.9.tgz Running requirements check first for jbundle-ex-9.2R1.9-domestic... Running pre-install for jbundle-ex-9.2R1.9-domestic... Installing jbundle-ex-9.2R1.9-domestic in /tmp/pa2350.21/jbundle-ex-9.2R1.9domestic.x2350... Running post-install for jbundle-ex-9.2R1.9-domestic... Adding jkernel-ex... . . .
Updated JUNOS versions may automate the pushing of compatible software to new switch members. In the 9.2 release, this process must be performed manually.
So far, so good; all indications are that the matched software version is being installed. It makes watching water boil seem...enticing, doesn’t it? Sometime later when the upgrade is complete, the initial console login is again Amnesiac, causing a pang of fear to run up your spine: Tue Aug
5 08:59:53 UTC 2008
Amnesiac (ttyu0)
Virtual Chassis Case Study | 253 Download at Boykma.Com
Your concerns melt away in true “Calgon bath” fashion, when you see that the console login is now correctly redirected to the VC’s master. Eureka! A Vodkila is born and you can’t help declaring, “It’s alive!” login: lab Logging to master €ƒPassword: --- JUNOS 9.2R1.9 built 2008-08-05 07:25:22 UTC lab@Vodkila>
With things apparently working, the VC status is displayed to confirm that member 1 is now correctly listed as a backup RE: lab@Vodkila> show virtual-chassis Preprovisioned Virtual Chassis Virtual Chassis ID: 001f.123d.b4c0 Mastership Neighbor List Member ID Status Serial No Model priority Role ID Interface 0 (FPC 0) Prsnt BM0208269834 ex4200-24t 129 Master* 1 vcp-0 1 vcp-1 1 (FPC 1) Prsnt BM0208269767 ex4200-24t 129 Backup 0 vcp-0 0 vcp-1
The assignment of the same priority (based on the VC member role in preprovisioned mode) results in a non-revertive mastership behavior, which is a required aspect of the VC deployment. Should the current master fail and then come back online, it will not overthrow the new master, given that both have the same priority. The show chassis mac-addresses command provides final proof that you now have a functional twomember VC: lab@Vodkila> show chassis mac-addresses FPC 0 MAC address information: Public base address 00:1f:12:3d:b4:c0 Public count 64 FPC 1 MAC address information: Public base address 00:1f:12:3d:d2:80 Public count 64
Recall that in the event of an RE switch, the new master begins using its own MAC address after the configured age-out time. During the age-out it continues to use the old master’s MAC address. To complete the VC migration, the original interface assignments in Tequila’s original (and luckily enough, saved) configuration are modified to replace slot/FPC number 0 with 1, resulting in the list shown. While you’re at it, you decide to add some descriptions to help keep things straight in the new world order that is Vodkila: ge-1/0/0 { description "To Rum also"; unit 0 { family inet {
254 | Chapter 4: EX Virtual Chassis Download at Boykma.Com
address 10.4.5.4/24; } } } ge-1/0/1 { description "To unit 0 { family inet address } } } ge-1/0/2 { description "To unit 0 { family inet address } } } ge-1/0/3 { description "To unit 0 { family inet address } } } ge-1/0/8 { description "To unit 0 { family inet address } } }
Brandy"; { 10.4.6.4/24;
Bourbon"; { 10.4.7.4/24;
Gin"; { 10.2.4.4/24;
Whiskey too"; { 10.1.4.4/24;
A load merge terminal relative is entered at the [edit interfaces] hierarchy to paste the modified interface name into the configuration, and the change is committed: [edit interfaces] lab@Vodkila# load merge terminal relative [Type ^D at a new line to end input] ge-1/0/0 { description "To Rum also"; unit 0 { family inet { address 10.4.5.4/24; } } } ge-1/0/1 { description "To Brandy"; unit 0 { family inet { address 10.4.6.4/24;
Virtual Chassis Case Study | 255 Download at Boykma.Com
} } } ge-1/0/2 { description "To unit 0 { family inet address } } } ge-1/0/3 { description "To unit 0 { family inet address } } } ge-1/0/8 { description "To unit 0 { family inet address } } } load complete
Bourbon"; { 10.4.7.4/24;
Gin"; { 10.2.4.4/24;
Whiskey too"; { 10.1.4.4/24;
[edit interfaces] lab@Vodkila# [edit interfaces] lab@Vodkila# commit and-quit fpc0: configuration check succeeds fpc1: commit complete fpc0: commit complete Exiting configuration mode lab@Vodkila>
Note how the commit synchronize setting results in the configuration being mirrored to both REs. You will be happy you did this should the mastership later change. Not being one to leave well enough alone, you decide to test a mastership change now using a request chassis routing-engine command: lab@Vodkila> request chassis routing-engine master release no-confirm lab@Vodkila> Vodkila (ttyu0)
The virtual management session is broken during the mastership change. Upon reconnection, you are again attached to the newly active master: 256 | Chapter 4: EX Virtual Chassis Download at Boykma.Com
login: lab Password: --- JUNOS 9.2R1.9 built 2008-08-05 07:25:22 UTC lab@Vodkila> lab@Vodkila> show virtual-chassis Preprovisioned Virtual Chassis Virtual Chassis ID: 001f.123d.b4c0 Member ID 0 (FPC 0)
Mastership Status Serial No Model priority Role Prsnt BM0208269834 ex4200-24t 129 Backup
1 (FPC 1)
Prsnt
BM0208269767 ex4200-24t
Neighbor List ID Interface 1 vcp-0 1 vcp-1 129 Master* 0 vcp-0 0 vcp-1
Given the change in mastership that was just triggered, it is no surprise to see that member 1 is now acting as the VC’s master RE while member 0 stands by waiting to return to its former glory. Having confirmed proper mastership switchover (GRES) and the desired non-revertive behavior, you return to the original member roles, but using a slightly different approach to keep it real, yo: lab@Vodkila> request session member 0 € --- JUNOS 9.2R1.9 built 2008-08-05 07:25:22 UTC lab@Vodkila-fpc0-BK> request chassis routing-engine master acquire no-confirm lab@Vodkila-fpc0-BK> Vodkila-fpc1-BK (ttyu0) login: lab Logging to master €Password: --- JUNOS 9.2R1.9 built 2008-08-05 07:25:22 UTC lab@Vodkila> show virtual-chassis Preprovisioned Virtual Chassis Virtual Chassis ID: 001f.123d.b4c0 Mastership Neighbor List Member ID Status Serial No Model priority Role ID Interface 0 (FPC 0) Prsnt BM0208269834 ex4200-24t 129 Master* 1 vcp-0 1 vcp-1 1 (FPC 1) Prsnt BM0208269767 ex4200-24t 129 Backup 0 vcp-0
The highlights call out the redirection of the console port on Switch 4 to the current VC master, which is always called Vodkila. The current master is again member 0. In the next section the two-member VC is expanded to pick up a remote member.
Virtual Chassis Case Study | 257 Download at Boykma.Com
Newer versions of JUNOS helps to disambiguate which member is the active RE by adding the member ID to the hostname prompt.
Expand the VC with VCE Links In this section, you will complete the VC deployment by adding a third member switch, located some distance away from the current VC members. Given the distance needed, you will need to use VCE ports, which involves redefining one or more uplink module ports to operate in VCCP mode. Figure 4-17 shows the VCE design specifics needed to meet the stated redundancy requirements.
Figure 4-17. Expanding the VC with member 3
The key point is the use of two VCE ports at member 3, with each port attached to a different VC member, thereby meeting the stated redundancy objectives given that this approach ensures no single point of failure for the VC, and that the VC can continue to communicate with the loss of any one VC trunk. You can define as many VCEs as you have uplink ports, but note that VCCP routing will use only one such link for any given destination, based on the results of its shortestpath calculation. VCCP factors link speed so that the high-speed VCP backplane ports are generally preferred over any VCE link when an all-VCP path exists.
Prepare the new switch As before, you should return the new switch to a factory default, after archiving any configuration it may have. In this case, you also have the foresight to ensure that it’s already running a matched software version. You can configure the new switch’s uplinks now, as long as you do not attach its uplink cables to the other VC members before their uplinks are set to VCCP mode. Failing to 258 | Chapter 4: EX Virtual Chassis Download at Boykma.Com
do this may prevent proper VCCP auto-sense, which may force a restart virtualchassis-control to get things working properly.
Configure the VCE ports In our lab, the cables are already attached, and the lab is too far away to warrant a trip just for this. To help ensure that things work to plan, the approach taken is to configure the VC’s VCE ports first. In effect, this places them in auto-discovery mode. The new switch does not have any uplink configuration, so currently only light traffic is sent over its uplink ports, which should avoid any potential confusion to the VCCP autosense function. When ready, you plan to activate the VCE ports on the new switch and things should work. You start at the master RE, where you configure member 0’s VCE link to Switch 3. Note that given that this is member 0, you are configuring PIC 0/1, which is the uplink module: lab@Vodkila> request virtual-chassis vc-port set ? Possible completions: interface Member's virtual chassis interface pic-slot Member's PIC slot lab@Vodkila> request virtual-chassis vc-port set pic-slot 1 port 0
The pic-slot argument correctly identifies the uplink module on the local switch, and sets the first port to VCE mode. The change is confirmed for member 0: lab@Vodkila> show virtual-chassis vc-port member 0 fpc0: --------------------------------------------------------------------Interface Type Status or PIC / Port vcp-0 Dedicated Up vcp-1 Dedicated Up 1/0 Configured Up
The new VCE is correctly displayed and is in the Up state given that it’s cabled to the new switch member and has light. This leaves the three remaining 1 GE ports available for normal uplink usage at member 0. The same command is used to create a VCE link at member 1. In this case, the member argument is used to push the change to the correct VC member: lab@Vodkila> request virtual-chassis vc-port set pic-slot member 1 1 port 0 fpc1: --------------------------------------------------------------------lab@Vodkila>
And the results are confirmed as before: lab@Vodkila> show virtual-chassis vc-port member 1 fpc1: ---------------------------------------------------------------------
Virtual Chassis Case Study | 259 Download at Boykma.Com
Interface or PIC / Port vcp-0 vcp-1 1/0
Type
Status
Dedicated Dedicated Configured
Up Up Up
As expected, no adjacencies have been formed over either VCE at this point: lab@Vodkila> show virtual-chassis protocol adjacency member 0 fpc0: --------------------------------------------------------------------Interface System State Hold (secs) internal-0/27 001f.123d.b4c1 Up 65535 internal-1/24 001f.123d.b4c0 Up 65535 vcp-0 001f.123d.d281 Up 58 vcp-1 001f.123d.d280 Up 59 vcp-255/1/0 001f.123d.d280 Down 11
With the VC end ready to go, it’s time to power up the new switch and configure its uplinks for VCE operation. Note that until it’s attached, the switch has member ID 0, which you must keep in mind when you configure its VCE ports. Once it becomes part of the VC it will receive its new member ID and will do the right thing to update its private configuration: root> show virtual-chassis Virtual Chassis ID: 001f.123d.e6c0 Mastership Neighbor List Member ID Status Serial No Model priority Role ID Interface 0 (FPC 0) Prsnt BM0208269780 ex4200-24t 128 Master* Member ID for next new member: 1 (FPC 1)
Both VCE ports are activated. The 1/0 port goes to member 0 and the 1/1 port goes to member 1: root> request virtual-chassis vc-port set pic-slot 1 port 0 root> request virtual-chassis vc-port set pic-slot 1 port 1
After a moment or two, the results are confirmed. You begin by logging out, at which time you note that the prompt changes, which indicates proper VC operation and is a good omen: -fpc0-LC (ttyu0) . . . root@-fpc0-LC% .9 built 2008-08-05 07:25:22 UTC root@-fpc0-LC% cli root@-fpc0-LC> show virtual-chassis Virtual Chassis ID: 001f.123d.b4c0 Mastership Neighbor List Member ID Status Serial No Model priority Role ID Interface 0 (FPC 0) Prsnt BM0208269780 ex4200-24t 128 Linecard*
260 | Chapter 4: EX Virtual Chassis Download at Boykma.Com
But the show virtual-chassis display confirms that something is again wrong. The new switch member has the wrong ID, and fails to list the rest of the VC members that are known to exist. Back at the master we get some additional hints as to the nature of the problem: lab@Vodkila> show virtual-chassis Preprovisioned Virtual Chassis Virtual Chassis ID: 001f.123d.b4c0 Mastership Neighbor List Member ID Status Serial No Model priority Role ID Interface 0 (FPC 0) Prsnt BM0208269834 ex4200-24t 129 Master* 1 vcp-0 1 vcp-1 1 (FPC 1) Prsnt BM0208269767 ex4200-24t 129 Backup 0 vcp-0 0 vcp-255/1/0 0 vcp-1 Unprvsnd BM0208269780 ex4200-24t
Yep, the display makes the problem clear. We are in a preprovisioned mode but have failed to update the master configuration with the new member’s serial number. The configuration mistake is rectified: lab@Vodkila> configure Entering configuration mode [edit] lab@Vodkila# set virtual-chassis member 2 role line-card serial-number BM0208269780 [edit] lab@Vodkila# commit and-quit fpc0: configuration check succeeds fpc1: commit complete fpc0: commit complete Exiting configuration mode
And the VC status is again displayed: lab@Vodkila> show virtual-chassis Preprovisioned Virtual Chassis Virtual Chassis ID: 001f.123d.b4c0 Mastership Neighbor List Member ID Status Serial No Model priority Role ID Interface 0 (FPC 0) Prsnt BM0208269834 ex4200-24t 129 Master* 1 vcp-0 2 vcp-255/1/0 1 vcp-1 1 (FPC 1) Prsnt BM0208269767 ex4200-24t 129 Backup 0 vcp-0 2 vcp-255/1/0 0 vcp-1 2 (FPC 2) Prsnt BM0208269780 ex4200-24t 0 Linecard 0 vcp-255/1/0 1 vcp-255/1/1
Virtual Chassis Case Study | 261 Download at Boykma.Com
The results are as expected, and they confirm that a three-member VC is now operational. The neighbor ID list indicates that some neighbors are adjacent over a VCE, as indicated by the vcp-255/1/0 designation. Proper internal routing is confirmed by displaying the VC’s active topology: lab@Vodkila> show virtual-chassis active-topology Destination ID Next-hop 1
1(vcp-0)
1(vcp-1)
2
(vcp-255/1/0)
1(vcp-1)
The display confirms that member 0 plans to reach member 1, which is collocated using the VCP cables. Its first choice is to use VCP Port 0, and it can fall back to Port 1 if needed. To reach the remote chassis, it prefers the direct VCE link vcp-255/1/0, but in the event of that next hop failing it is prepared to fall back to its vcp-1 link, which takes it through member 1 via the VCP connection, and then from member 1 to member 2 over the remaining VCE link. A quick look at the VC RT for Destination 3 at member 0 confirms that VCE links have a higher cost, due to their reduced bandwidth: lab@Vodkila> show virtual-chassis protocol route 2 member 0 fpc0: --------------------------------------------------------------------Dev 001f.123d.b4c0 ucast routing table ---------------System ID Version Metric Interface 001f.123d.b4c1 79 10 internal-0/27 001f.123d.d280 79 20 vcp-0 internal-0/27 001f.123d.d281 79 10 vcp-0 001f.123d.e6c0 79 63 vcp-255/1/0 001f.123d.e6c1 79 73 vcp-255/1/0
Current version: 79 Via 001f.123d.b4c1 001f.123d.d281 001f.123d.b4c1 001f.123d.d281 001f.123d.e6c0 001f.123d.e6c0
The display shows that internal and VCP links have a cost of 10. Thus, the route from PFE 0 in member 0 to PFE d280, which is in member 1, has a path cost of 20, given the use of two such links. The lower-speed 1 GE VCE is assigned a cost of 63 by the automatic scaling algorithm. As such, for member 0 to reach PFE 1 (e6c1) in member 2, the path cost is 73, reflecting the need to transit one VCE and one internal link. These results confirm the operation of the new VC and complete the VC deployment case study. Since you were the one to bring it up, who better to pull it all down? Note the use of the all-members switch to force the graceful shutdown of the entire VC: lab@Vodkila> request system halt all-members warning: This command will halt all the members. If planning to halt only one member use the member option Halt the system ? [yes,no] (no) yes
262 | Chapter 4: EX Virtual Chassis Download at Boykma.Com
Halting fpc1 Halting fpc2 Shutdown NOW! [pid 2413] *** FINAL System shutdown message from lab@Vodkila *** System going down IMMEDIATELY
Case Study Summary The VC deployment case study demonstrated the simplicity and veritable plug-andplay nature of the EX4200 VC. Along with VC configuration, the commands and procedures used to verify a VC’s operational status and maintenance procedures were also demonstrated.
Conclusion The EX4200 VC is a powerful form of abstraction that permits you to start small and grow into a large-scale switching platform that offers the ease of use and management associated with a single entity. The Juniper Networks VC is truly simple to deploy and maintain, given the CLI’s support of a member context switch and the ability to connect to member switches over internal communications paths, even when there is a problem that may prevent that member from actively joining the VC. You have the choice of just plugging things together with no explicit VC configuration, or you can exercise a high degree of deterministic control over most aspects of a VC’s operation. Besides being easier to manage, there are significant HA benefits to the VC, including redundant REs and the resulting ability to support GRES and NSR, but also for forwarding plane faults and the VC’s ability to work around a failed PFE or VC trunk through LS VCCP. The next chapter keeps things rolling by getting into the meat of STP, the heart and soul of any LAN switch. You will be glad that there is now one less switch to manage and troubleshoot when things invariably go astray, given that Vodkila lives strong, and lives large, and is far more than the sum of its individual parts.
Chapter Review Questions 1. How many EX4200s can be grouped into a VC? a. 2 b. 6 c. 8 d. 10
Chapter Review Questions | 263 Download at Boykma.Com
2. Each VC port operates at: a. 16 Gbps, FD b. 32 Gbps, FD c. 64 Gbps, FD d. 128 Gbps, FD 3. True or false: the master RE must be assigned member ID 0. 4. Which is the correct order for master RE election when a VC is rebooted? a. Uptime, member ID, priority, lowest MAC address b. Priority, last role, uptime, lowest MAC address c. Last role, priority, uptime, highest MAC address d. Uptime, last role, lowest MAC address, priority 5. Which is true about VCE ports? a. Only the 2 × 10 GE uplink module can support VCE in Release 9.2 b. All ports on an uplink module must operate in normal or VCE mode c. You must use a single VCE link when connecting wiring closets to avoid loops d. An operational mode configuration command is used to set or clear VCE mode 6. Which are true regarding VCCP? (Choose all that apply.) a. VCCP is defined in an Internet draft b. It’s a Juniper proprietary protocol based on distance vector routing c. It’s a Juniper proprietary protocol based on link state OSPF routing d. It’s a Juniper proprietary protocol based on link state IS-IS routing 7. Which can be set in a non-provisioned deployment? a. A member ID to a priority b. A member ID to a VC role such as RE or LC c. A serial number to a priority and VC role d. You cannot configure any VC parameters in this mode 8. How is the member ID assigned in a non-provisioned deployment? a. Based on VC role b. Based on power-up sequence, with each new switch getting the next ID c. The serial number is mapped to the member ID d. You cannot control member ID in this mode 9. A new switch is added to a preprovisioned VC. Until the serial number is mapped: a. No VCCP adjacency can form b. The switch can enter the VC but as an LC only c. A VCCP adjacency will form but the switch will not be a member of the VC
264 | Chapter 4: EX Virtual Chassis Download at Boykma.Com
d. The master configuration file is automatically updated with the new member’s serial number, as learned through VCCP 10. Which command connects you to the current backup RE, from the current master? a. request routing-engine login backup b. request routing-engine login other c. start shell pfe network member d. request session member 11. You want to alter a serial number to VC role assignment, but after you commit the change, the related VC member does not take on the new role. What may be wrong? a. You need to use commit synchronize to push the change to the VC member’s private configuration b. The VC backbone is malfunctioning, preventing intra-VC communications c. The EX4200 chassis type mapped to that member ID is not compatible with the new role; a hardware key is needed to function as the master RE d. You must use non-provisioned mode to map a member ID to a VC role
Chapter Review Answers 1. Answer: D. A VC consists of 2 to 10 EX4200 chassis. 2. Answer: B. Each VC port operates at 32 Gbps FD, yielding 64 Gbps of throughput per port. Two ports yield 128 Gbps of throughput between adjacent VC members. 3. Answer: False. Although it is a best practice to make the master RE member 0, this is not mandatory; the member ID must be unique, but has no direct relationship to the VC role. 4. Answer: B. Only B is correct, and the lowest MAC address is the tiebreaker. 5. Answer: D. The operational mode request virtual chassis vc-port command alters the private NVRAM configuration to set or clear VCE mode. Support for 1X GE VCE ports first appeared in Release 9.2. You can mix and match VCE and normal modes, and all ports can operate in VCE mode if desired. 6. Answer: D. VCCP is based on the IS-IS link state routing protocol, but is proprietary to Juniper. 7. Answer: A. In non-provisioned mode, you can map a member ID to a mastership priority. 8. Answer: B. In non-provisioned mode, the member ID is not set directly, but is instead controlled through the power-up sequence. You can later alter the assignment with the CLI request chassis renumber command. 9. Answer: C. VCCP can function even when mismatched software or configuration issues prevent a successful VC join.
Chapter Review Answers | 265 Download at Boykma.Com
10. Answer: A, B. From the current master you can request a login to the other RE, which will be a backup. You can also explicitly state that a connection should be formed to the backup RE. Option C is used to form internal VTY connections to PFE components, which may or may not be a master/backup RE. Option D allows you to access the CLI of a member switch using an internal communications path. As with option C, such a switch member may be acting in an LC role. 11. Answer: A. In the 9.2 release used for this book, member-specific VC changes committed on the master RE are pushed to the member’s private configuration only when the synchronize switch is used; later releases may automate this function for LC-related changes, but synchronization is required between the master and backup REs as in some cases you may wish to have different configurations. Use of NSR requires that the system commit synchronize option be set, forcing all commits to synchronize.
266 | Chapter 4: EX Virtual Chassis Download at Boykma.Com
CHAPTER 5
Virtual LANs and Trunking
LAN switches filter and forward traffic based on learning Source MAC (SMAC) addresses, and then later filter traffic based on Destination MAC (DMAC) addresses. Although a regular switch does terminate a collision domain, it does not isolate broadcast and multicast traffic; such traffic must be flooded to all LAN members because these addresses are never used as an SMAC, and thus can never be learned. By definition, this Broadcast, Unknown, or Multicast (BUM) traffic by its nature has to be flooded to all stations anyway. LAN virtualization, also known as a virtual LAN or VLAN, allows switches to logically group end stations to provide isolation of BUM traffic, enhancing both performance and security. This chapter covers VLAN tagging and the configuration and monitoring of VLAN switching on the EX platform in the context of integrating a JUNOS switch into a Cisco environment. The topics covered in this chapter include: • Virtual LANs and trunking • EX to catalyst VLAN integration (and troubleshooting)
Virtual LANs and Trunking Ethernet LAN and LAN switching concepts, also known as bridging, are described in Chapter 1. This chapter focuses on using VLAN tags to logically partition the LAN into multiple broadcast domains. In a conventional Ethernet LAN, all nodes must be physically connected to the same MAC broadcast domain to communicate at Layer 2. With VLANs, the physical location of the nodes is not important, as you can group network devices in ways that make sense for your organization—for example, by department or business function— without regard for the physical station attachment point. A VLAN is identified by a specific tag value, as described shortly, and the stations that belong to a common VLAN will normally share a common IP network address, meaning they share a LAN from the IP perspective. 267 Download at Boykma.Com
VLAN capability allows switching for multiple-LAN communities that share a physical infrastructure, while ensuring that no information is leaked between these communities. This trunking is achieved via VLAN tags, as defined in the IEEE 802.1Q standard; in fact, a trunk interface is often said to operate in dot1Q mode. The 802.1Q standard also characterizes the meaning of a VLAN with regard to Media Access Control (MAC) layer functions and protocols such as bridging or Spanning Tree Protocol (STP), and how stations on separate VLANs can communicate through the services of a Layer 3 device in the form of a router. In this case, the router uses a Routed VLAN Interface (RVI) to route between the otherwise ships-in-the-night separation of traffic riding over different VLANs. In IOS terminology, the Layer 3 interface that connects logically distinct Layer 2 domains with IP forwarding is referred to as a Switched Virtual Interface (SVI).
Port Modes Switch ports, or interfaces, operate in either access or trunk mode. An interface in access mode connects to a network device, such as a desktop computer or an IP telephone. The interface itself belongs to a single VLAN, and the frames sent and received over that access interface are normal, untagged native Ethernet frames. In a default EX configuration, all interfaces are placed in access mode. Trunk interfaces handle traffic for multiple VLANs, multiplexing the traffic for all those VLANs over the same physical connection. Trunk interfaces are generally used to interconnect with other switches, or routers, and use explicit tagging to segregate traffic on the shared trunks.
Tagging User Traffic Traffic received on an access port, or from a particular MAC address when so configured, is mapped to an associated VLAN and the related VLAN tag is inserted before the frame is forwarded over trunk ports. Once tagged, the frame is forwarded only over those trunks that are defined to support that VLAN, and for which that VLAN is in a forwarding state when running Multiple Spanning Tree Protocol (MSTP), as described in Chapter 6. When a switch has local access ports that belong to the associated VLAN, and the frame needs to be sent to those ports (based on DMAC and learning), the tag is removed and the frame is sent in its original (native) format out the access port.
ISL Versus 802.1Q Trunks The Inter Switch Link (ISL) protocol predates the IEEE 802.1Q standard and is proprietary to Cisco Systems. ISL is considered a two-level encapsulation scheme and operates by adding a 26-byte header and 4-byte CRC trailer to each frame. The header contains a 10-bit VLAN identifier to support 1,024 VLANs, as well as a user priority indication.
268 | Chapter 5: Virtual LANs and Trunking Download at Boykma.Com
JUNOS software does not support ISL. Therefore, you must configure .1Q trunking on IOS devices to interoperate with JUNOS switching gear by issuing a switchport trunk encapsulation dot1q and switchport mode trunk configuration statement under the desired interface. Note that some IOS hardware is not capable of supporting the standards-based .1Q form of trunking, and that in some cases you can run both ISL and .1Q as part of a migration strategy. Given that the original IEEE 802.1D (Bridging) standard has been updated to support features such as MSTP and Rapid Spanning Tree Protocol (RSTP) in a .1Q trunk context, there is little need to continue deploying vendor-proprietary trunk protocols such as ISL.
Figure 5-1 shows the format of an IEEE 802.1Q tagged frame.
Figure 5-1. The IEEE 802.1Q tagged frame format
Figure 5-1 shows that 802.1Q tagging is not really an encapsulation scheme, but rather involves the insertion of a 4-byte field after the frame’s SMAC address. The tag is inserted before the Type or Length field when sending Ethernet frames or IEEE 802.3 frames, respectively.
Virtual LANs and Trunking | 269 Download at Boykma.Com
Although standards exist to define the transport of IPv4/IPv6 traffic over IEEE 802.3, typically using a combination of Logical Link Control (LLC/IEEE 802.2) and Subnetwork Access Protocol (SNAP) encapsulation, which ironically allows an escape back to EtherType codes, this method of IP transport is rarely used and is not supported by JUNOS devices. JUNOS devices always encapsulate IP in Ethernet v2 frames, which use an EtherType for explicit identification of the encapsulated protocol, thus eliminating the need for LLC/SNAP. Ethernet-based IP encapsulation is defined in RFCs 894 and 2464 for IPv4 and IPv6 using Type codes 0×0800 and 0×86DD, respectively.
The insertion of .1Q tags increases frame size, and necessitates recalculation and update of the frame check sequence (FCS). When received over a trunk port, the VLAN tag is removed and the FCS is restored before the (now) untagged frame is forwarded (as needed) to all access ports associated with that VLAN. Adding four bytes to an Ethernet frame containing 1,500 bytes of user data creates a jumbo frame, which, according to the original Ethernet/ 802.3 standards, is a frame larger than 1,518 bytes (not counting the Start Frame Delimiter). Modern devices typically adjust the local definition of a jumbo frame when VLAN tagging is in effect to support socalled baby giants of 1,522 octets, but this is not always the case. Note that older LAN switching gear may not even support VLAN tagging/.1Q trunking. Although you can pass VLAN-tagged traffic through such a pre-VLAN switch, you must ensure that it’s capable of being configured to support the larger frame sizes that result from tag insertion to ensure that you do not suffer jumbo-related frame discards.
The Tag Protocol Identifier (TPID) informs switches as to whether there is a .1Q tag field in the frame being processed; the default coding of 0 × 8100 is selected to not conflict with valid IEEE 802.3 Length indicators, which are always less than 0 × 0600, or with any preexisting EtherType codes. As a result, tag coding is unambiguous and ensures that proper actions are taken for tagged and untagged frames. Other TPID values exist to support stacked VLANs, which is also known as QinQ and is described in a later section. The Priority Code Point (PCP) is defined in IEEE 802.1p, and provides eight levels (0–7) of priority indication to accommodate class of service (CoS) actions by Layer 2/3 devices. The use of .1p priority as part of a CoS solution is covered in Chapter 10. Note that a Layer 3 device can also use .1p marking when configured for VLAN tagging via 802.1Q, but more often, Layer 3 devices are set to look into the Layer 3 header, that is, at an IP packet’s Precedence or DiffServ Code Points (DSCPs), for CoS classification.
270 | Chapter 5: Virtual LANs and Trunking Download at Boykma.Com
The Canonical Format Identifier (CFI) is used to support translational bridging between Ethernet and Token Ring networks. Ethernet/802.3 LANs use a canonical address format, meaning that each octet of the MAC address is sent starting with the Least Significant Bit (LSB) first. In contrast, Token Ring networks (IEEE 802.5) send each address octet starting with the Most Significant Bit (MSB). This bit is sometimes referred to as the Token Ring Encapsulation flag, which denotes its historical use in this capacity. The term historical is used here because, despite its technical merits, the simple truth is that 802.5/Token Ring and the related Source Route Bridging (SRB) failed in the marketplace, and quite resoundingly, too. This fact makes the whole concept of translational bridging moot given the ubiquitous nature of Ethernet technologies. The 12-bit VLAN Identifier field is the meat of the matter here; it codes the VLAN value in the range of 0 to 4,095 inclusive. Note that a coding of 0 indicates a frame that is not part of any VLAN. In this case, the .1Q tag can still indicate user priority and is referred to as a priority tag. Also, the all-1s value of 0×FFF (decimal 4,095) is reserved for implementation use. Together these restrictions yield a total of 4,094 usable VLANs. Note that in some implementations the VLAN number space is said to be global (chassisbased), and in some cases internal functions may consume additional VLAN IDs, further reducing the values that can be defined for user purposes; in the EX architecture, VLAN numbering is global, but the full range of VLAN IDs from 1 to 4,094 are available for use. It’s a common practice to see a VLAN, oftentimes VLAN 1, reserved for network management, especially on Cisco devices, which, unlike EX switches, often do not support a discrete Out of Band (OoB) management interface that is reserved for that purpose.
MX Platforms and Switching Domains Although coverage of the MX platform is outside the scope of this book, it bears mentioning that the MX platform supports the notion of a virtual switching domain or instance. On an MX, each switching instance can support the full range of 1 to 4,094 VLAN IDs, and you can bridge/route between these switching domains using an Integrated Route Bridge (IRB) interface. EX platforms do not support virtual switches, or the IRB construct. On an EX you use an RVI to route between VLANs that are all part of its single switching instance.
QinQ, a.k.a. provider bridging The term QinQ, also called Service VLANs (S-VLANs), defines a method of pushing multiple VLAN tags onto a single frame, typically at the edges of a service provider’s network, to provide a VLAN “trunk of trunks” type of service that requires a minimum of cooperation between the service’s users and the service provider. In some ways, this is similar to an ATM Virtual Path Indicator (VPI), which allowed a single virtual path to carry multiple Virtual Chassis (VCs) that were managed by the end user in a manner that was transparent to the provider of the ATM path service. Virtual LANs and Trunking | 271 Download at Boykma.Com
QinQ is defined in the IEEE 802.1ad-2005 specification and is gaining popularity in metropolitan and wide-area LAN emulation services, sometimes called a Transparent LAN Service (TLS) or a Virtual Private LAN Service (VPLS) because of the added flexibility to the service user and ease of management for the provider. In the basic case, the service provider allocates a single outer tag, called a Service tag (S-VLAN), that’s used to identify the customer access link; this leaves the customer free to add additional VLANs, called Customer VLANs (C-VLANs), which are then trunked over the provider’s core in transparent fashion. In most cases, an alternative TPID value is used for the outer tag to flag QinQ versus normal, single-tagged traffic. Although the 802.1ad specification defines 0×88a8 for service-provider outer tags, most QinQ-supporting equipment allows you to define the S-tag value, and 0×9100 or 0×9200 are commonly used in today’s networks. Figure 5-2 shows a typical QinQ scenario. Figure 5-2 shows two provider customers: Customer 1 is using tagged frames and Customer 2 sends native Ethernet; within the service provider’s network, an additional layer of tagging in the form of S-tags is added. This results in both the original C-tag as well as an S-tag for Customer 1, while Customer 2 has only the S-tag when in the provider’s core. The additional layer of trunking allows the customers to manage their own VLAN trunking independent of the service provider, which greatly simplifies VLAN moves, adds, and changes. The provider gains the benefit of being able to offer an S-VLAN service, and can also take steps to normalize tagging for its customers and their varying service types, which in turn can simplify general operations and maintenance activities, creating the proverbial win-win situation for QinQ. With all those great things to be said for S-VLANs, it has to be noted that in the 9.2 JUNOS release, EX platforms do not offer QinQ support. As always, this may change in a later release, so check back often. MX platforms feature full QinQ support and can be used to build the core/distribution layer in a large switching deployment involving both S-VLANs and large-scale routing services as well. By mixing and matching lowercost EX platforms at the network while the more sophisticated (and expensive) MX platforms handle the core, you get the best of both worlds: many lower-cost ports at the edge, combined with fewer high-cost but also high-touch ports in the core that provide both value-added services and high-speed transport.
272 | Chapter 5: Virtual LANs and Trunking Download at Boykma.Com
Figure 5-2. S-VLANs (QinQ) in action
Virtual LANs and Trunking | 273 Download at Boykma.Com
The Native and Default VLANs There is much confusion over the terms default VLAN and native VLAN, and whether this means tagged or untagged. In many cases, the confusion stems from the fact that the native and default VLANs can be different, but by default are the same in IOS devices, and because the native VLAN can use tagging, but typically is sent and received untagged.
The native VLAN Clause 9 in the 802.1Q specification defines a native VLAN that is designed to support older switches that do not understand .1Q tagging. Although this is not a Cisco book, Cisco did invent much of what is now called bridging and routing, and many modern network concepts have roots in IOS. Cisco provides the following definition of the native VLAN: The native VLAN is defined as the VLAN to which a port returns when not trunking, and is the untagged VLAN on an 802.1Q trunk. By default, VLAN 1 is the native VLAN.
In other words, the native VLAN defines how a switch transmits and receives traffic associated with the native VLAN assigned to the switch port. At egress, such traffic is not tagged, and is therefore sent in native (i.e., untagged) format on that link. In reverse, at reception any untagged frame is assumed to belong to that port’s native VLAN. Support for native VLAN allows a trunk to send and receive a mix of tagged and untagged traffic, with the latter being mapped to the trunk’s native VLAN. Non-native traffic is always explicitly tagged when sent over a trunk interface, and upon reception the explicit tag value is used to associate the traffic with its destination VLAN. In contrast, the lack of an explicit tag implicitly associates traffic with that port’s native VLAN. Although each trunk can have its own native VLAN, the current best practice is to define a single native VLAN within the bridge domain. Native VLANs are significant when interoperating with Cisco devices because the switches have historically associated control plane traffic with a native VLAN in an effort to protect the (limited) control plane resources from the burden associated with having to process end-station multicast and broadcast traffic. Placing the management and Layer 2 control plane traffic in a specific VLAN, one that is not shared by normal user devices, alleviated this problem. Historically, the native VLAN on a Cisco device is VLAN ID 1, and as noted, the associated traffic is typically sent and received untagged; note that you can alter this behavior on supported platforms with a vlan dot1q tag native configuration statement. You can also modify the native VLAN ID with the interface-level switchport trunk native vlan command; but keep in mind that making changes to the native VLAN ID can lead to complexities with signaling protocols and should be approached with caution.
274 | Chapter 5: Virtual LANs and Trunking Download at Boykma.Com
It should also be noted that in IOS, support for implicit tagging has resulted in an exploit that allows traffic to jump across VLAN boundaries without having to first cross a router. See http://www.sans.org/resources/idfaq/vlan.php for more information. Although it’s unclear whether EX switches are vulnerable to this particular issue, the current best practice is to ensure that the native VLAN ID used for trunk ports is never assigned to user access ports, thus preventing a user from crafting traffic that seeks to avail itself of special treatment via the implicit tagging that was really intended for interswitch communications. You need to watch out for the vendor’s defaults here. In Cisco’s case, the defaults have trunk ports accepting untagged traffic as part of the native VLAN, and all access ports belong to this native VLAN, a condition that can open you up to this exploit and put you in conflict with Cisco’s stated best practice. In contrast, JUNOS trunk ports do not accept untagged traffic without explicit configuration to do so, and all interfaces are placed into a default and untagged VLAN. The native VLAN concept is also used to support IP telephony devices that do not support Link Layer Discovery Protocol (LLDP). Here the switch port attached to the IP telephone is placed into trunk mode, and a native VLAN is defined to map untagged data traffic received via the phone’s PC interface into a data VLAN, while the voice traffic is sent and received using the access port tag, which is in turn associated with voice traffic and specialized CoS treatment. We provide details on EX IP telephony and LLDP support in Chapter 10.
The default VLAN A default VLAN describes a device’s factory-default VLAN configuration and is not part of any LAN standard. Generally, this configuration places all Layer 2 interfaces into a common VLAN, one that is not tagged and which provides out-of-the-box connectivity among all ports. On a Cisco switch, the default has all interfaces in access mode and associated with VLAN 1, the native VLAN. On EX switches, the factory default places all interfaces into an untagged VLAN called default. The JUNOS Layer 2 default configuration does not define a native VLAN, and explicit support for a native VLAN must be added to trunk interfaces with the native-vlan-id statement.
Putting it all together We’ve covered quite a few concepts getting to this point. It’s time to step back and look at the big picture, and Figure 5-3 provides just such an overview of the key concepts we’ve covered thus far.
Virtual LANs and Trunking | 275 Download at Boykma.Com
Figure 5-3. VLANs and trunking: putting it all together
Figure 5-3 shows two user communities named red and green. The two communities are associated with VLAN tags 10 and 20, respectively. The end-user devices are attached to access ports that send and receive untagged traffic, which in turn are associated with VLAN ID 10 or 20 based on user role. The trunk interface is configured with both the green and red VLANs, and user traffic is explicitly tagged based on the ingress access port’s VLAN association. In this example, a native VLAN has been defined (or is a default) on each trunk port and uses VLAN ID 1. Traffic that is intended for the other end of the link—for example, a Cisco Discovery Protocol (CDP) packet or an EX’s LLDP message—is sent on the native VLAN, which means this traffic is not tagged. The default/native VLAN handling behavior differs between an EX and an IOS device:
276 | Chapter 5: Virtual LANs and Trunking Download at Boykma.Com
Cisco • The default VLAN is untagged and is the native VLAN. • Trunk ports default to accept all for VLANs in the range 1 to 4,095, which includes the native VLAN, which is also the default VLAN. • Ports default to auto-negotiate and try to form trunks, or else operate as access ports. • Access ports that are not reassigned to some specific VLAN default to the native VLAN. JUNOS • The default VLAN is named default and is untagged. There is no native VLAN by default. • Ports default to access mode with no auto-negotiation; trunk ports do not support any VLANs, including the default VLAN. The result of the Cisco default is that stations on “unused” ports can communicate with other “unused” ports using the native VLAN, both locally and remotely via trunk interfaces. Such communications can represent a security risk, especially from known exploits that allow VLAN hopping when trunked over the native VLAN, not to mention the potential for a denial of service (DoS) attack given that control plane protocols often ride over the native VLAN as well. To mitigate these risks, you could redefine the native VLAN, disable native VLAN trunking, or simply configure all unused access ports into a non-trunked VLAN that acts as a type of quarantine. For JUNOS, explicit configuration is needed to create a native VLAN, and again to define a trunk port, and yet again to support the native VLAN on that trunk port. In addition, unused access ports default to the default VLAN, which, as previously stated, is not automatically supported by trunk interfaces, and as a result bars any remote connectivity for members of the default VLAN.
Generic Attribute Registration Protocol Generic Attribute Registration Protocol (GARP) is defined in the IEEE 802.1D (Bridging) standard, and is intended to provide a generic framework for bridges to register and deregister attribute values such as VLAN tags or multicast group membership. GARP defines the architecture, rules of operation, state machines, and variables for the registration and deregistration of these attribute values, while the attributes themselves are opaque to GARP, much as a donkey has no opinion about what’s in his saddle bags, as long as they’re not too heavy. One application for GARP is a VLAN management protocol called GARP VLAN Registration Protocol (GVRP), which can simplify the administration and management of VLAN membership information. As a network expands and the number of clients and
Virtual LANs and Trunking | 277 Download at Boykma.Com
VLANs increases, VLAN administration becomes complex, and the task of efficiently configuring VLANs on multiple switches becomes increasingly difficult. GVRP learns VLANs on a particular 802.1Q trunk port, and adds the corresponding VLAN to the trunk port if the learned VLAN is locally defined on that switch. For example, if two trunk-attached switches have a local VLAN 10 defined (the numeric tag must match, not necessarily the local symbolic name), and one of them associates its VLAN 10 with its trunk interface, the remote switch will automatically add its VLAN 10 to that trunk interface as well. The result is that one step is eliminated at an access switch. You still have to define the trunk port, enable GVRP, and define a local VLAN. But with GVRP, you are spared having to map the VLAN to the trunk interface. Restating this a bit differently, in the current EX implementation, GVRP can automate trunk VLAN membership on one end of a trunk as a result of changes to the local end’s VLAN definition (removing the VLAN indicates no interest, and that VLAN is pruned), or as a result of the remote end unbinding a VLAN from its trunk. In either case, that VLAN is automatically removed from the local switch’s trunk interface. In addition to reducing administration overhead, GVRP helps to preserve trunk bandwidth by pruning VLANs that are of no interest to the downstream switch, thus eliminating any flooding of broadcast traffic for that VLAN over that trunk.
Cisco and GVRP Although some IOS versions claim to support GVRP, most in-place boxes continue to use Dynamic Trunking Protocol (DTP) and VLAN Trunking Protocol (VTP) to automate trunk and VLAN administration. DTP first negotiates and ensures compatible trunk parameters (i.e., encapsulation type and native VLAN), and after trunk establishment VTP kicks in (when so configured) to automatically propagate VLAN membership information. JUNOS devices do not support either DTP or VTP. You should disable both protocols to ensure proper operation in an EX network. This is especially true for DTP, which when run over a trunk attached to a non-IOS device will typically fail to activate the trunk. You should disable DTP on trunks that attach to an EX device using an interfacelevel switchport nonegotiate command. It should be stressed that, unlike Cisco’s VTP, GVRP does not support a client/server model, and the current implementation offers no support for authentication or encryption. Also, although VTP actually propagates VLAN definitions from the server to client switches, GVRP currently only handles trunk membership for VLANs that must still be locally defined on each switch.
VLAN and Trunking Summary This section detailed the concept of virtual LANs, the related use of tagging to instantiate, and the use of trunk versus access interfaces in the role of a switch VLAN.
278 | Chapter 5: Virtual LANs and Trunking Download at Boykma.Com
Although this is not a Cisco book, the reality is that many EX switches will be installed alongside some form of IOS-based switching device. This section detailed the Cisco and Juniper defaults for Layer 2 interfaces, and how these relate to interoperability and out-of-the-box operation. In the next section, we put the theory to good use when we deploy VLANs and trunking in a Cisco/Juniper switching environment.
EX to Catalyst VLAN Integration Having once again muddled our way through the boring background, it’s time to jump on the test bed and put all this information to use. Figure 5-4 details the test topology used in the VLAN trunking integration task. Before going any further, the following topology characteristics should be duly noted: • There is a mix of IOS and Juniper EX devices; note that integration is fun. • The switches and links are chosen to be loop-free and STP is disabled; STP is detailed in the next chapter. • All switches are running a factory-default configuration with regard to Layer 2 interfaces, with the exception that STP is explicitly disabled. • The four host machines share an IP subnet that permits full connectivity if allowed by the switched backbone.
Disabling STP in a Switched Network! Are You Crazy? In a word, yes. That being said, STP serves a useful purpose in a switched Layer 2 network, and failing to run it when it’s actually needed will quickly generate a deluge of flooded traffic that will crash your network. Loops are bad: very, very bad. But so too is running with a pair of scissors, usually. In this case, we have specific pedagogical reasons for doing this. Chief among them is that STP is covered in the next chapter, it’s not technically needed in a physically loopfree network, and it has little to do with the topics of VLAN tagging and trunking proper. Given that this is not a production network and the topology is known to be loop-free, and considering the flow of material coverage, it makes perfect sense to disable STP in this context. In a similar fashion, a highly trained individual wearing appropriate safety attire in a controlled environment that’s free of innocents may well have a good reason for wanting to run with a pair of scissors, and by golly, with these constraints, he ought to be free to do so!
EX to Catalyst VLAN Integration | 279 Download at Boykma.Com
Figure 5-4. VLAN trunking topology: default behavior
Default VLAN/Trunking Behavior Before making changes to add VLANs and trunking, it’s a good idea to first get your head around each vendor’s out-of-the-box Layer 2 behavior. Note again that aside from disabling STP, both the IOS and JUNOS EX boxes are in their factory-default mode of operation, which is based on Layer 2 switching. The relevant portions of Whiskey, an IOS-based Catalyst 3550 switch, are shown here: Whiskey#show running-config Building configuration... . . . spanning-tree mode pvst
280 | Chapter 5: Virtual LANs and Trunking Download at Boykma.Com
spanning-tree extend system-id no spanning-tree vlan 1-4094 ! . . . interface FastEthernet0/1 switchport mode dynamic desirable ! . . . interface FastEthernet0/7 switchport mode dynamic desirable ! . . . interface FastEthernet0/24 switchport mode dynamic desirable ! . . . end
Based on the configuration, it can be said that STP has been disabled on all VLANs, that no specific VLAN definitions exist, and that all interfaces are in their default mode, which means they try to form a trunking relationship (via DTP), or the port falls back to access mode. Knowing that JUNOS does not speak DTP, it’s safe to assume that Whiskey’s Fa0/1 port is in access mode, which is confirmed: Whiskey#show interfaces Fa0/1 switchport Name: Fa0/1 Switchport: Enabled Administrative Mode: dynamic desirable Operational Mode: static access Administrative Trunking Encapsulation: negotiate Operational Trunking Encapsulation: native Negotiation of Trunking: On Access Mode VLAN: 1 (default) Trunking Native Mode VLAN: 1 (default) Administrative Native VLAN tagging: enabled Voice VLAN: none . . . Trunking VLANs Enabled: ALL Pruning VLANs Enabled: 2-1001 Capture Mode Disabled Capture VLANs Allowed: ALL
The highlighted portions of the code confirm the port’s dynamic/desirable setting, which makes it trunking-capable and always looking to establish a trunk when a compatible device is detected. The port is currently in access mode, which is expected given that the remote end does not speak DTP. As an access port, the current encapsulation is native, indicating that no tagging is in effect on this port. Some other trunk defaults, such as default support for the native VLAN and allowed VLAN range, are also highlighted. The results are compared to the state of Whiskey’s Fa0/24 port, which is attached to another IOS device, and therefore was able to form a trunk via DTP:
EX to Catalyst VLAN Integration | 281 Download at Boykma.Com
Whiskey#show interfaces Fa0/24 switchport Name: Fa0/24 Switchport: Enabled Administrative Mode: dynamic desirable Operational Mode: trunk Administrative Trunking Encapsulation: negotiate Operational Trunking Encapsulation: isl Negotiation of Trunking: On Access Mode VLAN: 1 (default) Trunking Native Mode VLAN: 1 (default) . . .
The output confirms that DTP has found a soul mate in Gin, and as a result established an operational trunk. In this case, the default encapsulation is the proprietary ISL rather than the standards-based .1Q, but that’s no great surprise, as this is a Cisco-to-Cisco link, and ISL is Cisco’s own brand of dog food, so they may as well dine on it. Even though Fa0/24 is an operational trunk, given that only the native VLAN currently exists, the net result is that no VLAN tagging occurs on this port, either. The default VLAN state for IOS is confirmed with a show vlan brief command; note that the Fa0/24 interface is omitted from the port listing due to its trunk status: Whiskey#show vlan brief VLAN Name Status Ports ---- ---------------------- --------- ------------------------------1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4 Fa0/5, Fa0/6, Fa0/7, Fa0/8 Fa0/9, Fa0/10, Fa0/11, Fa0/12 Fa0/13, Fa0/14, Fa0/15, Fa0/16 Fa0/17, Fa0/18, Fa0/19, Fa0/20 Fa0/21, Fa0/22, Fa0/23, Fa0/25 Fa0/26, Fa0/27, Fa0/28, Fa0/29 Fa0/30, Fa0/31, Fa0/32, Fa0/33 Fa0/34, Fa0/35, Fa0/36, Fa0/37 Fa0/38, Fa0/39, Fa0/40, Fa0/41 Fa0/42, Fa0/43, Fa0/44, Fa0/45 Fa0/46, Gi0/1, Gi0/2 . . .
The display confirms that only the default VLAN is defined, which here is also the native VLAN by virtue of its tag 1 assignment. Note that all non-trunk interfaces are listed as members of the default/native VLAN, to include the link to switch Vodkila given that trunking was not successfully negotiated there. Recall that the ISL trunk between Whiskey and Gin, the only trunk in the current network, has already been confirmed to support VLAN 1 as its native VLAN. The output of a show interfaces trunk command confirms its status: Whiskey#show interfaces trunk Port Mode Encapsulation Status Fa0/24 desirable n-isl trunking Port Fa0/24
Vlans allowed on trunk 1-4094
282 | Chapter 5: Virtual LANs and Trunking Download at Boykma.Com
Native vlan 1
Port Fa0/24
Vlans allowed and active in management domain 1
Port Fa0/24
Vlans in spanning tree forwarding state and not pruned 1
As noted in a previous section, the net result here is that there will be no VLAN tagging because only the native VLAN is in effect, all access ports belong to the native VLAN, and all trunk ports consider VLAN 1 as their native VLAN and support trunking of this VLAN. Security issues aside, the net result is a plug-and-play switch that provides connectivity among all devices. In fact, to an external observer, the current operation of the IOS devices mirrors that of a non-VLAN-aware switch. All ports are allowed to communicate, both locally and via the “uplink” (ISL trunk) to remote ports; there is no tagging; and there is a single broadcast domain by virtue of there being only one virtual LAN, the native/default one. Having seen the IOS default behavior, you do the same for the JUNOS switch Vodkila. First, the relevant bits of its configuration: [edit] lab@Vodkila# show interfaces ge-0/0/0 { description "To Rum"; unit 0 { family ethernet-switching; } } ge-0/0/3 { description "To Whiskey"; unit 0 { family ethernet-switching; } } ge-0/0/7 { description "To Host 1"; unit 0 { family ethernet-switching; } } . . . [edit] lab@Vodkila# show protocols . . . stp { disable; } [edit] lab@Vodkila# show vlans [edit] lab@Vodkila#
EX to Catalyst VLAN Integration | 283 Download at Boykma.Com
Seems fair enough. STP is disabled globally, as was the case with Cisco; the pertinent interfaces are operating in their default mode; and no explicit VLAN configuration has been performed. In the Juniper case, all ports default to access mode. Although not the most direct characteristic to view, adding the extensive switch to a show vlans command does the trick: [edit] lab@Vodkila# run show vlans extensive VLAN: default, Created at: Sat Jan 1 17:54:05 2005 Internal index: 6, Admin State: Enabled, Origin: Static Protocol: Port Mode Number of interfaces: Tagged 0 (Active = 0), Untagged 3 (Active = 3) ge-0/0/0.0*, untagged, access ge-0/0/3.0*, untagged, access ge-0/0/7.0*, untagged, access . . .
The highlighted portions of this snippet confirm that no trunks are enabled in the default VLAN. The Protocol field identifies whether a VLAN is operating in the default port rather than MAC-based VLAN mode. Also note that all three interfaces associated with the default VLAN are in access mode and are operating in an untagged mode. Although the default VLAN is similar to IOS’s native VLAN, a key difference here is that no VLAN ID is assigned to the default VLAN, and the default VLAN is not considered synonymous with a native VLAN, which in JUNOS has to be explicitly configured on each trunk. This all assumes, of course, that a native VLAN is even desired. It’s IOS that seems to get wrapped around the whole native VLAN axle, after all. Note that in the JUNOS case we have no trunk ports, even on the Juniper-to-Juniper link between Vodkila and Rum; this is expected given no support for a dynamic trunking protocol such as DTP in the 9.2 release being tested. There are significant differences in the two vendors’ defaults: for example, native VLAN 1 versus an untagged default VLAN, or IOS having ports that want to be trunks, and in fact actually having an active ISL trunk to its IOS brethren, while the EX switches have only access ports. The irony is that outside the respective chassis, no one is the wiser. Although the Cisco switch feels it has a trunk, the association with the native VLAN means there is no tagging, so in effect, the ISL trunk ends up operating as though it were an access port anyway! In the factory-default integration scenario, you discover the same overall connectivity and forwarding behavior with both operating systems, which is to say that all ports are able to talk to all others, forming a single logical IP subnet (LIS) that permits open communications among all four hosts. The communications bit is confirmed from the viewpoint of Host1: Host1#ping 200.2.2.2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 200.2.2.2, timeout is 2 seconds: !!!!!
284 | Chapter 5: Virtual LANs and Trunking Download at Boykma.Com
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/6/8 ms Host1#ping 200.2.2.3 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 200.2.2.3, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 4/14/48 ms Host1#ping 200.2.2.4 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 200.2.2.4, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 4/5/8 ms Host1#show ip arp Protocol Address Internet 200.2.2.1 Internet 200.2.2.2 Internet 200.2.2.3 Internet 200.2.2.4
Age (min) 1 1 1
Hardware Addr 0010.7b3a.02ea 0060.7015.9576 0010.7b3a.0404 0010.7b3a.0399
Type ARPA ARPA ARPA ARPA
Interface Ethernet0 Ethernet0 Ethernet0 Ethernet0
The pings to all three remote hosts succeed, and the Address Resolution Protocol (ARP) cache at Host1 reflects direct reachability at the IP layer, as no gateway (router) is used. A traceroute confirms a single hop, belying the Layer 2 forwarding nature of the current network: Host1#traceroute 200.2.2.2 Type escape sequence to abort. Tracing the route to 200.2.2.2 1 200.2.2.2 4 msec 4 msec *
Before moving on, clear the switching table of learned entries at Rum. Note that this command clears learned entries for all VLANs, which is currently only the default VLAN: [edit] lab@Rum# run clear ethernet-switching table [edit]
The now-empty table is confirmed: lab@Rum# run show ethernet-switching table Ethernet-switching table: 1 entries, 0 learned VLAN MAC address Type default * Flood
Age Interfaces - All-members
Well, it’s empty save for the flood entry used for unknown/multicast MAC addresses, which results in the sending of that frame to all interfaces that are members of that VLAN. Without STP enabled, there is really no reason for an interface to be blocked. The forwarding state is confirmed on both of Rum’s interfaces with a show ethernetswitching interfaces command:
EX to Catalyst VLAN Integration | 285 Download at Boykma.Com
lab@Rum# run show ethernet-switching interfaces Interface State VLAN members Blocking ge-0/0/0.0 up default unblocked ge-0/0/4.0 up default unblocked
To validate MAC address learning, you quickly generate another set of pings from Host1 to Host4: Host1#ping 200.2.2.4 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 200.2.2.4, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 4/29/128 ms Host1#
and again display the switching table at Rum: [edit] lab@Rum# run show ethernet-switching table Ethernet-switching table: 4 entries, 3 learned VLAN MAC address Type default * Flood default 00:0b:5f:c3:cc:81 Learn default 00:10:7b:3a:02:ea Learn default 00:10:7b:3a:03:99 Learn
Age 31 29 26
Interfaces All-members ge-0/0/0.0 ge-0/0/0.0 ge-0/0/4.0
Good; three MAC addresses have been learned, and two appeared as SMACs on Rum’s ge-0/0/0 interface. Given the different OUI values, it’s a safe bet that 00:0b:5f:c3:cc: 81 belongs to Host1 and 00:10:7b:3a:02:ea belongs to Vodkila. We can make this assumption because the third MAC address, which was learned on Rum’s ge-0/0/4 interface, has the same 00:10:7b vendor (OUI) code, and from the topology it’s safe to say that Rum does not connect to two Cisco switches. The theory is quickly confirmed with a show chassis mac-addresses command: [edit] lab@Vodkila# run show chassis mac-addresses FPC 0 MAC address information: Public base address 00:1f:12:3d:b4:c0 Public count 64 FPC 1 MAC address information: Public base address 00:1f:12:3d:d2:80 Public count 64
The chassis MAC at Vodkila indeed matches one of the two addresses learned on Rum’s ge-0/0/0 interface. Therefore, the other MAC must belong to Host1, which in this lab is actually a Cisco router, thus explaining the use of the 0010.7b OUI, a value that is registered to our good friends over on Tasman Drive (Cisco Systems, Inc.): Host1#show interface ethernet 0 | include Hardware Hardware is Lance, address is 0010.7b3a.02ea (bia 0010.7b3a.02ea)
Having analyzed the default out-of-the-box Layer 2 behavior for both Cisco and Juniper, and finding it more or less the same despite some differences, you decide in all 286 | Chapter 5: Virtual LANs and Trunking Download at Boykma.Com
your pluckiness to proceed with the addition of VLAN and trunk interfaces. After all, what could go wrong?
Define VLANs In this section, you’ll modify the default configuration by adding VLAN definitions and associating access ports with the correct VLAN. Figure 5-5 details the logical partitioning needed in this example.
Figure 5-5. VLAN topology for the Sales and Admin groups
Figure 5-5 confirms that two VLANs are needed: one for the Sales group supporting Host1 and Host2, and another for the Admin group with Host3 and Host4. Two user communities, two VLANs: seems simple enough. In this example, IDs 10 and 20 are used for the Sales and Admin groups, respectively. Because of the specifics in this topology, some switches need to support both VLANs on their trunks whereas others need to support one trunked VLAN. EX to Catalyst VLAN Integration | 287 Download at Boykma.Com
Perhaps noteworthy, if only by virtue of its omission, is the absence of trunking support for Cisco’s native VLAN. Given that the native VLAN is primarily an issue for Cisco and its litany of proprietary signaling protocols, there is no real need for a native VLAN here, as the only two IOS devices are directly connected and most of the signaling that happens on the native VLAN is not supported by EX switches, and in this example there is no need to “trunk” CDP or the like over the EX core. The plan in this example is to omit native VLAN definition at the EX switches, and disallow trunking of the native VLAN on the Cisco switches. In this manner, the native VLAN remains unchanged in the Cisco switches, but now functions as a type of quarantine used by unassigned access ports, which default to VLAN 1. By disabling trunk support, you ensure that “unused” access ports cannot communicate with core switch ports, or other remote “unused” access ports over the native VLAN.
Configure and confirm IOS VLANs and trunking As usual, we start with the configuration needed for the Cisco switches, in this example Whiskey: Whiskey#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Whiskey(config)#interface fastEthernet 0/7 Whiskey(config-if)# switchport mode access Whiskey(config-if)#switchport access vlan 10 % Access VLAN does not exist. Creating vlan 10
The first set of configuration commands forces the Fa0/7 switch port into access mode, and associates the port with VLAN 10. The software notes that the related VLAN does not exist, and kindly creates one for you: Whiskey(config-if)#exit Whiskey(config)#vlan 10 Whiskey(config-vlan)#name "Sales_vlan"
The next set of commands adds a description to denote the VLAN’s association with the sales team. So far, so good; you move on to configure the Admin VLAN. Although there are no local access ports for this VLAN, Whiskey still needs to trunk VLAN 20 to Vodkila to permit communications between Host3 and Host4, and therefore must know of the VLAN so that it can be made active: Whiskey(config-vlan)#exit Whiskey(config)#vlan 20 Whiskey(config-vlan)#name "Admin_vlan"
Although the vlan commands are entered in configuration mode, subsequent display of the running configuration does not reflect the VLAN definitions. The output of a show vlan command confirms that they persist through reloads, however. To see locally defined VLANs in the running configuration you must be in VTP transparent mode.
288 | Chapter 5: Virtual LANs and Trunking Download at Boykma.Com
With both VLANs defined, and the Host1 access port configured, confirm the access and trunk port settings at Whiskey: Whiskey#show interfaces fastEthernet 0/7 switchport Name: Fa0/7 Switchport: Enabled Administrative Mode: static access Operational Mode: static access Administrative Trunking Encapsulation: negotiate Operational Trunking Encapsulation: native Negotiation of Trunking: Off Access Mode VLAN: 10 (Sales_vlan) Trunking Native Mode VLAN: 1 (default) Administrative Native VLAN tagging: enabled . . .
The output confirms that the access port is correctly configured. This leaves only the trunk definitions at Whiskey. Given that both Whiskey and Gin are compatible IOS devices, you opt to leave the defaults in place and initially focus on the shared trunk. The default settings are expected to yield a dynamically negotiated ISL trunk. The switch port settings are displayed with a show interfaces switchport command: Gin#show inter fastEthernet 0/24 switchport | include Trunking Administrative Trunking Encapsulation: negotiate Negotiation of Trunking: On Trunking Native Mode VLAN: 1 (default) Trunking VLANs Enabled: ALL
The results confirm that things pretty much “just worked” on the Cisco-to-Cisco trunk, with the exception that the trunk supports only the native VLAN, which is the default. This condition is quickly remedied with a switchport trunk allowed statement omitting VLAN 1: . . . Whiskey(config)#interface fa0/24 Whiskey(config-if)#switchport trunk allowed vlan 2-4094 Whiskey(config-if)#^Z
The modified trunk status is displayed: Whiskey#show interfaces fastEthernet 0/24 switchport Name: Fa0/24 Switchport: Enabled Administrative Mode: dynamic desirable Operational Mode: trunk Administrative Trunking Encapsulation: negotiate Operational Trunking Encapsulation: isl Negotiation of Trunking: On Access Mode VLAN: 1 (default) Trunking Native Mode VLAN: 1 (default) . . . Trunking VLANs Enabled: 2-4094 Pruning VLANs Enabled: 2-1001 . . .
EX to Catalyst VLAN Integration | 289 Download at Boykma.Com
The show interfaces trunk command is also useful when confirming IOS trunk status and VLAN settings. Here’s some sample output: Whiskey#show interfaces fastEthernet 0/24 trunk Port Fa0/24
Mode desirable
Encapsulation Status n-isl trunking
Native vlan 1
Port Fa0/24
Vlans allowed on trunk 2-4094
Port Fa0/24
Vlans allowed and active in management domain 10,20,666
Port Fa0/24
Vlans in spanning tree forwarding state and not pruned 10,20,666
However, you notice that things are not so rosy on Whiskey’s “trunk” connection to EX switch Vodkila: Whiskey#show interfaces fastEthernet 0/1 switchport Name: Fa0/1 Switchport: Enabled Administrative Mode: dynamic desirable Operational Mode: static access Administrative Trunking Encapsulation: negotiate Operational Trunking Encapsulation: native Negotiation of Trunking: On Access Mode VLAN: 1 (default) . . .
The display confirms the expected: Cisco’s proprietary DTP/ISL protocols failed to successfully negotiate a trunk link to a JUNOS device. There’s no real surprise here, it would seem. To interoperate, you must configure compatible trunking parameters, which in this case require that you manually set trunk mode and use .1Q tagging. You move on to make the changes needed for an interoperable VLAN trunk between an IOS- and JUNOS-based device: Whiskey#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Whiskey(config)#interface fastEthernet 0/1 Whiskey(config-if)#no switchport 1d22h: %LINK-3-UPDOWN: Interface FastEthernet0/1, changed state to up 1d22h: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up Whiskey(config-if)#switchport Whiskey(config-if)#switchport mode trunk 1d22h: %LINK-3-UPDOWN: Interface FastEthernet0/1, changed state to up 1d22h: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down 1d22h: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up Whiskey(config-if)#switchport trunk encapsulation dot1q Whiskey(config-if)#switchport nonegotiate
290 | Chapter 5: Virtual LANs and Trunking Download at Boykma.Com
Whiskey(config-if)#switchport trunk allowed vlan 2-4094 Whiskey(config-if)#^Z
In this example, the no switchport command is issued first to clear previous switch port defaults, which in turn ensures no conflicts with the configuration commands that are then entered. Note that the trunk is set to switchport nonegotiate, which “nails up” the trunk’s status while also ensuring that no resources are wasted on attempts to dynamically negotiate trunk mode and parameters; disabling negotiation can prevent unpredictable operation that may occur when both ends of a trunk don’t support the same negotiation protocols. Note that native VLAN trunking is disabled via the switch port trunk allowed vlan 2-4094 statement, which is in keeping with the deployment plans described previously. The new trunk settings at Whiskey are confirmed: Whiskey#show interfaces fastEthernet 0/1 switchport Name: Fa0/1 Switchport: Enabled Administrative Mode: trunk Operational Mode: trunk Administrative Trunking Encapsulation: dot1q Operational Trunking Encapsulation: dot1q Negotiation of Trunking: Off Access Mode VLAN: 1 (default) Trunking Native Mode VLAN: 1 (default) Administrative Native VLAN tagging: enabled . . . Trunking VLANs Enabled: 2-4094 Pruning VLANs Enabled: 2-1001 . . .
Similar changes are now made at switch Gin. Specifically, both the Sales and Admin VLANs are defined, and the Fa0/3 trunk to Brandy is configured for static .1Q operation. In this example, CDP is disabled on Gin’s Fa0/3 link using a no cdp enable interfacelevel configuration statement, because CDP is not supported by the EX, and therefore the protocol would just waste bandwidth here. The VLAN settings are confirmed at Gin: Gin#show vlan brief VLAN Name Status Ports ---- ---------------------- --------- ------------------------------1 default active Fa0/1, Fa0/2, Fa0/4, Fa0/5 Fa0/6, Fa0/7, Fa0/8, Fa0/9 Fa0/10, Fa0/11, Fa0/12, Fa0/13 Fa0/14, Fa0/15, Fa0/16, Fa0/17 Fa0/18, Fa0/19, Fa0/20, Fa0/21 Fa0/22, Fa0/23, Fa0/25, Fa0/26 Fa0/27, Fa0/28, Fa0/29, Fa0/30 Fa0/31, Fa0/32, Fa0/33, Fa0/34 Fa0/35, Fa0/36, Fa0/37, Fa0/38 Fa0/39, Fa0/40, Fa0/41, Fa0/42 Fa0/43, Fa0/44, Fa0/45, Fa0/46 Gi0/1, Gi0/2
EX to Catalyst VLAN Integration | 291 Download at Boykma.Com
10 20
Sales_vlan Admin_vlan
active active
You can assume that Gin’s ISL and .1Q trunks are configured as described for Whiskey, and are confirmed operational. With the IOS devices configured and confirmed, it’s time to direct attention to getting JUNOS and the EX switches up and running in the trunking topology.
JUNOS VLAN and trunk configuration Before moving on with the VLAN trunking configuration, first assess the state of host communications; recall that previously, with the default configurations, connectivity was confirmed among all four hosts: Host1#ping 200.2.2.2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 200.2.2.2, timeout is 2 seconds: ..... Success rate is 0 percent (0/5) Host1#ping 200.2.2.3 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 200.2.2.3, timeout is 2 seconds: ..... Success rate is 0 percent (0/5) Host1#ping 200.2.2.4 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 200.2.2.4, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 4/4/8 ms Host1#
The limited connectivity matches expectations, given the partial trunking configs now in place. Host1 and Host3 can still communicate because the EX switches they transit are still in the default any-to-any untagged mode. The other pings fail because this traffic leaves Vodkila untagged, and it is therefore assumed to be part of the native VLAN upon receipt at Whiskey. Because native VLAN trunking has been disabled, this traffic is dropped. A similar fate befalls Host2 to Host3 pings: Host2#ping 200.2.2.3 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 200.2.2.3, timeout is 2 seconds: ..... Success rate is 0 percent (0/5) Host2#
292 | Chapter 5: Virtual LANs and Trunking Download at Boykma.Com
This traffic belongs to the Sales VLAN at Whiskey, and therefore arrives at Brandy with a VLAN tag of 10. However, Brandy has no such VLAN configured, and no trunk ports, for that matter, so the tagged traffic is dropped at ingress. The JUNOS configuration begins at switch Vodkila, where the two VLANs are defined at the [edit vlans] hierarchy. The supported options to the vlan statement are displayed with the command-line interface’s (CLI’s) ? help function: [edit] lab@Vodkila# edit vlans [edit vlans] lab@Vodkila# set ? Possible completions:
+ apply-groups + apply-groups-except > traceoptions [edit vlans]
VLAN name Groups from which to inherit configuration data Don't inherit configuration data from these groups VLAN trace options
The context-based help implies that the software is looking for a name, so one is provided: lab@Vodkila# set Sales_vlan ? Possible completions:
Execute this command + apply-groups Groups from which to inherit configuration data + apply-groups-except Don't inherit configuration data from these groups description Text description of the VLAN > filter Packet filtering > interface Name of interface that uses this VLAN l3-interface Layer 3 interface for this VLAN mac-limit Number of MAC addresses allowed on this VLAN (1..65535) mac-table-aging-time MAC aging time (60..1000000 seconds) vlan-id 802.1Q tag (1..4094) vlan-range VLAN range in the form '-' | Pipe through a command
The output confirms that a number of VLAN-specific options are available. In JUNOS you can map a VLAN name to a specific tag, or to a range of tags, using the vlan-id or vlan-range keyword, respectively. In addition, you can apply Layer 2/Layer 3 filters on a VLAN basis with the filter hierarchy. You can also set MAC address limits and aging parameters under the mac-limit and mac-table-aging-time hierarchies. We cover VLAN-based filters in Chapter 8. The interface keyword is used to link the VLAN to an RVI (a.k.a. an SVI in IOS) that provides Layer 3 services (i.e., routing) for the VLAN. We cover the use of RVIs in Chapter 7. For now, define the two VLANs needed in this example: [edit vlans] lab@Vodkila# set Sales_vlan vlan-id 10
EX to Catalyst VLAN Integration | 293 Download at Boykma.Com
[edit vlans] lab@Vodkila# set Admin_vlan vlan-id 20
The result is confirmed: [edit vlans] lab@Vodkila# show Admin_vlan { vlan-id 20; } Sales_vlan { vlan-id 10; }
While in VLAN definition mode, add a single VLAN definition for Admin_vlan to Rum, Brandy, and Bourbon. Only Brandy is shown: [edit] lab@Brandy# edit vlans [edit vlans] lab@Brandy# load merge terminal relative [Type ^D at a new line to end input] Admin_vlan { vlan-id 20; } ^D load complete [edit vlans] lab@Brandy#
Only the Admin VLAN is defined on these three switches because all three service only Admin users. Adding full VLAN definitions to all switches is sometimes considered a good practice because it simplifies adds and changes, especially when using GVRP, as demonstrated in “Troubleshoot a VLAN problem” on page 301. In this example, we are keeping things minimal, so only the needed VLAN definition is added. The symbolic names used to reference VLAN tag values are locally significant. For proper operation, the tag value must match between switches; the names used to reference these tags are not communicated between switches. For obvious reasons, it’s considered a good practice to adopt a global naming strategy to avoid confusion as the network grows.
Meanwhile, back at Vodkila, the ge-0/0/7 interface is configured to belong to the Sales VLAN. This action removes the interface from the default VLAN, which is where the remaining access ports still reside: [edit vlans] lab@Vodkila# top
294 | Chapter 5: Virtual LANs and Trunking Download at Boykma.Com
[edit] lab@Vodkila# edit interfaces ge-0/0/7 [edit interfaces ge-0/0/7] lab@Vodkila# set unit 0 family ethernet-switching vlan members Sales_vlan
Note that when configuring VLAN assignments to an interface, you can use either a symbolic name, as shown here, or the corresponding numeric tag value. The result is displayed: [edit interfaces ge-0/0/7] lab@Vodkila# show description "To Host 1"; unit 0 { family ethernet-switching { vlan { members Sales_vlan; } } }
With the VLANs and access link defined, all that remains is trunk definition. You start with the ge-0/0/3 link to IOS device Whiskey: [edit interfaces ge-0/0/7] lab@Vodkila# up [edit interfaces] lab@Vodkila# edit ge-0/0/3 [edit interfaces ge-0/0/3] lab@Vodkila# set unit 0 family ethernet-switching port-mode trunk [edit interfaces ge-0/0/3] lab@Vodkila# set unit 0 family ethernet-switching vlan members Sales_vlan [edit interfaces ge-0/0/3] lab@Vodkila# set unit 0 family ethernet-switching vlan members Admin_vlan
The port-mode statement is used to place the interface’s logical unit into trunk mode; recall that the JUNOS default is access mode. The trunk settings are confirmed for the ge-0/0/3 interface: [edit interfaces ge-0/0/3] lab@Vodkila# show description "To Whiskey"; unit 0 { family ethernet-switching { port-mode trunk; vlan { members [ Sales_vlan Admin_vlan ]; } } }
EX to Catalyst VLAN Integration | 295 Download at Boykma.Com
Note that in this case, there is no native VLAN defined on the trunk interface. This is the JUNOS default, and is fine for our purposes; it’s one less VLAN to have to later remove (i.e., prune in IOS-speak) from the trunks, after all. The CLI supports the notion of the native VLAN, as well as a wildcard match-all function, via the native and all keywords. A set unit 0 family ethernet-switching vlan members all statement quickly adds all defined VLANs to a trunk interface, which saves a significant degree of work when dealing with large numbers of VLANs. This example shows the configuration of a single logical interface (ifl) that is assigned unit number 0. Note that in the 9.2 release used for this book, EX switches do not support the notion of flexible Ethernet encapsulation. The result is the mandate that any interface configured to support the ethernet-switching family must be assigned a single unit that is assigned number 0. This limitation is demonstrated at Rum: [edit interfaces ge-0/0/0] lab@Rum# show unit 0 { family ethernet-switching { port-mode trunk; } } unit 1 { family inet { address 200.0.0.1/24; } } [edit interfaces ge-0/0/0] lab@Rum# commit check [edit interfaces ge-0/0/0] 'unit 1' Only unit 0 is valid for this encapsulation error: configuration check-out failed
To better illustrate this point, the following example is taken from a significantly more expensive MX platform that does offer support for flexible Ethernet services: {master}[edit interfaces ge-5/0/3] user@mx960# run show chassis hardware | match mx Chassis JN10868FCAFA . . . {master}[edit interfaces ge-5/0/3] regress@auror# show vlan-tagging; encapsulation flexible-ethernet-services; unit 0 { encapsulation vlan-bridge; vlan-id-range 3-4094; family bridge; } unit 1 { vlan-id 2;
296 | Chapter 5: Virtual LANs and Trunking Download at Boykma.Com
MX960
family inet { address 200.0.0.1/24; } } {master}[edit interfaces ge-5/0/3] user@mx960# commit check configuration check succeeds
Getting back to the task at hand, the configuration of the ge-0/0/0 trunk is similar, except that it specifies only the Admin VLAN: [edit interfaces ge-0/0/0] lab@Vodkila# show description "To Rum"; unit 0 { family ethernet-switching { port-mode trunk; vlan { members Admin_vlan; } }
The configuration is committed at Vodkila, which should provide a working VLAN for hosts in the Sales VLAN. Proper operation is verified at Host1: Host1#ping 200.2.2.2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 200.2.2.2, timeout is 2 seconds: .!!!! Success rate is 80 percent (4/5), round-trip min/avg/max = 4/5/8 ms
The pings succeed, thereby confirming proper Sales VLAN operation. This is a good sign. You confirm VLAN status back at Vodkila with a show vlans command: [edit] lab@Vodkila# run show vlans Name Tag Interfaces Admin_vlan 20 ge-0/0/0.0*, ge-0/0/3.0* Sales_vlan 10 ge-0/0/3.0*, ge-0/0/7.0* default None mgmt bme0.32770, me0.0*
The output from the show vlans command confirms the presence of the default, Sales, and Admin VLANs. In this configuration, no unused interfaces are enabled for the ethernet-switching family, and as a result the default VLAN has no interface associations; the default VLAN still exists, however, and cannot be deleted. The asterisk (*) in the display denotes that unknown (BUM) traffic is flooded over the interface to facilitate learning and provide ongoing connectivity for traffic that can never be
EX to Catalyst VLAN Integration | 297 Download at Boykma.Com
learned—for instance, Open Shortest Path First (OSPF) routing updates, which are multicast-based. Ethernet switching information is displayed to complete validation of the Sales VLAN: [edit] lab@Vodkila# run show ethernet-switching interfaces Interface State VLAN members Blocking bme0.32770 down mgmt unblocked ge-0/0/0.0 up Admin_vlan unblocked ge-0/0/3.0 up Admin_vlan unblocked Sales_vlan unblocked ge-0/0/7.0 up Sales_vlan unblocked me0.0 up mgmt unblocked
The display confirms that the ge-0/0/3 interface is operating as a trunk, albeit somewhat indirectly by virtue of the interface having more than one VLAN association. In this case, ge-0/0/0 is also a trunk, but due to the single VLAN assignment, you cannot confirm the port’s role as access versus trunk interface in this display. For easy access to that information, use the extensive switch to the show vlans command: [edit] lab@Vodkila# run show vlans extensive Sales_vlan VLAN: Sales_vlan, Created at: Wed Jan 5 00:09:42 2005 802.1Q Tag: 10, Internal index: 8, Admin State: Enabled, Origin: Static Protocol: Port Mode Number of interfaces: Tagged 1 (Active = 1), Untagged 1 (Active = 1) ge-0/0/3.0*, tagged, trunk ge-0/0/7.0*, untagged, access
This output clearly indicates that the Sales VLAN has a single untagged access link and one tagged trunk, which is in accordance with the test topology. The show ethernetswitching table detail command is executed to confirm forwarding and learning behavior for each active VLAN: [edit] lab@Vodkila# run show ethernet-switching table detail Ethernet-switching table: 3 entries, 1 learned Admin_vlan, * Interface(s): ge-0/0/0.0 Interface(s): ge-0/0/3.0 Type: Flood Nexthop index: 1283 Sales_vlan, * Interface(s): ge-0/0/3.0 Interface(s): ge-0/0/7.0 Type: Flood Nexthop index: 1293 Sales_vlan, 00:10:7b:3a:02:ea Interface(s): ge-0/0/7.0 Type: Learn, Age: 0, Learned: 39:08 Nexthop index: 1285
298 | Chapter 5: Virtual LANs and Trunking Download at Boykma.Com
The output confirms that Admin_vlan has two flood interfaces, as denoted by the * character that denotes a wildcard (match-all) entry. As noted previously, the wildcard entries use a flood-style next hop, which confirms that BUM traffic associated with this VLAN will be flooded out of both the ge-0/0/3.0 and ge-0/0/7.0 interfaces; given this topology, this behavior ensures proper ARP flooding and resulting IP operation. Note that a flood next hop is always associated with an interface in Ethernet-switching mode, even when that interface is not forwarding, for example. The lack of a learned MAC entry on either of these ports implies there is no direct end-station attachment, which in turn indicates both trunk ports (as was confirmed previously). Sales_vlan also shows two flood next hops, but in addition displays a learned MAC address for its ge-0/0/7 access port. With Sales_vlan now confirmed, it’s time to shift your attention to the steps needed to get Admin_vlan up and running. Recall that you have already added the Admin_vlan definition to all switches, including Rum, Brandy, and Bourbon: [edit] lab@Rum# show vlans Admin_vlan { vlan-id 20; }
This means all that’s left to get things up and running is trunk definition at all three switches, and of course, the access port definitions for VLAN 20 at Brandy and Bourbon. You begin at Brandy with both access and trunk port definition: [edit interfaces] lab@Brandy# set ge-0/0/4 unit 0 family ethernet-switching port-mode trunk [edit interfaces] lab@Brandy# set ge-0/0/7 unit 0 family ethernet-switching vlan members Admin_vlan
That wasn’t too difficult, was it? You display the results and commit the changes: [edit interfaces] lab@Brandy# show ge-0/0/4 { unit 0 { family ethernet-switching { port-mode trunk; } } } ge-0/0/7 { unit 0 { family ethernet-switching { vlan { members Admin_vlan; } } } } . . . .
EX to Catalyst VLAN Integration | 299 Download at Boykma.Com
[edit interfaces] lab@Brandy# commit
Next, define both trunks at Rum: [edit interfaces] lab@Rum# set ge-0/0/0 unit 0 family ethernet-switching port-mode trunk [edit interfaces] lab@Rum# set ge-0/0/4 unit 0 family ethernet-switching port-mode trunk [edit interfaces] lab@Rum# show ge-0/0/0 { unit 0 { family ethernet-switching { port-mode trunk; } } } ge-0/0/4 { unit 0 { family ethernet-switching { port-mode trunk; } } } . . .
The changes are committed, and you complete the configuration with the access and trunk port definitions at Bourbon: [edit interfaces] lab@Bourbon# set ge-0/0/3 unit 0 family ethernet-switching port-mode trunk [edit interfaces] lab@Bourbon# set ge-0/0/7 unit 0 family ethernet-switching vlan members 20 [edit interfaces] lab@Bourbon# show ge-0/0/3 { unit 0 { family ethernet-switching { port-mode trunk; } } } ge-0/0/7 { unit 0 { family ethernet-switching { vlan { members 20; } }
300 | Chapter 5: Virtual LANs and Trunking Download at Boykma.Com
} }
After committing the changes, test connectivity over the nascent Admin_vlan with a Host3 to Host4 ping: Host3#ping 200.2.2.4 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 200.2.2.4, timeout is 2 seconds: ..... Success rate is 0 percent (0/5) Host3#
The results are less than satisfactory. It seems something is wrong, so you get to do some extra-credit troubleshooting.
Troubleshoot a VLAN problem You begin fault analysis by displaying the VLAN status at Brandy: [edit interfaces] lab@Brandy# run show vlans Name Tag Interfaces Admin_vlan 20 ge-0/0/7.0* default None
The results seem pretty clear: only one interface, the ge-0/0/7 access port, is associated with Admin_vlan. But why; what could be wrong here? The issue stems from the JUNOS default that effectively sets the allowed VLAN range to null on all trunk interfaces, which, note again, is the opposite of Cisco trunk defaults. So, although you have functional trunk interfaces on the EXs, they are currently not associated with any VLANs, so they do you little good. This condition is confirmed at Rum, where both of its VLANs are shown to have no interface associations: [edit] lab@Rum# run show vlans extensive VLAN: Admin_vlan, Created at: Mon Aug 11 03:41:29 2008 802.1Q Tag: 20, Internal index: 7, Admin State: Enabled, Origin: Static Protocol: Port Mode Number of interfaces: Tagged 0 (Active = 0), Untagged 0 (Active = 0) VLAN: default, Created at: Thu Aug 7 01:36:26 2008 Internal index: 6, Admin State: Enabled, Origin: Static Protocol: Port Mode Number of interfaces: Tagged 0 (Active = 0), Untagged 0 (Active = 0)
Given that Brandy is isolated from the remaining EX switches by a Cisco cloud, there is not much you can do there, except to add a static VLAN association to Brandy’s trunk interface:
EX to Catalyst VLAN Integration | 301 Download at Boykma.Com
[edit interfaces ge-0/0/4] lab@Brandy# set unit 0 family ethernet-switching vlan members 20 [edit interfaces ge-0/0/4] lab@Brandy# commit commit complete
After the change is committed, the result of a show vlans command confirms that tag 20 is now correctly associated with Brandy’s trunk: [edit interfaces ge-0/0/4] lab@Brandy# run show vlans 20 detail VLAN: Admin_vlan, 802.1Q Tag: 20, Admin State: Enabled Number of interfaces: 2 (Active = 2) Untagged interfaces: ge-0/0/7.0* Tagged interfaces: ge-0/0/4.0*
While you are here, you decide to disable LLDP (i.e., 802.1ab) on the links that attach to Cisco switches, because their IOS version does not understand the protocol—so nothing is gained by running them on the Cisco attached links: [edit] lab@Brandy# show protocols lldp interface all; interface ge-0/0/7.0 { disable; } interface ge-0/0/4.0 { disable; }
This completes the configuration of Brandy, and you begin to mull what’s needed at the remaining EX switches. Thinking back to the previous discussion of GVMP, and the fact that Vodkila, Rum, and Bourbon share an all-EX path and share the Admin_vlan definition, this seems like a classic case of letting GVRP do some of the work by letting it automatically add interested VLANs to trunk interfaces. The current GVRP implementation is very basic, and pretty much only allows you to enable or disable the protocol and adjust some timers. Given there is little effort involved, you opt to deploy GVRP. Things begin at Vodkila, where you display the GVRP options: [edit protocols gvrp] lab@Vodkila# set ? Possible completions: + apply-groups + apply-groups-except disable > interface join-timer leave-timer leaveall-timer
Groups from which to inherit configuration data Don't inherit configuration data from these groups Disable GVRP Configure interface options Join timer interval (milliseconds) Leave timer interval (milliseconds) LeaveAll timer interval (milliseconds)
It seems that there’s not much there, as previously noted. Seeing no need to alter the default timer, it seems that the interface hierarchy is where you want to go. You enable GVRP on Vodkila’s trunk interface to Rum: 302 | Chapter 5: Virtual LANs and Trunking Download at Boykma.Com
[edit protocols gvrp] lab@Vodkila# set interface ge-0/0/0 [edit protocols gvrp] lab@Vodkila# commit fpc0: . . .
After the commit, you confirm that GRVP is running with a few show gvrp commands: [edit protocols gvrp] lab@Vodkila# run show gvrp Global GVRP configuration GVRP status : Enabled GVRP Timers (ms) Join : 200 Leave : 600 LeaveAll : 10000 Interface Name Protocol Status ---------------------------ge-0/0/0.0 Enabled [edit protocols gvrp] lab@Vodkila# run show gvrp statistics GVRP statistics Join Empty received : 0 Join In received : 0 Empty received : 0 Leave In received : 0 Leave Empty received : 0 LeaveAll received : 0 Join Empty transmitted : 36 Join In transmitted : 72 Empty transmitted : 0 Leave In transmitted : 0 Leave Empty transmitted : 0 LeaveAll transmitted : 16
The display confirms that GVRP is running on the ge-0/0/0 interface. However, statistics indicate that only transmit activity is occurring on the trunk. Adding GVRP to Rum should remedy this: [edit] lab@Rum# set protocols gvrp interface all [edit] lab@Rum# commit . . .
After the change, the statistics at Rum confirm that GVRP messages are now being exchanged in both directions on the trunk: [edit] lab@Rum# run show gvrp statistics GVRP statistics Join Empty received : 4
EX to Catalyst VLAN Integration | 303 Download at Boykma.Com
Join In received Empty received Leave In received Leave Empty received LeaveAll received Join Empty transmitted Join In transmitted Empty transmitted Leave In transmitted Leave Empty transmitted LeaveAll transmitted
: : : : : : : : : : :
4 0 0 0 1 4 0 0 0 0 2
The result is that Rum automatically adds the Admin VLAN to its ge-0/0/0 trunk interface: [edit] lab@Rum# run show vlans Name Tag Interfaces Admin_vlan 20 ge-0/0/0.0* default None
You’re definitely getting close, but you’re not quite there yet; the lack of GVRP operation on Rum’s ge-0/0/4 trunk to access the Bourbon switch means there’s no automatic tag association with this interface, given that GVRP cannot determine whether any interested switches are attached to the trunk. Adding GVRP to Bourbon is the final piece to this puzzle: [edit] lab@Bourbon# set protocols gvrp interface ge-0/0/3 [edit] lab@Bourbon# commit
After the change, the VLAN-to-trunk associations are again displayed at Rum: [edit] lab@Rum# run show vlans Name Tag Interfaces Admin_vlan 20 ge-0/0/0.0*, ge-0/0/4.0* default None
Awesome! Both of Rum’s trunks now have the correct tag association. Things should really turn around for the Admin folks. The ping is repeated at Host3 to confirm: Host3#ping 200.2.2.4 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 200.2.2.4, timeout is 2 seconds: .!!!! Success rate is 80 percent (4/5), round-trip min/avg/max = 4/5/8 ms
304 | Chapter 5: Virtual LANs and Trunking Download at Boykma.Com
As hoped for, the machines in the Admin VLAN are now able to communicate. For a final check, you confirm that no inter-VLAN communication is possible with a ping attempt from Host3 in the Admin group to Host2 in the Sales group: Host3#ping 200.2.2.2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 200.2.2.2, timeout is 2 seconds: ..... Success rate is 0 percent (0/5) Host3#
As expected, the pings fail. For these stations to communicate, they will need to share a VLAN, or a router will need to provide Layer 3 forwarding. We cover the use of an RVI to provide Layer 3 routing between VLANs in Chapter 7. These results conclude the VLAN and trunking integration verification.
When All Looks Good but Things Don’t Work In some rare instances after making VLAN-related changes, you may find that switching is not working as expected. In many cases, you can issue a restart ethernetswitching operational mode command to restart the Layer 2 switching process to regain normal operation without having to reboot the switch: lab@Rum> restart ethernet-switching Ethernet Switching Process started, pid 665 lab@Rum>
This concept is similar to restarting the routing process when something goes awry at Layer 3. The modular nature of JUNOS software makes such incremental recovery possible, and in turn helps to minimize negative impact to the network. Early adopters of any new product may find that they need to avail themselves of a restart function more often than they would like; as always, a Problem Report should be opened with the Juniper Technical Assistance Center (JTAC) to open a support case and get the defect repaired.
Add Native VLAN Support Typically, folks are never happy with “good enough.” In this case, after you successfully deploy the required VLAN connectivity, you are asked to support CDP between the two Cisco switches. Because CDP is sent and received on the native VLAN, this task requires that you add native VLAN support to the EX switches; you can leave native VLAN trunking disabled at both Cisco devices because the CDP traffic is locally originated and is not switched between trunk interfaces. Figure 5-6 provides details on the current task, along with the topology changes that need to be made.
EX to Catalyst VLAN Integration | 305 Download at Boykma.Com
Figure 5-6. Native VLAN support
Figure 5-6 shows a simplified version of the VLAN topology. Note that the ISL trunk between the two Cisco devices is shut down, for reasons that will become clear shortly: Whiskey#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Whiskey(config)#interface fastEthernet 0/24 Whiskey(config-if)#sh 2d04h: %LINK-5-CHANGED: Interface FastEthernet0/24, changed state to administratively down . . .
The reason for this change will become obvious a bit later. Also, a new link has been added between Gin and Rum. The trunk has been configured on both ends as per the previous EX examples. At the IOS end: Gin(config-if)#switchport Gin(config-if)# switchport trunk encapsulation dot1q Gin(config-if)# switchport trunk allowed vlan 2-4094 Gin(config-if)# switchport mode trunk
306 | Chapter 5: Virtual LANs and Trunking Download at Boykma.Com
Gin(config-if)# switchport nonegotiate Gin(config-if)#no sh 2d04h: %LINK-3-UPDOWN: Interface FastEthernet0/2, changed state to up . . .
And at the Juniper end: [edit interfaces ge-0/0/2] lab@Rum# show unit 0 { family ethernet-switching { port-mode trunk; vlan { members 20; } } }
The modified topology is confirmed with a host ping over the Admin VLAN: Host3#ping 200.2.2.4 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 200.2.2.4, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 4/4/8 ms
You now confirm baseline CDP operation at IOS switch Whiskey: Whiskey#show cdp interface fa0/1 FastEthernet0/1 is up, line protocol is up Encapsulation ARPA Sending CDP packets every 60 seconds Holdtime is 180 seconds
The display confirms that CDP is enabled on its fa0/1 trunk, as is also the case with Gin’s Fa0/2 trunk (not shown). Yet for some reason CDP has failed to detect the two as neighbors: Whiskey#show cdp neighbors Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone Device ID Local Intrfce INTERVLAN-SWITCH Fas 0/48
Holdtme 173
Capability Platform Port ID S I WS-C3550- Fas 0/21
These results confirm that although CDP is enabled, it’s not being trunked through the EX segment of the network. Thinking back on that native VLAN stuff, and the differences in default handling of all things native, a solution presents itself. You must enable native VLAN trunking on EX switches so that they can correctly process the untagged CDP traffic that’s being sent by the Cisco devices. By adding VLAN 1 support as a native VLAN to the EX trunks, you enable them to switch this untagged traffic end to end.
EX to Catalyst VLAN Integration | 307 Download at Boykma.Com
You start by defining a native VLAN on the Vodkila and Rum switches. The VLAN does not technically have to be called native, but why not? This business is hard enough without additional complexity. lab@Vodkila# show vlans Admin_vlan { vlan-id 20; } Sales_vlan { vlan-id 10; } native { vlan-id 1; }
Note again that, unlike IOS, JUNOS does not define a native VLAN in a default config, and by default the native VLAN is not trunked. To add trunking support, you must define the native VLAN on each trunk interface (or use config groups to catch them all): [edit] lab@Vodkila# show interfaces ge-0/0/0 description "To Rum"; unit 0 { family ethernet-switching { port-mode trunk; vlan { members Admin_vlan; } native-vlan-id 1; } } [edit] lab@Vodkila# run show vlans native Name Tag Interfaces native 1 ge-0/0/0.0*, ge-0/0/3.0*
The results confirm that native VLAN support is added to both of Vodkila’s interfaces. Similar changes are added to Rum, and a few moments later CDP status is again checked at the IOS switches: Whiskey#show cdp neighbors Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone Device ID Local Intrfce Gin.rtp.ietraining.net Fas 0/1 INTERVLAN-SWITCH Fas 0/48
Holdtme 152 155
Capability Platform Port ID S I S I
WS-C3550- Fas 0/2 WS-C3550- Fas 0/21
The display confirms that CDP has formed a neighbor relationship between Whiskey and Gin, showing that the EX switches are now correctly handling native VLAN traffic on their trunk interfaces. Congratulations!
308 | Chapter 5: Virtual LANs and Trunking Download at Boykma.Com
Trunking CDP Through a VLAN In this section, we tried to get CDP running between the Host machines, as they are also IOS-based. This effort was foiled by the Catalyst 3550 switches used in the lab, which seemed bent on intercepting this traffic, even though it had been received on an EX access port and was not sporting a non-native VLAN tag. This traffic would pass end to end through an EX-only switch path, but upon ingress to the Cisco switch, the CDP messages were locally intercepted, ostensibly due to the use of a well-known Ethernet multicast address (0100.0ccc.cccc). This condition is shown here for Host4 and Whiskey, which have CDP enabled but are not directly connected: Host4(config)#interface ethernet 0 Host4(config-if)#cdp enable Host4(config-if)# 3d23h: CDP-PA: version 2 packet sent out on Ethernet0^Z Host4#
And back at Whiskey, we have a new CDP neighbor and an accompanying console warning that reports a (bogus) duplex mismatch, stemming from the belief that the two neighbors are directly connected when in fact they are not: 15:50:54: %CDP-4-DUPLEX_MISMATCH: duplex mismatch discovered on FastEthernet0/1 (not half duplex), with Host4 Ethernet0 (half duplex). Whiskey#show cdp neighbor Capability Codes: R - Router, T - Trans Bridge, B Source Route Bridge S - Switch, H - Host, I - IGMP, r Repeater, P - Phone Device ID Local Intrfce Capability Platform Port ID Gin.rtp.ietraining.net Fas 0/24 WS-C3550- Fas 0/24 INTERVLAN-SWITCH Fas 0/48 WS-C3550- Fas 0/21 Host4 Fas 0/1 2520 Eth 0
Holdtme
162
S I
178
S I 151
R
IOS supports a feature called Layer 2 Protocol Tunneling (L2PT) that allows the tunneling of STP, CDP, and other control plane messages over a Layer 2 switched infrastructure. This feature is not needed on EX switches, as shown in this section. On the EX, you simply tag such traffic at ingress, where it can be trunked normally.
Getting Loopy with It Before we part ways in this chapter, a word on Layer 2 switching and loops is in order. Recall that STP was disabled in this network, thereby eliminating any automatic protection from loops. Forwarding loops are particularly disastrous in a Layer 2 switched
EX to Catalyst VLAN Integration | 309 Download at Boykma.Com
network because there is no Time to Live (TTL) mechanism to break the loop—so things tend to just keep getting worse until the weak link in the chain breaks, which temporarily breaks the loop, allowing a brief respite and return to normalcy. This relief is short-lived and lasts only until the next BUM packet, which, given the chatty nature of most LAN-based protocols, won’t be long. Currently, the test network is loop-free due to the disabling of the ISL trunk link between Whiskey and Gin. Before making any changes, get an idea of the normal baseline for host pings by starting pings from Host3 to Host4, while also monitoring traffic at Brandy’s trunk interface: Host3#ping Protocol [ip]: Target IP address: 200.2.2.4 Repeat count [5]: 500000 Datagram size [100]: Timeout in seconds [2]: Extended commands [n]: Sweep range of sizes [n]: Type escape sequence to abort. Sending 500000, 100-byte ICMP Echos to 200.2.2.4, timeout is 2 seconds: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! . . .
And back at Brandy, here are the effects: Delay: 8/0/26 Interface: ge-0/0/4, Enabled, Link is Up Encapsulation: Ethernet, Speed: 100mbps Traffic statistics: Input bytes: 324127 (144048 bps) Output bytes: 139459 (143472 bps) Input packets: 3694 (148 pps) Output packets: 1101 (147 pps) Error statistics: Input errors: 0 Input drops: 0 Input framing errors: 0 Policed discards: 0 L3 incompletes: 0 L2 channel errors: 0 . . .
Current delta [131106] [128100] [1089] [1050] [0] [0] [0] [0] [0] [0]
The display confirms a rate of approximately 150 packets per second (pps). Big wow, I know. The pings at Host3 are stopped, and the ISL trunk is reenabled: Whiskey(config)#inter fastEthernet 0/24 Whiskey(config-if)#no sh Whiskey(config-if)# 2d05h: %LINK-3-UPDOWN: Interface FastEthernet0/24, changed state to up
Remember, folks, please don’t try this at home. With redundant paths and no STP active, this is a recipe for disaster. That being said, clear the ARP cache at Host3, which should generate a single ARP broadcast at the next ping:
310 | Chapter 5: Virtual LANs and Trunking Download at Boykma.Com
Host3#clear arp
The ping is started, and you notice that it fails: Host3#ping 200.2.2.4 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 200.2.2.4, timeout is 2 seconds: ..... Success rate is 0 percent (0/5)
The failure stems from loss related to the resulting broadcast storm; note that in this network we have 10 Mbps access links and a 1,000-fold multiplication factor when the packet starts looping through a GE-enabled core. Meanwhile, back at Brandy, things are looking mighty wet given that there is a lot of rain in this “storm”: Interface: ge-0/0/4, Enabled, Link is Up Encapsulation: Ethernet, Speed: 100mbps Traffic statistics: Current delta Input bytes: 994191979 (16288856 bps) [78485889] Output bytes: 9914725 (0 bps) [204] Input packets: 11759148 (26425 pps) [943254] Output packets: 81231 (0 pps) [3] Error statistics: Input errors: 0 [0] Input drops: 0 [0] Input framing errors: 0 [0] Policed discards: 0 [0] L3 incompletes: 0 [0] L2 channel errors: 0 [0] L2 mismatch timeouts: 0 Carrier transitions [0] Input framing errors: 0 [0] Policed discards: 0 [0] . . .
A total of 26,425 pps is a lot of traffic to stem from a few wafer-thin ARP packets! Note that each new BUM message simply piles on to increase the aggregate rate, until something gives. In this example, the following warnings are noted on the Cisco console: 2d05h: %SW_MATM-4-MACFLAP_NOTIF: Host 001d.b50e.9603 in vlan 666 is flapping between port Fa0/24 and port Fa0/48 2d05h: %SW_MATM-4-MACFLAP_NOTIF: Host 0010.7b3a.0404 in vlan 20 is flapping between port Fa0/24 and port Fa0/1 . . .
The messages are an indication that a MAC address is seen to be moving between ports too often, which is a sure sign of a loop. In this case, as the messages are logged, the forwarding loop is broken, which does save the network from the indefinite pain of a “death by a million floods.” This IOS flood-protection feature works to break the loop, but kicks in only after the threshold is crossed and does nothing to prevent or limit the effect of the next loop until the threshold is triggered, again forcing a cessation of traffic on the affected VLAN to break the loop.
EX to Catalyst VLAN Integration | 311 Download at Boykma.Com
Note that during the storm, MAC learning errors are also reported by the EX switches in the output of a show ethernet-switching statistics mac-learning command: [edit] lab@Brandy# run show ethernet-switching statistics mac-learning Learning stats: 9579 learn msg rcvd, 1204 error Interface Local pkts Transit pkts Error ge-0/0/4.0 90 390 381 ge-0/0/7.0 1 7 0
Here, the errors are incrementing on the trunk interface because the attached host’s SMAC keeps oscillating between the access and trunk ports thousands of times per second—a behavior that is deemed unnatural. EX switches offer a storm-control feature that allows you to block all broadcast and all unknown unicast traffic, or to rate-limit both to some percentage of interface speed. You configure storm-control at the [edit ethernet-switching-options] hierarchy: [edit] lab@Rum# set ethernet-switching-options ? Possible completions: > analyzer Analyzer options + apply-groups Groups from which to inherit configuration data + apply-groups-except Don't inherit configuration data from these groups > bpdu-block Block BPDU on interface (BPDU Protect) > redundant-trunk-group Redundant trunk group > secure-access-port Access port security options > static Static forwarding entries > storm-control Storm control configuration > traceoptions Global tracing options for access security > voip Voice-over-IP configuration [edit] lab@Rum#
Storm control is configured on a per-interface basic. The options are displayed: [edit] lab@Rum# edit ethernet-switching-options [edit ethernet-switching-options] lab@Rum# set storm-control interface ge-0/0/4 ? Possible completions:
Execute this command + apply-groups Groups from which to inherit configuration data + apply-groups-except Don't inherit configuration data from these groups level Percentage of link bandwidth (0..100) no-broadcast Disable broadcast storm control no-unknown-unicast Disable unknown unicast storm control | Pipe through a command
The CLI help function confirms options to block all broadcast or all unlearned unicast traffic: edit ethernet-switching-options] lab@Rum# set storm-control interface ge-0/0/4 ? Possible completions:
312 | Chapter 5: Virtual LANs and Trunking Download at Boykma.Com
+ apply-groups + apply-groups-except level no-broadcast no-unknown-unicast |
Execute this command Groups from which to inherit configuration data Don't inherit configuration data from these groups Percentage of link bandwidth (0..100) Disable broadcast storm control Disable unknown unicast storm control Pipe through a command
In this example, we crank down BUM traffic to 1%, a low rate that still allows normal operation, assuming, of course, that for most networks BUM is the exception rather than the rule: [edit ethernet-switching-options] lab@Rum# show storm-control { interface ge-0/0/0.0 { level 1; } interface ge-0/0/2.0 { level 1; } interface ge-0/0/4.0 { level 1; } }
With the limits in place, the error messages cease to be logged on the Cisco devices. Although 1% of a 1,000 Mbps link is still a boatload of traffic, in this case the stormcontrol feature, applied on a single switch, greatly reduces the severity of the storm, almost tamping it down to the level of a refreshing spring shower. The interface monitor is started while pings are again attempted: Brandy
Seconds: 201
Interface: ge-0/0/4, Enabled, Link is Up Encapsulation: Ethernet, Speed: 100mbps Traffic statistics: Input bytes: 996537526 Output bytes: 9915473 Input packets: 11790031 Output packets: 81242 Error statistics: Input errors: 0 . . .
(178976 bps) (544 bps) (329 pps) (1 pps)
Time: 01:07:38 Delay: 0/0/18
Current delta [80831436] [952] [974137] [14] [0]
And as expected, the display confirms a dramatic decrease in packet count, which now hovers at a paltry 329 pps. Even though the EX platform’s storm-control feature has been demonstrated to work, every effort should be made to keep a Layer 2 network loop-free. Storm control is a safeguard that prevents total meltdown, but the presence of a Layer 2 loop is always disruptive and never beneficial. At the same time, you often need a rich interconnection to ensure no single points of failure. This is where STP comes in. It lets you have as many redundant paths as you can pay for, while ensuring that the end-to-end EX to Catalyst VLAN Integration | 313 Download at Boykma.Com
forwarding topology remains loop-free. When all goes well with the STP plan, storm control is an insurance policy you will never need. Interested? I bet. And that’s great because guess what’s covered in the next chapter? Enjoy the ride.
VLAN Integration Summary This section examined out-of-the-box VLAN and trunking behavior for IOS and JUNOS, and went on to demonstrate a VLAN trunking scenario in a multivendor environment. Along with configuration, the various operational mode commands used to verify and troubleshoot a VLAN configuration on EX switches were also shown. The section ended with the purposeful creation of a forwarding loop and demonstration of the mitigating EX storm-control feature, and hopefully motivated the reader for the ensuing STP discussion in the following chapter.
Conclusion VLANs and trunking are the norm in today’s Layer 2 switched networks. VLANs have standards-based support in multivendor networks, offering the ability to perform virtual adds, moves, and changes, and inherently limit BUM traffic to the interested user communities to help improve both performance and security. This chapter demonstrated best-practice VLAN and trunking concepts for EX switches operating in a multivendor network.
Chapter Review Questions 1. In a default Layer 2 configuration, all EX interfaces: a. Belong to the native VLAN, which is untagged b. Belong to the native VLAN, which is VLAN 1 c. Belong to the default VLAN, which is untagged d. Belong to the default VLAN, which is VLAN 1 2. Which of the following is true for the native VLAN? a. It is not always required b. It is defined by default on EX switches because switch-to-switch protocols use it c. User traffic can never use the native VLAN d. EX switches support native VLAN trunking by default, for interoperability with IOS devices
314 | Chapter 5: Virtual LANs and Trunking Download at Boykma.Com
3. True or false: an access port is mapped to its VLAN through explicit tagging. 4. What is required for communications to occur between stations assigned to different VLANs? a. You must run multi-instance STP b. A standalone Layer 3 device is required c. This is never allowed, which is why the users are in different VLANs to start with d. A Layer 3 device, possibly housed within the switch itself, is required 5. What setting is required on an IOS switch to successfully trunk with an EX? a. Nothing; the defaults on the IOS device will automatically negotiate compatible settings b. You must manually configure ISL trunking because EX switches do not support VTP c. You must manually configure .1Q trunking because EX switches do not support DTP d. This is possible only through tentative VLAN, which requires no explicit configuration 6. Which are true regarding GVRP on EX switches? a. It can automate the addition and removal of a local VLAN to a trunk b. It can automate both the propagation of VLAN definitions and trunk binding c. It performs propagation of VLAN definitions only d. It operates in a client/server model with the ability to authenticate exchanges e. Both A and D 7. By default, when you pair two EX switches the link will be in: a. Trunk mode b. Access mode, untagged c. Down until you define either an access or a trunk mode role at both ends d. Access mode using native VLAN tagging 8. Based on the following capture, which is true? [edit] lab@Brandy# run show ethernet-switching interfaces Interface State VLAN members Blocking ge-0/0/4.0 up Admin_vlan unblocked foo unblocked ge-0/0/7.0 up Admin_vlan unblocked
a. Interface ge-0/0/4 is an access link b. Interface ge-0/0/7 is a trunk c. Interface ge-0/0/4 is a trunk Chapter Review Questions | 315 Download at Boykma.Com
d. Not enough information is given to determine the interface’s trunking status 9. Which is true with regard to MAC learning and VLANs on an EX? a. Learning is performed on a per-VLAN basis b. You can set MAC limits on a per-VLAN basis c. You can define storm-control parameters on a per-VLAN basis d. When configuring VLAN properties, you can specify either a symbolic name or its numeric tag e. Both A and B 10. Which of the following correctly assigns Admin_vlan to the ge-0/0/0 interface? lab@Rum# show vlans Admin_vlan { vlan-id 20; } [edit interfaces ge-0/0/0 unit 0]
a. set family ethernet-switching vlan members Admin_vlan b. set family ethernet-switching vlan members 20 [edit interfaces ge-0/0/0]
c. set unit 0 vlan-id 20 d. set unit 0 vlan-id Admin_vlan e. Either A or B
Chapter Review Answers 1. Answer: C. In the default EX configuration, there is no native VLAN. The default VLAN is untagged, and in this manner it is similar but not equal to a native VLAN. 2. Answer: A. A native VLAN is not technically required, depending on what switchto-switch protocols and what types of equipment you are working with. On the EX, you must specifically define and then add trunk support for a native VLAN when one is desired. 3. Answer: False. Traffic on access links is untagged. The access link is mapped to a VLAN at the [edit interfaces unit family ethernetswitching] hierarchy using the vlan members statement. 4. Answer: D. A Layer 3 device (a router) is needed, but this function does not have to be external and can be instantiated through the EX switch’s RVI. 5. Answer: C. Only C is correct. EX switches do not have any dynamic trunking negotiation protocols, and do not support ISL encapsulation.
316 | Chapter 5: Virtual LANs and Trunking Download at Boykma.Com
6. Answer: A. Currently, GVRP functions only to automate VLAN-to-trunk bindings. It does not operate in a client/server model, nor does it propagate VLAN definitions themselves, and it does not support authentication. 7. Answer: B. With no trunk negotiation protocols, the default is access mode, even on switch-to-switch links. As there is no native VLAN in a default configuration, the access port defaults to the default VLAN, and does not use tagging. 8. Answer: C. Only a trunk interface is allowed to have multiple VLAN associations. Use the output of a show vlans extensive command when in doubt: [edit] lab@Brandy# run show vlans extensive VLAN: Admin_vlan, Created at: Sat Aug 9 22:05:10 2008 802.1Q Tag: 20, Internal index: 7, Admin State: Enabled, Origin: Static Protocol: Port Mode Number of interfaces: Tagged 1 (Active = 1), Untagged 1 (Active = 1) ge-0/0/4.0*, tagged, trunk ge-0/0/7.0*, untagged, access
9. Answer: E. Each VLAN provides the ability to specify MAC limits and aging. Storm control is done on an interface rather than VLAN basis. When you assign a VLAN to an interface you can use either a name or a tag, but when configuring the VLAN and its properties at the [edit vlans] hierarchy you must use the symbolic name. 10. Answer: E. When you assign VLAN membership to an interface you can use the symbolic name or numeric tag value, and this is done under the Ethernet-switching hierarchy. The VLAN ID at the interface’s unit level is used to support a VLAN tagged interface, which is not the same thing as binding an access or trunk link to VLAN membership.
Chapter Review Answers | 317 Download at Boykma.Com
Download at Boykma.Com
CHAPTER 6
Spanning Tree Protocol
Switches have been used in networking for years and at times seem like a perfect solution to your problems. However, switches do have some limitations, and that is that they do exactly what they are told. (Don’t you wish everybody did?) This can lead to some undesirable results and often can lead to network meltdowns. To avoid this, protocols such as Spanning Tree Protocol (STP) were developed to add some intelligence to the physical switching architecture—in other words, “Do what you are told, unless what I am telling you is incorrect.” The following topics are examined in this chapter: • • • • • •
Switches and loop issues STP Rapid Spanning Tree Protocol (RSTP) Configuring and monitoring the spanning tree Multiple Spanning Tree Protocol (MSTP) Redundant Trunk Groups (RTGs)
Feeling a Little Loopy Before diving into the problem, let’s recap how a switch works: • It uses Media Access Control (MAC) addresses to forward traffic toward its destinations. • It “learns” station locations based on the Source MAC (SMAC) addresses. • If a destination is not known, it will send the frame out all ports in that broadcast domain. With these fundamental concepts in mind, consider the network in Figure 6-1. At first glance, it may seem like a very redundant, well-designed network. Let’s examine what happens when unicast, multicast, and broadcast frames are sent from Station A to Station C. 319 Download at Boykma.Com
First, the unicast packet is sent from A to C, both switches on the LAN. They will perform a Destination MAC (DMAC) lookup for Station C and determine that the outgoing port is Segment 2. In this case, it does not matter whether Station C had been learned yet, as there is only one possible forwarding direction onto Segment 2, since a frame will not be forwarded from the port that was received. The end result of this is that Station C receives two copies of the frame. This violates the duplication definition that a LAN should never receive multiple frames to a destination for a single frame transmission. Also, duplicate frames could place quite a burden on the upper layer protocols (perhaps breaking many), as well as increasing the network bandwidth on the LAN by a factor of two. If things are not ominous enough yet, consider what happens if a multicast or broadcast frame is sent from Station A. Once again, both switches receive that frame and forward it on toward Segment 2. However, both switches will receive the broadcast frame from each other on Segment 2, and will forward it on to Segment 1. Then they will see the frame on Segment 1 and forward it back to Segment 2, and so on, and so forth, and a loop will be created. This will continue forever or until the switches’ resources are consumed and they stop working properly. Even worse, when the frame is circulating, the switches have to update their MAC table, and it appears that a station has moved. For example, Switch 1 will see Segment 1 as the source for Station A, but when receiving the broadcast frame on Segment 2, it will update its table to reflect the “move” even though the actual physical station has not moved. Then, moments later, Switch 1 will see a frame with Station A as a source on Segment 1, so it will update its MAC table. Then it will receive a frame on Segment 2 with the source of Station A—oh, the confusion! In other words, the switches see either Station A on two different segments at the same time, or two Station As, which causes enough uncertainty for the switches to want to stop working and head to the bar.
Stupid Is As Stupid Does You may just say to yourself, “Well, I would never configure my LAN for such a harmful situation. I am the best network engineer in the world!” Before you start handing out blue ribbons to yourself (hey, you can’t lose if nobody else is competing), consider these fundamental network rules: • Two of anything is usually better than one (increased capacity). • People will make mistakes, and they may connect the wrong physical port. • Redundancy is good, and you need to design around the possibility of element failure.
320 | Chapter 6: Spanning Tree Protocol Download at Boykma.Com
Figure 6-1. Sample LAN topology
Based on these rules, it is quite easy to create a loop in a network topology. So, how do you avoid this? Ideally, you will simply never configure the network to perform a loop, but with redundancy requirements this is often not possible. Manually disabling/ enabling certain ports could be a solution, but not a very scalable one in large networks. The answer? A simple protocol: Spanning Tree Protocol.
Loop Issue Summary Loops can be an issue in a LAN environment based on even simple topologies. Loops can cause: • Unicast frame duplication • Multicast and broadcast storms • Flapping of switching tables Loops are sometimes unavoidable due to a network’s physical topology and requirements, so STP was created to intelligently avoid loops. We examine this protocol in detail in the next section.
Feeling a Little Loopy | 321 Download at Boykma.Com
Spanning Tree Protocol The loop issue was detected early on and many switch vendors developed their own loop detection protocols. In 1985, the IEEE set out to develop switching standards that could be used on any vendor, and part of the standard (IEEE 802.1D) included STP.
STP Basics So, how does STP prevent loops? In simple terms it creates a tree topology with only one available path between the root of a tree and a leaf (Figure 6-2). As the physical switched network evolves, STP reconverges and rebuilds the tree. It does this by electing a single “root” bridge and building paths with this bridge as the starting/ending point. Although a single root bridge will be elected, the bridge can change over time due to topology or bridge alterations.
The root bridge itself does not prevent loops in our two-switch topology (as in Figure 6-1). The issue is that each bridge forwards a duplicate frame onto the same LAN segment. An easy fix is to simply elect a single switch to forward the frame onto the segment. In STP terminology, a single switch should be elected to forward from the root bridge to any single branch. This ensures that there is only a single path from one end station to another end station. The switch that is responsible for this is called the designated bridge (Figure 6-3). In this chapter, we use the words switch and bridge interchangeably. Historically, a bridge has two ports and is used to interconnect LANs, usually in software-based devices. A switch is really a multiport bridge and is usually a hardware-based device. Because there is not much of a market for a two-port switch, bridges are no longer manufactured.
Since the designated bridge connects many paths between end stations, there can be many designated bridges. These are decided on a link-by-link basis. So, a switch can be a designated bridge for one link, many links, or no links at all. Also, the root bridge is always the designated bridge for all of its directly connected ports.
322 | Chapter 6: Spanning Tree Protocol Download at Boykma.Com
Figure 6-2. Roots and trees
Figure 6-3. Designated bridge
Spanning Tree Protocol | 323 Download at Boykma.Com
The designated bridge can have three types of ports: Designated port This is the port chosen for forwarding from the root bridge to a local segment (Figure 6-4). Root port This is the port closest to the root bridge. Traffic is forwarded from the root port to the designated port and vice versa. Inactive port If a port is not the designated or root port, it is not used for forwarding, so it is inactive.
Figure 6-4. Link-by-link designated bridges
For the entire network to learn about the tree topology, messages called Bridge Protocol Data Units (BPDUs) are sent around the network, describing each bridge/switch. To identify each switch, a unique value called the bridge identifier is used. The original specification states that the bridge identifier is a 64-bit field consisting of a 16-bit bridge priority and a 48-bit MAC address. Since the switch will have many MAC addresses for each interface, switches usually choose the lowest numbered port in the broadcast domain as the bridge identifier. Since MAC addresses are simply identifiers, and do not carry any numerical significance, the 16-bit priority plays a very important role. The priority field is what gives the network administrator the control needed for spanning tree control. The bridge priority default value is in the center of the range, at 32,768.
Bridge Priority and STP In 2004, the bridge priority was redefined to be four bits of priority and 12 bits of system ID. This system ID is used for 802.1Q MSTP, discussed later in this chapter. To be compatible with older implementations, the priority component is still considered, for management purposes, to be a 16-bit value. However, the values are restricted to the four most significant bits. So, in practice the bridge priority must be set in the range of 0 to 61,140 in increments of 4,096.
324 | Chapter 6: Spanning Tree Protocol Download at Boykma.Com
Although MAC address OUIs are not assigned in any particular order, the manufacturer-assigned field in the MAC address is generally assigned in numerical order as the switch is made. As a result, older switches usually have an advantage, due to default behaviors and STP tiebreaking rules. This is why the priority field plays such an important role, as an older, less-powerful switch may continue as the root bridge using default parameters.
Each port on the bridge is also assigned a 16-bit port identifier, which consists of an 8bit port priority field and an 8-bit port number (see the sidebar “Port Numbers in STP” on page 326). The port priority is a value in the range of 0 to 255 with a default value of 128. The port number identifies the port on the switch, and can be any value depending on the vendor. Cisco switches begin counting at a value of 1, and Juniper begins at a value of 512.
Each link also receives a corresponding cost. In the original STP standard, the equation was very simple: Link cost = 1,000 / Data rate (Mbps) However, the IEEE 802.1 committee soon realized that LAN speeds were steadily increasing past 1 Gbps. Therefore, in 1998 they recommended a non-linear relationship between data rates and link costs while maintaining backward compatibility with the original specification. Table 6-1 lists STP link costs. Table 6-1. STP link costs Link speed (Mbps)
STP cost
4
250
10
100
16
62
45
39
100
19
155
14
200
12
622
6
1,000
4
2,000
3
10,000
2
Spanning Tree Protocol | 325 Download at Boykma.Com
These costs were updated yet again in 2004 when Rapid Spanning Tree Protocol was defined (we discuss RSTP later in this chapter).
Port Numbers in STP In the original specification, the port number field was set to 8 bits. This seemed like an ample size, since most switches were two, four, or eight ports. The emergence of switched LANs, microsegmentation, and freaking big switches changed all of that, and the IEEE specification in 1998 set the port number field to 12 bits. However, to maintain backward compatibility with older implementations’ management, the priority is still considered 8 bits but with restricted values; only the most significant 4 bits can be set. In practical terms, this means priority values must be set in increments of 16 (0, 16, 32, 64, 128, 144, 160, 176, 192, 208, 224, 240).
Calculating and Maintaining the Spanning Tree Now that the exciting definitions are out of the way, let’s get down to the dirty business of how STP actually works. When STP is configured, each switch must perform three very simple functions: 1. Determine the root bridge. 2. Determine the designated bridges and ports for each link. 3. Maintain and react to topology changes. All of the functions are done in parallel and independently on each switch. In step 1, determining the root bridge, an election occurs (Figure 6-5). The election is very simple: whichever bridge has the lowest bridge identifier becomes the root bridge. This root bridge maintains its monarchist status until another bridge with a lower identifier enters the fray, or the current root bridge is removed (or somebody unplugs it to use the outlet for a phone charger). You control the root bridge and root responsibilities by setting the bridge priority.
Figure 6-5. Root bridge election
326 | Chapter 6: Spanning Tree Protocol Download at Boykma.Com
After the election process, there is a root bridge for every link in the broadcast domain. By definition, the root bridge is the designated bridge for every attached link. For other switches, the designated bridge will be elected based on the cost back toward the root. The lowest cost (based on interface speed) will be the designated bridge. If two switches have the same cost back to the root bridge, the bridge with the lowest bridge identifier will become the bridge with the designated port, and thus will become the designated bridge (Figure 6-6).
Figure 6-6. Election of designated ports
If a bridge has multiple ports on the same LAN segment (Figure 6-7), the port with the lowest port identifier becomes the designated port.
Figure 6-7. Multiple ports on the same segment
Once the tree has been created, it needs to be maintained to keep the topology loopfree. This is done by having the root bridge and all designated bridges advertise the current understanding of the spanning tree via configuration messages encoded as BPDUs. Every bridge listens for the configuration messages and compares the information it receives with its own internal information. If the bridge’s internal information indicates that it is a better choice for the root bridge or designated bridge, it takes action Spanning Tree Protocol | 327 Download at Boykma.Com
to change the topology. In addition, these configuration messages act as keepalives for a segment. If no messages are received on a certain port, it could indicate a switch failure and cause that port to become a forwarding port and reconverge to a new topology. In steady state operation, the root bridge is the source of the configuration messages. At every “Hello” instance (the default is two seconds), the root bridge will send out a configuration message indicating that it is the root (the root identifier will equal the bridge identifier) and the path cost is zero. All bridges sharing links with the root bridge receive the message, and the designated bridges create a new message based on the information from the root bridge. BPDUs are never forwarded through a bridge, but rather are re-created and updated based on received information.
The designated bridges, in turn, transmit this message out of their designated ports. Then the designated bridge for the next tier sends a message from its designated ports. This process continues until there are no more designated bridges and the tree has reached its final leaf. During this process, each bridge compares the received information to its own internal information. In particular, each bridge will compare: • The root identifier in the received message to its own root identifier. If the bridge has a better root identifier than that in the received configuration message, the bridge will attempt to become the root by issuing a topology change configuration message. • The path cost received to the path cost available through any other ports. If the bridge believes it has a better path cost than the designated bridge, it will attempt to become the designated bridge by issuing a topology change configuration message.
Bridge Protocol Data Units BPDUs are the messages that the switches send to learn about each other, create the spanning tree, and send configuration changes. There are two BPDUs: the configuration message and the topology change message. BPDUs have changed over time (see “Rapid Spanning Tree Protocol” on page 338), but the original fields are as follows (Figure 6-8).
328 | Chapter 6: Spanning Tree Protocol Download at Boykma.Com
Figure 6-8. Original STP BPDU
Protocol Identifier Identifies STP, and is always set to 00000000. Generic Attribute Registration Protocol (GARP) uses the same BPDU format with a different protocol identifier. Protocol Version Gives the version of the protocols, and is set to 00000000. BPDU Type Indicates the type of message (0 = configuration and 1 = topology change). Flags Specify bit 1 for the topology change indicator and bit 8 for the topology change acknowledgment. Root Identifier Specifies the current root bridge. Root Path Cost Specifies the total cost back to the root bridge. Bridge Identifier Provides the sender’s bridge ID. Port Identifier Provides the sending port’s ID. Message Age Indicates the amount of time that has elapsed since the root sent the configuration message on which the current configuration message is based. Max Age Indicates when the current configuration message should be deleted. Spanning Tree Protocol | 329 Download at Boykma.Com
Hello Time Indicates the time between root bridge configuration messages. Forward Delay Indicates the length of time bridges should wait before transitioning to a new state after a topology change. This timer is also used to age-out MAC addresses more quickly than normal during a topology change. The topology change BPDU shown in Figure 6-9 is much more basic and contains only the following fields: • Protocol Identifier (set to 0) • Protocol Version (set to 0) • BPDU Type (set to 1)
Figure 6-9. Topology change BPDU
BPDUs are encapsulated using Logical Link Control (LLC) Type 1 with a Destination Service Access Point (DSAP) and a Source Service Access Point (SSAP) of 0x42. The MAC source is the port in which the frame is transmitted, and the DMAC address is a well-known link local multicast address of 01-80-C2-00-00-00. This means a bridge does not need to know the unicast address of other bridges to run STP. Due to the link local scope, bridges running STP will not forward BPDUs beyond the significant link. Although STP uses a link local DMAC address, it is possible for devices not running STP to forward the BPDU as a normal multicast address.
BPDU Learning and Port States When BPDUs are sent out from each switch, each port can be in one of five possible states: disabled, listening, learning, forwarding, or blocking (Figure 6-10).
330 | Chapter 6: Spanning Tree Protocol Download at Boykma.Com
Figure 6-10. Port states
The disabled state is just as described—it is not involved in STP. A port is in this state due to a link failure, or if intentionally disabled by the administrator. A port in this state does not send or receive any BPDUs. The first state in which the port will normally initiate is called the blocking state. This is a port that is neither the designated nor the root port. The blocking state will not forward any data plans or send any BPDUs. However, it will listen for BPDUs to determine whether it should be active in the spanning tree, as well as to make sure the neighbor switch is still “alive.” The first state a switch usually transitions to is the listening state. In this state, the port will not forward traffic but will continue to receive BPDUs. The switch may also send out BPDUs on this port to determine whether it should be the root or the designated bridge. This is a transient state, as the port will then transition to either the blocking state or the learning state. The learning state indicates that the port is preparing to forward traffic. Since a new switch will have an empty address table, it waits a certain amount of time, called the forwarding delay, to build its address table. This is the same time a system will wait in the listening state. After the switch’s forwarding delay timer has expired, it is ready to forward data frames. This state is called the forwarding state and is the steady state for a port that is part of the active spanning tree. Table 6-2 shows the activity in each state.
Spanning Tree Protocol | 331 Download at Boykma.Com
Table 6-2. Behavior of switches in different states State
Forward data
Receive BPDU
Send BPDU
Important timers
Disabled
No
No
No
None
Blocking
No
Yes
No
Hello
Listening
No
Yes
Yes
Forwarding delay
Learning
No
Yes
Yes
Forwarding delay
Forwarding
Yes
Yes
Yes
Max age
Once the spanning tree is established, topology changes should not regularly occur. The most common reasons for a topology change include the following: • • • • •
A new bridge or port is added to the network. An active link in the spanning tree fails. A root or designated bridge fails. A new link is added into the network. The administrator adjusts the bridge priorities, port priorities, or link costs that affect the current spanning tree.
Since a topology change can cause a temporary disruption in service, do not add any new switches or ports or change configurations until you reach a planned maintenance window. A failure can never be planned, though, so STP has timers in place to avoid transient loops as well as explicit topology change detection and notification. When a topology change is detected (due to better configuration data than what is available in the internal database), the switch will transmit a topology change message from its root port toward its designated bridge. It sends this message until an explicit acknowledgment from the designated bridge is received. This acknowledgment is determined by the tc ac bit being set in the topology change BPDU. The designated bridge then sends a topology change BPDU to its root port and waits for an acknowledgment. This process continues all the way up the tree until it reaches the root bridge. The root bridge then sets the topology change message in all of its configuration messages for some period of time so that all bridges are informed of the change (Figure 6-11). When this bit is set, the bridges will use a shorter address-aging time for their address tables.
Protocol Timers A few important timers need to be adjusted for STP to operate efficiently. Some of these we have touched upon, but not fully examined. These timers affect convergence and are configurable as needed. The specification has recommended default values, however, which usually exhibit the needed behavior.
332 | Chapter 6: Spanning Tree Protocol Download at Boykma.Com
Figure 6-11. Topology change
Table age Recall that switches are based on SMAC and DMAC addresses and receiving and sending port numbers. Since there could be thousands of stations on the segment and new ones arriving and leaving the network, it is important to keep the table as small and efficient as possible. Unlike IP routing, which can accomplish this efficiency via route summarization, MAC addresses cannot be summarized into blocks because a station can choose to be wired to just about any switch port. In order to increase table efficiency, switches use an aging rule, removing entries that have not been heard from for some time, called the table aging time. As in any relationship, a delicate balance of time and removal must be maintained. If the aging time is too short, the table will purge quickly and constant flooding will be required for learning (nag, nag). If the timer is too long, the table size may approach maximum limits due to stations that have not transmitted for hours (ignore, ignore). The most common aging time is 5 minutes, but this value is adjustable from 10 seconds up to several days.
Spanning Tree Protocol | 333 Download at Boykma.Com
Hello time The hello time is the time between configuration messages sent by the root bridge, which in turn correlates to the time between configuration messages established by the designated bridges. Faster hello times will speed up topology changes, but will also increase messaging. The default hello time is 2 seconds, with a configurable range from 1 to 10 seconds.
Message age Since there may be many switches in the network, propagation of new topology changes takes time. During this time, it is entirely possible that a new topology change could occur. This means before this new switch receives the information, it could be using stale information and making the incorrect spanning tree decision, forming transient loops. In order to prevent this eventuality, each configuration message carries a message age that starts from zero at the root bridge and increments at each designated bridge. When a bridge accepts the configuration data, the timer starts, and the message is aged out if no refresh message is received within the maximum age (the default is 20 seconds).
Forwarding delay The forwarding delay is the time a switch waits to transition to a new state, as well as the MAC address aging time during a topology change. It’s necessary because sometimes stations appear to move based on a spanning tree topology change. In Figure 6-12, if Link 1 fails, Link 2 will be activated and added to the spanning tree. From the view of Switch 3, the stations appear to move from Port 1 to Port 2. In normal operations, the switch would have to wait five minutes to age-out the old entries or wait to receive data from each station and enable correct data flow. To remedy this, when switches receive a topology change they enter a “fast aging” time indicated by the forwarding delay, which is usually set to 15 seconds but can be in a range of 4 to 30 seconds. As previously mentioned, the forwarding delay takes on a dual role, as it is also the time that the switch is waiting to transition to each state (listening to learning, and learning to forwarding).
Putting the Theory Together We have tossed a lot of concepts at you in this chapter, so let’s look at an example and see how a spanning tree is built. Figure 6-13 shows a sample network. The bridge IDs, port IDs, and link costs are all specified. Please note that Figure 6-13 is for learning purposes only and is not necessarily what you will see in a real network. Also, notice that Segment A is attached via a hub that is not shown in the diagram.
334 | Chapter 6: Spanning Tree Protocol Download at Boykma.Com
Figure 6-12. The incredible moving station
Figure 6-13. Spanning tree example
Spanning Tree Protocol | 335 Download at Boykma.Com
The first step is to determine the root bridge. In this example, the root bridge is Bridge 122, as it has the lowest bridge ID. By definition, all ports on that bridge will be designated ports, and the root ports of Bridge 200 and Bridge 423 will be on Port 1 Link A, as that is the lowest-cost path back to the root bridge. Next, determine the root port—that is, the lowest cost back to the root bridge for each switch: • • • • • •
Bridge 200 is Port 1 with a cost of 19. Bridge 423 is Port 1 with a cost of 19. Bridge 347 is Port 1 with a cost of 100. Bridge 572 is Port 4 with a cost of 19. Bridge 347 is Port 1 with a cost of 100. Bridge 224 is Port 1 with a cost of 119.
Lastly, calculate the designated bridge for Segment B, Segment C, and Segment D, as all other segments are connected to the root bridge. Recall that the root bridge is always the designated bridge for its local ports.
Segment B has two possible options, and both bridges have a cost of 19 back to the root bridge. In this case, the bridge with the lowest bridge ID, 423, wins. Bridge 572 is the designated bridge for Segment C because it has a lower cost. The same goes for Bridge 347, with a lower cost for Segment D. All other bridge ports that are not root or designated bridges will transition to the blocking state. Figure 6-14 shows the resulting topology. We highly suggest that you draw out Figure 6-13 and see whether you get the same spanning tree result.
STP Issues STP seems like the perfect little protocol, right? It was created under the assumption that topology changes do not happen often, and as a result, it was designed for stability and loop-free reliability as opposed to speed.
336 | Chapter 6: Spanning Tree Protocol Download at Boykma.Com
Figure 6-14. Spanning tree result
However, it does have limitations, some of which include the following: • Sometimes suboptimal paths are taken. STP chooses all of its paths based on link speed, with no influence on the size or reliability of the link or switch. • Convergence can be slow. Sometimes it can take up to 30 seconds for the spanning tree to reconverge after a change. • There is no per-link protocol. As a result, “hellos” essentially originate from the root bridge and propagate to each designated bridge, which can slow down the detection of link failure. • The transition to the forwarding state can be slow, based on the forwarding delay timer.
Spanning Tree Protocol | 337 Download at Boykma.Com
These issues are addressed in RSTP (IEEE 802.1w), and we discuss them shortly. Today most switches follow the 801.1D-2004 specification, which sets RSTP as the default mode for switches.
STP Summary Spanning Tree Protocol was made to solve the “loop” issues in bridges by creating a single path between hosts with the reference point of the root bridge. It does some simple calculations based on user-controllable parameters, which creates a single path from one host to another to avoid any loops in the topology. However, STP was not written for fast convergence, a major drawback for modern-day networks. Rapid Spanning Tree Protocol, examined next, was created to fix those deficiencies.
Rapid Spanning Tree Protocol In order to fix some of the deficiencies in the original STP, the IEEE defined 802.1w, Rapid Spanning Tree Protocol, later described in the 802.1D-2004 specification. STP converges very slowly, after a topological change. When using default values for the max age (20 sec) and the forward delay (15 sec) parameters, it takes 50 seconds for the bridge to finally converge: convergence delay = 2 × forward delay + max age This setup was OK for early networks, but like the Commodore 64, it became unacceptable as technology advanced. RSTP vastly improves that time, often providing subsecond transitions. Essentially, the major difference is a centralized versus distributed model. In STP, the root bridge has most of the responsibility for spanning tree maintenance and change notifications and is the “central” point. In RSTP, all bridges take an active role in the network’s connectivity. This and other new protocol specifications lead to increased reconvergence times.
New BPDU Definition and Function RSTP slightly modifies the BPDUs’ format and function and sends them out at a quicker rate (two-second default). They are now used as “hellos,” as opposed to in original STP, where BPDUs were relayed from the root bridge. Every bridge will send out the BPDU with current information every hello time, even if it does not receive a BPDU from the root bridge. This method is quicker and more distributed. The first change is that the BPDU and type field are now version 2, which means a switch that does not support RSTP will drop the BPDU. The biggest change, however, is the flags field. STP defines only two bits, but in RSTP, all bits are defined. Three of
338 | Chapter 6: Spanning Tree Protocol Download at Boykma.Com
the bits are used to indicate the port role, and two of the bits are for port states, as shown in Figure 6-15.
Figure 6-15. Option bits
The final two bits are used for proposal and agreement, which we discuss in the sections on topology change and transitions later in this chapter.
Interface Types and States RSTP defines new interface types, as well as new port states. This allows for quicker direct and indirect link failure and recovery. The first new features define new interface types: Point-to-point (P-to-P) Direct connections between switches Edge port Port connection to end stations and not receiving BPDUs Shared/non-edge Connection to a LAN that is a shared medium and is receiving BPDUs, mostly likely a simple hub Depending on the interface type, RSTP acts differently, based on the port roles. The port roles in RSTP are as follows: Root port Indicates the port with the lowest cost to the root bridge, as in original STP Designated port Indicates the designated port, as in original STP Alternate port Provides an alternate port to the root port in case of a failure Backup port Provides a redundant path to a segment, and acts as a backup in case of a designated port failure Rapid Spanning Tree Protocol | 339 Download at Boykma.Com
Figure 6-16 shows the alternate and backup ports.
Figure 6-16. Alternate and backup ports
RSTP uses fewer port states than STP, defining only three states: discarding, learning, and forwarding. The discarding state is comparable to three of STP’s states: disabled, blocking, and listening. Table 6-3 compares the states. Table 6-3. RSTP versus STP port states STP
RSTP
Disabled
Discarding
Blocking
Discarding
Listening
Discarding
Learning
Learning
Forwarding
Forwarding
340 | Chapter 6: Spanning Tree Protocol Download at Boykma.Com
RSTP Convergence As previously mentioned, RSTP speeds up convergence by decreasing transition time and topology change notifications. Whereas STP relied heavily on timers, RSTP allows a feedback mechanism in order to transition a port. A new root port or designated port that is connected to a P-to-P link or configured as an edge port can be transitioned to the forwarding state without waiting for the timer to expire. The edge port connects directly to end stations and thus cannot create loops. Therefore, it can be placed in the forwarding state without any delay. Also, an alternate port and backup port can immediately transition to the root port or designated port in the event of a link failure. A P-to-P link can transition to the forwarding state after it receives an acknowledgment from the neighboring bridge that it is attached to the link in the agreement/proposal mechanism. Basically, when a bridge needs to transition a port into the forwarding state, it sends out a configuration message with the proposal bit set. If a bridge receives this message and verifies that the information in the message is superior, it begins the sync operation. This operation places all non-edge ports in the blocked state and sends a configuration message with the agreement bit set to the original bridge. The agreement bit setting causes the interface to immediately transition to the forwarding state. If a bridge does not receive an acknowledgment of a proposal message it has sent, it returns to the original 802.1D convention and slowly transitions its port to the forwarding state through listening and then learning intermediate states. This method works only for P-to-P links; shared media follow the legacy STP method.
As an example, take a look at Figure 6-17. The root bridge and Bridge A exchange BPDUs. Initially, the link between the root bridge and Bridge A is in the blocked/learning state, as is normal for the initialization process. The BPDUs have the proposal bit set. Bridge A notices that the BPDU from the root bridge is superior, so it begins the sync process (Figure 6-18). The sync process causes the bridge to put its links to Bridge B and Bridge C in the discarding state. It also sends a BPDU to the root bridge with the agreement bit set. This is a copy of the BPDU that was received from the root with only the agreement bit set. This causes the ports between the root bridge and Bridge A to go to the forwarding state.
Rapid Spanning Tree Protocol | 341 Download at Boykma.Com
Next, Bridge B and Bridge C receive the BPDU with the proposal bit set. Bridge B contains only edge ports, so it has no ports to block for the sync process. Bridge C has two edge ports and one non-edge port to Bridge D, which it blocks. Again, Bridge B and Bridge C send BPDUs back to Bridge A, which sets the ports to the forwarding state (Figure 6-19).
Figure 6-17. RSTP convergence, step 1
Figure 6-18. RSTP convergence, step 2
342 | Chapter 6: Spanning Tree Protocol Download at Boykma.Com
Finally, Bridge C sends a BPDU to Bridge D, which examines the BPDU and notices that it is inferior. It responds to Bridge C with its superior BPDU, which causes Bridge C to remain in the blocking state.
Figure 6-19. RSTP convergence, step 3
Topology changes As mentioned previously, when an STP bridge detects that a topology change has occurred, it transmits a TCN message toward the root bridge and sets the TC flag in the configuration messages it transmits to the network. When network bridges receive a configuration message with the TC flag on, they also set this flag in the configuration messages they transmit on their designated ports toward the root bridge. This process continues until the root bridge is notified of the change. The root bridge then sets the TC flag in its BPDUs so that all bridges are notified of the event and the shortened aging time can be used. RSTP bridges, on the contrary, use TCN messages only if an STP bridge needs to be notified of the topology change. Instead, each RSTP bridge that has detected a topology change starts a timer equal to twice the hello time for all its non-edge designated ports and its root port if needed, and then constantly transmits configuration messages on these ports with the TC flag on until the timer expires.
Rapid Spanning Tree Protocol | 343 Download at Boykma.Com
When a bridge receives a configuration message with the TC flag set, it first flushes all the entries in its filtering database except the entries containing MAC addresses that were learned via the port that received the configuration message with the TC flag on. Then that bridge starts a timer and transmits its own configuration messages with the TC flag set on all its designated ports and the root port until the timer expires. This is another example of RSTP’s efficiency. STP sets a timer (forwarding delay) when the TC flag is received in order to age-out entries; in RSTP, on the other hand, the bridge ages out its database as soon as it receives the TC flag.
In this way, the news of the topology change quickly spreads over the entire network. This mechanism is faster and much more efficient than the one used by STP bridges. First, there is no need to wait until the TCN message reaches the root bridge, and then wait still longer until a configuration message with the TC flag on is received on the root port, and even longer until the shorter aging timer expires in order to delete old entries from the filtering database. Instead, the RSTP bridge immediately deletes old entries and notifies the other bridges to do the same. Second, a receipt of a configuration message with the TC flag set causes an STP bridge to age-out all the entries of its filtering database. The RSTP bridge, on the contrary, does not flush entries containing MAC addresses that were learned via the port that received the configuration message with the TC flag on. As a result, the number of flushed MAC addresses during a topology change is reduced.
Link failures Let’s look at two examples of direct link failures between switches and the root bridge. These scenarios are often known as “backbone fast” in the Cisco world. Figure 6-20 depicts the first scenario. The link between the root and Switch B fails. The process goes like this: 1. As soon as Switch B detects the link failure, the alternate port assumes the new role of root port. Depending on the failure type, this could be a subsecond transition. 2. Switch B sends out BPDUs with the TC flag on to Switch A, which sends the BPDU to the root. This causes the switches to age-out the MAC addresses and start the relearning process.
344 | Chapter 6: Spanning Tree Protocol Download at Boykma.Com
Figure 6-20. Failure with alternate port
A slightly different failure is observed if we look at the link between Switch A and the root bridge. The process, shown in Figure 6-21, is as follows: 1. Switch A’s root port fails, assuming it’s a new root, since it has no previous alternate port. 2. Switch B receives inferior BPDUs from Switch A on its alternate port, and sends a root link query to verify that the root bridge is still alive. 3. Upon root verification, Switch B immediately moves from the alternate port to the designated port role, and begins sending stored superior BPDUs to the downstream Switch A. 4. Switch A receives superior BPDUs, knows it is not the root, and places the port connecting to Switch B in the root port role.
Rapid Spanning Tree Protocol | 345 Download at Boykma.Com
Figure 6-21. Failure without alternate port
Link Cost in RSTP The original STP specification used a 16-bit unsigned integer for link speed, but RSTP uses the full 32 bits of range. This causes the default values to change according to the rules laid out in Table 6-4. If a bridge is encountered that uses the old 16-bit link speed field, it will use a 65,535 cost for any link speeds greater than 100 Mbps. Table 6-4. RSTP link costs Link speed
Recommended value
≤100 Kbps
200,000,000
1 Mbps
20,000,000
10 Mbps
2,000,000
100 Mbps
200,000
1 Gbps
20,000
10 Gbps
2,000
100 Gbps
200
346 | Chapter 6: Spanning Tree Protocol Download at Boykma.Com
Link speed
Recommended value
1 Tbps
20
10 Tbps
2
Compatibility with STP As previously mentioned, RSTP is backward compatible with STP. If there are three bridges on the segment, A, B, and C, and Bridge C runs legacy STP, Bridge A and Bridge B will fall back to STP mode. For instance, suppose Bridge A and Bridge B both run RSTP, with Switch A designated for the segment (Figure 6-22). Bridge C is brought online and runs legacy STP. Because 802.1D bridges ignore RSTP BPDUs and drop them, C believes there are no other bridges on the segment and starts to send its inferior 802.1D-format BPDUs. Switch A receives these BPDUs and, after twice the hello-time seconds maximum, changes its mode to 802.1D on that port only. As a result, C now understands the BPDUs of Switch A and accepts A as the designated bridge for that segment.
Figure 6-22. STP compatibility
Notice that in this particular case, if Bridge C is removed, Bridge A runs in STP mode on that port even though it is able to work more efficiently in RSTP mode with its unique neighbor B. This is because A does not know Bridge C is removed from the segment. In this situation, you’d have to manually restart the STP process in order for Bridge A and Bridge B to revert to RSTP.
Interoperability Between Juniper and Cisco Before RSTP and MSTP (discussed shortly) were standardized, Cisco implemented its own proprietary protocols to try to solve these issues. One such protocol on Cisco is PVST+, which implements “multi-instance” spanning trees that allow multiple instances of STP on a single trunk. Essentially, virtual LAN (VLAN) 1 traffic uses the standard spanning tree destination multicast address 01:80:C2:00:00:00. The other VLAN(s) on the trunk advertise tagged PVST+ BPDUs to Cisco’s reserved multicast address, 01:00:0C:CC:CC:CD. This allows Cisco to have a per-VLAN instance that can utilize multiple redundant trunk links by load-balancing the VLANs across them. The disadvantage of this protocol is that it has scaling issues, in addition to being proprietary. Rapid Spanning Tree Protocol | 347 Download at Boykma.Com
Since this is the default configuration for many Cisco switches, it is important to note that any non-VLAN 1 traffic will simply be forwarded like any other multicast address and flooded on all forwarding ports within the VLAN in which the respective BPDUs are received (Figure 6-23). If the port is in the blocked state, no traffic will be forwarded, as usual.
Figure 6-23. Juniper forwarding with PVST+
In Figure 6-24, Switch 1 and Switch 2 are Cisco switches running PVST+. Switch 1 is the STP root for VLANs 1, 5, and 77, with a bridge priority of 4096. It is also the STP backup root switch for VLANs 20 and 66, with a bridge priority of 8192. Switch 2 is the STP root switch for VLANs 20 and 66, with a bridge priority of 4096, and is the STP backup root switch for VLANs 1, 5, and 77, with a bridge priority of 8192.
Figure 6-24. Juniper at the access layer
348 | Chapter 6: Spanning Tree Protocol Download at Boykma.Com
There is one additional caveat to PVST+. By default, the path cost assigned by PVST+ is based on Cisco’s STP cost convention, not the IEEE STP cost. You must change the path cost so that it complies with the IEEE STP path cost and all similar links (such as FastE and GbE) have the same link-cost value. On the Cisco devices, the command spanningtree pathcost method long must be entered to make it compliant with the current IEEE STP path cost. This command will be applied to all Cisco switch ports.
Switch 3, shown in Figure 6-25, is a Juniper Networks EX Series switch running RSTP. Since RSTP has only a single spanning tree instance for all VLANs across a trunk and there is no VLAN awareness, all traffic will be forwarded or blocked based on the VLAN 1 topology. Therefore, the link between Switch 1 and Switch 3 will be forwarded for all VLANs. The net result is that Switch 3 is blocking one of the uplinks; there is no logical Layer 2 loop in the topology presented in Figure 6-25, regardless of which Cisco switch is the root for any of the VLANs (except VLAN 1) and regardless of the fact that these Cisco switches are running PVST+.
Figure 6-25. Cisco at the access layer
Again, RSTP is enabled on the EX Series switches (Switch 1 and Switch 2) and PVST+ is enabled on the Cisco switch (Switch 3). Switch 1 is the root of RSTP with a priority of 4096; Switch 2 is the backup root switch of the Common Spanning Tree (CST, discussed shortly) with a priority of 8192.
Rapid Spanning Tree Protocol | 349 Download at Boykma.Com
Switch 3 (the Cisco switch running PVST+) recognizes Switch 1 as the STP root for VLAN 1 and recognizes Switch 2 as having a lower bridge priority than itself on VLAN 1, therefore blocking its uplink trunk port to Switch 2 on VLAN 1. For VLANs 5, 77, 20, and 66, Switch 3 sends out Cisco proprietary PVST+ BPDUs on the trunks. Because Switch 1 and Switch 2 do not understand PVST+ BPDUs, the switches will treat them as regular Layer 2 multicast packets and flood them out of the switch ports. Switch 3 is the PVST+ root for VLANs 5, 77, 20, and 66 and receives its own PVST+ BPDUs for the VLANs on both of its uplinks; so it ends up blocking one of these two uplink trunk ports. Therefore, the result is a forwarding topology similar to that in Figure 6-25 with only one uplink trunk port forwarding on all VLANs on Switch 3 and the other uplink trunk port blocking on all VLANs.
RSTP Summary Rapid Spanning Tree Protocol fixes the convergence issues found in the original Spanning Tree Protocol. It accomplishes this by simplifying states and eliminating the timers needed to transition from one state to another. Why not take a quick break and make sure you understand these concepts as we prepare to take a swan dive into a real live network.
Spanning Tree Configuration To configure spanning in JUNOS software, first navigate to the [edit protocols stp] level. Enable each interface on which you would like to run STP, or alternatively, if you would like to run STP on every interface with Ethernet switching, simply enable the protocol itself: [edit] lab@Brandy# set protocols stp [edit] lab@Brandy# show protocols lldp { interface all; } stp;
350 | Chapter 6: Spanning Tree Protocol Download at Boykma.Com
The all keyword is not configured, as every interface with Ethernet switching will have STP enabled.
This is also where timers, priorities, and other STP parameters can be set. Notice that some aspects of RSTP configuration are shown, since JUNOS implements 802.1D-2004: lab@Brandy# set protocols stp ? Possible completions:
Execute this command + apply-groups Groups from which to inherit configuration data + apply-groups-except Don't inherit configuration data from these groups bpdu-block-on-edge Block BPDU on all interfaces configured as edge (BPDU Protect) bridge-priority Priority of the bridge (in increments of 4k - 0,4k,8k,..60k) disable Disable STP forward-delay Time spent in listening or learning state (4..30 seconds) hello-time Time interval between configuration BPDUs (1..10 seconds) > interface max-age Maximum age of received protocol bpdu (6..40 seconds) > traceoptions Tracing options for debugging protocol operation | Pipe through a command
Let’s look at how STP operates with default parameters. Recall the topology in Figure 6-25. All interfaces are enabled for STP using the default configuration. Figure 6-26 shows the resulting STP topology, with Rum as the root bridge, since it has the lowest bridge ID (MAC address). Since all default parameters are used, the root bridge (Rum) is determined by the MAC address.
Spanning Tree Configuration | 351 Download at Boykma.Com
Figure 6-26. Physical topology
352 | Chapter 6: Spanning Tree Protocol Download at Boykma.Com
Figure 6-27 shows the default spanning tree.
Figure 6-27. Default spanning tree
Spanning Tree Configuration | 353 Download at Boykma.Com
The loop-free paths between the hosts are as follows: Host1→Vodkila, Rum, Bourbon→Host4 Host1→Vodkila, Rum, Gin, Whiskey→Host2 Host1→Vodkila, Rum, Brandy→Host3 Host2→Whiskey, Gin, Rum, Brandy→Host3 Host2→Whiskey, Gin, Rum, Bourbon→Host4 Host3→Brandy, Rum, Bourbon→Host4
Let’s take a closer look at a few of the switches in the topology, namely, Rum, Brandy, and Gin, and see how some of the ports were assigned the states. First, look at the default parameters for each switch. On Rum, notice that the bridge ID and the root ID are identical, indicating that it is indeed the root bridge: lab@Rum> show spanning-tree bridge detail STP bridge parameters Context ID : 0 Enabled protocol : STP Root ID : 32768.00:19:e2:56:ee:80 Hello time : 2 seconds Maximum age : 20 seconds Forward delay : 15 seconds Message age : 0 Number of topology changes : 1 Time since last topology change : 1328 seconds Local parameters Bridge ID : 32768.00:19:e2:56:ee:80 Extended system ID : 0 Internal instance ID : 0 Hello time : 2 seconds Maximum age : 20 seconds Forward delay : 15 seconds Path cost method : 32 bit
In Juniper, the bridge ID is chosen as the first public MAC address assigned to the switch. A show chassis mac-addresses command will show you the first public address: lab@Rum> show chassis mac-addresses FPC 0 MAC address information: Public base address 00:19:e2:56:ee:80 Public count 64
Brandy also sees Rum as the root bridge with a MAC address of 32768.00:19:e2:56:ee:80: lab@Brandy> show spanning-tree bridge STP bridge parameters Context ID : 0 Enabled protocol : STP Root ID : 32768.00:19:e2:56:ee:80 Root cost : 20000 Root port : ge-0/0/3.0 Hello time : 2 seconds Maximum age : 20 seconds Forward delay : 15 seconds
354 | Chapter 6: Spanning Tree Protocol Download at Boykma.Com
Message age Number of topology changes Time since last topology change Local parameters Bridge ID Extended system ID Internal instance ID
: 1 : 1 : 1402 seconds : 32768.00:1f:12:30:96:80 : 0 : 0
On Gin, the same timers are observed with this default configuration: spanning-tree mode pvst spanning-tree extend system-id
Notice there are two VLANs configured—the default VLAN 1 and management VLAN 666, as PVST+ is enabled by default: Gin#show spanning-tree bridge de VLAN0001 Bridge ID Priority 32769 (priority 32768 Address 000b.5fc6.9180 Hello Time 2 sec Max Age 20 sec VLAN0666 Bridge ID Priority 33434 (priority 32768 Address 000b.5fc6.9180 Hello Time 2 sec Max Age 20 sec
sys-id-ext 1) Forward Delay 15 sec sys-id-ext 666) Forward Delay 15 sec
It also sees the root bridge as Rum: Gin#show spanning-tree root Root Hello Max Fwd Vlan Root ID Cost Time Age Dly Root Port ------------ -------------------- --------- ----- --- --- ----------VLAN0001 32768 0019.e256.ee80 19 2 20 15 Fa0/2 VLAN0666 33434 000b.5f01.f380 19 2 20 15 Fa0/48
Now examine the interface states on the switches. First, on the root bridge Rum, we expect to see all interfaces as designated ports and in the forwarding state, and this is the case except for ge-0/0/8, which is an administratively disabled port: lab@Rum> show spanning-tree interface Spanning tree interface parameters for instance 0 Interface ge-0/0/0.0 ge-0/0/1.0 ge-0/0/2.0 ge-0/0/3.0 ge-0/0/4.0 ge-0/0/8.0
Port ID 128:513 128:514 128:515 128:516 128:517 128:521
Designated port ID 128:513 128:514 128:515 128:516 128:517 128:521
Designated bridge ID 32768.0019e256ee80 32768.0019e256ee80 32768.0019e256ee80 32768.0019e256ee80 32768.0019e256ee80 32768.0019e256ee80
Port Cost 20000 20000 200000 20000 20000 20000
State Role FWD FWD FWD FWD FWD BLK
DESG DESG DESG DESG DESG DIS
Notice the port cost is using the updated recommended values in 802.1D-2004. All 1 Gbps links have a port cost of 20,000, while the link to ge-0/0/2, which is a 100 Mbps link, has a port cost of 200,000.
Spanning Tree Configuration | 355 Download at Boykma.Com
Next, looking at Brandy, we see that it is the designated bridge for most of its ports, as it has a lower bridge ID (MAC address) than its neighbor switches. The priorities are the same, since they have not been configured, so this is the tiebreaker calculation. Also observe that ge-0/0/3 is the root port, as it is the lowest-cost path back to Rum. We also see a path cost of 2,000,000 for ge-0/0/7 and ge-0/0/12 because they connect to a 10 Mbps port: lab@Brandy> show spanning-tree interface Spanning tree interface parameters for instance 0 Interface
Port ID
ge-0/0/1.0 ge-0/0/2.0 ge-0/0/3.0 ge-0/0/4.0 ge-0/0/5.0 ge-0/0/7.0 ge-0/0/8.0 ge-0/0/9.0 ge-0/0/12.0
Designated port ID 128:514 128:514 128:515 128:515 128:516 128:516 128:517 128:3 128:518 128:518 128:520 128:520 128:521 128:521 128:522 128:522 128:525 128:525
Designated bridge ID 32768.001f12309680 32768.001f12309680 32768.0019e256ee80 32769.000b5fc69180 32768.001f12309680 32768.001f12309680 32768.001f12309680 32768.001f12309680 32768.001f12309680
Port Cost 20000 20000 20000 200000 20000 2000000 20000 20000 2000000
State Role FWD FWD FWD BLK FWD FWD FWD FWD FWD
DESG DESG ROOT ALT DESG DESG DESG DESG DESG
In a Juniper device, port IDs begin counting at 513, whereas Cisco devices begin counting at 0.
Brandy’s ge-0/0/4 interface is in the blocking state. Let’s look at the neighbor switch to see why: lab@Brandy> show spanning-tree interface ge-0/0/4 detail Spanning tree interface parameters for instance 0 Interface name Port identifier Designated port ID Port cost Port state Designated bridge ID Port role Link type Boundary port
: : : : : : : :
ge-0/0/4.0 128.517 128.3 200000 Blocking 32769.00:0b:5f:c6:91:80 Alternate Pt-Pt/NONEDGE : NA
Gin is the designated bridge on all its interfaces and has a root port of Fa0/2. One important difference from the Juniper switches is that the default cost is based on the STP cost and not the IEEE recommended cost. Notice the cost of 19 on the interfaces, which causes Gin to appear as the best root path cost for all ports:
356 | Chapter 6: Spanning Tree Protocol Download at Boykma.Com
Gin# show spanning-tree VLAN0001 Spanning tree enabled protocol ieee Root ID Priority 32768 Address 0019.e256.ee80 Cost 19 Port 2 (FastEthernet0/2) Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID
Priority 32769 (priority 32768 sys-id-ext 1) Address 000b.5fc6.9180 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Aging Time 300
Interface ------------------Fa0/1 Fa0/2 Fa0/3 Fa0/4 Fa0/24
Role ---Desg Root Desg Desg Desg
Sts --FWD FWD FWD FWD FWD
Cost --------19 19 19 19 19
Prio.Nbr -------128.1 128.2 128.3 128.4 128.24
Type --------------------P2p P2p P2p P2p P2p
VLAN0666 Spanning tree enabled protocol ieee Root ID Priority 33434 Address 000b.5f01.f380 Cost 19 Port 48 (FastEthernet0/48) Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID
Priority 33434 (priority 32768 sys-id-ext 666) Address 000b.5fc6.9180 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Aging Time 300
Interface Role Sts Cost Prio.Nbr Type ------------------- ---- --- --------- -------- --------------------Fa0/48 Root FWD 19 128.48 P2p
In order to have a consistent view and to link costs in the topology, the Cisco switches should enable IEEE recommendations with the spanning-tree pathcost method long command. This small alteration causes the STP topology to change, as now slower 100 Mbps links have a higher link cost. Also notice that this enables the RSTP roles, as we saw on the Juniper switches (alternate, backup, etc.). However, RSTP is still not enabled on the switches:
Spanning Tree Configuration | 357 Download at Boykma.Com
Gin(config)#spanning-tree pathcost method long Gin(config)# Gin#show spanning-tree VLAN0001 Spanning tree enabled protocol ieee Root ID Priority 32768 Address 0019.e256.ee80 Cost 200000 Port 2 (FastEthernet0/2) Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID
Priority 32769 (priority 32768 sys-id-ext 1) Address 000b.5fc6.9180 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Aging Time 300
Interface ------------------Fa0/1 Fa0/2 Fa0/3 Fa0/4 Fa0/24
Role ---Altn Root Altn Altn Desg
Sts --BLK FWD BLK BLK FWD
Cost --------200000 200000 200000 200000 200000
Prio.Nbr -------128.1 128.2 128.3 128.4 128.24
Type --------------------P2p P2p P2p P2p P2p
VLAN0666 Spanning tree enabled protocol ieee Root ID Priority 33434 Address 000b.5f01.f380 Cost 200000 Port 48 (FastEthernet0/48) Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID
Priority 33434 (priority 32768 sys-id-ext 666) Address 000b.5fc6.9180 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Aging Time 300
Interface Role Sts Cost Prio.Nbr Type ------------------- ---- --- --------- -------- --------------------Fa0/48 Root FWD 200000 128.48 P2p
This changes the paths over which each host communicates (see Figure 6-28). For example, Host2 now reaches Host3 via Whiskey, Vodkila, Rum, and then Brandy.
358 | Chapter 6: Spanning Tree Protocol Download at Boykma.Com
Figure 6-28. Default STP with IEEE settings
Spanning Tree Configuration | 359 Download at Boykma.Com
Failures with Default Parameters Let’s see how quickly the current topology can converge when there is a link failure between Host1 and Host4. Currently, Vodkila forwards the frames out its root port of ge-0/0/0 to get to Host4: [edit] lab@Vodkila# run show spanning-tree interface Spanning tree interface parameters for instance 0 Interface ge-0/0/0.0 ge-0/0/3.0 ge-0/0/7.0 ge-0/0/8.0 ge-0/0/9.0 ge-0/1/1.0 ge-1/0/0.0 ge-1/0/1.0 ge-1/0/2.0 ge-1/0/3.0 ge-1/0/8.0
Port ID 128:513 128:516 128:520 128:521 128:522 128:610 128:625 128:626 128:627 128:628 128:633
Designated port ID 128:513 128:516 128:520 128:521 128:522 128:610 128:514 128:514 128:514 128:628 128:633
Designated bridge ID 32768.0019e256ee80 32768.001f123dd280 32768.001f123dd280 32768.001f123dd280 32768.001f123dd280 32768.001f123dd280 32768.0019e256ee80 32768.001f12309680 32768.001f1230c480 32768.001f123dd280 32768.001f123dd280
Port Cost 20000 200000 2000000 20000 200000 20000 20000 20000 20000 200000 20000
State Role FWD FWD FWD FWD FWD BLK BLK BLK BLK FWD BLK
ROOT DESG DESG DESG DESG DIS ALT ALT ALT DESG DIS
Host1 is going to ping Host4, while the ge-0/0/0 interface is disabled on Vodkila. This causes port ge-1/0/0 to transition to the new root port. However, this transition does not happen instantaneously. Recall that the port must transition from the blocking state to the forwarding state. Before this happens, it stays in the learning state for the length of the forwarding delay, which defaults to 15 seconds. The following sequence shows these states on Vodkila: lab@Vodkila# run show spanning-tree interface ge-1/0/0 detail Spanning tree interface parameters for instance 0 Interface name : ge-1/0/0.0 Port identifier : 128.625 Designated port ID : 128.514 Port cost : 20000 Port state : Blocking Designated bridge ID : 32768.00:19:e2:56:ee:80 Port role : Root Link type : Pt-Pt/NONEDGE Boundary port : NA lab@Vodkila# run show spanning-tree interface ge-1/0/0 detail Spanning tree interface parameters for instance 0 Interface name Port identifier Designated port ID Port cost Port state
: : : : :
ge-1/0/0.0 128.625 128.514 20000 Learning
360 | Chapter 6: Spanning Tree Protocol Download at Boykma.Com
Designated bridge ID Port role Link type Boundary port
: 32768.00:19:e2:56:ee:80 : Root : Pt-Pt/NONEDGE : NA
[edit] lab@Vodkila# run show spanning-tree interface ge-1/0/0 detail Spanning tree interface parameters for instance 0 Interface name Port identifier Designated port ID Port cost Port state Designated bridge ID Port role Link type Boundary port
: : : : : : : :
ge-1/0/0.0 128.625 128.514 20000 Forwarding 32768.00:19:e2:56:ee:80 Root Pt-Pt/NONEDGE : NA
If you need more verification, notice that the ping from Host1 to Host4 times out and 15 pings are lost: Reply to request 464 (4 ms) Reply to request 465 (4 ms) Request 466 timed out Request 467 timed out Request 468 timed out Request 469 timed out Request 470 timed out Request 471 timed out Request 472 timed out Request 473 timed out Request 474 timed out Request 475 timed out Request 476 timed out Request 477 timed out Request 478 timed out Request 479 timed out Request 480 timed out Request 481 timed out Reply to request 482 (172 ms)
This seems like a great time to deploy RSTP!
Configuring RSTP In order to move from STP to RSTP on Juniper switches, simply delete the old STP configuration on each switch and move to RSTP. Here is an example taken from Rum: [edit] lab@Rum# delete protocols stp [edit] lab@Rum# set protocols rstp
Spanning Tree Configuration | 361 Download at Boykma.Com
[edit] lab@Rum# commit commit complete
The options are similar to what was shown in STP: lab@Rum# set protocols Possible completions:
+ apply-groups + apply-groups-except bpdu-block-on-edge bridge-priority disable forward-delay hello-time > interface max-age > traceoptions |
rstp ? Execute this command Groups from which to inherit configuration data Don't inherit configuration data from these groups Block BPDU on all interfaces configured as edge (BPDU Protect) Priority of the bridge (in increments of 4k - 0,4k,8k,..60k) Disable STP Time spent in listening or learning state (4..30 seconds) Time interval between configuration BPDUs (1..10 seconds) Maximum age of received protocol bpdu (6..40 seconds) Tracing options for debugging protocol operation Pipe through a command
On the Cisco devices, enable rapid-pvst: Whiskey(config)#spanning-tree mode rapid-pvst
Verify that RSTP is running in the Juniper switches: [edit] lab@Rum# run show spanning-tree bridge STP bridge parameters Context ID : 0 Enabled protocol : RSTP Root ID : 32768.00:19:e2:56:ee:80 Hello time : 2 seconds Maximum age : 20 seconds Forward delay : 15 seconds Message age : 0 Number of topology changes : 4 Time since last topology change : 141 seconds Local parameters Bridge ID : 32768.00:19:e2:56:ee:80 Extended system ID : 0 Internal instance ID : 0
Also verify that RSTP is running for VLAN 1 on the Cisco switches: Whiskey#show spanning-tree bridge Hello Max Bridge Group Bridge ID Time Age ---------------- --------------------------------- ----- --Bridge group 1 128 000b.5fc3.cc80 1 15 Hello Max
Fwd Dly Protocol --- -------30 dec Fwd
Vlan Bridge ID Time Age Dly Protocol ---------------- --------------------------------- ----- --- --- --------
362 | Chapter 6: Spanning Tree Protocol Download at Boykma.Com
VLAN0001 VLAN0666
32769 (32768, 1) 000b.5fc3.cc80 33434 (32768, 666) 000b.5fc3.cc80
2 2
20 20
15 rstp 15 rstp
The topology has not changed from Figure 6-28. However, notice that on Vodkila, ge-1/0/0, ge-1/0/1, and ge-1/0/2 are in the alternate port roles. This means that upon a root port failure, the alternate port will automatically switch to the root port. Since Vodkila has multiple alternate ports, the default behavior is for the numerically lowest port to take precedence, which in this case is ge-1/0/0: lab@Vodkila# run show spanning-tree interface Spanning tree interface parameters for instance 0 Interface ge-0/0/0.0 ge-0/0/3.0 ge-0/0/7.0 ge-0/0/8.0 ge-0/0/9.0 ge-0/1/1.0 ge-1/0/0.0 ge-1/0/1.0 ge-1/0/2.0 ge-1/0/3.0 ge-1/0/8.0
Port ID 128:513 128:516 128:520 128:521 128:522 128:610 128:625 128:626 128:627 128:628 128:633
Designated port ID 128:513 128:516 128:520 128:521 128:522 128:610 128:514 128:514 128:514 128:628 128:633
Designated bridge ID 32768.0019e256ee80 32768.001f123dd280 32768.001f123dd280 32768.001f123dd280 32768.001f123dd280 32768.001f123dd280 32768.0019e256ee80 32768.001f12309680 32768.001f1230c480 32768.001f123dd280 32768.001f123dd280
Port Cost 20000 200000 2000000 20000 200000 20000 20000 20000 20000 200000 20000
State Role FWD FWD FWD FWD FWD BLK BLK BLK BLK FWD BLK
ROOT DESG DESG DESG DESG DIS ALT ALT ALT DESG DIS
Let’s invoke the link failure again: [edit] lab@Vodkila# set interfaces ge-0/0/0 disable [edit] lab@Vodkila# commit fpc1: configuration check succeeds fpc0: commit complete fpc2: commit complete fpc1: commit complete
The interface switches over to the root port and forwarding mode without any timers expiring: lab@Vodkila# run show spanning-tree interface ge-1/0/0 detail Spanning tree interface parameters for instance 0 Interface name Port identifier Designated port ID Port cost Port state Designated bridge ID Port role
: : : : : : :
ge-1/0/0.0 128.625 128.514 20000 Forwarding 32768.00:19:e2:56:ee:80 Root
Spanning Tree Configuration | 363 Download at Boykma.Com
Link type Boundary port
: Pt-Pt/NONEDGE : NA
The Port Fast Feature The port fast feature is enabled on non-edge P-to-P interfaces, which is the majority of connections in modern networks. Since the port was set for full duplex (FD) and BPDUs were received from neighbor switches, it is automatically set to P-to-P. In contrast, interface ge-0/0/7 does not receive BPDUs, as it contains only a host and is put in edge mode: [edit] lab@Vodkila# run show spanning-tree interface ge0/0/7 detail Spanning tree interface parameters for instance 0 Interface name Port identifier Designated port ID Port cost Port state Designated bridge ID Port role Link type Boundary port
: : : : : : : : :
ge-0/0/7.0 128.520 128.520 2000000 Forwarding 32768.00:1f:12:3d:d2:80 Designated SHARED/EDGE NA
On Host1, a single ping packet is dropped, which is a vast improvement over what happens in the STP case (15 drops). Also, remember that the switches will flush out their MAC tables in order to achieve proper forwarding. This is likely the cause for the single lost packet in the following code: Reply to request 452 (8 ms) Reply to request 453 (8 ms) Reply to request 454 (8 ms) Reply to request 455 (8 ms) Reply to request 456 (4 ms) Reply to request 457 (4 ms) Request 458 timed out Reply to request 459 (148 ms) Reply to request 460 (4 ms) Reply to request 461 (4
Notice that ge-0/0/0 is now disabled and is blocking, whereas ge-1/0/0 is now forwarding and is the root port. If that port failed, ge-1/0/1 would be next in line to succeed as the root port:
364 | Chapter 6: Spanning Tree Protocol Download at Boykma.Com
[edit] lab@Vodkila# run show spanning-tree interface Spanning tree interface parameters for instance 0 Interface ge-0/0/0.0 ge-0/0/3.0 ge-0/0/7.0 ge-0/0/8.0 ge-0/0/9.0 ge-0/1/1.0 ge-1/0/0.0 ge-1/0/1.0 ge-1/0/2.0 ge-1/0/3.0 ge-1/0/8.0
Port ID 128:513 128:516 128:520 128:521 128:522 128:610 128:625 128:626 128:627 128:628 128:633
Designated port ID 128:513 128:516 128:520 128:521 128:522 128:610 128:514 128:514 128:514 128:628 128:633
Designated bridge ID 32768.0019e256ee80 32768.001f123dd280 32768.001f123dd280 32768.001f123dd280 32768.001f123dd280 32768.001f123dd280 32768.0019e256ee80 32768.001f12309680 32768.001f1230c480 32768.001f123dd280 32768.001f123dd280
Port Cost 20000 200000 2000000 20000 200000 20000 20000 20000 20000 200000 20000
State Role BLK FWD FWD FWD FWD BLK FWD BLK BLK FWD BLK
DIS DESG DESG DESG DESG DIS ROOT ALT ALT DESG DIS
When RSTP isn’t going to be rapid Remember that this rapid transition happens only for ports that are in P-to-P mode. Ports in other modes, such as edge ports or shared LANs, do not enjoy this quick failover. For example, the shared LAN between Brandy, Bourbon, and Ethanol will simply use the standard STP timers due to the shared status of the interface: [edit] lab@Brandy# run show spanning-tree interface ge-0/0/12 detail Spanning tree interface parameters for instance 0 Interface name Port identifier Designated port ID Port cost Port state Designated bridge ID Port role Link type Boundary port
: : : : : : : : :
ge-0/0/12.0 128.525 128.525 2000000 Forwarding 32768.00:1f:12:30:96:80 Designated SHARED/NONEDGE NA
RSTP design consideration So far in the example we have relied on the default parameters to calculate the spanning tree, but often the default parameters are not sufficient. This usually corresponds to the root bridge as well as interface costs. STP takes into account only link speeds, and not other important items such as monetary link cost or link reliability. In order for STP to use these factors in the calculation, you may have to manually configure the link cost:
Spanning Tree Configuration | 365 Download at Boykma.Com
lab@Rum# set protocols Possible completions: + apply-groups + apply-groups-except > bpdu-timeout-action cost disable edge mode no-root-port priority
rstp interface ge-0/0/1 ? Groups from which to inherit configuration data Don't inherit configuration data from these groups Define action on BPDU expiry (Loop Protect) Cost of the interface (1..200000000) Disable Spanning Tree on port Port is an edge port Interface mode (P2P or shared) Enable root-protect feature on this port Interface priority (in increments of 16 - 0,16,..240)
You also define and set the location of the root bridge. In the default topology (Figure 6-29), Rum was chosen as the root bridge simply because it has the lowest bridge ID, due to having the lowest MAC address. In general, the root bridge should be your most powerful switch since much of the forwarding of the frame will transit this switch. Also, it makes sense to choose a bridge that has some significance for being the central point of the tree. This could be where the highest-speed interfaces connect or where the multiple intercampus or WAN links exist. In our topology, Vodkila would seem like a logical choice, as it is the largest switch due to its Virtual Chassis (VC) configuration and because it connects to the default gateway, which is Scotch. To configure Vodkila to be the root bridge, simply set the bridge priority to a lower value than the default: [edit] lab@Vodkila# set protocols rstp bridge-priority 4k
After this change is committed, the first portion of the bridge ID changes to 4096 on the active ports: lab@Vodkila> show spanning-tree interface Spanning tree interface parameters for instance 0 Interface ge-0/0/0.0 ge-0/0/3.0 ge-0/0/7.0 ge-0/0/8.0 ge-0/0/9.0 ge-0/1/1.0 ge-1/0/0.0 ge-1/0/1.0 ge-1/0/2.0 ge-1/0/3.0 ge-1/0/8.0
Port ID 128:513 128:516 128:520 128:521 128:522 128:610 128:625 128:626 128:627 128:628 128:633
Designated port ID 128:513 128:516 128:520 128:521 128:522 128:610 128:625 128:626 128:627 128:628 128:633
Designated bridge ID 4096.001f123dd280 4096.001f123dd280 4096.001f123dd280 4096.001f123dd280 4096.001f123dd280 32768.001f123dd280 4096.001f123dd280 4096.001f123dd280 4096.001f123dd280 4096.001f123dd280 32768.001f123dd280
366 | Chapter 6: Spanning Tree Protocol Download at Boykma.Com
Port Cost 20000 200000 2000000 20000 200000 20000 20000 20000 20000 200000 20000
State Role FWD FWD FWD FWD FWD BLK FWD FWD FWD FWD BLK
DESG DESG DESG DESG DESG DIS DESG DESG DESG DESG DIS
Figure 6-29. Default STP topology
Spanning Tree Configuration | 367 Download at Boykma.Com
Verify that Vodkila is the root bridge by checking that the root ID equals the bridge ID: lab@Vodkila> lab@Vodkila> show spanning-tree bridge STP bridge parameters Context ID : 0 Enabled protocol : RSTP Root ID : 4096.00:1f:12:3d:d2:80 Hello time : 2 seconds Maximum age : 20 seconds Forward delay : 15 seconds Message age : 0 Number of topology changes : 13 Time since last topology change : 24 seconds Local parameters Bridge ID : 4096.00:1f:12:3d:d2:80 Extended system ID : 0 Internal instance ID : 0
When BPDUs Attack It is possible that an edge port could receive BPDUs as a result of a misconfiguration or even an attack. These could be from a PC, a simple switch bought from your local electronics store, or an access switch. In these cases, the receipt of the BPDU could result in a spanning tree calculation, or worse, a root bridge recalculation. Two JUNOS features help guard against this issue: BPDU protection and root protection. In BPDU protection, the receipt of a BPDU will cause the port to transition to the blocking state and stop forwarding frames. The command to enable this is set ethernet-switchingoptions bpdu-block interface . To verify whether the port is blocked, issue the show ethernet-switching interfaces command. In order to transition the interface out of the blocked state, either set a timer value (disable-timeout ) for the blocking and wait for the timeout to expire, or issue the clear ethernetswitching bpdu-error command. Another alternative is to block the port only if it is receiving superior BPDUs on that port. This is the case when you have a small switch on which you may want to run STP but you don’t want to allow it to become the root bridge, which could happen due to a misconfiguration or faulty software (sorry, electronics store). In order to ensure that a port cannot receive superior BPDUs, set the no-root-port command after the interface in [edit protocols rstp]. If the port receives a superior BPDU, it will transition into the blocking state and will not leave that state until it no longer receives superior BPDUs.
Spanning Tree Configuration Summary We looked at how to configure Spanning Tree Protocol as well as Rapid Spanning Tree Protocol. Although RSTP solves many convergence issues, it does have a major problem when you are dividing your LAN segment into multiple VLANs. RSTP allows only a 368 | Chapter 6: Spanning Tree Protocol Download at Boykma.Com
single instance of a spanning tree, causing all of your VLANs to traverse a single link. If you want to use multiple links, Multiple Spanning Tree Protocol, examined next, would be your solution.
Multiple Spanning Tree Protocol RSTP solves many of STP’s limitations, but it does have one major drawback, in that it is not “VLAN-aware.” In other words, only one spanning tree is created for the entire LAN, and there is only a single path for all VLANs to use. This causes underutilization of links that are in the blocking state and results in no load balancing. MSTP (or 802.1s) provides for a new spanning tree instance per VLAN or per group of VLANs, allowing more links in the LAN to be utilized. MSTP was originally defined in IEEE 802.1s and later merged into IEEE 802.1Q-2003. That specification describes the operation of MSTP as follows: MSTP allows frames assigned to different VLANs to follow separate paths, each based on an independent Multiple Spanning Tree Instance (MSTI), within Multiple Spanning Tree (MST) Regions composed of LANs and or MST Bridges. These Regions and the other Bridges and LANs are connected into a single Common Spanning Tree (CST).
Figure 6-30 gives an example of the goal of MSTP; here, it allows certain VLANs to utilize the link from A to D1, while others utilize the link from A to D2. This would be a common topology if Switch A were an access switch.
Figure 6-30. VLAN issue
PVST+ was created to solve the multiple-STP issue on Cisco devices. However, PVST+ creates an instance per VLAN, which can have massive scaling issues as the number of VLANs grows. Consequently, Cisco also recommends the use of MSTP over PVST+.
MSTP allows VLANs 501–1000 to be classified into one instance, and VLANs 1–500 to be classified into another region, resulting in a setup such as the one in Figure 6-31. Notice that each instance is blocked on the opposite port due to the spanning tree. Multiple Spanning Tree Protocol | 369 Download at Boykma.Com
Figure 6-31. MSTP solution
MSTP groups switches together in an MSTP region. Figure 6-32 depicts an MSTP region. A region is defined by three parameters: Region name User-defined name for the region. Revision level User-defined value that defines the region. Element table Provides mapping of VLANs to instances. This information is not actually sent out in the BPDU, but rather is a numerical digest that is generated from the local configuration.
Figure 6-32. MSTP region
370 | Chapter 6: Spanning Tree Protocol Download at Boykma.Com
Each region defines the boundary for the MSTI BPDUs that will be sent out. Up to 64 regions can be configured. Each region is interconnected via a Common Spanning Tree (CST), shown in Figure 6-33. The CST interconnects MSTP regions or even devices that are simply running RSTP. Since the BPDUs that are sent out in each region are standard RSTP BPDUs with the MSTI messages placed at the end of the BPDU, standard RSTP switches will interpret the MSTP BPDUs as RSTP and will view the entire region as a single spanning tree instance. CST’s role is to manage these regions and RSTP islands in order to ensure an accurate LAN topology. CST turns each MSTP region into a virtual bridge. So, from a logical point of view, it appears that there are multiple switches running STP, while in fact, physically they are the same switch. CST creates the “magic” by managing these logical separations.
Figure 6-33. Common Spanning Tree
Within an MSTP region, standard RSTP operation applies. The only difference is that on a given link both ends of a link can send and receive BPDUs simultaneously. This is because, as shown in Figure 6-34, each bridge can be designated for one or more instances and needs to transmit BPDUs. In other words, STP changes its view from operating on a per-port basis to operating on a per-instance basis.
Multiple Spanning Tree Protocol | 371 Download at Boykma.Com
Figure 6-34. RSTP in an MSTP region
MSTP allows 64 instances to be created. This was increased from an older value of 16.
MSTP Configuration MSTP is configured under [edit protocols mstp]. We already discussed most of the configuration options elsewhere in this chapter: lab@Bourbon# set protocols mstp ? Possible completions:
Execute this command + apply-groups Groups from which to inherit configuration data + apply-groups-except Don't inherit configuration data from these groups bpdu-block-on-edge Block BPDU on all interfaces configured as edge (BPDU Protect) bridge-priority Priority of the bridge (in increments of 4k - 0,4k,8k,..60k) configuration-name Configuration name (part of MST configuration identifier) disable Disable MSTP forward-delay Time spent in listening or learning state (4..30 seconds) hello-time Time interval between configuration BPDUs (1..10 seconds) > interface max-age Maximum age of received protocol bpdu (6..40 seconds) max-hops Maximum number of hops (1..255) > msti Per-MSTI options revision-level Revision level (part of MST configuration identifier)
372 | Chapter 6: Spanning Tree Protocol Download at Boykma.Com
> traceoptions |
Tracing options for debugging protocol operation Pipe through a command
We are going to configure the example topology as shown in Figure 6-35. Brandy has three access ports, each with a single VLAN 10, 20, or 30. It also is connected to a host on port ge-0/0/7, which is untagged. The goal is to send all VLAN 30 traffic toward Rum, and all other traffic toward Vodkila.
Figure 6-35. Sample MSTP topology
The VLANs are defined on Brandy: lab@Brandy> v10 { vlan-id } v20 { vlan-id } v30 { vlan-id }
show configuration vlans 10;
20;
30;
The interfaces of ge-0/0/1 and ge-0/0/3 are defined as trunk ports: lab@Brandy> show configuration interfaces ge-0/0/1 unit 0 { family ethernet-switching { port-mode trunk;
Multiple Spanning Tree Protocol | 373 Download at Boykma.Com
vlan { members [ v10 v20 ]; } } } lab@Brandy> show configuration interfaces ge-0/0/3 unit 0 { family ethernet-switching { port-mode trunk; vlan { members v30; } } }
The MSTP parameters are then defined. The first information that you must decide on is the revision level and configuration name. These values must be the same on each switch in order to identify the MSTP region and translate the incoming BPDUs: lab@Brandy# show protocols mstp configuration-name book-example; revision-level 1; msti 10 { vlan [ 10 20 ]; } msti 30 { vlan 30; }
After the configuration is committed, examine the MSTP configuration. Notice that proper VLANs assigned to MSTI 10 and 30 and the rest of the VLANs automatically mapped to the default MSTI of 0: lab@Brandy> show spanning-tree mstp configuration MSTP information Context identifier : 0 Region name : book-example Revision : 1 Configuration digest : 0x53973bbb358bdb2d6dcab806a189064f MSTI Member VLANs 0 0-9,11-19,21-29,31-4094 10 10,20 30 30 30 30
Then examine the spanning tree bridge parameters. Notice that Brandy is the root bridge for MSTI 10 and 30, but not for instance 0: lab@Brandy> show spanning-tree bridge STP bridge parameters Context ID : 0 Enabled protocol : MSTP
374 | Chapter 6: Spanning Tree Protocol Download at Boykma.Com
STP bridge parameters for CIST Root ID Root cost Root port CIST regional root CIST internal root cost Hello time Maximum age Forward delay Hop count Message age Number of topology changes Time since last topology change Local parameters Bridge ID Extended system ID Internal instance ID STP bridge parameters for MSTI 10 MSTI regional root Hello time Maximum age Forward delay Local parameters Bridge ID Extended system ID Internal instance ID STP bridge parameters for MSTI 30 MSTI regional root Hello time Maximum age Forward delay Local parameters Bridge ID Extended system ID Internal instance ID
: : : : : : : : : : : :
32768.00:19:e2:56:ee:80 20000 ge-0/0/1.0 32768.00:1f:12:3d:d2:80 20000 2 seconds 20 seconds 15 seconds 19 1 7 250 seconds
: 32768.00:1f:12:30:96:80 : 0 : 0
: : : :
32778.00:1f:12:30:96:80 2 seconds 20 seconds 15 seconds
: 32778.00:1f:12:30:96:80 : 0 : 1
: : : :
32798.00:1f:12:30:96:80 2 seconds 20 seconds 15 seconds
: 32798.00:1f:12:30:96:80 : 0 : 2
Looking at the forwarding states of the different spanning tree instances, notice that instance 10 contains the access ports for VLANs 10 and 20 as well as the trunk port. Instance 30 contains the access port for VLAN 30 and the trunk port. Instance 0 contains all the interfaces and is the CST that is tying the MSTP regions together. Instance 0 is sometimes called the internal spanning tree for the system and is a portion of the CST as a whole: lab@Brandy> show spanning-tree interface Spanning tree interface parameters for instance 0 Interface ge-0/0/1.0 ge-0/0/3.0 ge-0/0/5.0 ge-0/0/7.0
Port ID 128:514 128:516 128:518 128:520
Designated port ID 128:626 128:516 128:518 128:520
Designated bridge ID 32768.001f123dd280 32768.001f12309680 32768.001f12309680 32768.001f12309680
Port Cost 20000 20000 20000 2000000
State Role FWD FWD FWD FWD
ROOT DESG DESG DESG
Multiple Spanning Tree Protocol | 375 Download at Boykma.Com
ge-0/0/8.0 ge-0/0/9.0
128:521 128:522
128:521 128:522
32768.001f12309680 32768.001f12309680
20000 FWD 20000 FWD
DESG DESG
Spanning tree interface parameters for instance 10 Interface ge-0/0/1.0 ge-0/0/5.0 ge-0/0/8.0
Port ID 128:514 128:518 128:521
Designated port ID 128:514 128:518 128:521
Designated bridge ID 32778.001f12309680 32778.001f12309680 32778.001f12309680
Port Cost 20000 20000 20000
State Role FWD FWD FWD
DESG DESG DESG
Spanning tree interface parameters for instance 30 Interface ge-0/0/3.0 ge-0/0/9.0
Port ID 128:516 128:522
Designated port ID 128:516 128:522
Designated bridge ID 32798.001f12309680 32798.001f12309680
Port State Role Cost 20000 FWD DESG 20000 FWD DESG
The actual root for the CST is Rum: lab@Rum> show spanning-tree bridge STP bridge parameters Context ID Enabled protocol STP bridge parameters for CIST Root ID CIST regional root CIST internal root cost Hello time Maximum age Forward delay Number of topology changes Time since last topology change Local parameters Bridge ID Extended system ID Internal instance ID STP bridge parameters for MSTI 30 MSTI regional root Hello time Maximum age Forward delay Local parameters Bridge ID Extended system ID Internal instance ID
: 0 : MSTP
: : : : : : : :
32768.00:19:e2:56:ee:80 32768.00:19:e2:56:ee:80 0 2 seconds 20 seconds 15 seconds 5 371 seconds
: 32768.00:19:e2:56:ee:80 : 0 : 0
: : : :
32798.00:19:e2:56:ee:80 2 seconds 20 seconds 15 seconds
: 32798.00:19:e2:56:ee:80 : 0 : 1
It is also interesting to look at Vodkila as we see the ports toward Rum—for instance, 10 and 30—in the master state. The master state is a port on the shortest path from the entire region to the common root bridge, connecting the MSTP region to the common root bridge: lab@Vodkila> show spanning-tree interface
376 | Chapter 6: Spanning Tree Protocol Download at Boykma.Com
Spanning tree interface parameters for instance 0 Interface
Port ID
ge-0/0/0.0 ge-0/0/3.0 ge-0/0/7.0 ge-0/0/8.0 ge-0/0/9.0 ge-0/1/1.0 ge-1/0/0.0 ge-1/0/1.0 ge-1/0/2.0 ge-1/0/3.0 ge-1/0/8.0
128:513 128:516 128:520 128:521 128:522 128:610 128:625 128:626 128:627 128:628 128:633
Designated port ID 128:513 128:516 128:520 128:521 128:522 128:610 128:514 128:626 128:627 128:628 128:633
Designated bridge ID 32768.001f123dd280 32768.001f123dd280 32768.001f123dd280 32768.001f123dd280 32768.001f123dd280 32768.001f123dd280 32768.0019e256ee80 32768.001f123dd280 32768.001f123dd280 32768.001f123dd280 32768.001f123dd280
Port Cost 20000 200000 2000000 20000 200000 20000 20000 20000 20000 200000 20000
State Role FWD FWD FWD FWD FWD BLK FWD FWD FWD FWD BLK
DESG DESG DESG DESG DESG DIS ROOT DESG DESG DESG DIS
Spanning tree interface parameters for instance 10 Interface
Port ID
ge-1/0/0.0 ge-1/0/1.0
128:625 128:626
Designated port ID 128:625 128:514
Designated bridge ID 32778.001f123dd280 32778.001f12309680
Port State Role Cost 20000 FWD MSTR 20000 FWD ROOT
Spanning tree interface parameters for instance 30 Interface
Port ID
ge-1/0/0.0 ge-1/0/1.0
128:625 128:626
Designated port ID 128:625 128:626
Designated bridge ID 32798.001f123dd280 32798.001f123dd280
Port State Role Cost 20000 FWD MSTR 20000 FWD DESG
MSTP Summary In order to balance multiple VLANs across the links in your LAN, you should deploy MSTP. MSTP is essentially multiple instances of STP tied together efficiently. When diving into the details, the complexity of the protocol becomes clear; however, that complexity is not a burden due to the automatic learning built into the specification itself.
Redundant Trunk Groups Another feature that can help in loops is a feature called Redundant Trunk Groups (RTGs). Essentially, RTGs provide a fast and simplified Layer 2 failover mechanism, without introducing the complexity of running STP. RTG allows for one physical (or LAG) interface to back up another in case of a failure. In the Cisco world, RTG is often referred to as FlexLink.
Redundant Trunk Groups | 377 Download at Boykma.Com
One of the most common situations in which to use RTG is when an access layer switch is dual-homed to the aggregation or distribution switch (Figure 6-36). In this scenario, configuration is needed only on the local Switch C, as Switch A and Switch B do not need to know that RTG is enabled. However, if a link is enabled for RTG, it cannot participate in STP nor does it need to, as you manually solved the issue that STP was trying to solve. If STP was allowed on interfaces running RTG, confusion could occur if the active link suddenly became blocked due to an STP calculation. JUNOS software will display a commit error if STP and RTG are attempted at the same time: [edit ethernet-switching-options] lab@Brandy# commit error: XSTP : msti 0 STP and RTG cannot be enabled on the same interface ge-0/0/1.0 error: configuration check-out failed
Figure 6-36. Common deployment scenario for RTG
RTG Configuration RTG is configured under [edit ethernet-switching-options] and defines two interfaces under a group: a primary interface and a backup. JUNOS software allows up to 16 RTGs to be configured. In Figure 6-37, Brandy is dual-homed to Vodkila and Rum. The ge-0/0/3 interface should be configured as primary and ge-0/0/1 should be configured as secondary: [edit ethernet-switching-options] lab@Brandy# show redundant-trunk-group { group dual { interface ge-0/0/1.0; interface ge-0/0/3.0 { primary;
378 | Chapter 6: Spanning Tree Protocol Download at Boykma.Com
} } } [edit ethernet-switching-options] lab@Brandy# commit and-quit
Figure 6-37. RTG example
Verify that RTG is working as configured: lab@Brandy> show redundant-trunk-group group-name dual Interface
State
Bandwidth
Time of last flap
ge-0/0/3.0 ge-0/0/1.0
Up/Pri/Act Up
1000 Mbps 1000 Mbps
Never Never
Flap count 0 0
Notice that ge-0/0/3 is set to primary and active under the State tag. The ge-0/0/3 interface fails, and the ge-0/0/1 interface becomes the active interface: lab@Brandy# run show redundant-trunk-group group-name dual Interface
State
Bandwidth
Time of last flap
Flap count
ge-0/0/3.0 ge-0/0/1.0
Dwn/Pri Up/Act
1000 Mbps 1000 Mbps
2008-08-06 10:36:20 UTC (00:00:22 ago) Never
1 0
Since the ge-0/0/3 interface is set as the primary interface, it has a revertive capability. This means that if the primary interface fails and then returns, it will revert back to the active link. In our example, ge-0/0/3 returns: Redundant Trunk Groups | 379 Download at Boykma.Com
lab@Brandy# run show redundant-trunk-group group-name dual Interface
State
Bandwidth
Time of last flap
Flap count
ge-0/0/3.0 ge-0/0/1.0
Up/Pri/Act Up
1000 Mbps 1000 Mbps
2008-08-06 10:37:08 UTC (00:00:01 ago) Never
2 0
Although a backup RTG interface will not forward traffic, Layer 2 management protocols such as Link Layer Discovery Protocol (LLDP) will still function across it.
It is possible to create a non-revertive RTG group by removing the primary flag. This takes some planning, as the software will always set the interface with the higher interface value to be the active link: [edit ethernet-switching-options] lab@Brandy# show redundant-trunk-group { group dual { interface ge-0/0/1.0; interface ge-0/0/3.0; } }
Without the primary knob, ge-0/0/3 becomes the active link as before, but with the absence of the primary flag in the State field: lab@Brandy# run show redundant-trunk-group group-name dual Interface
State
Bandwidth
ge-0/0/3.0 ge-0/0/1.0
Up/Act 1000 Mbps Up 1000 Mbps
Time of last flap
Never Never
Flap count 0 0
When the failure occurs, ge-0/0/1 takes over as the active link: lab@Brandy# run show redundant-trunk-group group-name dual Interface
State
Bandwidth
Time of last flap
ge-0/0/3.0 ge-0/0/1.0
Dwn Up/Act
1000 Mbps 1000 Mbps
2008-08-06 10:46:28 UTC (00:00:03 ago) Never
Flap count 1 0
However, when the ge-0/0/3 link comes back, the active link stays at ge-0/0/1. The only way to switch back to ge-0/0/3 is to temporarily disable ge-0/0/1 and initiate a switchover: [edit] lab@Brandy# run show redundant-trunk-group group-name dual
380 | Chapter 6: Spanning Tree Protocol Download at Boykma.Com
Interface
State
Bandwidth
Time of last flap
Flap count
ge-0/0/3.0 ge-0/0/1.0
Up Up/Act
1000 Mbps 1000 Mbps
2008-08-06 10:47:07 UTC (00:00:03 ago) Never
2 0
RTG Summary RTG is a simple alternative to the spanning tree and redundancy in simple topologies. It eliminates all the complex messaging of STP and makes the link decision a purely local matter. RTG is not designed for complex topologies, however, and is best used when an access switch is multihomed to two distribution switches.
Conclusion This chapter examined Spanning Tree Protocol and its evolution, namely, the creation of the original Spanning Tree Protocol and the problems that it solved. It was evident pretty early on that some improvements needed to be made, and Rapid Spanning Tree Protocol was thus born. RSTP also had some limitations for VLANs and redundancy, so finally, Multiple Spanning Tree Protocol was created. The spanning tree is not the only way to prevent loops and provide redundancy, however, so we also examined Redundant Trunk Groups. Now that you have the Layer 2 functionality established, you can start looking at some Layer 3 functionality in the next chapters.
Chapter Review Questions 1. What is the primary purpose of Spanning Tree Protocol? a. Load-balance across multiple links b. Eliminate loops c. Learn neighbor switch information d. Create optimized paths throughout the LAN 2. Which bridge is the primary forwarder on a given link? a. Designated b. Primary c. Active d. Forwarder 3. By default, how is the root bridge chosen? a. Based on the number of total ports b. Port identifier
Chapter Review Questions | 381 Download at Boykma.Com
4.
5.
6.
7.
8.
9.
10.
c. Total port cost d. Bridge ID Which two port states are valid STP states: a. Blocking b. Waiting c. Listening d. Establishing Which command is issued to view the STP port states on an EX Series switch? a. show stp b. show stp bridge c. show stp interface d. show stp ports True or false: STP provides subsecond failover time. a. True b. False c. There are no absolutes in the universe! Which two new port types are introduced in RSTP? a. Backup b. Root c. Blocking d. Alternate e. Fast Choose two items that RSTP changes from the original STP specification: a. More root bridges b. Fewer port states c. Different link costs d. Faster tree algorithm Which command protects the switch from receiving superior BPDUs? a. Bpdu-block b. inferior c. no-root-port d. edge port How many regions are allowed when configuring MSTP? a. 3 b. 32
382 | Chapter 6: Spanning Tree Protocol Download at Boykma.Com
c. 64 d. 100 e. 128 11. What is the maximum number of root bridges that can be configured in MSTP? a. 1 b. 64 c. 65 d. 100 12. Which command allows a primary link to revert back after a failover in RTG? a. primary b. active c. revert d. master
Chapter Review Answers 1. Answer: B. STP’s primary goal is to create a loop-free topology. Answer D is close, as it is an optimized topology, but that is not the primary goal of STP. 2. Answer: A. The designated bridge is the device chosen to forward local traffic on a given link. This ensures that on a segment, a bridge does not receive a multicast or broadcast packet and reinject it into the LAN. 3. Answer: D. The root bridge is the bridge with the lowest bridge ID. Remember that the bridge ID consists of the MAC address and the priority field, which is userconfigurable. 4. Answer: A, C. Blocking and listening are the only valid STP states in the list. 5. Answer: C. The only other valid command is answer B, but that command lists only local bridge parameters. 6. Answer: B. The failover times in STP could range as high as 30 seconds using default timers. The convergence time of STP is a known issue that has been corrected in RSTP. 7. Answer: A, D. The new ports in RSTP are the backup ports and the alternate ports. Both provide rapid switchover in case of a root or designated port failure. 8. Answer: B, C. RSTP actually decreases the number of port states an interface can be in. This allows for much quicker transition times. The port cost values were also adjusted in order to include modern high-speed ports. 9. Answer: C. This command will place the port in the blocking state if a superior BPDU is received.
Chapter Review Answers | 383 Download at Boykma.Com
10. Answer: C. Sixty-four regions are allowed in MSTP, with each region allowing multiple VLANs. 11. Answer: C. One root bridge is possible per MSTP region, as well as a single root bridge for the common spanning tree. 12. Answer: A. The primary knob causes that interface to be revertive. In other words, the switch will always use the primary interface to forward traffic if it is available.
384 | Chapter 6: Spanning Tree Protocol Download at Boykma.Com
CHAPTER 7
Routing on the EX
Wait, routing in a Layer 2/LAN switching book! What gives? EX switches run JUNOS software, and therefore inherit a rich legacy of carrier-grade routing support. EX routing support pretty much comes for free, which is to say IPv4 routing is included in the base EX chassis. There are no special “routing-enabled” EX software images, or added hardware requirements, or any special commands to turn on/enable IP routing. You simply have to decide that Layer 3 forwarding is desired, determine which routing protocols to use, and then configure the EX to route as you would any other JUNOS device. In many network designs, the optimal solution combines Layer 2 switching at the edge with Layer 3 routing in the distribution and core layers. The built-in (rather than boltedon) nature of EX routing support makes the deployment of such hybrid networks both simple and reliable, given the known stability of JUNOS routing and the respectable Layer 3 scaling limits supported by the EX platforms. Large enterprise networks or service provider data centers may warrant the extended routing capabilities of a purpose-built routing platform such as a J Series, MX Series, or even M or T Series routing platform. It should be noted that the goal here is to expose the reader to general EX routing capabilities and basic configurations and operational verification examples. A detailed discussion of IP routing and routing protocols, including aggregate and generated routes, multicast, OSPF, IS-IS, BGP, and complex routing policy, is outside the scope of this book. Readers interested in expanding on the topic of IP routing in a JUNOS environment are encouraged to consult the companion volume to this book, JUNOS Enterprise Routing, by Doug Marschke and Harry Reynolds (O’Reilly). The topics covered in this chapter include: • EX routing overview • Inter-VLAN routing and the Routed VLAN Interface • Static routing 385 Download at Boykma.Com
• RIP routing
EX Routing Overview This section provides a high-level overview of key routing concepts, some JUNOSspecific, that you need to understand before moving into any particular routing scenario. Readers familiar with IP routing in a JUNOS environment are expected to be familiar with the material presented here; the review may be worthwhile, nonetheless.
What Is Routing? Recall that Chapter 1 provided a general overview of bridging and routing concepts. Rather than reinvent that wheel, let’s do a quick review of the key differences between bridging and routing. They are summarized in Table 7-1. Table 7-1. Bridging versus routing summary Bridge
Router
Forwards frames based on flat Media Access Control (MAC) address, limited scalability
Forwards packets based on variable length IP address (longest match), supports addressing hierarchy for global scalability
Transparent to end stations (shared subnet, no Time to Live [TTL] decrement)
End stations participate in routing via default gateway and local/nonlocal decision, TTL decrement at each hop
Floods Broadcast, Unknown, or Multicast (BUM) addresses
Filters BUM addresses
Prone to loops, uses Spanning Tree Protocol (STP) to block redundant paths, no load balancing, slow convergence
Tolerates loops, no blocking, load balancing over multiple paths, fast convergence
Uses bridging protocols to find and block loops for a single path
Uses routing protocols to find and select optimal paths; in some cases unequal cost load balancing is possible
Limited filtering/firewall/services
Rich set of filtering/firewall and enhanced services such as Dynamic Host Configuration Protocol (DHCP) or stateful firewall/deep packet inspection
Interior Gateway Protocol overview Interior Gateway Protocols (IGPs) provide routing connectivity within the interior of a given routing domain (RD). An RD is defined as a set of routers under common administrative control that share a common routing protocol. Most multivendor IP networks use a standardized IGP to permit interoperability. Small networks tend to use Routing Information Protocol (RIP), while larger, more complicated designs favor the performance and scalability of a link state protocol such as Open Shortest Path First (OSPF). In general, an IGP functions to advertise and learn network prefixes (routes) from neighboring routers. It uses this information to populate the routing table (RT) with 386 | Chapter 7: Routing on the EX Download at Boykma.Com
entries for all sources advertising reachability for a given prefix. A route selection algorithm then selects the best (i.e., the shortest) path between the local router and each destination, and the associated next hop is pushed into the forwarding table (FT) to direct matching packets along that path. When network conditions change, perhaps due to equipment failure or management activity, the IGP both generates and receives updates and recalculates a new best route to the affected destinations. Here, the concept of a “best” route is normally tied to a route metric, which is the criterion used to determine the relative path cost of a given route. Generally speaking, a route metric is significant only to the routing protocol it’s associated with, and is meaningful only within a given RD. In some cases, a router may learn multiple paths to an identical destination from more than one routing protocol. Given that metric comparison between two different IGPs is meaningless, the selection of the best route between multiple routing sources is controlled by a route preference. In addition to advertising internal network reachability, IGPs are often used to advertise routing information that is external to that IGP’s RD through a process known as route redistribution. Route redistribution is performed via routing policy in JUNOS software.
EX Routing Capabilities All EX platforms ship with support for basic IPv4 routing. While described as “basic,” the EX’s support of static, RIP, and OSPF routing, most users will agree, is quite complete, and more than they will ever need. An advanced routing license is needed to support Border Gateway Protocol (BGP) and the Intermediate System to Intermediate System (IS-IS) routing protocols; a single advanced routing license is used to unlock both features simultaneously. Table 7-2 reflects EX Layer 3 routing capabilities as of the 9.3 JUNOS release. Note that the software demonstrated in this book is based on the 9.2 release, which means, for example, that IPv6 routing is not supported in the current EX test bed. Table 7-2. EX Layer 3 feature support circa JUNOS 9.3 Layer 3 feature
License
Release
Comment
IPv4
No
9.0R2
IPv4 unicast and multicast offered in the initial 9.0R2 EX release.
Static routing
No
9.0R2
Often frowned upon, but static routes have their place.
OSPF
No
9.0R2
Link state (LS) IGP for IPv4. No support for Traffic Engineering (TE) extensions.
RIPv1 and v2
No
9.0R2
Distance-vector-based IPv4 unicast routing protocol.
IS-IS
Yes
9.0R2
LS IGP for IPv4, requires advanced license. No support for End System to Intermediate System (ES-IS), IPv6 multicast, or TE.
BGP/MBGP
Yes
9.0R2
Full BGP and Multiprotocol BGP support with advanced license.
SSM
No
9.0R2
Single-Source Multicast support.
PIM SM
No
9.0R2
Protocol Independent Multicast for IPv4 operating in Sparse mode. EX Routing Overview | 387 Download at Boykma.Com
Layer 3 feature
License
Release
Comment
PIM DM/SSM
No
9.3R2
Protocol Independent Multicast for IPv4 operating in Dense or SourceSpecific mode.
IGMPv1 through v3
No
9.0R2
IPv4 host registration protocols for multicast.
IGMP snooping
No
9.1R1/9.2R1
Allows Layer 2 switches to become multicast-group-aware; snooping support on Routed VLAN Interface (RVI) added in 9.2R1.
Virtual router (VR)
No
9.3R2
Virtual router instances for “VRF-Lite” support (multiple VRs in a single CE router).
IPv6 unicast
No
9.3R2
IPv6 multicast support to follow in a later release.
OSPF3, RIPng, MBGP
No
9.3R2
IPv6 unicast routing support via OSPF3, RIPng, and MBGP.
Routed VLAN Interface
Yes
9.0R2/9.4 (8200)
RVI is like an IOS SVI, used to route/support IGMP snooping between virtual LANs (VLANs).
What’s missing? Even when you factor in the latest 9.3 capabilities, a number of Layer 3 protocols are supported in JUNOS routing platforms that are not supported in the EX JUNOS builds. Some of the more significant Layer 3 features not supported include: • IPv6 multicast • IP Security (IPSec) • Multiprotocol Label Switching (MPLS) in all forms, including Label Distribution Protocol (LDP) and Resource Reservation Protocol (RSVP), TE, and by extension, Virtual Private LAN Service (VPLS), Layer 2/Layer 3 virtual private network (VPNs), and Layer 2 circuits • Generic Routing Encapsulation (GRE) tunneling • Logical routers • Traffic sampling The complete list of unsupported Layer 3 functionality for the 9.3 EX JUNOS release is available at http://www.juniper.net/techpubs/en_US/junos9.3/topics/reference/general/ ex-series-l3-protocols-not-supported.html. Given the relatively recent release of the EX platform, and its switching rather than routing focus, the lack of complete Layer 3 parity with routing flavors of JUNOS is understandable. Additional Layer 3 capabilities are likely to be added as the product matures; as always, you should check Juniper’s website at http://www.juniper.net/products_and_services/switching.html to confirm the latest feature and protocol support.
388 | Chapter 7: Routing on the EX Download at Boykma.Com
Layer 3 scaling limits Everything has a limit, and there is no exception to this universal rule afforded to the EX Series. Generally speaking, the EX is designed to excel at Layer 2 filtering and forwarding, and as a result, some compromises have been made with respect to EX Layer 3 scaling, at least when compared to Juniper’s purpose-built routing platforms. Then again, as most JUNOS routing platforms do not offer any bridging (the MX is the exception), the Layer 3 scaling limits for the EX are both understandable and respectable. Table 7-3 summarizes Layer 3 scaling guidelines for EX switches. Table 7-3. EX Layer 3 scaling Feature
EX3200/4200
EX8200
Comment
IPv4 unicast routes
16K
512K
FT entries for IPv4, RT is limited by RAM
IPv4 multicast routes
2K
256K
FT entries for IPv4, RT is limited by RAM
IPv6 unicast routes
4K
128K
FT entries for IPv6, RT is limited by RAM
IPv6 multicast routes
512
64K
FT entries for IPv6, RT is limited by RAM
Multicast groups
2K
4K
Active multicast group addresses
BGP peers
128
128
BGP peering limited by memory and number of routes per peer
Address Resolution Protocol (ARP) entries
20K
64K
ARP table holds Layer 3 to Layer 2 address bindings
JUNOS Routing Concepts This section details generic JUNOS routing concepts that you must understand before delving into any specific routing protocol examples. Many of these concepts exist in other routing products, usually with a different name to keep the innocent guessing.
Global route preference A router always seeks to forward a packet based on the longest match, and the longest match always wins, regardless of how the longest matching route was learned. It’s possible to learn routes of the same specificity from multiple sources. To break ties, each source is assigned a global preference. It can be said that the global preference determines the “goodness” of a routing source. Therefore, routes learned through local administrative action—for example, static routes—are more believable than the same routes learned through a routing protocol such as OSPF. In Cisco IOS, this concept is called administrative distance. Table 7-4 shows the default protocol preferences for JUNOS software.
EX Routing Overview | 389 Download at Boykma.Com
Table 7-4. Global protocol preference values Source
Purpose
Default preference
Local
Local IP address of the interface
0
Directly connected network
Subnet corresponding to the directly connected interface
0
Static
Static routes
5
RSVP
Routes learned from the Resource Reservation Protocol used in MPLS
7
LDP
Routes learned from the Label Distribution Protocol used in MPLS
9
OSPF internal route
OSPF internal routes, such as interfaces that are running OSPF
10
IS-IS Level 1 internal route
IS-IS Level 1 internal routes, such as interfaces that are running IS-IS
15
IS-IS Level 2 internal route
IS-IS Level 2 internal routes such as interfaces that are running IS-IS
18
Redirects
Routes from Internet Control Message Protocol (ICMP) redirect
30
Kernel
Routes learned via route socket from kernel
40
Simple Network Management Protocol (SNMP)
Routes installed by Network Management System
50
Router discovery
Routes installed by ICMP router discovery
55
RIP
Routes from Routing Information Protocol (IPv4)
100
RIPng
Routes from Routing Information Protocol (IPv6)
100
PIM
Routes from Protocol Independent Multicast
105
DVMRP
Routes from Distance Vector Multicast Routing Protocol
110
Aggregate
Aggregate and generated routes
130
OSPF AS external routes
Routes from Open Shortest Path First that have been redistributed into OSPF
150
IS-IS Level 1 external route
Routes from IS-IS Level 1 that have been redistributed into IS-IS
160
IS-IS Level 2 external route
Routes from IS-IS Level 1 that have been redistributed into IS-IS
165
BGP
Routes from Border Gateway Protocol
170
As with a route metric, numerically lower preference values are preferred. You can alter the default preference values through configuration. Altering global route preference should be considered only after careful thought and, better yet, testing—there can be unpredictable side effects.
Routing tables and RIB groups JUNOS automatically creates a number of RTs that are used for a variety of purposes. In advanced routing scenarios, users can create their own RTs, either indirectly through the use of virtual routers or Layer 2/Layer 3 VPNs, or directly through the use of Routing Information Base (RIB) groups. Generally speaking, each RT/RIB populates a designated portion of the FT. This creates a single FT that’s partitioned based on each specific RT context. Packets are forwarded 390 | Chapter 7: Routing on the EX Download at Boykma.Com
based on this RT context. The ability to maintain separate RTs and FTs is a key component of any VPN type of service. You can view the contents of a particular RT using the command show route table