Actually you can use the swaps curve to price such bond for forwarding and discounting if you only assume that the bond has the same credit risk, liquidity risk as the swaps curve. In practice this is almost never the case - in practice the floating payments are forwarded from swaps curve but we consider credit spread in discount factors.
But let's assume you have such bond and we price it with only one curve. If you want to calculate duration of that bond you have to consider only first cashflow and a notional principal as it was paid at the next coupon payment. The reasoning is that when you price this bond by forwarding and discounting you get a lot of cancelations leading to formula with next payment only. If you time weight all the cashflows (rather than only the next one) to calculate duration you don't get the same cancelations. Therefore you have to consider only next coupon payment and notional and time weight it to get the duration.
Consider floating rate bond $V$ with notional principal $N$. The bond pays floating coupon every $\Delta t$, the coupon is indexed to some market index, for example Libor. For quarterly payments it would be Libor 3M. Then the valuation formula is:
$$V=\sum_{i=1}^M CF_i*DF_i$$
where $M$ is the number of coupon payments, $CF$ is cashflow and $DF$ is discount factor. The last cashflow $CF_M$ is Notional principal $N$ + interest. For valuation we only consider future/unpaid cashflows, hence realized cashflows are not considered. The first cashflow $CF_1$ is known, we know it because Libor has been set. Other cashflows are unknow, will be fixed in the future. For valuation purpose we substitute unknown cashflows with forward rates $F_i$. Therefore we get:
$$V=CF_1*DF_1 + \sum_{i=2}^{M-1} N*F_i*DF_i+(N+N*{\Delta t}*F_M)*DF_M$$
The forward rate is:
$$F_i=\frac{1}{\Delta t} *(DF_{i-1} /DF_i-1) $$
Therefore the casfhlow $CF_i$ is:
$$CF_i=F_i*{\Delta t}*N$$
Substituting it all together we get:
$$V=CF_1*DF_1 + \sum_{i=2}^{M-1} N*F_i*{\Delta t}*DF_i+(N+N*{\Delta t}*F_M)*DF_M$$
$$=CF_1*DF_1 + \sum_{i=2}^{M-1} \frac{1}{\Delta t}*{\Delta t}*N*(DF_{i-1} /DF_i-1)*DF_i+N*DF_M+N*(DF_{M-1}-DF_{M})$$
$$=CF_1*DF_1 + \sum_{i=2}^{M-1} N*(DF_{i-1} - DF_i)+N*DF_{M-1}$$
you get a lot of cancellations in the sum and end with:
$$V=CF_1*DF_1 + N*DF_1$$
Therefore 5Y floating rate bond, from the IR perspective, can be seen as a bond maturing in next payment date $\Delta t$. Try to calculate duration on that and you will end with duration roughly equal to next coupon payment ${\Delta t}$. Duration is price sensitivity to change in interest rates, therefore for floating rate bond duration should be low. If the curve shifts up, the future cashflows are shifted up but also the discount factors are shifted down which leads to low duration. For fixed rate bond only discount factors change which leads to high duration.
Please bear in mind that floating bond that pays coupon based on Libor + margin (let's say 200 bp) will have higher duration. You can derive it yourself if you consider that this bond is just a sum of two bonds: pure floating rate bond and a fixed rate bond (where coupon rate is a margin).