Skip to content

Commit

Permalink
Add SRGW GTP4 addr for downlink
Browse files Browse the repository at this point in the history
  • Loading branch information
louisroyer committed Jan 17, 2025
1 parent 74ff307 commit 0f9dec3
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
2 changes: 2 additions & 0 deletions config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ uplink:
downlink:
- control-uri: "http://[fd00:0:0:0:2:8000:0:4]:8080"
enabled: true
srgw_gtp4: "10.3.0.1"
segments-list:
- "fc00:1:1::/48"
- control-uri: "http://[fd00:0:0:0:2:8000:0:5]:8080"
enabled: true
srgw_gtp4: "10.3.0.1"
segments-list:
- "fc00:1:1::/48"
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/gin-gonic/gin v1.10.0
github.com/gofrs/uuid v4.4.0+incompatible
github.com/nextmn/go-pfcp-networking v0.0.42
github.com/nextmn/json-api v0.0.16
github.com/nextmn/json-api v0.0.17-0.20250117120523-f0c7cb4f9792
github.com/nextmn/logrus-formatter v0.0.1
github.com/nextmn/rfc9433 v0.0.2
github.com/sirupsen/logrus v1.9.3
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ github.com/nextmn/go-pfcp-networking v0.0.42 h1:kYcGyIUMe/RVt3DpvDOKJt4+UbScIewD
github.com/nextmn/go-pfcp-networking v0.0.42/go.mod h1:KYoKLiltDmHL2YMU5mz2k/E1xMoz4TpmzTz6Nr5u5gA=
github.com/nextmn/json-api v0.0.16 h1:RU5eTVvnwrYK0Zmh/EhdO7Q3A+hUWjavg9ytJknaYTU=
github.com/nextmn/json-api v0.0.16/go.mod h1:CQXeNPj9MDGsEExtnqJFIGjLgZAKsmOoO2fy+mep7Ak=
github.com/nextmn/json-api v0.0.17-0.20250117102021-8f2d7604eabc h1:WZg8N41u0VIeII/AS5U7aVjPCuGP+c3PdAd782xGxtI=
github.com/nextmn/json-api v0.0.17-0.20250117102021-8f2d7604eabc/go.mod h1:CQXeNPj9MDGsEExtnqJFIGjLgZAKsmOoO2fy+mep7Ak=
github.com/nextmn/json-api v0.0.17-0.20250117120523-f0c7cb4f9792 h1:eeigbuE6dbRFWl76iOvP+FgvLtkfgL7d0dRnGDgCJ5w=
github.com/nextmn/json-api v0.0.17-0.20250117120523-f0c7cb4f9792/go.mod h1:CQXeNPj9MDGsEExtnqJFIGjLgZAKsmOoO2fy+mep7Ak=
github.com/nextmn/logrus-formatter v0.0.1 h1:Bsf78jjiEESc+rV8xE6IyKj4frDPGMwXFNrLQzm6A1E=
github.com/nextmn/logrus-formatter v0.0.1/go.mod h1:vdSZ+sIcSna8vjbXkSFxsnsKHqRwaUEed4JCPcXoGyM=
github.com/nextmn/rfc9433 v0.0.2 h1:6FjMY+Qy8MNXQ0PPxezUsyXDxJiCbTp5j3OcXQgIQh8=
Expand Down
5 changes: 3 additions & 2 deletions internal/app/rules-pusher.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func (pusher *RulesPusher) pushRTRRule(ctx context.Context, ue_ip string) error
return nil // already pushed, nothing to do
}
infos.Pushed = true
service_ip := "10.4.0.1"
service_ip := "10.4.0.1" // FIXME: don't hardcode
logrus.WithFields(logrus.Fields{
"ue-ip": ue_ip,
"gnb-ip": infos.Gnb,
Expand Down Expand Up @@ -234,7 +234,8 @@ func (pusher *RulesPusher) pushRTRRule(ctx context.Context, ue_ip string) error
return err
}
action := n4tosrv6.Action{
SRH: *srh,
SRH: *srh,
SourceGtp4: r.SrgwGtp4,
}
rule := n4tosrv6.Rule{
Enabled: true,
Expand Down
3 changes: 2 additions & 1 deletion internal/config/rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ type Rule struct {
ControlURI jsonapi.ControlURI `yaml:"control-uri"` // e.g. http://srgw.local:8080
Area *[]netip.Prefix `yaml:"area,omitempty"` // list of gnbs in this area (can be aggregated in prefixes)
Enabled bool `yaml:"enabled"`
SegmentsList []string `yaml:"segments-list"` // Segment[0] is the ultimate node, Segment[n-1] is the next hop ; Segment[0] can be a prefix (for downlink)
SegmentsList []string `yaml:"segments-list"` // Segment[0] is the ultimate node, Segment[n-1] is the next hop ; Segment[0] can be a prefix (for downlink)
SrgwGtp4 *netip.Addr `yaml:"srgw-gtp4,omitempty"` // GTP4 Address of the SRGW (for downlink rules only)
}

0 comments on commit 0f9dec3

Please sign in to comment.