SlideShare a Scribd company logo
1 of 15
Session Initiation
Protocol(SIP)
Via Header
- Detailed Coverage
Sridhar Kumar N
Takeaways
 Why Via?
 List of Via-Parameters & role
 Magic Cookie
 Role played in Response
 Via vs Other Headers
 Addressing NAT Concerns
 Summary
Why Via ?
 SIP is based on an HTTP-like request/response transaction
model. So Request originator has to receive the response back.
Between request travels one or more proxies and reaches
destination finally, further returned back to originator. During
each proxy travel Via header records the route taken based on
stack methodologies and uses the same route one by one(Last
in First Out) usually called TOP-VIA to reach back to Originator.
i.e Consider Starting journey from home to unknown preferred
destination for Picnic. So During travel, we usually memorize few
Landmarks to reach home Back successfully without wastage of
time.
 The Via header field indicates the transport used for the
transaction and identifies the location where the response is
to be sent. So It contains the transport protocol, the client's
host name or network address, and possible the port number
at which it wishes to receive responses. Default -5060
Example:-
Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bK776asdhds
Mandatory Header vs Methods
Via –Parameters
 A Via header field value can contain parameters such as
 sent-protocol (UDP,TCP,SCTP)
 sent-by
 Branch
 maddr
 ttl
 Rport (RFC3581)
 received
 via-hidden (RFC2543- deprecated/was used for encryption purpose)
Via : Sent-protocol & Sent-by
Sent-Protocol:-
 The protocol name and protocol version in the header field MUST be SIP and
2.0(Latest version), respectively with transport protocol details.
i.e SIP 1.0 (RFC2543) and SIP 2.0 (RFC3261)
Sent-by:-
 IP address or host name, and port. The usage of an FQDN is RECOMMENDED.
 When a response arrives at a stateless proxy, the proxy MUST inspect the sent-by
value in the first (topmost) Via header field value. If that address matches the
proxy, (it equals a value this proxy has inserted into previous requests) the proxy
MUST remove that header field value from the response and forward the result to
the location indicated in the next Via header field value.
Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bK776asdhds
Via:Branch
What is Magic Cookie
 The Via header field value MUST contain a branch parameter. The branch parameter value MUST be
unique. The exceptions to this rule are CANCEL and ACK for non-2xx responses.
 The branch ID inserted by an element compliant with this specification MUST always begin with the
characters "z9hG4bK". These 7 characters are used as a magic cookie (7 is deemed sufficient to
ensure that an older RFC 2543 implementation would not pick such a value), so that servers
receiving the request can determine that the branch ID was constructed in the fashion described by
this specification (that is, globally unique).
 This avoids the complex and bug-laden transaction identification rules from RFC 2543.
 It now plays the role of a unique transaction identifier. This requirement was added to identify
that the branch was created in accordance with RFC 3261 and not the older RFC 2543 which did not
require global uniqueness.
 It’s Case Insensitive
Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bK776asdhds
Via:maddr & ttl
Maddr:-
 The intent is that maddr is really for multicast. This need not be an IP address, since DNS names can refer to multicast addresses
(sip.mcast.net) and not to use SRV processing.
 A client that sends a request to a multicast address MUST add the "maddr" parameter to its Via header field value containing the
destination multicast address, and for IPv4, SHOULD add the "ttl“ parameter with a value of 1. Usage of IPv6 multicast is not defined in
this specification, and will be a subject of future.
 Originally, the maddr in the URI was the same - meant just for multicast. However, in the absence of a suitable loose routing mechanism,
it got continually abused until the common case was for that, and not for multicast at all. Doing that properly required SRV processing.
Now, we have thankfully deprecated the usage of maddr for that purpose, but older rfc2543 elements might construct such URIs, and so
RFC3263 continues to perform the SRV processing for the maddr in the request URI, when present.
Note:-
Service Records(SRV): SIP using NAPTR and SRV DNS Records to locate Server IP details.
ttl:-
 The ttl parameter determines the time-to-live value of the UDP multicast packet and MUST only be used if maddr is a multicast address
and the transport protocol is UDP. For example, to specify a call to alice@atlanta.com using multicast to 239.255.255.1 with a ttl of 15,
the following URI would be used. If not specified default value is 1.
sip:alice@atlanta.com;maddr=239.255.255.1;ttl=15
Via:Received & Rport
Received:-
 During reply response, Received parameter is added. It’s actual source address from which the packet was
received.
Usually if Sent-By is FQDN, then IP address will be mentioned. if Sent-by is IP address, Received is not
added in response.
Request via: SIP/2.0/UDP bobspc.biloxi.com:5060;branch=z9hG4bKnashds7
Response Via: SIP/2.0/UDP bobspc.biloxi.com:5060;branch=z9hG4bKnashds7;received=192.0.2.4
 Special usage for RPORT.
Rport:
 A new parameter for the Via header field, called "rport", that allows a client to request that the server send
the response back to the source IP address and port from which the request originated.
 RFC3581 specification is primarily aimed at allowing SIP responses to be received when a request is sent
through a NAT.
 To resolve traversal of NAT, we have many methods, among that one is RFC 3581. In that Rport Introduced :
To Solve NAT issue as shown below and etc.
Response Handling by UAC
 The branch parameter in the top Via header field is used for this purpose.
 A response matches a client transaction under two conditions:
Role Played in Response
 The proxy removes the topmost Via header field value from the response. If no Via header
field values remain in the response, the response was meant for this element and MUST NOT
be forwarded.
 When a response is received, the client transport examines the top Via header field value. If
the value of the "sent-by" parameter in that header field value does not correspond to a value
that the client transport is configured to insert into requests, the response MUST be silently
discarded.
 If there is no second Via header field, this response is destined for this client. Otherwise,
the processing depends on whether the Via field contains a "maddr" parameter or is a
receiver-tagged field.
 If the second Via header field contains a "maddr“ parameter, send the response to the
multicast address listed there, using the port indicated in "sent-by", or port 5060 if none is
present. The response SHOULD be sent using the TTL indicated in the "ttl" parameter, or with a
TTL of 1 if that parameter is not present. For
robustness, responses MUST be sent to the address indicated in the "maddr" parameter even if
it is not a multicast address.
 If the second Via header field does not contain a "maddr“ parameter and is a receiver-tagged
field send the message to the address in the "received" parameter, using the port indicated in
the "sent-by" value, or using port 5060 if none is present.
 If neither of the previous cases apply, send the message to the address indicated by the "sent-
by" value in the second Via header field.
Via vs Other Headers
 VIA vs CONTACT Headers
While the Via header field tells other elements where to send the response, the
Contact header field tells other elements where to send future requests with in
same dialog. i.e the sender is expecting to receive requests re-Invite, BYE, Ack.
 Via-BRANCH vs Cseq:-
Both are transaction Identifier. However Serves purpose in different manner.
The CSeq header field serves as a way to identify and order transactions. It
consists of a sequence number and a method. The method MUST match that
of the request(invite, bye, etc) and to differentiate between new requests and
request retransmissions.
The branch ID parameter in the Via header field values serves as a global unique
transaction identifier, and provides Magic Cookie also used by proxies to detect
loops.
Summary
 Identifies which transport Protocol is used.
 The branch ID parameter in the Via header field values serves as a global
unique transaction identifier
 Loop detection i.e This prevents request looping and ensures replies take the
same path as the requests,
ErrorCode -482 Loop Detected
The server received a request with a Via path containing itself.
 Serve the purpose to rectify the NAT issue using rport features.
Courtesy:- RFC & Books
 RFC3261 - SIP: Session Initiation Protocol
 RFC3581 - An Extension to the Session Initiation Protocol (SIP) for Symmetric
Response Routing
 https://mailarchive.ietf.org/arch/msg/sip/RRLaJoxbVgbetbAWvLtheITT7O0
 https://www.z9hg4bk.org/
 https://www.dialogic.com/webhelp/BorderNet2020/1.1.0/WebHelp/sip_invite_m
ethod.htm
 Internet Multimedia Communications Using SIP: A Modern Approach Including
 SIP: Understanding the Session Initiation Protocol
Thanks for Listening
Be Happy and Make Happy
@how? given by my aasaan:-
#Go below what you have # Dream above what you have # First love what you have
#Spread info what you have # Get info what others have # Help as per what you have

More Related Content

What's hot

GoBGP : yet another OSS BGPd
GoBGP : yet another OSS BGPdGoBGP : yet another OSS BGPd
GoBGP : yet another OSS BGPdPavel Odintsov
 
Настройка маршрутизаторов Juniper серии MX
Настройка маршрутизаторов Juniper серии MXНастройка маршрутизаторов Juniper серии MX
Настройка маршрутизаторов Juniper серии MXSkillFactory
 
network convergence problem and solutions
network convergence  problem and solutionsnetwork convergence  problem and solutions
network convergence problem and solutionsSiddhi Viradiya
 
Hereditary macular dystrophies
Hereditary macular  dystrophiesHereditary macular  dystrophies
Hereditary macular dystrophiesShruti Laddha
 
Ripe71 FastNetMon open source DoS / DDoS mitigation
Ripe71 FastNetMon open source DoS / DDoS mitigationRipe71 FastNetMon open source DoS / DDoS mitigation
Ripe71 FastNetMon open source DoS / DDoS mitigationPavel Odintsov
 
W smith uveitis compressed 5.22.11 (1)
W smith uveitis compressed 5.22.11 (1)W smith uveitis compressed 5.22.11 (1)
W smith uveitis compressed 5.22.11 (1)Visionary Ophthamology
 
Lasers in ophth undergraduate 2015
Lasers in ophth undergraduate 2015Lasers in ophth undergraduate 2015
Lasers in ophth undergraduate 2015Abdelmonem Hamed
 
Ip traceback seminar full report
Ip traceback seminar full reportIp traceback seminar full report
Ip traceback seminar full reportdeepakmarndi
 
모델 서빙 파이프라인 구축하기
모델 서빙 파이프라인 구축하기모델 서빙 파이프라인 구축하기
모델 서빙 파이프라인 구축하기SeongIkKim2
 
DHCP (Dynamic Host Configuration Protocol)
DHCP (Dynamic Host Configuration Protocol)DHCP (Dynamic Host Configuration Protocol)
DHCP (Dynamic Host Configuration Protocol)Faisal Jatt
 
Demystifying DataFrame and Dataset with Kazuaki Ishizaki
Demystifying DataFrame and Dataset with Kazuaki IshizakiDemystifying DataFrame and Dataset with Kazuaki Ishizaki
Demystifying DataFrame and Dataset with Kazuaki IshizakiDatabricks
 
MANAGEMENT OF DIABETIC MACULOPATHY
MANAGEMENT OF DIABETIC MACULOPATHYMANAGEMENT OF DIABETIC MACULOPATHY
MANAGEMENT OF DIABETIC MACULOPATHYSmith Snehal Sute
 

What's hot (20)

GoBGP : yet another OSS BGPd
GoBGP : yet another OSS BGPdGoBGP : yet another OSS BGPd
GoBGP : yet another OSS BGPd
 
Настройка маршрутизаторов Juniper серии MX
Настройка маршрутизаторов Juniper серии MXНастройка маршрутизаторов Juniper серии MX
Настройка маршрутизаторов Juniper серии MX
 
network convergence problem and solutions
network convergence  problem and solutionsnetwork convergence  problem and solutions
network convergence problem and solutions
 
SIP security in IP telephony
SIP security in IP telephonySIP security in IP telephony
SIP security in IP telephony
 
Hereditary macular dystrophies
Hereditary macular  dystrophiesHereditary macular  dystrophies
Hereditary macular dystrophies
 
Ripe71 FastNetMon open source DoS / DDoS mitigation
Ripe71 FastNetMon open source DoS / DDoS mitigationRipe71 FastNetMon open source DoS / DDoS mitigation
Ripe71 FastNetMon open source DoS / DDoS mitigation
 
W smith uveitis compressed 5.22.11 (1)
W smith uveitis compressed 5.22.11 (1)W smith uveitis compressed 5.22.11 (1)
W smith uveitis compressed 5.22.11 (1)
 
Routing protocols
Routing protocolsRouting protocols
Routing protocols
 
Lasers in ophth undergraduate 2015
Lasers in ophth undergraduate 2015Lasers in ophth undergraduate 2015
Lasers in ophth undergraduate 2015
 
Ip traceback seminar full report
Ip traceback seminar full reportIp traceback seminar full report
Ip traceback seminar full report
 
DSAEK
DSAEKDSAEK
DSAEK
 
모델 서빙 파이프라인 구축하기
모델 서빙 파이프라인 구축하기모델 서빙 파이프라인 구축하기
모델 서빙 파이프라인 구축하기
 
Pachychoroid
PachychoroidPachychoroid
Pachychoroid
 
Dalk
DalkDalk
Dalk
 
DHCP (Dynamic Host Configuration Protocol)
DHCP (Dynamic Host Configuration Protocol)DHCP (Dynamic Host Configuration Protocol)
DHCP (Dynamic Host Configuration Protocol)
 
Demystifying DataFrame and Dataset with Kazuaki Ishizaki
Demystifying DataFrame and Dataset with Kazuaki IshizakiDemystifying DataFrame and Dataset with Kazuaki Ishizaki
Demystifying DataFrame and Dataset with Kazuaki Ishizaki
 
Coats Disease
Coats DiseaseCoats Disease
Coats Disease
 
Bgp protocol
Bgp protocolBgp protocol
Bgp protocol
 
MANAGEMENT OF DIABETIC MACULOPATHY
MANAGEMENT OF DIABETIC MACULOPATHYMANAGEMENT OF DIABETIC MACULOPATHY
MANAGEMENT OF DIABETIC MACULOPATHY
 
EAGLE study
EAGLE studyEAGLE study
EAGLE study
 

Similar to Session Initiation Protocol (SIP)– Via Header Detailed Coverage

Radius client
Radius clientRadius client
Radius clientdhenis1
 
Tutorial radius client mikrotik
Tutorial radius client mikrotikTutorial radius client mikrotik
Tutorial radius client mikrotikAdi Utami
 
DCHP,NAT,forwarding of ip packets
DCHP,NAT,forwarding of ip packetsDCHP,NAT,forwarding of ip packets
DCHP,NAT,forwarding of ip packetsrajshreemuthiah
 
16.) layer 3 (basic tcp ip routing)
16.) layer 3 (basic tcp ip routing)16.) layer 3 (basic tcp ip routing)
16.) layer 3 (basic tcp ip routing)Jeff Green
 
Differentiated services - Advance Routing
Differentiated services - Advance RoutingDifferentiated services - Advance Routing
Differentiated services - Advance RoutingPradnya Saval
 
Hacking Trust Relationships Between SIP Gateways
Hacking Trust Relationships Between SIP GatewaysHacking Trust Relationships Between SIP Gateways
Hacking Trust Relationships Between SIP GatewaysFatih Ozavci
 
Improved secure address resolution protocol
Improved secure address resolution protocolImproved secure address resolution protocol
Improved secure address resolution protocolcsandit
 
Chapter14ccna
Chapter14ccnaChapter14ccna
Chapter14ccnarobertoxe
 
Application Layer and Socket Programming
Application Layer and Socket ProgrammingApplication Layer and Socket Programming
Application Layer and Socket Programmingelliando dias
 
Micro HTTP Server Implemented in C @ COSCUP 2016
Micro HTTP Server Implemented in C @ COSCUP 2016Micro HTTP Server Implemented in C @ COSCUP 2016
Micro HTTP Server Implemented in C @ COSCUP 2016Jian-Hong Pan
 

Similar to Session Initiation Protocol (SIP)– Via Header Detailed Coverage (20)

Radius client
Radius clientRadius client
Radius client
 
Tutorial radius client mikrotik
Tutorial radius client mikrotikTutorial radius client mikrotik
Tutorial radius client mikrotik
 
STUN protocol
STUN protocolSTUN protocol
STUN protocol
 
DCHP,NAT,forwarding of ip packets
DCHP,NAT,forwarding of ip packetsDCHP,NAT,forwarding of ip packets
DCHP,NAT,forwarding of ip packets
 
Dhcp Snooping
Dhcp SnoopingDhcp Snooping
Dhcp Snooping
 
16.) layer 3 (basic tcp ip routing)
16.) layer 3 (basic tcp ip routing)16.) layer 3 (basic tcp ip routing)
16.) layer 3 (basic tcp ip routing)
 
Tcp Udp Notes
Tcp Udp NotesTcp Udp Notes
Tcp Udp Notes
 
Differentiated services - Advance Routing
Differentiated services - Advance RoutingDifferentiated services - Advance Routing
Differentiated services - Advance Routing
 
Unit 4 - Network Layer
Unit 4 - Network LayerUnit 4 - Network Layer
Unit 4 - Network Layer
 
PPT
PPTPPT
PPT
 
Hacking Trust Relationships Between SIP Gateways
Hacking Trust Relationships Between SIP GatewaysHacking Trust Relationships Between SIP Gateways
Hacking Trust Relationships Between SIP Gateways
 
Improved secure address resolution protocol
Improved secure address resolution protocolImproved secure address resolution protocol
Improved secure address resolution protocol
 
Wsdl
WsdlWsdl
Wsdl
 
Skip to Main content.docx
Skip to Main content.docxSkip to Main content.docx
Skip to Main content.docx
 
Lecture9
Lecture9Lecture9
Lecture9
 
Chapter14ccna
Chapter14ccnaChapter14ccna
Chapter14ccna
 
Chapter14ccna
Chapter14ccnaChapter14ccna
Chapter14ccna
 
Application Layer and Socket Programming
Application Layer and Socket ProgrammingApplication Layer and Socket Programming
Application Layer and Socket Programming
 
Micro HTTP Server Implemented in C @ COSCUP 2016
Micro HTTP Server Implemented in C @ COSCUP 2016Micro HTTP Server Implemented in C @ COSCUP 2016
Micro HTTP Server Implemented in C @ COSCUP 2016
 
Chapter 6r
Chapter 6rChapter 6r
Chapter 6r
 

Recently uploaded

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 

Recently uploaded (20)

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 

Session Initiation Protocol (SIP)– Via Header Detailed Coverage

  • 1. Session Initiation Protocol(SIP) Via Header - Detailed Coverage Sridhar Kumar N
  • 2. Takeaways  Why Via?  List of Via-Parameters & role  Magic Cookie  Role played in Response  Via vs Other Headers  Addressing NAT Concerns  Summary
  • 3. Why Via ?  SIP is based on an HTTP-like request/response transaction model. So Request originator has to receive the response back. Between request travels one or more proxies and reaches destination finally, further returned back to originator. During each proxy travel Via header records the route taken based on stack methodologies and uses the same route one by one(Last in First Out) usually called TOP-VIA to reach back to Originator. i.e Consider Starting journey from home to unknown preferred destination for Picnic. So During travel, we usually memorize few Landmarks to reach home Back successfully without wastage of time.  The Via header field indicates the transport used for the transaction and identifies the location where the response is to be sent. So It contains the transport protocol, the client's host name or network address, and possible the port number at which it wishes to receive responses. Default -5060 Example:- Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bK776asdhds
  • 5. Via –Parameters  A Via header field value can contain parameters such as  sent-protocol (UDP,TCP,SCTP)  sent-by  Branch  maddr  ttl  Rport (RFC3581)  received  via-hidden (RFC2543- deprecated/was used for encryption purpose)
  • 6. Via : Sent-protocol & Sent-by Sent-Protocol:-  The protocol name and protocol version in the header field MUST be SIP and 2.0(Latest version), respectively with transport protocol details. i.e SIP 1.0 (RFC2543) and SIP 2.0 (RFC3261) Sent-by:-  IP address or host name, and port. The usage of an FQDN is RECOMMENDED.  When a response arrives at a stateless proxy, the proxy MUST inspect the sent-by value in the first (topmost) Via header field value. If that address matches the proxy, (it equals a value this proxy has inserted into previous requests) the proxy MUST remove that header field value from the response and forward the result to the location indicated in the next Via header field value. Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bK776asdhds
  • 7. Via:Branch What is Magic Cookie  The Via header field value MUST contain a branch parameter. The branch parameter value MUST be unique. The exceptions to this rule are CANCEL and ACK for non-2xx responses.  The branch ID inserted by an element compliant with this specification MUST always begin with the characters "z9hG4bK". These 7 characters are used as a magic cookie (7 is deemed sufficient to ensure that an older RFC 2543 implementation would not pick such a value), so that servers receiving the request can determine that the branch ID was constructed in the fashion described by this specification (that is, globally unique).  This avoids the complex and bug-laden transaction identification rules from RFC 2543.  It now plays the role of a unique transaction identifier. This requirement was added to identify that the branch was created in accordance with RFC 3261 and not the older RFC 2543 which did not require global uniqueness.  It’s Case Insensitive Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bK776asdhds
  • 8. Via:maddr & ttl Maddr:-  The intent is that maddr is really for multicast. This need not be an IP address, since DNS names can refer to multicast addresses (sip.mcast.net) and not to use SRV processing.  A client that sends a request to a multicast address MUST add the "maddr" parameter to its Via header field value containing the destination multicast address, and for IPv4, SHOULD add the "ttl“ parameter with a value of 1. Usage of IPv6 multicast is not defined in this specification, and will be a subject of future.  Originally, the maddr in the URI was the same - meant just for multicast. However, in the absence of a suitable loose routing mechanism, it got continually abused until the common case was for that, and not for multicast at all. Doing that properly required SRV processing. Now, we have thankfully deprecated the usage of maddr for that purpose, but older rfc2543 elements might construct such URIs, and so RFC3263 continues to perform the SRV processing for the maddr in the request URI, when present. Note:- Service Records(SRV): SIP using NAPTR and SRV DNS Records to locate Server IP details. ttl:-  The ttl parameter determines the time-to-live value of the UDP multicast packet and MUST only be used if maddr is a multicast address and the transport protocol is UDP. For example, to specify a call to alice@atlanta.com using multicast to 239.255.255.1 with a ttl of 15, the following URI would be used. If not specified default value is 1. sip:alice@atlanta.com;maddr=239.255.255.1;ttl=15
  • 9. Via:Received & Rport Received:-  During reply response, Received parameter is added. It’s actual source address from which the packet was received. Usually if Sent-By is FQDN, then IP address will be mentioned. if Sent-by is IP address, Received is not added in response. Request via: SIP/2.0/UDP bobspc.biloxi.com:5060;branch=z9hG4bKnashds7 Response Via: SIP/2.0/UDP bobspc.biloxi.com:5060;branch=z9hG4bKnashds7;received=192.0.2.4  Special usage for RPORT. Rport:  A new parameter for the Via header field, called "rport", that allows a client to request that the server send the response back to the source IP address and port from which the request originated.  RFC3581 specification is primarily aimed at allowing SIP responses to be received when a request is sent through a NAT.  To resolve traversal of NAT, we have many methods, among that one is RFC 3581. In that Rport Introduced : To Solve NAT issue as shown below and etc.
  • 10. Response Handling by UAC  The branch parameter in the top Via header field is used for this purpose.  A response matches a client transaction under two conditions:
  • 11. Role Played in Response  The proxy removes the topmost Via header field value from the response. If no Via header field values remain in the response, the response was meant for this element and MUST NOT be forwarded.  When a response is received, the client transport examines the top Via header field value. If the value of the "sent-by" parameter in that header field value does not correspond to a value that the client transport is configured to insert into requests, the response MUST be silently discarded.  If there is no second Via header field, this response is destined for this client. Otherwise, the processing depends on whether the Via field contains a "maddr" parameter or is a receiver-tagged field.  If the second Via header field contains a "maddr“ parameter, send the response to the multicast address listed there, using the port indicated in "sent-by", or port 5060 if none is present. The response SHOULD be sent using the TTL indicated in the "ttl" parameter, or with a TTL of 1 if that parameter is not present. For robustness, responses MUST be sent to the address indicated in the "maddr" parameter even if it is not a multicast address.  If the second Via header field does not contain a "maddr“ parameter and is a receiver-tagged field send the message to the address in the "received" parameter, using the port indicated in the "sent-by" value, or using port 5060 if none is present.  If neither of the previous cases apply, send the message to the address indicated by the "sent- by" value in the second Via header field.
  • 12. Via vs Other Headers  VIA vs CONTACT Headers While the Via header field tells other elements where to send the response, the Contact header field tells other elements where to send future requests with in same dialog. i.e the sender is expecting to receive requests re-Invite, BYE, Ack.  Via-BRANCH vs Cseq:- Both are transaction Identifier. However Serves purpose in different manner. The CSeq header field serves as a way to identify and order transactions. It consists of a sequence number and a method. The method MUST match that of the request(invite, bye, etc) and to differentiate between new requests and request retransmissions. The branch ID parameter in the Via header field values serves as a global unique transaction identifier, and provides Magic Cookie also used by proxies to detect loops.
  • 13. Summary  Identifies which transport Protocol is used.  The branch ID parameter in the Via header field values serves as a global unique transaction identifier  Loop detection i.e This prevents request looping and ensures replies take the same path as the requests, ErrorCode -482 Loop Detected The server received a request with a Via path containing itself.  Serve the purpose to rectify the NAT issue using rport features.
  • 14. Courtesy:- RFC & Books  RFC3261 - SIP: Session Initiation Protocol  RFC3581 - An Extension to the Session Initiation Protocol (SIP) for Symmetric Response Routing  https://mailarchive.ietf.org/arch/msg/sip/RRLaJoxbVgbetbAWvLtheITT7O0  https://www.z9hg4bk.org/  https://www.dialogic.com/webhelp/BorderNet2020/1.1.0/WebHelp/sip_invite_m ethod.htm  Internet Multimedia Communications Using SIP: A Modern Approach Including  SIP: Understanding the Session Initiation Protocol
  • 15. Thanks for Listening Be Happy and Make Happy @how? given by my aasaan:- #Go below what you have # Dream above what you have # First love what you have #Spread info what you have # Get info what others have # Help as per what you have