Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing some parts of SIP header and the entire SDP in HEP ​​message #278

Closed
matuskaacc opened this issue May 3, 2024 · 19 comments
Closed

Comments

@matuskaacc
Copy link

matuskaacc commented May 3, 2024

I'm noticing that when the SIP message collected for the captagent is a little larger, is missing out part of the header and the entire SDP body in the HEP message sent to the heplify-server. Does anyone know if there is any configuration in the captagent that could cause this behavior?

I have enabled the reasm parameter in socket_pcap.xml file but didn't work. The captagent stops to send the Invite message to heplify-server

            <param name="dev" value="enp129s0f0"/>
            <param name="promisc" value="true"/>
            <param name="reasm" value="true"/>
            <param name="websocket-detection" value="false"/>
            <param name="tcpdefrag" value="false"/>
            <param name="erspan" value="false"/>
            <!-- <param name="capture-filter" value="ip_to_ip"/> -->
            <param name="capture-plan" value="sip_capture_plan.cfg"/>
            <param name="filter">
                <value>portrange 5060-5091</value>
            </param>
        </settings>
    </profile>
@matuskaacc matuskaacc changed the title Missing SIP and SDP header in HEP ​​message Missing some parts of SIP header and the entire SDP in HEP ​​message May 3, 2024
@lmangani
Copy link
Member

lmangani commented May 4, 2024

The issue is indeed packet fragmentation. The reasm parameter only affects UDP packets, while for TCP you need to also enable tcpdefrag. If none works, I would suggest attempting the same with heplify to determine if this is a bug or some other issue.

@matuskaacc
Copy link
Author

Thank you for your quick response. I noticed in source SIP signaling that isn’t receiving some of fragmented packets. In Wireshark it’s just cames one packet of this Invite message with fragment-offset = 1480. I am not seeing the packet with fragment-offset=0. I will open a ticket with the switch supplier to understand this behavior in the mirror process.

@kYroL01
Copy link
Collaborator

kYroL01 commented May 6, 2024

Most likely you're not receiving the last fragment, the one with fragment-offset = 0, but only the first one (fragment-offset = 1480).

Thank you

@kYroL01 kYroL01 closed this as completed May 6, 2024
@matuskaacc
Copy link
Author

After checking more carefully, wireshark did not show off-set because it had the default reasemble configuration. When I disabled this option I was able to check the part of the fragment with off-set=0. So what could be causing this Invite message to not be sent to these fragmented UDP packets received even with the reasm parameter enabled?

@kYroL01
Copy link
Collaborator

kYroL01 commented May 6, 2024

It's very hard to say. reasm = true should do the trick.
I will retest my lab and see if I discover something.

@kYroL01
Copy link
Collaborator

kYroL01 commented May 6, 2024

@matuskaacc I just tested and for me it works fine. I import a fragmented INVITE and I see it reassembled.
Just to test, can you please try to remove the value inside filter and try it again ?
Thank you

@matuskaacc
Copy link
Author

Thank you. Could you show here how your socket_pcap file that you tested was configured?

@kYroL01
Copy link
Collaborator

kYroL01 commented May 7, 2024

<profile name="socketspcap_sip" description="HEP Socket" enable="true" serial="2014010402">
	    <settings>
		<param name="dev" value="eth0"/>
		<param name="promisc" value="true"/>
		<param name="reasm" value="true"/>
		<param name="websocket-detection" value="false"/>
		<param name="tcpdefrag" value="false"/>
		<param name="erspan" value="false"/>
	        <!-- <param name="capture-filter" value="ip_to_ip"/> -->
		<param name="capture-plan" value="sip_capture_plan.cfg"/>
		<param name="filter">
		    <value>port 5060</value>
		</param>
	    </settings>
	</profile>

Have you already tried to remove the BPF filter and retest ?
Remove the filter part and give it another shot.

@matuskaacc
Copy link
Author

matuskaacc commented May 7, 2024

How could i remove all BPF?
I have tried edit with this config:
image

but its ocurring this error:

image

@kYroL01
Copy link
Collaborator

kYroL01 commented May 7, 2024

Just remove these lines

                <param name="filter">
		    <value>port 5060</value>
		</param>

@matuskaacc
Copy link
Author

matuskaacc commented May 7, 2024

Its ocurring this error removing BBF filter

image

@kYroL01
Copy link
Collaborator

kYroL01 commented May 8, 2024

Yes because we're ingesting all the traffic with no filter, so some bad packets also arrive and create issues.
Anyway, if you have the correct IPV4 SIP fragments it should work, is still unclear why it does not.
Does this traffic have anything particular that you can spot ? I'm also happy to take a look.

@matuskaacc
Copy link
Author

sip_invite_fragments_not_reassembling.zip
This is the pcap with the two packets parts of UDP SIP Invite fragmented that isn't working the reassembling. thank you.

@kYroL01
Copy link
Collaborator

kYroL01 commented May 10, 2024

I see this traffic has VLAN layer. Have you tried to use this filter in socket_pcap.xml ?

<param name="filter">
         <value>vlan and port 5060</value>
</param>

@matuskaacc
Copy link
Author

I tried this sugestion with vlan and port in filter configuration but didn't work. Heplify is working nice
./heplify -i enp129s0f0 -pr 5060-5500 -hs 127.0.0.1:9060 -sipassembly true -dim OPTIONS,NOTIFY

@kYroL01
Copy link
Collaborator

kYroL01 commented May 13, 2024

Ah, wait wait, now it makes sense: you're using -sipssembly which reassemble the out of order SIP at application level, not transport level, which is not implemented in Captagent.

BTW this does not reflects the pcap you shared, that it must be reassembled with no issue on Captagent.

Just to try, could you please remove the -sipassembly from the heplify command and see if it's still working fine or not ?

Thank you

@matuskaacc
Copy link
Author

When i remove the -sipassembly works nice also.Then the parameter -sipassembly doesn't make diference to heplify processing complete Invite. Have you tested with my pcap file if captagent is processing all Invite with SDP?

@matuskaacc
Copy link
Author

The fragmentation problem was resolved with this configuration/filter in the socket_pcap.xml file:
root@SPOCEN-HOMER-AGENT1:/usr/local/captagent/etc/captagent# cat socket_pcap.xml

< param name="capture-plan" value="sip_capture_plan.cfg"/> portrange 5060-5500 or ip

@kYroL01
Copy link
Collaborator

kYroL01 commented Sep 11, 2024

Thanks @matuskaacc this means you have VLAN and non-VLAN traffic to be processed in the same time.
Thank you for sharing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants