Juniper MX接口栈介绍
接口栈接口栈 SUMMER 理解接口栈的概念,了解接口如何创建,接口之间如何嫁 接等等,这对理解MX作为BRAS如何部署业务,如何管理 接入用户起着至关重要的作用。本文从三个方面加以阐述: 接口的类别、属性 各种典型业务情况下接口栈如何嫁接 各种典型配置和验证。 备注:为简化,本文只是为了讲述接口栈,没有涉及到接口上复杂的特性,比 如接口上的filter, QOS等等。 3 Copyright 2012 Juniper Networks, Inc. IFX IFD - The Interface Device contains the physical interface config. IFL - The Logical Interfaces. It contains the L2 protocol config and is the interfaces for forwarding and routing IFF - The Interface Family is used to configure Layer3 protocol configuration. IFA - The Interface Address is used to configure Layer3 addresses on families. 4 Copyright 2012 Juniper Networks, Inc. INTERFACE HIERARCHY (IFD) ifdev (aka IFD) One for each piece of network hardware in the system (almost) Not all IFDs have an associated physical hardware (e.g. lo0, ae0, dsc, gre, ipip, .local. Etc.) Holds most procedure handles for the device driver and device specific information Added as part of device discovery Autoconfig time for RE devices Chassisd added for PFE devices Layer 1 data structure 5 Copyright 2012 Juniper Networks, Inc. INTERFACE HIERARCHY (IFD) How do we identify IFDs in the system? By name (ge-x/y/z) x FPC slot y PIC slot z Port on the PIC The kernel maintains a patricia tree based on the IFD name By ifd index Assigned by the kernel when an IFD is created By snmp Id 6 Copyright 2012 Juniper Networks, Inc. INTERFACE HIERARCHY (IFD) Procedure handles for device driver ifd_devoutput Routine to send packet out of this interface ifd_iflinput Routine to receive packets from this interface ifd_ifdconfig Routine to configure this interface ifd_ifdstat Stats collection routine ifd_iflconfig ADD/DEL/CHG IFLs (e.g. ether_ifconfig) ifd_pfe_iflconfig PFE specific work (e.g. stats memory allocation, etc.) ifd_iffconfig Routine to add an IFF on this IFD 7 Copyright 2012 Juniper Networks, Inc. INTERFACE HIERARCHY (IFL) iflogical (aka IFL) One or more IFLs could be associated with an IFD via configuration Layer 2 data structure Incoming and outgoing data on an IFD maps onto one of the IFLs on the IFD based on the flow the data is associated with E.g. VLAN-ID, DLCI, packet IP src (for demux) etc. Added via config (DCD) and created in the kernel using the IFD specific routines (ifd_iflconfig) 8 Copyright 2012 Juniper Networks, Inc. INTERFACE HIERARCHY (IFL) How do we identify IFLs in the system By name and sub-unit e.g ge-1/2/3.0 The kernel maintains a patricia tree of IFLs at the IFD level with the above name as the key By ifl index Assigned by the kernel when an IFL is added By snmp id 9 Copyright 2012 Juniper Networks, Inc. INTERFACE HIERARCHY (IFF) iffamily (aka IFF) This is the protocol family structure One per forwarding protocol enabled on the interface It is the configured addition of a protocol family structure to an interface that enables that protocol on the interface Holds procedure handlers Protocol specific (IFA addition, next-hop addition, etc) Protocol specific and interface dependent (ARP, ND) Added via config (DCD) and created in the kernel using IFD specific routines (ifd_iffconfig) E.g inet, inet6, mpls 10 Copyright 2012 Juniper Networks, Inc. INTERFACE HIERARCHY (IFA) ifaddr (IFA) Interface address structure Zero or more of these are attached to the IFF based on configuration Addition of IFAs will trigger the creation of routes to make the address configuration functional 11 Copyright 2012 Juniper Networks, Inc. INTERFACE HIERARCHY (CONTD) Odd cases Aggregate Ethernets ae0 ifd is pseudo Several physical ges constitute the actual hardware Dependencies need to take care of this PPP and demux ifls Concept of underlying interface that represents the actual interface Dependencies need to take care of this hierarchy 12 Copyright 2012 Juniper Networks, Inc. ifstate historically meant “interface state” One single instance of each object in the state chain Hierarchical dependencies showed by red arrows Consumers only see last state of each object Continuous flapping events are only reflected in the object states unit 1 vlan-id 101; family inet filter input test-filter; fe-0/3/3 vlan-tagging; gratuitous-arp-reply; address 1.1.1.1/24; IFD (Interface Device) IFL (Interface Logical) IFF (Interface Family) IFA (Interface Address) INTERFACE TERMINOLOGY 13 Copyright 2012 Juniper Networks, Inc. ifstate entries generated by custom event sequence Every CLI set command is followed by a configuration commit. IFD addPIC 0/3 boots set interfaces fe-0/3/3 vlan-tagging set interfaces fe-0/3/3 unit 1 vlan-id 101 set interfaces fe-0/3/3 unit 1 family inet set interfaces fe-0/3/3 unit 1 family inet address 1.1.1.1/24 set firewall family inet filter test-filter term single then accept set