# Ping an IP address

**URL:** <https://discourse.julialang.org/t/ping-an-ip-address/72191>\
**Category:** General Usage\
**Tags:** networking\
**Created:** [November 28, 2021, 9:59am UTC](https://discourse.julialang.org/t/ping-an-ip-address/72191 "2021-11-28T09:59:04Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![\_RBMK](https://avatars.discourse-cdn.com/v4/letter/_/c89c15/32.png) [@\_RBMK](https://discourse.julialang.org/u/_RBMK)\
**Post date:** [November 28, 2021, 9:59am UTC](https://discourse.julialang.org/t/ping-an-ip-address/72191/1 "2021-11-28T09:59:04Z")

</div>

How about, I’m working on a P2P module for Julia, and I need to do native ping to a host, there is already a post about this in the forum, but I’m trying to do it internally, from Julia. Is it possible to access the Raw Sockets from Julia? how else can this be done? In case it cannot be done from Julia, is it possible to create an external module in C to do this? In the style of [https://github.com/digitalloggers/node-raw-socket/](https://github.com/digitalloggers/node-raw-socket/) for NodeJS, could something similar be created for Julia?  
Thanks in advance and greetings.

---

<div class="post-metadata">

**Author:** ![gustaphe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gustaphe/32/18174_2.png) [@gustaphe](https://discourse.julialang.org/u/gustaphe)\
**Post date:** [November 28, 2021, 10:52am UTC](https://discourse.julialang.org/t/ping-an-ip-address/72191/2 "2021-11-28T10:52:09Z")

</div>

Are you looking for `Sockets`? [Sockets · The Julia Language](https://docs.julialang.org/en/v1/stdlib/Sockets/)

---

<div class="post-metadata">

**Author:** ![robsmith11](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/robsmith11/32/29641_2.png) [@robsmith11](https://discourse.julialang.org/u/robsmith11)\
**Post date:** [November 28, 2021, 10:55am UTC](https://discourse.julialang.org/t/ping-an-ip-address/72191/3 "2021-11-28T10:55:58Z")

</div>

Does it need to be an ICMP ping? And are you using Linux? In that case you’ll need root to permanently or temporarily set `CAP_NET_RAW` for Julia. (The standard ping binary already has this set.)

---

<div class="post-metadata">

**Author:** ![\_RBMK](https://avatars.discourse-cdn.com/v4/letter/_/c89c15/32.png) [@\_RBMK](https://discourse.julialang.org/u/_RBMK)\
**Post date:** [November 28, 2021, 4:29pm UTC](https://discourse.julialang.org/t/ping-an-ip-address/72191/4 "2021-11-28T16:29:38Z")

</div>

It does not need to be ICMP, im just trying to get the ms difference. Any idea how o doit without ICMP? Its important to NOT need root access, this is for a end user.  
Thanks in advance.

---

<div class="post-metadata">

**Author:** ![\_RBMK](https://avatars.discourse-cdn.com/v4/letter/_/c89c15/32.png) [@\_RBMK](https://discourse.julialang.org/u/_RBMK)\
**Post date:** [November 28, 2021, 4:33pm UTC](https://discourse.julialang.org/t/ping-an-ip-address/72191/5 "2021-11-28T16:33:32Z")

</div>

> [@robsmith11](#):
>
> `CAP_NET_RAW`

Its a litle bit complex than that

---

<div class="post-metadata">

**Author:** ![robsmith11](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/robsmith11/32/29641_2.png) [@robsmith11](https://discourse.julialang.org/u/robsmith11)\
**Post date:** [November 28, 2021, 10:16pm UTC](https://discourse.julialang.org/t/ping-an-ip-address/72191/6 "2021-11-28T22:16:37Z")

</div>

It should be fairly easy to do tcp ping with Sockets.jl. You could follow this python implementation:  
[https://github.com/yantisj/tcpping/blob/master/tcpping.py](https://github.com/yantisj/tcpping/blob/master/tcpping.py)
