Skip to content

Commit

Permalink
Merge pull request #85 from cne/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
oscargdd committed Feb 25, 2016
2 parents 4165550 + 2535fc5 commit 3e4fa82
Show file tree
Hide file tree
Showing 102 changed files with 3,798 additions and 1,387 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
v1.2.1
- Make JUnit tests compatible with java 1.7
- JUnit tests for PCEP Constructs
- Added coding of REQ_ADAP_CAP from draft-ietf-pce-gmpls-pcep-extensions-11
- Deleted old SRERO objects (no longer used)
- Added encoding of REQ_MISSING_TLV
- BGP-LS Path Attribute: Next Hop Address IPv4 encoding added
- Update to https://tools.ietf.org/html/draft-ietf-pce-segment-routing-06
- Bugfixes
v1.2
- Added JUnit tests for PCEP (still to be fully completed)
- Bugfixes
Expand Down
43 changes: 26 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,37 @@
netphony-network-protocols v1.2
netphony-network-protocols v1.2.1
=================================
The netphony-network-protocols library is a set of implementations of the main networking protocols stacks that enable control and management functions:
* PCEP protocol
* RVP-TE protocol
* OSPF-TE protocol
* BGP-LS protocol
The netphony-network-protocols library is an implementation of four networking protocols:
* **PCEP protocol**: Path Computation Element Protocol (PCEP) (RFC 5440).
* **RSVP-TE protocol**: Resource reservation protocol (RSVP) with Traffic Engineering extensions.
* **OSPF-TE protocol**: OSPF Version 2 protocol with Traffic Engineering extensions.
* **BGP-LS protocol**: North-Bound Distribution of Link-State and Traffic Engineering Information using BGP https://datatracker.ietf.org/doc/draft-ietf-idr-ls-distribution.

Any software requiring the connection with a device/software that supports such protocols can easily integrate the protocol library. The library provides the encoding and decoding from java objects to bit-level. Note that, the state machine and set up of sessions is provided by other components, also available in github.
The protocol library can be easily integrated in any software that needs to interact with other software/devices using these protoocols. The library provides the encoding and decoding from java objects to bit-level. Note that, the state machine and set up of sessions is provided by other components, also available in github.

The library is maintained to be up-to-date to the latest version of the internet-drafts/RFCs. Contributions are highly welcomed.
The PCEP implemnentation has been tested against other PCEP implementations (Telecom Italia Implementation, CTTC Implementation and CNIT Implementation) .

The Netphony BGP-LS implementation is known to interoperate with Telecom Italia Implementation, CTTC Implementation and CNIT Implementation. It is listed in the IETF BGP-LS implemenation report https://tools.ietf.org/html/draft-ietf-idr-ls-distribution-impl-04

The library is maintained to be up-to-date to the latest version of the internet-drafts/RFCs. **Contributions are highly welcomed.**

## Compilation and use

The library can be built using the maven tool. There is a set of junit tests included that tests the enconding/decoding process. Contributions on expanding the test suite are welcomed.
To build the .jar file and run the tests, simply clone the repository, go to the main directory and run
The library can be built using the maven tool. There is a set of Junit tests included that check the enconding/decoding process . Contributions on expanding the test suite are welcomed.
To build the .jar file and run the tests, clone the repository, go to the main directory and run:
```bash
cd netphony-network-protocols
mvn package
```

To use the library in your application, simply add the dependency in your pom.xml file:
To use the library in your application, add the dependency in your pom.xml file:
```xml
<dependency>
<groupId>es.tid.netphony</groupId>
<artifactId>network-protocols</artifactId>
<version>1.2</version>
<version>1.2.1</version>
</dependency>
```
Authors keep also a copy of the artifact in maven central to facilitate the deployment.
Authors keep also a copy of the artifact in maven central to facilitate the deployment. (*) In process

## How to use the code:

Expand Down Expand Up @@ -66,9 +70,11 @@ To build the .jar file and run the tests, simply clone the repository, go to the
out.write(message.getBytes());
out.flush();
```
## PCEP Support
## PCEP Protocol and Support

The Path Computation Element Protocol (PCEP) is used for communications between a PCC and a PCE, or between two PCEs, in compliance with RFC4657. Such interactions include path computation requests, path computation replies as well as notifications of specific states related to the use of a PCE in the context of MPLS and GMPLS Traffic Engineering. Recent extensions. A good source of PCE material can be found in http://ict-one.eu/pace/public_wiki/mediawiki-1.19.7/index.php?title=Tools

Detailed PCEP Support [click here](doc/PCEP_Support.md)
The detail of the messages, objects and TLVs can be found in [click here](doc/PCEP_Support.md)

* RFC 5440: Full compliance
* RFC 5521: Path-key not supported
Expand All @@ -86,7 +92,7 @@ Detailed PCEP Support [click here](doc/PCEP_Support.md)
Detailed RSVP-TE Support [click here](doc/RSVP-TE_Support.md)


## OSPF-TE Support
## OSPF-TE

Detailed OSPF-TE Support [click here](doc/OSPF-TE_Support.md)

Expand All @@ -95,8 +101,11 @@ Inter-AS-TE-v2 LSA from RFC5392 http://tools.ietf.org/html/rfc5392

# BGP-LS Support

Detailed BGP4 & BGP-LS Support [click here](doc/BGP-LS_Support.md)
It is used to exchange TE information between BGP-LS speakers.

Detailed BGP4 & BGP-LS Support [click here](doc/BGP-LS_Support.md)

http://tools.ietf.org/html/draft-ietf-idr-ls-distribution-03

(*) The BGLP-LS Speaker is available in https://github.com/telefonicaid/netphony-topology

2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.2
v1.2.1
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>es.tid.netphony</groupId>
<artifactId>network-protocols</artifactId>
<version>1.2</version>
<version>1.2.1</version>
<packaging>jar</packaging>
<name>Netphony Network Protocols</name>
<description>BGP-LS,OSPF-TE,PCEP and RSVP-TE protocol encodings.</description>
Expand Down Expand Up @@ -31,7 +31,7 @@
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<version>3.5.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
Expand Down
32 changes: 30 additions & 2 deletions src/main/java/es/tid/bgp/bgp4/objects/BGP4Object.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package es.tid.bgp.bgp4.objects;

import java.util.Arrays;

import es.tid.bgp.bgp4.BGP4Element;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -15,13 +18,38 @@ public abstract class BGP4Object implements BGP4Element {
public byte[] getBytes() {
return bytes;
}
public void setBytes(byte[] bytes) {
protected void setBytes(byte[] bytes) {
this.bytes = bytes;
}
public int getLength() {
return length;
}
public void setLength(int length) {
protected void setLength(int length) {
this.length = length;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + Arrays.hashCode(bytes);
result = prime * result + length;
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
BGP4Object other = (BGP4Object) obj;
if (!Arrays.equals(bytes, other.bytes))
return false;
if (length != other.length)
return false;
return true;
}


}
33 changes: 31 additions & 2 deletions src/main/java/es/tid/bgp/bgp4/update/fields/LinkStateNLRI.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public int getNLRIType() {
}


public void setNLRIType(int nLRIType) {
protected void setNLRIType(int nLRIType) {
NLRIType = nLRIType;
}

Expand All @@ -91,7 +91,7 @@ public int getTotalNLRILength() {
}


public void setTotalNLRILength(int totalNLRILength) {
protected void setTotalNLRILength(int totalNLRILength) {
TotalNLRILength = totalNLRILength;
}

Expand All @@ -111,4 +111,33 @@ public static int getNLRIType(byte[] bytes, int offset){

public abstract void encode();


@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result + NLRIType;
result = prime * result + TotalNLRILength;
return result;
}


@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
LinkStateNLRI other = (LinkStateNLRI) obj;
if (NLRIType != other.NLRIType)
return false;
if (TotalNLRILength != other.TotalNLRILength)
return false;
return true;
}



}
48 changes: 46 additions & 2 deletions src/main/java/es/tid/bgp/bgp4/update/fields/PathAttribute.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package es.tid.bgp.bgp4.update.fields;

import es.tid.bgp.bgp4.objects.BGP4Object;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -107,7 +108,7 @@ public void encodeHeader(){

}

public void setPathAttributeLength(int pal){
protected void setPathAttributeLength(int pal){
this.pathAttributeLength= pal;
if (pathAttributeLength>255){
this.mandatoryLength=4;
Expand Down Expand Up @@ -165,11 +166,53 @@ public int getTypeCode() {
}


public void setTypeCode(int typeCode) {
protected void setTypeCode(int typeCode) {
this.typeCode = typeCode;
}


@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result + (extendedLengthBit ? 1231 : 1237);
result = prime * result + mandatoryLength;
result = prime * result + (optionalBit ? 1231 : 1237);
result = prime * result + (partialBit ? 1231 : 1237);
result = prime * result + pathAttributeLength;
result = prime * result + (transitiveBit ? 1231 : 1237);
result = prime * result + typeCode;
return result;
}


@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
PathAttribute other = (PathAttribute) obj;
if (extendedLengthBit != other.extendedLengthBit)
return false;
if (mandatoryLength != other.mandatoryLength)
return false;
if (optionalBit != other.optionalBit)
return false;
if (partialBit != other.partialBit)
return false;
if (pathAttributeLength != other.pathAttributeLength)
return false;
if (transitiveBit != other.transitiveBit)
return false;
if (typeCode != other.typeCode)
return false;
return true;
}



// public String toString() {
// return "[typeCode=" + typeCode + ", optionalBit="
Expand All @@ -179,6 +222,7 @@ public void setTypeCode(int typeCode) {
// }





}
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,34 @@ public String toString(){

return text;
}

@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result + ((lsNLRI == null) ? 0 : lsNLRI.hashCode());
return result;
}

@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
BGP_LS_MP_Reach_Attribute other = (BGP_LS_MP_Reach_Attribute) obj;
if (lsNLRI == null) {
if (other.lsNLRI != null)
return false;
} else if (!lsNLRI.equals(other.lsNLRI))
return false;
return true;
}





}
Loading

0 comments on commit 3e4fa82

Please sign in to comment.