Repository navigation
Support for LDP (IPv4) - #497
Open
rudranil-das wants to merge 4 commits into
Open
rudranil-das wants to merge 4 commits into
rudranil-das wants to merge 4 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Feature Overview
Brief Description:
Adds LDP (Label Distribution Protocol, RFC 5036) emulation for IPv4. A new
ldpproperty onDeviceconfigures one emulated Label Switching Router (LSR) per device. It runs Basic (link) discovery on IPv4 interfaces (RFC 5036 Section 2.4.1) and Extended (targeted) discovery to configured peers (RFC 5036 Section 2.4.2), sourced from an IPv4 interface or an IPv4 loopback. The router carries the session parameters: LSR ID and label space ID (the LDP Identifier), label advertisement mode (Downstream Unsolicited or Downstream on Demand) and keepalive timers. It also supports TCP MD5 authentication (RFC 2385) per interface / targeted peer and graceful restart (FT Session TLV, RFC 3478). The LSR advertises ranges of IPv4 Prefix FECs, each bound to an incrementing or fixed label; a fixed 3 (Implicit NULL) or 0 (Explicit NULL) emulates an egress LSR. The PR also adds:Flow.Routertx_names / rx_names).State.Protocol.Route).State.Protocol.Ldp) and initiate graceful restart (Action.Protocol.Ldp).Out of scope for this PR (separate features, and the naming leaves room for them): LDPv6 / dual-stack, mLDP, pseudowires / VPLS (FEC 128 / 129), per-session state, and the OTF update API.
Feature Details
Redocly docs for this feature/branch
https://redocly.github.io/redoc/?url=https://raw.githubusercontent.com/open-traffic-generator/models/ldp-model/artifacts/openapi.yaml&nocors#tag/Configuration/operation/set_config
New Locations/Nomenclature:
Configuration
Device.ldp(Device.LdpRouter) in device/device.yaml, defined in device/ldp/ldp.yaml. It containslsr_id(required),label_space_id,label_advertisement_mode,keepalive_hold_time,keepalive_interval,graceful_restart(Ldp.GracefulRestart; GR is on when present), and the arraysipv4_interfaces,ipv4_targeted_peersandipv4_fec_ranges.Ldp.Ipv4Interface(device/ldp/ipv4interface.yaml): link discovery on aDevice.Ipv4, withhello_interval,hello_hold_timeand optionalauthentication.Ldp.Ipv4TargetedPeer(device/ldp/ipv4targetedpeer.yaml): targeted discovery from aDevice.Ipv4orDevice.Ipv4Loopbacktoremote_address, with its own Hello timers and optionalauthentication.Ldp.Authentication(device/ldp/authentication.yaml): TCP MD5 key. Authentication is on when the object is present.Ldp.Ipv4FecRange,Ldp.FecLabel,Ldp.FecLabel.Increment(device/ldp/ipv4fecrange.yaml): prefixes reuseV4RouteAddress.labelisincrement(start + n for the n-th prefix, default start 16) orfixed(default 3, Implicit NULL).Ldp.Ipv4FecRangenames added to theFlow.Routertx_names / rx_names constraints in flow/endpoint.yaml.Control
State.Protocol.ldp(State.Protocol.Ldp->routers:router_names,stateup | down) in control/state.yaml and control/protocol.yaml.Ldp.Ipv4FecRangenames added to theState.Protocol.Routeconstraint (withdraw | advertise) in control/protocol.yaml.Action.Protocol.ldp(Action.Protocol.Ldp->initiate_graceful_restart:router_names,restart_delay) in control/action.yaml, defined in the new control/ldp.yaml.Monitor
Get Metrics:
Metrics.Request.ldp(Ldp.Metrics.Request) andMetrics.Response.ldp_metrics(Ldp.Metric) in result/metrics.yaml, defined in result/ldp.yaml. The columns are:sessions_upandsessions_flap.sessions_non_existent,sessions_initialized,sessions_open_received,sessions_open_sent,sessions_operational.ingress_lsps_upandegress_lsps_up.Every value is
uint64.Get States:
States.Request.ldp_bindings(LdpBindings.State.Request) andStates.Response.ldp_bindings(LdpBindings.State->ipv4_bindings[]:LdpIpv4Binding.Statewithprefix,prefix_length,label,peer_lsr_id,peer_label_space_id) in result/states.yaml, defined in result/ldpbindings.yaml.Dev-Snappi branch reference
https://github.com/open-traffic-generator/snappi/tree/dev_ldpv4
Example command to fetch the dev-snappi branch:
go get github.com/open-traffic-generator/snappi/gosnappi@dev_ldpv4
Code snippets
Please provide a concise, well-commented code snippet demonstrating how to use the new feature in snappi/gosnappi:
Test Specification (Optional)
Example test scenario:
ldp-key-1and graceful restart helper enabled. Device d1 (behind p1) is a plain IPv4 traffic source.sessions_upis 1 on d2.ldp. The link and targeted adjacencies lead to the same DUT LSR, so they share one session.ldp_bindingson d2.ldp shows the bindings received from the DUT (for example Implicit NULL for 1.1.1.1/32).label_withdraws_sentincreases and f1 is forwarded unlabelled). Advertise it again and verify the labels return.