envoyproxy / envoy

Cloud-native high-performance edge/middle/service proxy
https://www.envoyproxy.io
Apache License 2.0
24.34k stars 4.7k forks source link

[Feature] SIP protocol support in envoy #16247

Closed durd07 closed 3 years ago

durd07 commented 3 years ago

Title: SIP protocol support in envoy

Description:

Background

SIP protocol is widely used in communications industry like VoLTE or 5G Core. More and more operators are willing to deploy their product on Cloud Native Service Mesh environment. But SIP protocol has many different routing mechanism and other specific features like transaction affinity, registration affinity, weighted load balancer based on resource utilization and so on. It is impossible to just reuse TCP Proxy as the proxy in envoy. A new standalone extension sip-proxy is necessary in order to enable Service Mesh for SIP protocol.

Requirements

A new extension should be added into envoy to support basic SIP features, the detail SIP Call Flow Requirements can be found here: https://docs.google.com/document/d/1viLfnzhLL7MUDvcRaFe6VfRJzHqsWCqnwjNtQ9_WgG8/edit?usp=sharing

Design Ideas

This is the draft configuration for sip extension:

static_resources:
  listeners:
  - name: listener_0
    address:
      socket_address: { address: 11.0.0.1, port_value: 5060 }
    filter_chains:
    - filters:
      - name: envoy.sip_proxy
        typed_config:
           "@type": type.googleapis.com/envoy.extensions.filters.network.sip_proxy.v3.SipProxy
           stat_prefix: egress_sip
           route_config:
             routes:
             - match:
                domain: "sips1.default.svc.nokia.local"
               route:
                cluster: egress_sip1
             - match:
                domain: "sips2.default.svc.nokia.local"
               route:
                cluster: egress_sip2
           settings:
             transaction_timeout: 32s
             session_stickness: false
             tra_service_config:
               grpc_service:
                 envoy_grpc:
                   cluster_name: tra_service
               transport_api_version: V3

  clusters:
  - name: egress_sip1
    type: strict_dns
    connect_timeout: 2s
    lb_policy: ROUND_ROBIN
    dns_refresh_rate: 5s
    load_assignment:
      cluster_name: egress_sip
      endpoints:
      - lb_endpoints:
        - endpoint:
            address:
              socket_address:
                address: 12.0.0.1
                port_value: 5060
                protocol: TCP
          load_balancing_weight: 1
      - lb_endpoints:
        - endpoint:
            address:
              socket_address:
                address: 13.0.0.1
                port_value: 5060
                protocol: TCP
          load_balancing_weight: 99

  - name: egress_sip2
    type: strict_dns
    connect_timeout: 2s
    lb_policy: ROUND_ROBIN
    dns_refresh_rate: 5s
    load_assignment:
      cluster_name: egress_sip
      endpoints:
      - lb_endpoints:
        - endpoint:
            address:
              socket_address:
                address: 13.0.0.1
                port_value: 5060
                protocol: TCP
          load_balancing_weight: 100
  - name: tra_service
    type: strict_dns
    connect_timeout: 2s
    lb_policy: ROUND_ROBIN
    http2_protocol_options: {} # enable H2 protocol
    dns_refresh_rate: 5s
    load_assignment:
      cluster_name: tra_service
      endpoints:
      - lb_endpoints:
        - endpoint:
            address:
              socket_address:
                address: 127.0.0.1
                port_value: 50053
                protocol: TCP
admin:
  access_log_path: /dev/null
  address:
    socket_address: { address: 11.0.0.1, port_value: 9657 }

The major functions are following:

The system architecture is below:

Sip Request image Sip Response image

The basic call flow for sip proxy extension is below:

image image image

durd07 commented 3 years ago

@nearbyfly

nearbyfly commented 3 years ago

SIP is also raw text based protocol and widely used for multiple media communication. It sounds like reasonable proposal.

durd07 commented 3 years ago

https://github.com/envoyproxy/envoy/pull/16416

github-actions[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions.

github-actions[bot] commented 3 years ago

This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted" or "no stalebot". Thank you for your contributions.