[Asterisk behavior]The source port of SIP responses

Hello,

I tried to create a test application which sends SIP messages to Asterisk using raw socket. The IP & UDP header are created manually. My messages sent to Asterisk at the port 5060 have an empty Ethernet header :

00:00:00:00:00:00
00:00:00:00:00:00
08:00 (IP protocol)

Asterisk responses me by sending 100 Trying and 200 OK but the source port in these 2 messages are not 5060 (always 1024 as source port). Is it because of an empty Ethernet header? If not, which conditions Asterisk verifies in receiving a SIP request (REGISTER for example)? How does it choose the source port to insert in its responses?

Thanks,

I forgot a detail, the destination address in my packets is 127.0.0.1