Skip to content
Snippets Groups Projects
Commit 77325355 authored by Maximilian Wilhelm's avatar Maximilian Wilhelm
Browse files

Annotate route selection process and add eBGP vs. iBGP tie breaking.

parent 6dc51678
No related branches found
No related tags found
No related merge requests found
......@@ -40,6 +40,11 @@ func (b *BGPPath) Compare(c *BGPPath) int8 {
return -1
}
/*
* 9.1.2.2. Breaking Ties (Phase 2)
*/
// a)
if c.ASPathLen > b.ASPathLen {
return 1
}
......@@ -48,6 +53,7 @@ func (b *BGPPath) Compare(c *BGPPath) int8 {
return -1
}
// b)
if c.Origin > b.Origin {
return 1
}
......@@ -56,6 +62,7 @@ func (b *BGPPath) Compare(c *BGPPath) int8 {
return -1
}
// c)
if c.MED > b.MED {
return 1
}
......@@ -64,6 +71,18 @@ func (b *BGPPath) Compare(c *BGPPath) int8 {
return -1
}
// d)
if c.EBGP && !b.EBGP {
return -1
}
if !c.EBGP && b.EBGP {
return 1
}
// e) TODO: interiour cost (hello IS-IS and OSPF)
// f)
if c.BGPIdentifier < b.BGPIdentifier {
return 1
}
......@@ -72,6 +91,7 @@ func (b *BGPPath) Compare(c *BGPPath) int8 {
return -1
}
// g)
if c.Source < b.Source {
return 1
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment