summaryrefslogtreecommitdiffhomepage
path: root/packet/bgp
AgeCommit message (Collapse)Author
2017-11-24packet/bgp: Sort FlowSpec rules when decoding/creatingIWASE Yusuke
Currently, we sort the FlowSpec rules when creating a new path containing the FlowSpec NLRI and when parsing CLI arguments for the FlowSpec rules. This patch moves sorting the rules into the inside of the "packet" module and sorts them when decoding binary and creating new NLRI. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-11-23table: fix merging of v4 paths with addpath enabledFUJITA Tomonori
V4 NLRI needs more 4 bytes with addpath enabled. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-11-21packet/bgp: Support EVPN Router's MAC Extended CommunityIWASE Yusuke
This patch supports EVPN Router's MAC Extended Community which described on "draft-ietf-bess-evpn-inter-subnet-forwarding". According to "draft-ietf-bess-evpn-prefix-advertisement" This extended community might be carried with EVPN IP Prefix Route NLRI. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-11-21packet/bgp: Zeros if GW in EVPN Prefix route omittedIWASE Yusuke
According to "draft-ietf-bess-evpn-prefix-advertisement-08", the GW IP field SHOULD be zero if it is not used, but currently, GoBGP skips encoding the GW IP field (not composed). This patch fixes to fill zeros to solve this problem. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-11-21packet/bgp: Check range of EVPN related Label fieldIWASE Yusuke
This patch enables to check the value range of Label included in EVPN routes or PMSI Tunnel attribute when decoding and serialising it. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-11-21packet/bgp: Use ESI str in EVPN Ethernet Segment RouteIWASE Yusuke
This patch fixes to use the string representation of ESI in the string representation of EVPN Ethernet Segment Route. Currently, displayed in the default representation of ESI structure. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-11-21packet/bgp: Avoid raw binary in EVPN ESI stringIWASE Yusuke
Currently, the value field of EVPN ESI might be corrupted when ESI type is ARBITRARY (not "single-homed") or unknown type because the value field will be formatted as the raw byte slice in this case. This patch fixes to convert the byte slice into the colon separated hex values which is corresponding to the format of the CLI input. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-11-21packet/bgp: Use decimal AS number in EVPN ESIIWASE Yusuke
Currently, the representation of AS number in EVPN ESI Type AS (Type 5) uses the colon separated 2 octet values format, but in other places, the AS4_PATH attribute for example, the single decimal format is used. This patch fixes to use the decimal AS number for the consistency with the AS_PATH/AS4_PATH attributes and also the CLI input format. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-11-21packet/bgp: EVPN ESI parser from string sliceIWASE Yusuke
This patch introduces a new function to parse EVPN ESI from string slice which passed via CLI for example. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-11-20packet/bgp: Rename snake case to camel caseIWASE Yusuke
This patch renames some variable names in snake case (e.g., "last_byte_value") to that in the camel case (e.g., "lastByte") because Go prefers the camel case for variable names. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-11-19packet/bgp: fix flowspec parser about cmd badly argsnnao45
2017-11-07packet/bgp: Add Validation for BGP ConfederationsSatoshi Fujimoto
RFC 5065 says that: "It is a error for a BGP speaker to receive an update message from a confederation peer that is not in the same Member-AS that does not have AS_CONFED_SEQUENCE as the first segment." Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2017-11-07*: Fix problems pointed by 'go vet'Satoshi Fujimoto
In the near feature (likely in Go1.10), 'go test' will never work if 'go vet' fails. (See: https://github.com/golang/go/issues/18084) This commit is for dealing with such a situation (and also for improving the quality of our code). Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2017-11-06packet/bgp: Avoid Varied Flag Representations in Flowspec FilterSatoshi Fujimoto
Currently, the parsing results of flags in flowsspec filter will be varied every time they are parsed. For example, the tcp-flag '=UFP' may be represented to '=UPF' or '=PUF' and so on. This is due to the use of interation to map. Iterations over maps does not happen in a consistent order. This fixes it by iterating sorted slices instead of maps. Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2017-11-03packet/bgp: Remove non route key fields from stringIWASE Yusuke
RFC7432 and draft-ietf-bess-evpn-prefix-advertisement says some fields in EVPN NLRIs (e.g., MPLS Label(s)) should no be treated as the route key, but currently, GoBGP's string representations of EVPN NLRIs include all fields. So the paths should be treated as the same (e.g., only different in MPLS Label and other field is the same) can be treated as the different. This patch removes non route key fields from NLRI string representation and fixes this problem. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-11-01Fix some typos found by spell checkerIWASE Yusuke
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-09-29packet/bgp: Add Unit Tests for Revised Error HandlingSatoshi Fujimoto
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2017-09-29server: Revised Error Handling (RFC7606)Satoshi Fujimoto
This patch enables GoBGP to keep the session established even if the received BGPUpdate message contains some errors, and to handle these errors according to what defined in RFC7606. This feature is enabled when 'treat-as-withdraw' in 'neighbors.error-handling.config' is specified to true in the GoBGP config file. Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2017-09-29packet/bgp: Return ErrorHandling in decoding/validating BGPUpdateSatoshi Fujimoto
For Revised Error Handling(RFC7606), this patch modifies the BGPUpdate message decoder/validator to return ErrorHandling according to what was detected as an error. In addition, this patch adds some validation defined in RFC7606. Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2017-09-29server/bgp: Extend MessageError for Revised Error HandlingSatoshi Fujimoto
This patch extends MessageError to contain error handling level and error path attribute. These informations are needed to Revised Error Handling (RFC7606). Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2017-09-29bgp/validate: Check Wellknown Attributes exist with MultiProtocolSatoshi Fujimoto
RFC4760 says "An UPDATE message that carries the MP_REACH_NLRI MUST also carry the ORIGIN and the AS_PATH attributes". This patch adds a validation to comply with it. Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2017-07-26add LocalPathIdentifierFUJITA Tomonori
add-path support needs two identifiers, remote (rx) and local (tx). The remote identifiers are assigined by remote peers, the local ones are assigned by gobgpd itself. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-07-10packet: Use bitmask operand format to fragmentSatoshi Fujimoto
RFC 5575 suggests using "bitmask operand format" for fragmentation field, but GoBGP does not have an interface to configure it. This patch introduce the way to configure bitmask operands for "fragment" field. The syntax is similar to TCP flags rules. For example: =not-a-fragment =is-fragment&!last-fragment Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2017-07-10const: Rename TcpFlagOp to BitmaskFlagOpSatoshi Fujimoto
This flag format is not only used for "tcp-flag" field, but also "fragment" field. To express the above, this patch renames the format. Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2017-07-10flowspec: Set AND to correct operand for TCP FlagsSatoshi Fujimoto
Currently, if TCP Flags field is specified from CLI command, GoBGP sets 'AND' bit to the invalid operand. RFC 5575 says it represents the previous term is logically ANDed or not, and "It should be unset in the first operator byte of a sequence". This patch fixes this to comply with RFC5575. Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2017-07-04support addpath recvISHIDA Wataru
2017-07-04packet: support addpath decoding/encodingISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2017-07-04packet: add marshalling option infraISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2017-06-23packet: fix addpath capability parser/serializerFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-06-01Fix RouteDistinguisher parsing and VPNV6 VRF rib parsingLamanna
2017-05-23flowspec: handling of >2 logical elements and fixed testDenis Shevchenko
2017-05-23flowspec: formatting of flowspec ranges in nice orderDenis Shevchenko
2017-05-23flowspec: correct handling of | bit case in opflagsDenis Shevchenko
2017-05-23flowspec: correct place for & bit in opflagsDenis Shevchenko
2017-05-23cli: Add User Interface for Redirect-IPv6 actionSatoshi Fujimoto
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2017-05-23packet/bgp: Redirect-IPv6 Flow Spec Traffic Filtering ActionSatoshi Fujimoto
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2017-05-23packet/bgp: IPv6 Address Specific Extended CommunitySatoshi Fujimoto
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2017-04-12don't To4() nexthop address when AFI is not IPv4ISHIDA Wataru
support for IPv6 NLRI with IPv4 nexthop Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2017-04-04skip asn negotiation for BGP unnumbered peersISHIDA Wataru
since BGP unnumbered peers are typically trusted, skip asn negotiation for easy configuration. from configuration file: ```toml [[neighbors]] [[neighbors.config]] neighbor-interface = "eth0" ``` from cli: ``` $ gobgp neighbor add interface eth0 ``` Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2017-04-04packet/bgp: add extended-nexthop capabilityISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2017-04-04packet/bgp: fix mp-reach-nlri attribute decoder/encoderISHIDA Wataru
Current mp-reach-nlri attribute decoder/encoder assumes NLRI's address family and that of nexthop is the same. However, when extended nexthop capability(RFC5549) is negotiated, this is not the case. This commit removes the assumption. Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2017-03-02flowspec: comply with new draft RFC5575bis normalized operatorsMatthieu Texier
2017-02-17flowspec: comply with RFC 5575 about TCP flags rulesMatthieu Texier
This patch proposes a new way to configure BGP flowspec TCP flags rules It allows to comply with RFC 5575 by defining flags like this =SA =A / '!SA' / '=SA&=!U' = means match, ! means not, & means and, all TCP flags are identified by their first charater S for SYN A for Ack ...
2017-02-14Adding support for port number 0 and above instead of only above 0Emil Palm
2017-02-03cli: Communication on Administrative Shutdown NOTIFICATIONIWASE Yusuke
This patch enable to send an arbitrary message on the Cease NOTIFICATION message with "Administrative Shutdown" and "Administrative Reset" subcodes with "--reason" option. Usage: $ gobgp neighbor <neighbor address> shutdown --reason "some messages" $ gobgp neighbor <neighbor address> reset --reason "some messages" Reference: https://tools.ietf.org/html/draft-ietf-idr-shutdown-04 Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-01-29Fix End of RIB handlingEiichiro Watanabe
- All of EoR except IPv4 unicast have MP_UNREACH only. (RFC4724) - length of the MP_UNREACH attr. should be 3bytes. - length of the value should be 0bytes. - Should send EoR marker in initial exchange of BMP Route Monitoring. (RFC7854)
2017-01-16packet/bgp/bgp_test: UT for PathAttributeMpReachNLRIIWASE Yusuke
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-01-16packet/bgp/bgp_test: UT for IPv6 MpReachNLRI with IPv4 peeringIWASE Yusuke
This patch adds a test case for PathAttributeMpReachNLRI with IPv6 prefix and IPv4 peering (IPv4 nexthop address). Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-01-16packet/bgp: Confirm IPv4/v6 conversion when AFI_IP6IWASE Yusuke
Currently, GoBGP will miss-convert IPv4 nexthop address to IPv6 address when advertising AFI_IP6 routes with IPv4 peering. For example, if the local address of GoBGP is "172.20.0.1", the advertised nexthop will be miss-converted into "AC14:1::". In this case, the nexthop address should be "::ffff:172.20.0.1". This patch fixes this problem. According to this change, this patch also fixes "nexthoplen" calculation to parse and serialize NextHop field, otherwise it will cause "mpreach nexthop length is incorrect" at GoBGP or "Invalid NextHop length" at BGP peers. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-01-16packet/bgp: Remove redundant type declaration "AsPathParamFormat"IWASE Yusuke
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>